linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Tony Luck <tony.luck@intel.com>,
	Kees Cook <keescook@chromium.org>,
	linux-pci@vger.kernel.org, jesse.brandeburg@intel.com,
	linux-kernel@vger.kernel.org,
	"Guilherme G . Piccoli" <gpiccoli@igalia.com>,
	Eric Dumazet <edumazet@google.com>,
	netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
	linux-hardening@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Intel-wired-lan] [PATCH v2] igc: Ignore AER reset when device is suspended
Date: Mon, 17 Jul 2023 15:47:04 +0800	[thread overview]
Message-ID: <CAAd53p6SiQrmjWA3=4CE0tw15-ZfmkcqTNoheXzkkkargfGtCw@mail.gmail.com> (raw)
In-Reply-To: <20230715191216.GA364070@bhelgaas>

On Sun, Jul 16, 2023 at 3:12 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Fri, Jul 14, 2023 at 01:35:55PM -0700, Vinicius Costa Gomes wrote:
> > Bjorn Helgaas <helgaas@kernel.org> writes:
> > > On Fri, Jul 14, 2023 at 01:05:41PM +0800, Kai-Heng Feng wrote:
> > >> When a system that connects to a Thunderbolt dock equipped with I225,
> > >> like HP Thunderbolt Dock G4, 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/hardware limitation.
> > >
> > > Does this mean we didn't disable PTM correctly on suspend?  Or is the
> > > device defective and sending PTM requests even though PTM is disabled?
> >
> > The way I understand the hardware bug, the device is defective, as you
> > said, the device sends PTM messages when "busmastering" is disabled.
>
> Bus Master Enable controls the ability of a Function to issue Memory
> and I/O Read/Write Requests (PCIe r6.0, sec 7.5.1.1.3).  PTM uses
> Messages, and I don't think they should be affected by Bus Master
> Enable.
>
> I also don't understand the I225 connection.  We have these
> Uncorrected Non-Fatal errors:
>
> > >> [  606.527931] pcieport 0000:00:1d.0: AER: Multiple Uncorrected (Non-Fatal) error received: 0000:00:1d.0
> > >> [  606.528064] pcieport 0000:00:1d.0: PCIe Bus Error: severity=Uncorrected (Non-Fatal), type=Transaction Layer, (Requester ID)
> > >> [  606.528068] pcieport 0000:00:1d.0:   device [8086:7ab0] error status/mask=00100000/00004000
> > >> [  606.528072] pcieport 0000:00:1d.0:    [20] UnsupReq               (First)
> > >> [  606.528075] pcieport 0000:00:1d.0: AER:   TLP Header: 34000000 0a000052 00000000 00000000
> > >> [  606.528079] pcieport 0000:00:1d.0: AER:   Error of this Agent is reported first
> > >> [  606.528098] pcieport 0000:04:01.0: PCIe Bus Error: severity=Uncorrected (Non-Fatal), type=Transaction Layer, (Requester ID)
> > >> [  606.528101] pcieport 0000:04:01.0:   device [8086:1136] error status/mask=00300000/00000000
> > >> [  606.528105] pcieport 0000:04:01.0:    [20] UnsupReq               (First)
> > >> [  606.528107] pcieport 0000:04:01.0:    [21] ACSViol
> > >> [  606.528110] pcieport 0000:04:01.0: AER:   TLP Header: 34000000 04000052 00000000 00000000
>
> They are clearly Unsupported Request errors caused by PTM Requests
> (decoding at https://bugzilla.kernel.org/show_bug.cgi?id=216850#c9),
> but they were logged by 00:1d.0 and 04:01.0.
>
> The hierarchy is this:
>
>   00:1d.0 Root Port to [bus 03-6c]
>   03:00.0 Switch Upstream Port to [bus 04-6c]
>   04:01.0 Switch Downstream Port to [bus 06-38]
>   06:00.0 Switch Upstream Port to [bus 07-38]
>   07:04.0 Switch Downstream Port to [bus 38]
>   38:00.0 igc I225 NIC
>
> If I225 sent a PTM request when it shouldn't have, i.e., when 07:04.0
> didn't have PTM enabled, the error would have been logged by 07:04.0.
>
> The fact that the errors were logged by 00:1d.0 and 04:01.0 means that
> they were caused by PTM requests from 03:00.0 and 06:00.0.

OK, so the PTM is actually fired by the Thunderbolt switch.
That means the I225 reset is collateral damage.
Let me see if I can reproduce the UR PTM with other devices.

Kai-Heng

>
> Bjorn

  reply	other threads:[~2023-07-17  7:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  5:05 [PATCH v2] igc: Ignore AER reset when device is suspended Kai-Heng Feng
2023-07-14 14:54 ` Bjorn Helgaas
2023-07-14 20:35   ` Vinicius Costa Gomes
2023-07-15 19:12     ` [Intel-wired-lan] " Bjorn Helgaas
2023-07-17  7:47       ` Kai-Heng Feng [this message]
2023-07-17  7:38   ` Kai-Heng Feng
2023-07-17 22:42     ` [Intel-wired-lan] " Bjorn Helgaas

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='CAAd53p6SiQrmjWA3=4CE0tw15-ZfmkcqTNoheXzkkkargfGtCw@mail.gmail.com' \
    --to=kai.heng.feng@canonical.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gpiccoli@igalia.com \
    --cc=helgaas@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.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=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).