Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751760AbdGaCMX convert rfc822-to-8bit (ORCPT ); Sun, 30 Jul 2017 22:12:23 -0400 Received: from mga14.intel.com ([192.55.52.115]:64957 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbdGaCMV (ORCPT ); Sun, 30 Jul 2017 22:12:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,439,1496127600"; d="scan'208";a="1200960208" From: "Zheng, Lv" To: "Song, Liwei (Wind River)" , Andy Shevchenko , "Rafael J . Wysocki" , "Len Brown" CC: linux-acpi , linux-kernel , "Song, Liwei (Wind River)" , "Moore, Robert" Subject: RE: [PATCH V2] ACPI, APEI: Fixup incorrect 16-bit access width firmware bug Thread-Topic: [PATCH V2] ACPI, APEI: Fixup incorrect 16-bit access width firmware bug Thread-Index: AQHTBoBxxp2NaMDedki2Gyt3/EuCDKJtNf3A Date: Mon, 31 Jul 2017 02:09:10 +0000 Message-ID: <1AE640813FDE7649BE1B193DEA596E886CEE8FF8@SHSMSX101.ccr.corp.intel.com> References: <1501122668-53948-1-git-send-email-liwei.song@windriver.com> In-Reply-To: <1501122668-53948-1-git-send-email-liwei.song@windriver.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWU1NWQxZjMtZmQyMC00OGU2LTkxYjYtNmZmZWUwYTc4MDY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImpabVNLVVNvbGYwTFNtbHo4YUZoQlpWb2ZTZklvQ0txdkpFcXNSYUJRRG89In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1977 Lines: 51 Hi, > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Song > liwei > Subject: [PATCH V2] ACPI, APEI: Fixup incorrect 16-bit access width firmware bug > > From: Liwei Song > > This is a follow up to commit f712c71f7b2b ("ACPI, APEI: Fixup common > access width firmware bug") fix the following firmware bug: > > [Firmware Bug]: APEI: Invalid bit width + offset in GAR [0xb2/16/0/1/1] > > This is due to an 8-bit access width is specified for a 16-bit register, > Rearrange the condition and add 8-bit width check. > > Signed-off-by: Liwei Song > --- > drivers/acpi/apei/apei-base.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c > index da370e1..eca3d7a 100644 > --- a/drivers/acpi/apei/apei-base.c > +++ b/drivers/acpi/apei/apei-base.c > @@ -604,12 +604,12 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr, > *access_bit_width = 1UL << (access_size_code + 2); > > /* Fixup common BIOS bug */ > - if (bit_width == 32 && bit_offset == 0 && (*paddr & 0x03) == 0 && > - *access_bit_width < 32) > - *access_bit_width = 32; > - else if (bit_width == 64 && bit_offset == 0 && (*paddr & 0x07) == 0 && > - *access_bit_width < 64) > - *access_bit_width = 64; > + if (*access_bit_width < bit_width && bit_offset == 0) { > + if ((bit_width == 16 && (*paddr & 0x01) == 0) || > + (bit_width == 32 && (*paddr & 0x03) == 0) || > + (bit_width == 64 && (*paddr & 0x07) == 0)) > + *access_bit_width = bit_width; > + } > > if ((bit_width + bit_offset) > *access_bit_width) { > pr_warning(FW_BUG APEI_PFX IMO, such problem could also be fixed by this commit and a cleanup of APEI GAR code to invoke generic ACPICA GAR API - acpi_read()/acpi_write() directly. https://github.com/acpica/acpica/pull/209 Thanks and best regards Lv