Gitweb: http://git.kernel.org/linus/8c1c699fec9e9021bf6ff0285dee086bb27aec90
Commit: 8c1c699fec9e9021bf6ff0285dee086bb27aec90
Parent: c465def6bfe834b62623caa9b98f2d4f4739875a
Author: Yu Zhao <yu.zhao@intel.com>
AuthorDate: Sat Jun 13 15:52:13 2009 +0800
Committer: Jesse Barnes <jbarnes@virtuousgeek.org>
CommitDate: Tue Jun 16 14:30:15 2009 -0700
PCI: cleanup Function Level Reset
This patch enhances the FLR functions:
1) remove disable_irq() so the shared IRQ won't be disabled.
2) replace the 1s wait with 100, 200 and 400ms wait intervals
for the Pending Transaction.
3) replace mdelay() with msleep().
4) add might_sleep().
5) lock the device to prevent PM suspend from accessing the CSRs
during the reset.
6) coding style fixes.
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/pci/iov.c | 4 +-
drivers/pci/pci.c | 166 ++++++++++++++++++++++++++-------------------------
include/linux/pci.h | 2 +-
3 files changed, 87 insertions(+), 85 deletions(-)
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index e87fe95..03c7706 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -110,7 +110,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
}
if (reset)
- pci_execute_reset_function(virtfn);
+ __pci_reset_function(virtfn);
pci_device_add(virtfn, virtfn->bus);
mutex_unlock(&iov->dev->sriov->lock);
@@ -164,7 +164,7 @@ static void virtfn_remove(struct pci_dev *dev, int id, int reset)
if (reset) {
device_release_driver(&virtfn->dev);
- pci_execute_reset_function(virtfn);
+ __pci_reset_function(virtfn);
}
sprintf(buf, "virtfn%u", id);
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 8ea911e..6a052ad 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2055,111 +2055,112 @@ ...