diff options
author | Hariprasad Shenai <hariprasad@chelsio.com> | 2015-06-05 14:24:51 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-05 21:25:58 -0700 |
commit | eca0f6eeadec74027a4f940bd6958c41e5259618 (patch) | |
tree | 3d600163345ef388f79fa3ff8297592e3eaa7105 /drivers | |
parent | 098ef6c28a956ba05c31fb9fbf8bad56165ed415 (diff) | |
download | linux-eca0f6eeadec74027a4f940bd6958c41e5259618.tar.bz2 |
cxgb4: program pci completion timeout
Set pci completion timeout to 0xd.
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c index da65e76c44b5..efd0aa1a224e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c @@ -5847,6 +5847,22 @@ static int get_flash_params(struct adapter *adap) return 0; } +static void set_pcie_completion_timeout(struct adapter *adapter, u8 range) +{ + u16 val; + u32 pcie_cap; + + pcie_cap = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP); + if (pcie_cap) { + pci_read_config_word(adapter->pdev, + pcie_cap + PCI_EXP_DEVCTL2, &val); + val &= ~PCI_EXP_DEVCTL2_COMP_TIMEOUT; + val |= range; + pci_write_config_word(adapter->pdev, + pcie_cap + PCI_EXP_DEVCTL2, val); + } +} + /** * t4_prep_adapter - prepare SW and HW for operation * @adapter: the adapter @@ -5919,6 +5935,9 @@ int t4_prep_adapter(struct adapter *adapter) adapter->params.nports = 1; adapter->params.portvec = 1; adapter->params.vpd.cclk = 50000; + + /* Set pci completion timeout value to 4 seconds. */ + set_pcie_completion_timeout(adapter, 0xd); return 0; } |