From: Jean Delvare <jdelvare@suse.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
linux-acpi@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Lukas Wunner <lukas@wunner.de>
Subject: Re: [PATCH v3 1/2] x86/PCI: Fix a potential regression when use dmi_get_bios_year()
Date: Tue, 20 Mar 2018 16:32:58 +0100 [thread overview]
Message-ID: <20180320163258.5ac39580@endymion> (raw)
In-Reply-To: <20180320135410.11627-2-andriy.shevchenko@linux.intel.com>
Hi Andy,
On Tue, 20 Mar 2018 15:54:09 +0200, Andy Shevchenko wrote:
> dmi_get_bios_year() may return 0 when it is incapable to parse
> the BIOS date string. Previously this has been checked in
> pci_acpi_crs_quirks().
>
> Update the code to restore old behaviour.
When fixing a regression, a good practice is to tag the fix commit as
such:
Fixes: 69c42d493db4 ("x86/pci: Simplify code by using the new dmi_get_bios_year() helper")
> Reported-by: Jean Delvare <jdelvare@suse.de>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> arch/x86/pci/acpi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
> index 00e60de30328..5559dcaddd5e 100644
> --- a/arch/x86/pci/acpi.c
> +++ b/arch/x86/pci/acpi.c
> @@ -140,7 +140,9 @@ static const struct dmi_system_id pci_crs_quirks[] __initconst = {
>
> void __init pci_acpi_crs_quirks(void)
> {
> - if ((dmi_get_bios_year() < 2008) && (iomem_resource.end <= 0xffffffff))
> + int year = dmi_get_bios_year();
> +
> + if (year >= 0 && year < 2008 && iomem_resource.end <= 0xffffffff)
> pci_use_crs = false;
>
> dmi_check_system(pci_crs_quirks);
This works with the non-inline version of dmi_get_bios_year()
introduced by patch 2/2 of this series. However the inline version of
this function would return 0 on error, which makes the condition above
always true.
The patches need to be applied in the opposite order, or the test above
should be changed to "year > 0".
Reviewed-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2018-03-20 15:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-20 13:54 [PATCH v3 0/2] x86, dmi: Uninline dmi_get_bios_year() Andy Shevchenko
2018-03-20 13:54 ` [PATCH v3 1/2] x86/PCI: Fix a potential regression when use dmi_get_bios_year() Andy Shevchenko
2018-03-20 15:32 ` Jean Delvare [this message]
2018-03-20 15:49 ` Andy Shevchenko
2018-03-20 16:47 ` Thomas Gleixner
2018-03-20 17:18 ` Andy Shevchenko
2018-03-20 18:34 ` Jean Delvare
2018-03-20 16:53 ` Rafael J. Wysocki
2018-03-20 13:54 ` [PATCH v3 2/2] firmware: dmi_scan: Uninline dmi_get_bios_year() helper Andy Shevchenko
2018-03-20 15:44 ` Jean Delvare
2018-03-20 16:54 ` Rafael J. Wysocki
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=20180320163258.5ac39580@endymion \
--to=jdelvare@suse.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=hpa@zytor.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mingo@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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.