Commit eca0f6ee authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller

cxgb4: program pci completion timeout

Set pci completion timeout to 0xd.
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 098ef6c2
...@@ -5847,6 +5847,22 @@ static int get_flash_params(struct adapter *adap) ...@@ -5847,6 +5847,22 @@ static int get_flash_params(struct adapter *adap)
return 0; 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 * t4_prep_adapter - prepare SW and HW for operation
* @adapter: the adapter * @adapter: the adapter
...@@ -5919,6 +5935,9 @@ int t4_prep_adapter(struct adapter *adapter) ...@@ -5919,6 +5935,9 @@ int t4_prep_adapter(struct adapter *adapter)
adapter->params.nports = 1; adapter->params.nports = 1;
adapter->params.portvec = 1; adapter->params.portvec = 1;
adapter->params.vpd.cclk = 50000; adapter->params.vpd.cclk = 50000;
/* Set pci completion timeout value to 4 seconds. */
set_pcie_completion_timeout(adapter, 0xd);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment