Received: by 10.223.176.5 with SMTP id f5csp1964338wra; Thu, 8 Feb 2018 06:25:33 -0800 (PST) X-Google-Smtp-Source: AH8x227VS56iadWIEP6ZzOd2lq7YOBkDtnXIWhg6QSNrUvi1CVRRaeStWCFL8DER8EwWTW0MX5zC X-Received: by 10.99.150.2 with SMTP id c2mr679269pge.424.1518099932952; Thu, 08 Feb 2018 06:25:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518099932; cv=none; d=google.com; s=arc-20160816; b=mAt/aq2VrteA0TfbMbPeOjz62zV6b61QPKLOdOv3/5GS0ZxMQEUXH3CGYS8v9wGJHg gFDG2gXgdcI1HcPRQ7KIsdmWkhyPchcsY4RzWOWrsx8r0kgX0RZfjKyNaPVy9o5DFiZw lWOQWXyZHUTlPCJPvx/nSBtcGcwRYK2knrpCIF1KR51vaN7adUuV5vT8bIFgrAI1l9/C 7INtwxHnAKmWuBm6f4huzBBl05XWMIuWsPwbbCfSDDnR5r4E2pZLvbyZX56yrlapb+K6 cVeu0pwG7XdNl05x3OjJpPBw9f5cmfiZUcDUZblzC/jkAuj8i1dOPJaBghf/2t3ZwUd6 DlNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=/5Iep1COpenAfr2diNvIYm+lUX92E9sMr3JQHoCRHDQ=; b=Mo6D3D/OIdjpNg9lWXlTO5/u+qNDrTYcbrTQtyvoexln9puOqO4K7FPMGB0mO0N1/r ++FkzDIcu4OSrIIBi+W1beq+jdjDn2gIr77k+6xLro3E9zePznwXsvWvVRmb0mtajhCs a4QrujOWGrgwN2Dw2CC4ujrsMRP/F/am2rpO49HYnUOfZKstlQMt//dODke8LpxltbsB 9OPWpqDENTsHeOOz7P30oux4Bv4oY2fuWKid1JFey+l6Th8TtuQyDbQVph+PdknXI33i B3Oup83ERrelrDuOktKJ3gAxXxuMIGjkXgxpilcGM6xXTRuPoy5mPdX/6d9IFn+ecSB/ uPvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f27uqVuz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si5431pgn.336.2018.02.08.06.25.19; Thu, 08 Feb 2018 06:25:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f27uqVuz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752249AbeBHOYK (ORCPT + 99 others); Thu, 8 Feb 2018 09:24:10 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:35642 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbeBHOYJ (ORCPT ); Thu, 8 Feb 2018 09:24:09 -0500 Received: by mail-qt0-f195.google.com with SMTP id g14so6350261qti.2; Thu, 08 Feb 2018 06:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/5Iep1COpenAfr2diNvIYm+lUX92E9sMr3JQHoCRHDQ=; b=f27uqVuz4Vh5JHVjDPwb6ygnCRojF+GXcqTSmNPGXRXu2dXJ0smiRvh0iTTchzqMu0 fAg7PQ6EPNWqDOemao3GhqqVObEAyBnKDawCH/3KD5d60Wwr6R97ncn3uLE+SMpdHwyg a7fh0nO5kiy7ni4VmJjkbhxsLm/1eQ1rt/dahhkF5k68I5MAOPbHcjg9+6CbaJl7jU3Z Go7XGNs86GnFI9KwjgzoeNDQ72SKkjV9eMRJ1NGHAZKgIpuUjQJaBURVEhNzt1/P/lfP z2lc1zUTkoMFXHIaUkWie20AyXu044dyuHmBHlqaKdZZBpvSv3paGHdt7koICZsPExa3 QnpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/5Iep1COpenAfr2diNvIYm+lUX92E9sMr3JQHoCRHDQ=; b=W7kJbb44KKfZfVJuj0QAOJQXtY0mPrnuD07Zc7BGQmZFLnSqwWzoDFqzd96k7xUaEo F1CbBex3llC8GbVYzdW3HeGUwyug6QyfYw5/6CmHH5+9WaSMJsagrQ1mBdqdPUzfpEgR 8A0nDv8V7zTK7Dl9QJvjgA4IBqg94WubMw8jDElnAsbptctTOX8cDfAatDPYWUlyEF+M mGdsHlBk0d62yS1V/ghKVtz6lAK91ZZcuGxzewn52RQxIF4mkEBAjUcoMcmH9msOI7U9 9VL3YxeqfDiCt5afKr87XuCt0ku+qmu77fR5Y1rckO4tgmZAKQXp/UTBncIogjIELeEZ Ra/w== X-Gm-Message-State: APf1xPAgiEDxmgwifGvupj+eO8CCdvdPJCnJAARQlUudJ2idKZqyiEyM dDNu2Xt9DwLBczfBimu6/MNE8L/EYmCwUcR3Yzs= X-Received: by 10.237.51.199 with SMTP id v65mr1389578qtd.184.1518099848063; Thu, 08 Feb 2018 06:24:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.89.199 with HTTP; Thu, 8 Feb 2018 06:24:07 -0800 (PST) In-Reply-To: <20180208064714.6042-3-bpoirier@suse.com> References: <20180208064714.6042-1-bpoirier@suse.com> <20180208064714.6042-3-bpoirier@suse.com> From: Alexander Duyck Date: Thu, 8 Feb 2018 06:24:07 -0800 Message-ID: Subject: Re: [PATCH net-queue 3/3] e1000e: Avoid missed interrupts following ICR read. To: Benjamin Poirier Cc: Jeff Kirsher , intel-wired-lan , Netdev , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 7, 2018 at 10:47 PM, Benjamin Poirier wrote: > 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 Acked-by: Alexander Duyck > --- > drivers/net/ethernet/intel/e1000e/defines.h | 21 ++++++++++++++++++++- > drivers/net/ethernet/intel/e1000e/netdev.c | 11 ++++------- > 2 files changed, 24 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h > index afb7ebe20b24..824fd44e25f0 100644 > --- a/drivers/net/ethernet/intel/e1000e/defines.h > +++ b/drivers/net/ethernet/intel/e1000e/defines.h > @@ -400,6 +400,10 @@ > #define E1000_ICR_RXDMT0 0x00000010 /* Rx desc min. threshold (0) */ > #define E1000_ICR_RXO 0x00000040 /* Receiver Overrun */ > #define E1000_ICR_RXT0 0x00000080 /* Rx timer intr (ring 0) */ > +#define E1000_ICR_MDAC 0x00000200 /* MDIO Access Complete */ > +#define E1000_ICR_SRPD 0x00010000 /* Small Receive Packet Detected */ > +#define E1000_ICR_ACK 0x00020000 /* Receive ACK Frame Detected */ > +#define E1000_ICR_MNG 0x00040000 /* Manageability Event Detected */ > #define E1000_ICR_ECCER 0x00400000 /* Uncorrectable ECC Error */ > /* If this bit asserted, the driver should claim the interrupt */ > #define E1000_ICR_INT_ASSERTED 0x80000000 > @@ -407,7 +411,7 @@ > #define E1000_ICR_RXQ1 0x00200000 /* Rx Queue 1 Interrupt */ > #define E1000_ICR_TXQ0 0x00400000 /* Tx Queue 0 Interrupt */ > #define E1000_ICR_TXQ1 0x00800000 /* Tx Queue 1 Interrupt */ > -#define E1000_ICR_OTHER 0x01000000 /* Other Interrupts */ > +#define E1000_ICR_OTHER 0x01000000 /* Other Interrupt */ > > /* PBA ECC Register */ > #define E1000_PBA_ECC_COUNTER_MASK 0xFFF00000 /* ECC counter mask */ > @@ -431,12 +435,27 @@ > E1000_IMS_RXSEQ | \ > E1000_IMS_LSC) > > +/* These are all of the events related to the OTHER interrupt. > + */ > +#define IMS_OTHER_MASK ( \ > + E1000_IMS_LSC | \ > + E1000_IMS_RXO | \ > + E1000_IMS_MDAC | \ > + E1000_IMS_SRPD | \ > + E1000_IMS_ACK | \ > + E1000_IMS_MNG) > + > /* Interrupt Mask Set */ > #define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ > #define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */ > #define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* Rx sequence error */ > #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* Rx desc min. threshold */ > +#define E1000_IMS_RXO E1000_ICR_RXO /* Receiver Overrun */ > #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* Rx timer intr */ > +#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO Access Complete */ > +#define E1000_IMS_SRPD E1000_ICR_SRPD /* Small Receive Packet */ > +#define E1000_IMS_ACK E1000_ICR_ACK /* Receive ACK Frame Detected */ > +#define E1000_IMS_MNG E1000_ICR_MNG /* Manageability Event */ > #define E1000_IMS_ECCER E1000_ICR_ECCER /* Uncorrectable ECC Error */ > #define E1000_IMS_RXQ0 E1000_ICR_RXQ0 /* Rx Queue 0 Interrupt */ > #define E1000_IMS_RXQ1 E1000_ICR_RXQ1 /* Rx Queue 1 Interrupt */ > diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c > index 2c9609bee2ae..9fd4050a91ca 100644 > --- a/drivers/net/ethernet/intel/e1000e/netdev.c > +++ b/drivers/net/ethernet/intel/e1000e/netdev.c > @@ -1914,16 +1914,12 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data) > struct net_device *netdev = data; > struct e1000_adapter *adapter = netdev_priv(netdev); > struct e1000_hw *hw = &adapter->hw; > - u32 icr; > - > - icr = er32(ICR); > - ew32(ICR, E1000_ICR_OTHER); > + u32 icr = er32(ICR); > > if (icr & adapter->eiac_mask) > ew32(ICS, (icr & adapter->eiac_mask)); > > if (icr & E1000_ICR_LSC) { > - ew32(ICR, E1000_ICR_LSC); > hw->mac.get_link_status = true; > /* guard against interrupt when we're going down */ > if (!test_bit(__E1000_DOWN, &adapter->state)) > @@ -1931,7 +1927,7 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data) > } > > if (!test_bit(__E1000_DOWN, &adapter->state)) > - ew32(IMS, E1000_IMS_OTHER); > + ew32(IMS, E1000_IMS_OTHER | IMS_OTHER_MASK); > > return IRQ_HANDLED; > } > @@ -2258,7 +2254,8 @@ static void e1000_irq_enable(struct e1000_adapter *adapter) > > if (adapter->msix_entries) { > ew32(EIAC_82574, adapter->eiac_mask & E1000_EIAC_MASK_82574); > - ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | E1000_IMS_LSC); > + ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | > + IMS_OTHER_MASK); > } else if (hw->mac.type >= e1000_pch_lpt) { > ew32(IMS, IMS_ENABLE_MASK | E1000_IMS_ECCER); > } else { > -- > 2.16.1 >