Skip to content

Commit ca2741b

Browse files
committed
e1000e: Remove duplicated writel() in e1000_configure_tx/rx()
Author: Takamitsu Iwai <takamitz@amazon.co.jp> Duplicated register initialization codes exist in e1000_configure_tx() and e1000_configure_rx(). For example, writel(0, tx_ring->head) writes 0 to tx_ring->head, which is adapter->hw.hw_addr + E1000_TDH(0). This initialization is already done in ew32(TDH(0), 0). ew32(TDH(0), 0) is equivalent to __ew32(hw, E1000_TDH(0), 0). It executes writel(0, hw->hw_addr + E1000_TDH(0)). Since variable hw is set to &adapter->hw, it is equal to writel(0, tx_ring->head). We can remove similar four writel() in e1000_configure_tx() and e1000_configure_rx(). commit 0845d45 ("e1000e: Modify Tx/Rx configurations to avoid null pointer dereferences in e1000_open") has introduced these writel(). This commit moved register writing to e1000_configure_tx/rx(), and as result, it caused duplication in e1000_configure_tx/rx(). This patch modifies the sequence of register writing, but removing these writes is safe because the same writes were already there before the commit. I also have checked the datasheets [0] [1] and have not found any description that we need to write RDH, RDT, TDH and TDT registers twice at initialization. Furthermore, we have tested this patch on an I219-V device physically. Link: https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/82577-gbe-phy-datasheet.pdf [0] Link: https://www.intel.com/content/www/us/en/content-details/613460/intel-82583v-gbe-controller-datasheet.html [1] Tested-by: Kohei Enju <enjuk@amazon.com> Signed-off-by: Takamitsu Iwai <takamitz@amazon.co.jp> Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> (cherry picked from commit 0cab3b0) JIRA: https://issues.redhat.com/browse/RHEL-99399 Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
1 parent 326fbde commit ca2741b

File tree

1 file changed

+0
-6
lines changed
  • drivers/net/ethernet/intel/e1000e

1 file changed

+0
-6
lines changed

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,11 +2928,8 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
29282928
tx_ring->head = adapter->hw.hw_addr + E1000_TDH(0);
29292929
tx_ring->tail = adapter->hw.hw_addr + E1000_TDT(0);
29302930

2931-
writel(0, tx_ring->head);
29322931
if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA)
29332932
e1000e_update_tdt_wa(tx_ring, 0);
2934-
else
2935-
writel(0, tx_ring->tail);
29362933

29372934
/* Set the Tx Interrupt Delay register */
29382935
ew32(TIDV, adapter->tx_int_delay);
@@ -3253,11 +3250,8 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
32533250
rx_ring->head = adapter->hw.hw_addr + E1000_RDH(0);
32543251
rx_ring->tail = adapter->hw.hw_addr + E1000_RDT(0);
32553252

3256-
writel(0, rx_ring->head);
32573253
if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA)
32583254
e1000e_update_rdt_wa(rx_ring, 0);
3259-
else
3260-
writel(0, rx_ring->tail);
32613255

32623256
/* Enable Receive Checksum Offload for TCP and UDP */
32633257
rxcsum = er32(RXCSUM);

0 commit comments

Comments
 (0)