Skip to content

Commit eca0f6e

Browse files
Hariprasad Shenaidavem330
authored andcommitted
cxgb4: program pci completion timeout
Set pci completion timeout to 0xd. Signed-off-by: Hariprasad Shenai <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 098ef6c commit eca0f6e

File tree

1 file changed

+19
-0
lines changed
  • drivers/net/ethernet/chelsio/cxgb4

1 file changed

+19
-0
lines changed

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5847,6 +5847,22 @@ static int get_flash_params(struct adapter *adap)
58475847
return 0;
58485848
}
58495849

5850+
static void set_pcie_completion_timeout(struct adapter *adapter, u8 range)
5851+
{
5852+
u16 val;
5853+
u32 pcie_cap;
5854+
5855+
pcie_cap = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
5856+
if (pcie_cap) {
5857+
pci_read_config_word(adapter->pdev,
5858+
pcie_cap + PCI_EXP_DEVCTL2, &val);
5859+
val &= ~PCI_EXP_DEVCTL2_COMP_TIMEOUT;
5860+
val |= range;
5861+
pci_write_config_word(adapter->pdev,
5862+
pcie_cap + PCI_EXP_DEVCTL2, val);
5863+
}
5864+
}
5865+
58505866
/**
58515867
* t4_prep_adapter - prepare SW and HW for operation
58525868
* @adapter: the adapter
@@ -5919,6 +5935,9 @@ int t4_prep_adapter(struct adapter *adapter)
59195935
adapter->params.nports = 1;
59205936
adapter->params.portvec = 1;
59215937
adapter->params.vpd.cclk = 50000;
5938+
5939+
/* Set pci completion timeout value to 4 seconds. */
5940+
set_pcie_completion_timeout(adapter, 0xd);
59225941
return 0;
59235942
}
59245943

0 commit comments

Comments
 (0)