Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935535AbeAKSD1 (ORCPT + 1 other); Thu, 11 Jan 2018 13:03:27 -0500 Received: from mail-oi0-f67.google.com ([209.85.218.67]:40650 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932454AbeAKSDZ (ORCPT ); Thu, 11 Jan 2018 13:03:25 -0500 X-Google-Smtp-Source: ACJfBosNX5ZHnHOzSCvwLamJG4bv3jrI7R65o95gQCkOUcbyMGH5DXiZuPGdFynwJuLU6+lE+6ek6cDv36l0kBJveO4= MIME-Version: 1.0 In-Reply-To: References: <20180111150316.19951-1-Yazen.Ghannam@amd.com> From: "Rafael J. Wysocki" Date: Thu, 11 Jan 2018 19:03:23 +0100 X-Google-Sender-Auth: AJxBSor8lhVOJfXhBkMp2qqSp2c Message-ID: Subject: Re: [PATCH] PCI/ACPI: Disable AER when _OSC control bit is clear. To: "Ghannam, Yazen" Cc: "Rafael J. Wysocki" , ACPI Devel Maling List , Linux Kernel Mailing List , Linux PCI , "Rafael J. Wysocki" , Len Brown , Bjorn Helgaas , Borislav Petkov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 6:48 PM, Ghannam, Yazen wrote: >> -----Original Message----- >> From: rjwysocki@gmail.com [mailto:rjwysocki@gmail.com] On Behalf Of >> Rafael J. Wysocki >> Sent: Thursday, January 11, 2018 12:39 PM >> To: Ghannam, Yazen >> Cc: ACPI Devel Maling List ; Linux Kernel Mailing >> List ; Linux PCI ; >> Rafael J. Wysocki ; Len Brown ; Bjorn >> Helgaas ; Borislav Petkov >> Subject: Re: [PATCH] PCI/ACPI: Disable AER when _OSC control bit is clear. >> >> On Thu, Jan 11, 2018 at 4:03 PM, Yazen Ghannam >> wrote: >> > From: Yazen Ghannam >> > >> > Currently, aer_service_init() checks if AER is available and that >> > Firmware First handling is not enabled. The _OSC request for AER is >> > not taken into account when deciding to enable AER in Linux. >> > >> > We should check that the _OSC control for AER is set. If it's not >> > then AER should be disabled. >> > >> > The _OSC control for AER is not requested when APEI Firmware First is >> > used, so the same condition applies. >> > >> > Mark AER as disabled if the _OSC request was not made or accepted. >> > >> > Remove redunant check for aer_acpi_firmware_first() when calling >> > aer_service_init(), since this is check is already included when >> > checking the _OSC control. >> > >> > Signed-off-by: Yazen Ghannam >> > --- >> > drivers/acpi/pci_root.c | 3 +++ >> > drivers/pci/pcie/aer/aerdrv.c | 2 +- >> > 2 files changed, 4 insertions(+), 1 deletion(-) >> > >> > diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c >> > index 6fc204a52493..19a625ed8de9 100644 >> > --- a/drivers/acpi/pci_root.c >> > +++ b/drivers/acpi/pci_root.c >> > @@ -512,6 +512,9 @@ static void negotiate_os_control(struct >> acpi_pci_root *root, int *no_aspm) >> > */ >> > *no_aspm = 1; >> > } >> > + >> > + if (!(requested & control & OSC_PCI_EXPRESS_AER_CONTROL)) >> >> One of the operators above needs to be a && I suppose? >> > > It's a 3-way bitwise AND to check that OSC_PCI_EXPRESS_AER_CONTROL is > set in both "requested" and "control". > > IOW, we check if AER was requested by the OS and that the platform > granted the request. OK I'll queue this up if Bjorn doesn't object, unless Bjorn wants to apply it himself. Thanks, Rafael