diff options
author | Bartlomiej Dudek <bartlomiej.dudek@intel.com> | 2017-07-24 16:46:30 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-07-31 21:18:37 +0200 |
commit | a618b7e40af2b2b751790d602ffa93800b594eca (patch) | |
tree | ca5dbfd47b838fc53f78f68e409df8277e9b856b /drivers/infiniband/hw/hfi1/chip.c | |
parent | IB/hfi1: Fix initialization failure for debug firmware (diff) | |
download | linux-a618b7e40af2b2b751790d602ffa93800b594eca.tar.xz linux-a618b7e40af2b2b751790d602ffa93800b594eca.zip |
IB/hfi1: Move saving PCI values to a separate function
During PCIe initialization some registers' values from
PCI config space are saved in order to restore them later
(i.e. after reset). Restoring those value is done by a
function called restore_pci_variables, while saving them
is put directly into function hfi1_pcie_ddinit.
Move saving values to a separate function in the image
of restoring functionality.
Reviewed-by: Jakub Byczkowski <jakub.byczkowski@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Bartlomiej Dudek <bartlomiej.dudek@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/chip.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/chip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index 789dbc40ebd0..4a4405ee9302 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c @@ -14866,6 +14866,11 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev, if (ret < 0) goto bail_free; + /* Save PCI space registers to rewrite after device reset */ + ret = save_pci_variables(dd); + if (ret < 0) + goto bail_cleanup; + /* verify that reads actually work, save revision for reset check */ dd->revision = read_csr(dd, CCE_REVISION); if (dd->revision == ~(u64)0) { |