* [PATCH] cxgb4: Simplify PCIe Completion Timeout setting
@ 2017-12-15 23:01 Bjorn Helgaas
2017-12-18 20:13 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2017-12-15 23:01 UTC (permalink / raw)
To: netdev; +Cc: linux-pci, Ganesh Goudar
From: Bjorn Helgaas <bhelgaas@google.com>
Simplify PCIe Completion Timeout setting by using the
pcie_capability_clear_and_set_word() interface. No functional change
intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index f63210f15579..4c99fdb2e13b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -8492,22 +8492,6 @@ static int t4_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
@@ -8593,8 +8577,9 @@ int t4_prep_adapter(struct adapter *adapter)
adapter->params.portvec = 1;
adapter->params.vpd.cclk = 50000;
- /* Set pci completion timeout value to 4 seconds. */
- set_pcie_completion_timeout(adapter, 0xd);
+ /* Set PCIe completion timeout to 4 seconds. */
+ pcie_capability_clear_and_set_word(adapter->pdev, PCI_EXP_DEVCTL2,
+ PCI_EXP_DEVCTL2_COMP_TIMEOUT, 0xd);
return 0;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cxgb4: Simplify PCIe Completion Timeout setting
2017-12-15 23:01 [PATCH] cxgb4: Simplify PCIe Completion Timeout setting Bjorn Helgaas
@ 2017-12-18 20:13 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-12-18 20:13 UTC (permalink / raw)
To: helgaas; +Cc: netdev, linux-pci, ganeshgr
From: Bjorn Helgaas <helgaas@kernel.org>
Date: Fri, 15 Dec 2017 17:01:50 -0600
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> Simplify PCIe Completion Timeout setting by using the
> pcie_capability_clear_and_set_word() interface. No functional change
> intended.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-18 20:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-15 23:01 [PATCH] cxgb4: Simplify PCIe Completion Timeout setting Bjorn Helgaas
2017-12-18 20:13 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.