diff options
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r-- | drivers/pci/pci-sysfs.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 0f6382f090ee..c5df94e86678 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -74,7 +74,11 @@ static ssize_t local_cpus_show(struct device *dev, | |||
74 | const struct cpumask *mask; | 74 | const struct cpumask *mask; |
75 | int len; | 75 | int len; |
76 | 76 | ||
77 | #ifdef CONFIG_NUMA | ||
78 | mask = cpumask_of_node(dev_to_node(dev)); | ||
79 | #else | ||
77 | mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); | 80 | mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); |
81 | #endif | ||
78 | len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); | 82 | len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); |
79 | buf[len++] = '\n'; | 83 | buf[len++] = '\n'; |
80 | buf[len] = '\0'; | 84 | buf[len] = '\0'; |
@@ -88,7 +92,11 @@ static ssize_t local_cpulist_show(struct device *dev, | |||
88 | const struct cpumask *mask; | 92 | const struct cpumask *mask; |
89 | int len; | 93 | int len; |
90 | 94 | ||
95 | #ifdef CONFIG_NUMA | ||
96 | mask = cpumask_of_node(dev_to_node(dev)); | ||
97 | #else | ||
91 | mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); | 98 | mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); |
99 | #endif | ||
92 | len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask); | 100 | len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask); |
93 | buf[len++] = '\n'; | 101 | buf[len++] = '\n'; |
94 | buf[len] = '\0'; | 102 | buf[len] = '\0'; |
@@ -176,6 +184,21 @@ numa_node_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
176 | #endif | 184 | #endif |
177 | 185 | ||
178 | static ssize_t | 186 | static ssize_t |
187 | dma_mask_bits_show(struct device *dev, struct device_attribute *attr, char *buf) | ||
188 | { | ||
189 | struct pci_dev *pdev = to_pci_dev(dev); | ||
190 | |||
191 | return sprintf (buf, "%d\n", fls64(pdev->dma_mask)); | ||
192 | } | ||
193 | |||
194 | static ssize_t | ||
195 | consistent_dma_mask_bits_show(struct device *dev, struct device_attribute *attr, | ||
196 | char *buf) | ||
197 | { | ||
198 | return sprintf (buf, "%d\n", fls64(dev->coherent_dma_mask)); | ||
199 | } | ||
200 | |||
201 | static ssize_t | ||
179 | msi_bus_show(struct device *dev, struct device_attribute *attr, char *buf) | 202 | msi_bus_show(struct device *dev, struct device_attribute *attr, char *buf) |
180 | { | 203 | { |
181 | struct pci_dev *pdev = to_pci_dev(dev); | 204 | struct pci_dev *pdev = to_pci_dev(dev); |
@@ -306,6 +329,8 @@ struct device_attribute pci_dev_attrs[] = { | |||
306 | #ifdef CONFIG_NUMA | 329 | #ifdef CONFIG_NUMA |
307 | __ATTR_RO(numa_node), | 330 | __ATTR_RO(numa_node), |
308 | #endif | 331 | #endif |
332 | __ATTR_RO(dma_mask_bits), | ||
333 | __ATTR_RO(consistent_dma_mask_bits), | ||
309 | __ATTR(enable, 0600, is_enabled_show, is_enabled_store), | 334 | __ATTR(enable, 0600, is_enabled_show, is_enabled_store), |
310 | __ATTR(broken_parity_status,(S_IRUGO|S_IWUSR), | 335 | __ATTR(broken_parity_status,(S_IRUGO|S_IWUSR), |
311 | broken_parity_status_show,broken_parity_status_store), | 336 | broken_parity_status_show,broken_parity_status_store), |