diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/scsi/csiostor | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/scsi/csiostor')
-rw-r--r-- | drivers/scsi/csiostor/csio_hw.c | 22 | ||||
-rw-r--r-- | drivers/scsi/csiostor/csio_init.c | 2 |
2 files changed, 20 insertions, 4 deletions
diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c index 0eaec47..0eb35b9 100644 --- a/drivers/scsi/csiostor/csio_hw.c +++ b/drivers/scsi/csiostor/csio_hw.c @@ -852,6 +852,22 @@ csio_hw_get_flash_params(struct csio_hw *hw) return 0; } +static void +csio_set_pcie_completion_timeout(struct csio_hw *hw, u8 range) +{ + uint16_t val; + int pcie_cap; + + if (!csio_pci_capability(hw->pdev, PCI_CAP_ID_EXP, &pcie_cap)) { + pci_read_config_word(hw->pdev, + pcie_cap + PCI_EXP_DEVCTL2, &val); + val &= 0xfff0; + val |= range ; + pci_write_config_word(hw->pdev, + pcie_cap + PCI_EXP_DEVCTL2, val); + } +} + /*****************************************************************************/ /* HW State machine assists */ /*****************************************************************************/ @@ -2053,10 +2069,8 @@ csio_hw_configure(struct csio_hw *hw) goto out; } - /* Set PCIe completion timeout to 4 seconds */ - if (pci_is_pcie(hw->pdev)) - pcie_capability_clear_and_set_word(hw->pdev, PCI_EXP_DEVCTL2, - PCI_EXP_DEVCTL2_COMP_TIMEOUT, 0xd); + /* Set pci completion timeout value to 4 seconds. */ + csio_set_pcie_completion_timeout(hw, 0xd); hw->chip_ops->chip_set_mem_win(hw, MEMWIN_CSIOSTOR); diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c index 1aafc33..00346fe 100644 --- a/drivers/scsi/csiostor/csio_init.c +++ b/drivers/scsi/csiostor/csio_init.c @@ -1010,6 +1010,7 @@ err_lnode_exit: csio_hw_stop(hw); spin_unlock_irq(&hw->lock); csio_lnodes_unblock_request(hw); + pci_set_drvdata(hw->pdev, NULL); csio_lnodes_exit(hw, 0); csio_hw_free(hw); err_pci_exit: @@ -1043,6 +1044,7 @@ static void csio_remove_one(struct pci_dev *pdev) csio_lnodes_exit(hw, 0); csio_hw_free(hw); + pci_set_drvdata(pdev, NULL); csio_pci_exit(pdev, &bars); } |