Skip to content

Commit 7a5b2bf

Browse files
gobenjigregkh
authored andcommitted
e1000e: Avoid missed interrupts following ICR read
commit 116f4a6 upstream. The 82574 specification update errata 12 states that interrupts may be missed if ICR is read while INT_ASSERTED is not set. Avoid that problem by setting all bits related to events that can trigger the Other interrupt in IMS. The Other interrupt is raised for such events regardless of whether or not they are set in IMS. However, only when they are set is the INT_ASSERTED bit also set in ICR. By doing this, we ensure that INT_ASSERTED is always set when we read ICR in e1000_msix_other() and steer clear of the errata. This also ensures that ICR will automatically be cleared on read, therefore we no longer need to clear bits explicitly. Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Acked-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent dd5456a commit 7a5b2bf

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

drivers/net/ethernet/intel/e1000e/defines.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,18 @@
400400
#define E1000_ICR_RXDMT0 0x00000010 /* Rx desc min. threshold (0) */
401401
#define E1000_ICR_RXO 0x00000040 /* Receiver Overrun */
402402
#define E1000_ICR_RXT0 0x00000080 /* Rx timer intr (ring 0) */
403+
#define E1000_ICR_MDAC 0x00000200 /* MDIO Access Complete */
404+
#define E1000_ICR_SRPD 0x00010000 /* Small Receive Packet Detected */
405+
#define E1000_ICR_ACK 0x00020000 /* Receive ACK Frame Detected */
406+
#define E1000_ICR_MNG 0x00040000 /* Manageability Event Detected */
403407
#define E1000_ICR_ECCER 0x00400000 /* Uncorrectable ECC Error */
404408
/* If this bit asserted, the driver should claim the interrupt */
405409
#define E1000_ICR_INT_ASSERTED 0x80000000
406410
#define E1000_ICR_RXQ0 0x00100000 /* Rx Queue 0 Interrupt */
407411
#define E1000_ICR_RXQ1 0x00200000 /* Rx Queue 1 Interrupt */
408412
#define E1000_ICR_TXQ0 0x00400000 /* Tx Queue 0 Interrupt */
409413
#define E1000_ICR_TXQ1 0x00800000 /* Tx Queue 1 Interrupt */
410-
#define E1000_ICR_OTHER 0x01000000 /* Other Interrupts */
414+
#define E1000_ICR_OTHER 0x01000000 /* Other Interrupt */
411415

412416
/* PBA ECC Register */
413417
#define E1000_PBA_ECC_COUNTER_MASK 0xFFF00000 /* ECC counter mask */
@@ -431,12 +435,27 @@
431435
E1000_IMS_RXSEQ | \
432436
E1000_IMS_LSC)
433437

438+
/* These are all of the events related to the OTHER interrupt.
439+
*/
440+
#define IMS_OTHER_MASK ( \
441+
E1000_IMS_LSC | \
442+
E1000_IMS_RXO | \
443+
E1000_IMS_MDAC | \
444+
E1000_IMS_SRPD | \
445+
E1000_IMS_ACK | \
446+
E1000_IMS_MNG)
447+
434448
/* Interrupt Mask Set */
435449
#define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */
436450
#define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */
437451
#define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* Rx sequence error */
438452
#define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* Rx desc min. threshold */
453+
#define E1000_IMS_RXO E1000_ICR_RXO /* Receiver Overrun */
439454
#define E1000_IMS_RXT0 E1000_ICR_RXT0 /* Rx timer intr */
455+
#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO Access Complete */
456+
#define E1000_IMS_SRPD E1000_ICR_SRPD /* Small Receive Packet */
457+
#define E1000_IMS_ACK E1000_ICR_ACK /* Receive ACK Frame Detected */
458+
#define E1000_IMS_MNG E1000_ICR_MNG /* Manageability Event */
440459
#define E1000_IMS_ECCER E1000_ICR_ECCER /* Uncorrectable ECC Error */
441460
#define E1000_IMS_RXQ0 E1000_ICR_RXQ0 /* Rx Queue 0 Interrupt */
442461
#define E1000_IMS_RXQ1 E1000_ICR_RXQ1 /* Rx Queue 1 Interrupt */

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,24 +1910,20 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data)
19101910
struct net_device *netdev = data;
19111911
struct e1000_adapter *adapter = netdev_priv(netdev);
19121912
struct e1000_hw *hw = &adapter->hw;
1913-
u32 icr;
1914-
1915-
icr = er32(ICR);
1916-
ew32(ICR, E1000_ICR_OTHER);
1913+
u32 icr = er32(ICR);
19171914

19181915
if (icr & adapter->eiac_mask)
19191916
ew32(ICS, (icr & adapter->eiac_mask));
19201917

19211918
if (icr & E1000_ICR_LSC) {
1922-
ew32(ICR, E1000_ICR_LSC);
19231919
hw->mac.get_link_status = true;
19241920
/* guard against interrupt when we're going down */
19251921
if (!test_bit(__E1000_DOWN, &adapter->state))
19261922
mod_timer(&adapter->watchdog_timer, jiffies + 1);
19271923
}
19281924

19291925
if (!test_bit(__E1000_DOWN, &adapter->state))
1930-
ew32(IMS, E1000_IMS_OTHER);
1926+
ew32(IMS, E1000_IMS_OTHER | IMS_OTHER_MASK);
19311927

19321928
return IRQ_HANDLED;
19331929
}
@@ -2254,7 +2250,8 @@ static void e1000_irq_enable(struct e1000_adapter *adapter)
22542250

22552251
if (adapter->msix_entries) {
22562252
ew32(EIAC_82574, adapter->eiac_mask & E1000_EIAC_MASK_82574);
2257-
ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | E1000_IMS_LSC);
2253+
ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER |
2254+
IMS_OTHER_MASK);
22582255
} else if (hw->mac.type >= e1000_pch_lpt) {
22592256
ew32(IMS, IMS_ENABLE_MASK | E1000_IMS_ECCER);
22602257
} else {

0 commit comments

Comments
 (0)