All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Manyi Li <limanyi@uniontech.com>
Cc: "Matthew Garrett" <mjg59@srcf.ucam.org>,
	"Kai-Heng Feng" <kai.heng.feng@canonical.com>,
	"Bjorn Helgaas" <helgaas@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Saheed O. Bolarinwa" <refactormyself@gmail.com>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rajat Jain" <rajatja@google.com>,
	"Linux PCI" <linux-pci@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Vidya Sagar" <vidyas@nvidia.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH] PCI/ASPM: Should not report ASPM support to BIOS if FADT indicates ASPM is unsupported
Date: Fri, 15 Jul 2022 14:56:40 +0200	[thread overview]
Message-ID: <CAJZ5v0g_G_TL36Dv-1TZycoXMO3Tr9wDL9w=94sPJPFYKS43-w@mail.gmail.com> (raw)
In-Reply-To: <CAJZ5v0hQezrqP8W0GBs8edqTLxZ=ZBmqYsevn57PUgnEDf0EXg@mail.gmail.com>

On Fri, Jul 15, 2022 at 2:32 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Fri, Jul 15, 2022 at 12:23 PM Manyi Li <limanyi@uniontech.com> wrote:
> >
> >
> >
> > On 2022/7/15 17:32, Matthew Garrett wrote:
> > > On Fri, Jul 15, 2022 at 05:19:25PM +0800, Manyi Li wrote:
> > >>
> > >>
> > >> On 2022/7/15 16:29, Matthew Garrett wrote:
> > >>> On Fri, Jul 15, 2022 at 03:40:36PM +0800, Manyi Li wrote:
> > >>>
> > >>>> Please see the details of this issus:
> > >>>> https://bugzilla.kernel.org/show_bug.cgi?id=216245
> > >>>
> > >>> Hmm. The only case where changing aspm_support_enabled to false should
> > >>> matter is in pcie_aspm_init_link_state(), where it looks like we'll
> > >>> potentially rewrite some registers even if aspm_disabled is true. I
> > >>> think in theory we shouldn't actually modify anything as a result, and
> > >>> the lspcis from the bug don't show any ASPM values having changed, but I
> > >>> don't trust Realtek hardware in the general case so maybe it gets upset
> > >>> here? If the proposed patch is to just set aspm_support_enabled to false
> > >>> when we see the FADT bit set then I think this is fine.
> > >>>
> > >>
> > >> "aspm_support_enabled" alse be used in calculate_support():
> > >> if (pcie_aspm_support_enabled())
> > >>      support |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT;
> > >> When set OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT, cause this AER
> > >> issue. I want don't set OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT when
> > >> we see the FADT bit set.
> > >
> > > Oh hm. Are you sure it's the OSC call that breaks it? I have some
> >
> > I don't sure.
> >
> > > recollection that I verified the behaviour of Windows here, but it's
> > > been over 10 years since I touched this so I could well be wrong. I can
> > > try to set up a test env to verify the behaviour of Windows when it
> > > comes to _OSC if the FADT says ASPM is unsupported.
> > >
> > but, I did a test,this modification also solves the problem:
> >
> > diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
> > index d57cf8454b93..b3ea8e886d7c 100644
> > --- a/drivers/acpi/pci_root.c
> > +++ b/drivers/acpi/pci_root.c
> > @@ -494,8 +494,8 @@ static u32 calculate_support(void)
> >          support |= OSC_PCI_HPX_TYPE_3_SUPPORT;
> >       if (pci_ext_cfg_avail())
> >               support |= OSC_PCI_EXT_CONFIG_SUPPORT;
> > -    if (pcie_aspm_support_enabled())
> > -            support |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT;
> > +//  if (pcie_aspm_support_enabled())
> > +//          support |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT;
> >       if (pci_msi_enabled())
> >               support |= OSC_PCI_MSI_SUPPORT;
> >       if (IS_ENABLED(CONFIG_PCIE_EDR))
> >
> > This issue occur in the Notebook: ASUSTeK COMPUTER INC. X456UJ
> > (ASUS-NotebookSKU) Notebook
> >
> > log "AER: Corrected error received: 0000:00:1c.5" is in the device:
> > 00:1c.5 PCI bridge [0604]: Intel Corporation Sunrise Point-LP PCI
> > Express Root Port #6 [8086:9d15] (rev f1)
>
> So it looks like the BIOS sets ACPI_FADT_NO_ASPM and then happily
> grants control of ASPM via _OSC.  That's somewhat contradictory.
>
> I would rather look at adjusting pcie_aspm_sanity_check() to this case
> instead of wholesale changing the way _OSC is handled at the host
> bridge level.

Actually, if ACPI_FADT_NO_ASPM is set in the FADT, aspm_disabled
should be set already when negotiate_os_control() runs?

Can you please check if this is the case on the affected system?

In that case, negotiate_os_control() doesn't need to set *no_aspm,
because it only causes pcie_no_aspm() to be called, but it should have
been called already.

  reply	other threads:[~2022-07-15 12:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 11:26 [PATCH] PCI/ASPM: Should not report ASPM support to BIOS if FADT indicates ASPM is unsupported Manyi Li
2022-07-13 18:28 ` Bjorn Helgaas
2022-07-14  3:20   ` Kai-Heng Feng
2022-07-14  4:56     ` Matthew Garrett
     [not found]     ` <7305201c-eaf2-cb36-80fe-15174d3e33c7@uniontech.com>
2022-07-15  8:29       ` Matthew Garrett
     [not found]         ` <c8498fc1-854f-efdc-bbc8-3de67dcf6430@uniontech.com>
2022-07-15  9:32           ` Matthew Garrett
     [not found]             ` <62d14039.1c69fb81.86d3c.71c2SMTPIN_ADDED_BROKEN@mx.google.com>
2022-07-15 12:32               ` Rafael J. Wysocki
2022-07-15 12:56                 ` Rafael J. Wysocki [this message]
2022-07-15 22:49             ` Bjorn Helgaas
     [not found]     ` <62d11a02.1c69fb81.ee60c.b0efSMTPIN_ADDED_BROKEN@mx.google.com>
2022-07-15 12:24       ` Rafael J. Wysocki
2022-07-15 14:07         ` Rafael J. Wysocki
2022-08-15  9:02           ` Manyi Li
2022-08-15 18:56 ` 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='CAJZ5v0g_G_TL36Dv-1TZycoXMO3Tr9wDL9w=94sPJPFYKS43-w@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=kw@linux.com \
    --cc=limanyi@uniontech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rajatja@google.com \
    --cc=refactormyself@gmail.com \
    --cc=vidyas@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.