diff options
Diffstat (limited to 'drivers/infiniband/hw/hfi1/pcie.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/pcie.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c index e39e01b79382..93faf86d54b6 100644 --- a/drivers/infiniband/hw/hfi1/pcie.c +++ b/drivers/infiniband/hw/hfi1/pcie.c | |||
@@ -240,36 +240,6 @@ void hfi1_pcie_ddcleanup(struct hfi1_devdata *dd) | |||
240 | iounmap(dd->piobase); | 240 | iounmap(dd->piobase); |
241 | } | 241 | } |
242 | 242 | ||
243 | /* | ||
244 | * Do a Function Level Reset (FLR) on the device. | ||
245 | * Based on static function drivers/pci/pci.c:pcie_flr(). | ||
246 | */ | ||
247 | void hfi1_pcie_flr(struct hfi1_devdata *dd) | ||
248 | { | ||
249 | int i; | ||
250 | u16 status; | ||
251 | |||
252 | /* no need to check for the capability - we know the device has it */ | ||
253 | |||
254 | /* wait for Transaction Pending bit to clear, at most a few ms */ | ||
255 | for (i = 0; i < 4; i++) { | ||
256 | if (i) | ||
257 | msleep((1 << (i - 1)) * 100); | ||
258 | |||
259 | pcie_capability_read_word(dd->pcidev, PCI_EXP_DEVSTA, &status); | ||
260 | if (!(status & PCI_EXP_DEVSTA_TRPND)) | ||
261 | goto clear; | ||
262 | } | ||
263 | |||
264 | dd_dev_err(dd, "Transaction Pending bit is not clearing, proceeding with reset anyway\n"); | ||
265 | |||
266 | clear: | ||
267 | pcie_capability_set_word(dd->pcidev, PCI_EXP_DEVCTL, | ||
268 | PCI_EXP_DEVCTL_BCR_FLR); | ||
269 | /* PCIe spec requires the function to be back within 100ms */ | ||
270 | msleep(100); | ||
271 | } | ||
272 | |||
273 | static void msix_setup(struct hfi1_devdata *dd, int pos, u32 *msixcnt, | 243 | static void msix_setup(struct hfi1_devdata *dd, int pos, u32 *msixcnt, |
274 | struct hfi1_msix_entry *hfi1_msix_entry) | 244 | struct hfi1_msix_entry *hfi1_msix_entry) |
275 | { | 245 | { |