IB/hfi1: Remove redundant sysfs irq affinity entry
authorTadeusz Struk <tadeusz.struk@intel.com>
Mon, 10 Oct 2016 13:14:50 +0000 (06:14 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 15 Nov 2016 21:16:40 +0000 (16:16 -0500)
The IRQ affinity entry is not needed after the irq notifier patch has been
added to the hfi1 driver.
The irq affinity settings for SDMA engine should be set using the standard
/proc/irq/<N>/ interface.

Reviewed-by: Jianxin Xiong <jianxin.xiong@intel.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/affinity.c
drivers/infiniband/hw/hfi1/affinity.h
drivers/infiniband/hw/hfi1/sysfs.c

index a26a9a0bfc417c536ed764499097b5e90c265d78..67ea85a569452e82d037b8e1ee8a3f2567d4f07f 100644 (file)
@@ -775,75 +775,3 @@ void hfi1_put_proc_affinity(int cpu)
        }
        mutex_unlock(&affinity->lock);
 }
-
-int hfi1_set_sdma_affinity(struct hfi1_devdata *dd, const char *buf,
-                          size_t count)
-{
-       struct hfi1_affinity_node *entry;
-       cpumask_var_t mask;
-       int ret, i;
-
-       mutex_lock(&node_affinity.lock);
-       entry = node_affinity_lookup(dd->node);
-
-       if (!entry) {
-               ret = -EINVAL;
-               goto unlock;
-       }
-
-       ret = zalloc_cpumask_var(&mask, GFP_KERNEL);
-       if (!ret) {
-               ret = -ENOMEM;
-               goto unlock;
-       }
-
-       ret = cpulist_parse(buf, mask);
-       if (ret)
-               goto out;
-
-       if (!cpumask_subset(mask, cpu_online_mask) || cpumask_empty(mask)) {
-               dd_dev_warn(dd, "Invalid CPU mask\n");
-               ret = -EINVAL;
-               goto out;
-       }
-
-       /* reset the SDMA interrupt affinity details */
-       init_cpu_mask_set(&entry->def_intr);
-       cpumask_copy(&entry->def_intr.mask, mask);
-
-       /* Reassign the affinity for each SDMA interrupt. */
-       for (i = 0; i < dd->num_msix_entries; i++) {
-               struct hfi1_msix_entry *msix;
-
-               msix = &dd->msix_entries[i];
-               if (msix->type != IRQ_SDMA)
-                       continue;
-
-               ret = get_irq_affinity(dd, msix);
-
-               if (ret)
-                       break;
-       }
-out:
-       free_cpumask_var(mask);
-unlock:
-       mutex_unlock(&node_affinity.lock);
-       return ret ? ret : strnlen(buf, PAGE_SIZE);
-}
-
-int hfi1_get_sdma_affinity(struct hfi1_devdata *dd, char *buf)
-{
-       struct hfi1_affinity_node *entry;
-
-       mutex_lock(&node_affinity.lock);
-       entry = node_affinity_lookup(dd->node);
-
-       if (!entry) {
-               mutex_unlock(&node_affinity.lock);
-               return -EINVAL;
-       }
-
-       cpumap_print_to_pagebuf(true, buf, &entry->def_intr.mask);
-       mutex_unlock(&node_affinity.lock);
-       return strnlen(buf, PAGE_SIZE);
-}
index b89ea3c0ee1afcd4a3eff2e6916fd9fb0e38d7ca..42e63316afd193f4baf932f0c420eeca52738b39 100644 (file)
@@ -102,10 +102,6 @@ int hfi1_get_proc_affinity(int);
 /* Release a CPU used by a user process. */
 void hfi1_put_proc_affinity(int);
 
-int hfi1_get_sdma_affinity(struct hfi1_devdata *dd, char *buf);
-int hfi1_set_sdma_affinity(struct hfi1_devdata *dd, const char *buf,
-                          size_t count);
-
 struct hfi1_affinity_node {
        int node;
        struct cpu_mask_set def_intr;
index edba22461a9c16dc86af705b2b86952d9fb85867..919a5474e6512a237fa0b6059f3f77f4a671103e 100644 (file)
@@ -49,7 +49,6 @@
 #include "hfi.h"
 #include "mad.h"
 #include "trace.h"
-#include "affinity.h"
 
 /*
  * Start of per-port congestion control structures and support code
@@ -623,27 +622,6 @@ static ssize_t show_tempsense(struct device *device,
        return ret;
 }
 
-static ssize_t show_sdma_affinity(struct device *device,
-                                 struct device_attribute *attr, char *buf)
-{
-       struct hfi1_ibdev *dev =
-               container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
-       struct hfi1_devdata *dd = dd_from_dev(dev);
-
-       return hfi1_get_sdma_affinity(dd, buf);
-}
-
-static ssize_t store_sdma_affinity(struct device *device,
-                                  struct device_attribute *attr,
-                                  const char *buf, size_t count)
-{
-       struct hfi1_ibdev *dev =
-               container_of(device, struct hfi1_ibdev, rdi.ibdev.dev);
-       struct hfi1_devdata *dd = dd_from_dev(dev);
-
-       return hfi1_set_sdma_affinity(dd, buf, count);
-}
-
 /*
  * end of per-unit (or driver, in some cases, but replicated
  * per unit) functions
@@ -658,8 +636,6 @@ static DEVICE_ATTR(serial, S_IRUGO, show_serial, NULL);
 static DEVICE_ATTR(boardversion, S_IRUGO, show_boardversion, NULL);
 static DEVICE_ATTR(tempsense, S_IRUGO, show_tempsense, NULL);
 static DEVICE_ATTR(chip_reset, S_IWUSR, NULL, store_chip_reset);
-static DEVICE_ATTR(sdma_affinity, S_IWUSR | S_IRUGO, show_sdma_affinity,
-                  store_sdma_affinity);
 
 static struct device_attribute *hfi1_attributes[] = {
        &dev_attr_hw_rev,
@@ -670,7 +646,6 @@ static struct device_attribute *hfi1_attributes[] = {
        &dev_attr_boardversion,
        &dev_attr_tempsense,
        &dev_attr_chip_reset,
-       &dev_attr_sdma_affinity,
 };
 
 int hfi1_create_port_files(struct ib_device *ibdev, u8 port_num,