From: Niklas Cassel <cassel@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Damien Le Moal <dlemoal@kernel.org>,
kernel-dev@rsta79.anonaddy.me,
Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-ide@vger.kernel.org,
Mario Limonciello <mario.limonciello@amd.com>
Subject: Re: [PATCH 1/2] ata: ahci: Refactor ahci_broken_lpm()
Date: Mon, 9 Jun 2025 17:43:40 +0200 [thread overview]
Message-ID: <aEcBLKZ91sZXTBzd@ryzen> (raw)
In-Reply-To: <6ea509c8-b38d-4941-8a29-c1117ff3dd5b@redhat.com>
Hello Hans,
On Mon, Jun 09, 2025 at 04:49:17PM +0200, Hans de Goede wrote:
> On 9-Jun-25 3:45 PM, Niklas Cassel wrote:
> > Currently, the match table in ahci_broken_lpm() contains DMI BIOS dates
> > of BIOSes that are known to be working.
> >
> > Having a list of known to be working versions is usually the wrong way to
> > do things (as this list could theoretically be infinite).
> >
> > Refactor this match table to contain DMI BIOS dates of BIOSes that are
> > known to not be working, such that this list can be extended with BIOS
> > versions (for other boards) that are known to not be working, where there
> > is no good BIOS version (because all released versions are broken).
> >
> > Signed-off-by: Niklas Cassel <cassel@kernel.org>
> > ---
> > drivers/ata/ahci.c | 34 ++++++++++++++++++++++++----------
> > 1 file changed, 24 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> > index 163ac909bd06..a6ce172fa928 100644
> > --- a/drivers/ata/ahci.c
> > +++ b/drivers/ata/ahci.c
> > @@ -1411,27 +1411,39 @@ static bool ahci_broken_suspend(struct pci_dev *pdev)
> > static bool ahci_broken_lpm(struct pci_dev *pdev)
> > {
> > static const struct dmi_system_id sysids[] = {
> > - /* Various Lenovo 50 series have LPM issues with older BIOSen */
> > + /* Table contains DMI BIOS dates of BIOSes with broken LPM. */
> > {
> > .matches = {
> > DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> > DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X250"),
> > },
> > - .driver_data = "20180406", /* 1.31 */
> > + /*
> > + * 1.31, released 20180406, has working LPM, mark any
> > + * DMI BIOS date before that as broken.
> > + */
>
> Note the DMI_BIOS_DATE field is the data the BIOS was build, I would avoid
> the word "released" here since release-notes doucments often contain different
> dates then the actual build date (e.g. see below).
Hm... the command to get this date is:
$ dmidecode -s bios-release-date
So in one way, I think this is the correct term.
But indeed, the "release date" in the release notes is usually different
from the "dmidecode -s bios-release-date" date, so perhaps just to avoid
confusion, using "build date" rather than "released"/"release date" is a
good idea.
>
> > + .driver_data = "20180405",
> > },
> > {
> > .matches = {
> > DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> > DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L450"),
> > },
> > - .driver_data = "20180420", /* 1.28 */
> > + /*
> > + * 1.28, released 20180420, has working LPM, mark any
> > + * DMI BIOS date before that as broken.
> > + */
> > + .driver_data = "20180419",
> > },
> > {
> > .matches = {
> > DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> > DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T450s"),
> > },
> > - .driver_data = "20180315", /* 1.33 */
> > + /*
> > + * 1.33, released 20180315, has working LPM, mark any
> > + * DMI BIOS date before that as broken.
> > + */
> > + .driver_data = "20180314",
> > },
> > {
> > .matches = {
> > @@ -1439,12 +1451,14 @@ static bool ahci_broken_lpm(struct pci_dev *pdev)
> > DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W541"),
> > },
> > /*
> > - * Note date based on release notes, 2.35 has been
> > - * reported to be good, but I've been unable to get
> > - * a hold of the reporter to get the DMI BIOS date.
> > - * TODO: fix this.
> > + * Note: according to release notes, version 2.35 has
> > + * working LPM, but we do not have the DMI BIOS date for
> > + * this version, so the date, 20180310, is based on the
> > + * release notes. Mark any DMI BIOS date before that as
> > + * broken.
> > + * TODO: find with date with DMI BIOS date.
> > */
> > - .driver_data = "20180310", /* 2.35 */
> > + .driver_data = "20180309",
>
> This reminds me that I did eventually got the actual BIOS date from
> the reporter. After some digging I managed to find the email.
>
> The first known working BIOS has a BIOS date of 04/09/2018 so that
> would become "20180409" before your patch / "20180408" after your patch.
>
> I guess you may want to add a prep patch before the rest of this
> series before this patch to make things a bit cleaner.
Thank you!
I will send a V2 with the proper date as a patch 1/3.
Kind regards,
Niklas
prev parent reply other threads:[~2025-06-09 15:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 13:45 [PATCH 1/2] ata: ahci: Refactor ahci_broken_lpm() Niklas Cassel
2025-06-09 13:45 ` [PATCH 2/2] ata: ahci: Disallow LPM for ASUSPRO-D840SA motherboard Niklas Cassel
2025-06-09 14:50 ` Hans de Goede
2025-06-09 14:49 ` [PATCH 1/2] ata: ahci: Refactor ahci_broken_lpm() Hans de Goede
2025-06-09 14:57 ` Hans de Goede
2025-06-09 15:43 ` Niklas Cassel [this message]
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=aEcBLKZ91sZXTBzd@ryzen \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=hdegoede@redhat.com \
--cc=kernel-dev@rsta79.anonaddy.me \
--cc=linux-ide@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mika.westerberg@linux.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 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.