Skip to content

Commit

Permalink
cxgb4: program pci completion timeout
Browse files Browse the repository at this point in the history
Set pci completion timeout to 0xd.

Signed-off-by: Hariprasad Shenai <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Hariprasad Shenai authored and davem330 committed Jun 6, 2015
1 parent 098ef6c commit eca0f6e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit eca0f6e

Please sign in to comment.