Commit 93ff68a5 authored by Mike Travis's avatar Mike Travis Committed by Jesse Barnes

PCI: make CPU list affinity visible

Stephen Hemminger wrote:
> Looks like Mike created cpulistaffinty in sysfs but never completed
> the job.

This patch hooks things up correctly, taking care to remove the new file
when the bus is destroyed.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarMike Travis <travis@sgi.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 5993760f
...@@ -151,6 +151,13 @@ void pci_bus_add_devices(struct pci_bus *bus) ...@@ -151,6 +151,13 @@ void pci_bus_add_devices(struct pci_bus *bus)
if (retval) if (retval)
dev_err(&dev->dev, "Error creating cpuaffinity" dev_err(&dev->dev, "Error creating cpuaffinity"
" file, continuing...\n"); " file, continuing...\n");
retval = device_create_file(&child_bus->dev,
&dev_attr_cpulistaffinity);
if (retval)
dev_err(&dev->dev,
"Error creating cpulistaffinity"
" file, continuing...\n");
} }
} }
} }
......
...@@ -109,6 +109,7 @@ static inline int pci_no_d1d2(struct pci_dev *dev) ...@@ -109,6 +109,7 @@ static inline int pci_no_d1d2(struct pci_dev *dev)
extern int pcie_mch_quirk; extern int pcie_mch_quirk;
extern struct device_attribute pci_dev_attrs[]; extern struct device_attribute pci_dev_attrs[];
extern struct device_attribute dev_attr_cpuaffinity; 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 * pci_match_one_device - Tell if a PCI device structure has a matching
......
...@@ -73,6 +73,7 @@ void pci_remove_bus(struct pci_bus *pci_bus) ...@@ -73,6 +73,7 @@ void pci_remove_bus(struct pci_bus *pci_bus)
up_write(&pci_bus_sem); up_write(&pci_bus_sem);
pci_remove_legacy_files(pci_bus); pci_remove_legacy_files(pci_bus);
device_remove_file(&pci_bus->dev, &dev_attr_cpuaffinity); device_remove_file(&pci_bus->dev, &dev_attr_cpuaffinity);
device_remove_file(&pci_bus->dev, &dev_attr_cpulistaffinity);
device_unregister(&pci_bus->dev); device_unregister(&pci_bus->dev);
} }
EXPORT_SYMBOL(pci_remove_bus); EXPORT_SYMBOL(pci_remove_bus);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment