[PATCH 5/6] pci: fix cpulistaffinity interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The cpulistaffinity sysfs support was only partially done.
The code to handle it was dead and never being activated.

Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxxxx>

---
 drivers/pci/bus.c    |    4 ++++
 drivers/pci/pci.h    |    1 +
 drivers/pci/probe.c  |    3 +++
 drivers/pci/remove.c |    1 +
 4 files changed, 9 insertions(+)

--- a/drivers/pci/probe.c	2008-09-08 09:17:53.000000000 -0700
+++ b/drivers/pci/probe.c	2008-09-08 09:20:56.000000000 -0700
@@ -1180,6 +1180,9 @@ struct pci_bus * pci_create_bus(struct d
 	error = device_create_file(&b->dev, &dev_attr_cpuaffinity);
 	if (error)
 		goto dev_create_file_err;
+	error = device_create_file(&b->dev, &dev_attr_cpulistaffinity);
+	if (error)
+		goto dev_create_file_err;
 
 	/* Create legacy_io and legacy_mem files for this bus */
 	pci_create_legacy_files(b);
--- a/drivers/pci/bus.c	2008-09-08 09:20:53.000000000 -0700
+++ b/drivers/pci/bus.c	2008-09-08 09:20:56.000000000 -0700
@@ -152,6 +152,10 @@ void pci_bus_add_devices(struct pci_bus 
 				" continuing...\n");
 			continue;
 		}
+		else if (device_create_file(&child_bus->dev,
+					    &dev_attr_cpulistaffinity))
+			dev_err(&dev->dev, "Error creating cpulistaffinity file,"
+				" continuing...\n");
 	}
 }
 
--- a/drivers/pci/pci.h	2008-09-08 09:20:50.000000000 -0700
+++ b/drivers/pci/pci.h	2008-09-08 09:20:56.000000000 -0700
@@ -109,6 +109,7 @@ static inline int pci_no_d1d2(struct pci
 extern int pcie_mch_quirk;
 extern struct device_attribute pci_dev_attrs[];
 extern struct device_attribute dev_attr_cpuaffinity;
+extern struct device_attribute dev_attr_cpulistaffinity;
 
 /**
  * pci_match_one_device - Tell if a PCI device structure has a matching
--- a/drivers/pci/remove.c	2008-09-08 09:21:15.000000000 -0700
+++ b/drivers/pci/remove.c	2008-09-08 09:21:25.000000000 -0700
@@ -73,6 +73,7 @@ void pci_remove_bus(struct pci_bus *pci_
 	up_write(&pci_bus_sem);
 	pci_remove_legacy_files(pci_bus);
 	device_remove_file(&pci_bus->dev, &dev_attr_cpuaffinity);
+	device_remove_file(&pci_bus->dev, &dev_attr_cpulistaffinity);
 	device_unregister(&pci_bus->dev);
 }
 EXPORT_SYMBOL(pci_remove_bus);

-- 

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux