[PATCH 2/3] pci: Kill rescan under /sys/.../pci/devices/...

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

 



That is not right. the device is already there, there is no reason to rescan it.
We can not get increase resource for them.

Now We already have rescan for pci_bus.

So remove rescan for all pci devices. less confusing

Finally We remove devices, and rescan bus that there were on before.

Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>

---
 Documentation/ABI/testing/sysfs-bus-pci |   10 ----------
 drivers/pci/pci-sysfs.c                 |   19 -------------------
 2 files changed, 29 deletions(-)

Index: linux-2.6/drivers/pci/pci-sysfs.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci-sysfs.c
+++ linux-2.6/drivers/pci/pci-sysfs.c
@@ -272,24 +272,6 @@ struct bus_attribute pci_bus_attrs[] = {
 	__ATTR_NULL
 };
 
-static ssize_t
-dev_rescan_store(struct device *dev, struct device_attribute *attr,
-		 const char *buf, size_t count)
-{
-	unsigned long val;
-	struct pci_dev *pdev = to_pci_dev(dev);
-
-	if (strict_strtoul(buf, 0, &val) < 0)
-		return -EINVAL;
-
-	if (val) {
-		mutex_lock(&pci_remove_rescan_mutex);
-		pci_rescan_bus(pdev->bus);
-		mutex_unlock(&pci_remove_rescan_mutex);
-	}
-	return count;
-}
-
 static void remove_callback(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
@@ -363,7 +345,6 @@ struct device_attribute pci_dev_attrs[]
 	__ATTR(msi_bus, 0644, msi_bus_show, msi_bus_store),
 #ifdef CONFIG_HOTPLUG
 	__ATTR(remove, (S_IWUSR|S_IWGRP), NULL, remove_store),
-	__ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_rescan_store),
 #endif
 	__ATTR_NULL,
 };
Index: linux-2.6/Documentation/ABI/testing/sysfs-bus-pci
===================================================================
--- linux-2.6.orig/Documentation/ABI/testing/sysfs-bus-pci
+++ linux-2.6/Documentation/ABI/testing/sysfs-bus-pci
@@ -83,16 +83,6 @@ Description:
 		and re-discover devices removed earlier from this
 		part of the device tree.  Depends on CONFIG_HOTPLUG.
 
-What:		/sys/bus/pci/devices/.../rescan
-Date:		January 2009
-Contact:	Linux PCI developers <linux-pci@xxxxxxxxxxxxxxx>
-Description:
-		Writing a non-zero value to this attribute will
-		force a rescan of the device's parent bus and all
-		child buses, and re-discover devices removed earlier
-		from this part of the device tree.
-		Depends on CONFIG_HOTPLUG.
-
 What:		/sys/bus/pci/devices/.../reset
 Date:		July 2009
 Contact:	Michael S. Tsirkin <mst@xxxxxxxxxx>
--
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