netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Neftin, Sasha" <sasha.neftin@intel.com>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	"Ruinskiy, Dima" <dima.ruinskiy@intel.com>,
	"Gomes, Vinicius" <vinicius.gomes@intel.com>,
	"Zulkifli,
	Muhammad Husaini" <muhammad.husaini.zulkifli@intel.com>,
	Tony Luck <tony.luck@intel.com>,
	Kees Cook <keescook@chromium.org>,
	linux-pci@vger.kernel.org, "Mushayev,
	Nikolay" <nikolay.mushayev@intel.com>,
	linux-kernel@vger.kernel.org, jesse.brandeburg@intel.com, "Edri,
	Michael" <michael.edri@intel.com>,
	"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
	Eric Dumazet <edumazet@google.com>,
	anthony.l.nguyen@intel.com, linux-hardening@vger.kernel.org,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
	Paolo Abeni <pabeni@redhat.com>,
	"Avivi, Amir" <amir.avivi@intel.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Intel-wired-lan] [PATCH] igc: Ignore AER reset when device is suspended
Date: Thu, 22 Jun 2023 08:11:23 -0500	[thread overview]
Message-ID: <20230622131123.GA137990@bhelgaas> (raw)
In-Reply-To: <16bcc313-a4e1-ab50-4487-c99ccf5ecdf9@intel.com>

On Thu, Jun 22, 2023 at 08:09:34AM +0300, Neftin, Sasha wrote:
> On 6/21/2023 23:43, Bjorn Helgaas wrote:
> > On Tue, Jun 20, 2023 at 08:36:36PM +0800, Kai-Heng Feng wrote:
> > > When a system that connects to a Thunderbolt dock equipped with I225,
> > > I225 stops working after S3 resume:

> > > The issue is that the PTM requests are sending before driver resumes the
> > > device. Since the issue can also be observed on Windows, it's quite
> > > likely a firmware/hardwar limitation.
> > 
> > I thought c01163dbd1b8 ("PCI/PM: Always disable PTM for all devices
> > during suspend") would turn off PTM.  Is that not working for this
> > path, or are we re-enabling PTM incorrectly, or something else?
> 
> I think we hit on the HW bug here. On some i225/6 parts, PTM requests are
> sent before SW takes ownership of the device. This patch could help.

Is there an erratum we can read?  If this is needed to work around a
hardware defect, there should be a comment in the code to that effect,
and we should have a better understanding because there may be other
scenarios (suspend/resume, hotplug, etc) that need similar changes.

(I know this patch is to work around a suspend/resume issue, but the
change is in the AER error recovery path, so it doesn't quite fit
together for me yet.)

Are you saying the NIC sends PTM requests when it doesn't have PTM
Enable set?

What exactly does it mean for "SW to take ownership of the device"?
What PCIe transaction would tell the device the SW has taken
ownership?

So far this feels kind of hand-wavey.

> > Checking pci_is_enable() in the .error_detected() callback looks like
> > a pattern that may need to be replicated in many other drivers, which
> > makes me think it may not be the best approach.
> > 
> > > So avoid resetting the device if it's not resumed. Once the device is
> > > fully resumed, the device can work normally.
> > > 
> > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=216850
> > > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> > > ---
> > >   drivers/net/ethernet/intel/igc/igc_main.c | 3 +++
> > >   1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> > > index fa764190f270..6a46f886ff43 100644
> > > --- a/drivers/net/ethernet/intel/igc/igc_main.c
> > > +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> > > @@ -6962,6 +6962,9 @@ static pci_ers_result_t igc_io_error_detected(struct pci_dev *pdev,
> > >   	struct net_device *netdev = pci_get_drvdata(pdev);
> > >   	struct igc_adapter *adapter = netdev_priv(netdev);
> > > +	if (!pci_is_enabled(pdev))
> > > +		return 0;
> > > +
> > >   	netif_device_detach(netdev);
> > >   	if (state == pci_channel_io_perm_failure)

  reply	other threads:[~2023-06-22 13:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 12:36 [PATCH] igc: Ignore AER reset when device is suspended Kai-Heng Feng
2023-06-20 14:34 ` [Intel-wired-lan] " Paul Menzel
2023-06-20 15:05 ` Guilherme G. Piccoli
2023-06-21 17:10 ` Vinicius Costa Gomes
2023-06-21 20:43 ` Bjorn Helgaas
2023-06-22  5:09   ` [Intel-wired-lan] " Neftin, Sasha
2023-06-22 13:11     ` Bjorn Helgaas [this message]
2023-06-27  8:12       ` Kai-Heng Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230622131123.GA137990@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=amir.avivi@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=dima.ruinskiy@intel.com \
    --cc=edumazet@google.com \
    --cc=gpiccoli@igalia.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=michael.edri@intel.com \
    --cc=muhammad.husaini.zulkifli@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay.mushayev@intel.com \
    --cc=pabeni@redhat.com \
    --cc=sasha.neftin@intel.com \
    --cc=tony.luck@intel.com \
    --cc=vinicius.gomes@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).