From patchwork Wed Oct 14 20:20:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 7398311 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4A4A6BEEA4 for ; Wed, 14 Oct 2015 20:21:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23CA120660 for ; Wed, 14 Oct 2015 20:21:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3EDA2086C for ; Wed, 14 Oct 2015 20:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754084AbbJNUUz (ORCPT ); Wed, 14 Oct 2015 16:20:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53853 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753619AbbJNUUx (ORCPT ); Wed, 14 Oct 2015 16:20:53 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 3EC8EA0A5D; Wed, 14 Oct 2015 20:20:53 +0000 (UTC) Received: from fidelio.ahs3 (ovpn-113-46.phx2.redhat.com [10.3.113.46]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9EKKpAI002116; Wed, 14 Oct 2015 16:20:52 -0400 Subject: Re: [Linaro-acpi] [PATCH v5 0/5] Provide better MADT subtable sanity checks To: Pat Erley , Al Stone , Hanjun Guo , "Rafael J. Wysocki" References: <1443570346-15378-1-git-send-email-al.stone@linaro.org> <560BA4C9.7090607@huawei.com> <560C0968.6020904@redhat.com> <2808057.teMg2oCLf6@vostro.rjw.lan> <5612AF64.4060900@redhat.com> <561B2442.9050600@erley.org> <561B2DAD.5070601@linaro.org> <561B2FCA.1010504@erley.org> <561C1D87.8010106@linaro.org> <561C8351.3030304@erley.org> Cc: linaro-kernel@lists.linaro.org, linux-ia64@vger.kernel.org, linaro-acpi@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, patches@linaro.org, Hanjun Guo , linux-arm-kernel@lists.infradead.org From: Al Stone X-Enigmail-Draft-Status: N1110 Message-ID: <561EB923.6010109@redhat.com> Date: Wed, 14 Oct 2015 14:20:51 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <561C8351.3030304@erley.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 10/12/2015 10:06 PM, Pat Erley wrote: > On 10/12/2015 01:52 PM, Al Stone wrote: >> On 10/11/2015 09:58 PM, Pat Erley wrote: >>> On 10/11/2015 08:49 PM, Hanjun Guo wrote: >>>> On 10/12/2015 11:08 AM, Pat Erley wrote: >>>>> On 10/05/2015 10:12 AM, Al Stone wrote: >>>>>> On 10/05/2015 07:39 AM, Rafael J. Wysocki wrote: >>>>>>> On Wednesday, September 30, 2015 10:10:16 AM Al Stone wrote: >>>>>>>> On 09/30/2015 03:00 AM, Hanjun Guo wrote: >>>>>>>>> On 2015/9/30 7:45, Al Stone wrote: >>>>>>>>>> NB: this patch set is for use against the linux-pm bleeding edge >>>>>>>>>> branch. >>>>>>>>>> >>>>>>>> >>>>>>>> [snip...] >>>>>>>> >>>>>>>>> >>>>>>>>> For this patch set, >>>>>>>>> >>>>>>>>> Reviewed-by: Hanjun Guo >>>>>>>>> >>>>>>>>> Thanks >>>>>>>>> Hanjun >>>>>>>> >>>>>>>> Thanks, Hanjun! >>>>>>> >>>>>>> Series applied, thanks! >>>>>>> >>>>>>> Rafael >>>>>>> >>>>>> >>>>>> Thanks, Rafael! >>>>>> >>>>> >>>>> Just decided to test out linux-next (to see the new nouveau cleanups). >>>>> This change set prevents my Lenovo W510 from booting properly. >>>>> >>>>> Reverting: 7494b0 "ACPI: add in a bad_madt_entry() function to >>>>> eventually replace the macro" >>>>> >>>>> Gets the system booting again. I'm attaching my dmesg from the failed >>>>> boot, who wants the acpidump? >>>> >>>> [ 0.000000] ACPI: undefined version for either FADT 4.0 or MADT 1 >>>> [ 0.000000] ACPI: Error parsing LAPIC address override entry >>>> [ 0.000000] ACPI: Invalid BIOS MADT, disabling ACPI >>>> >>>> Seems the MADT revision is not right, could you dump the ACPI MADT >>>> (APIC) table and send it out? I will take a look :) >>>> >>>> Thanks >>>> Hanjun >>> >>> Here ya go, enjoy. Feel free to CC me on any patches that might fix it. >> >> Pat, >> >> Would you mind sending a copy of the FADT, also, please? The first of the >> ACPI messages is a check of version correspondence between the FADT and MADT, >> while the second message is from looking at just an MADT subtable. Thanks >> for sending the MADT out -- that helps me quite a lot in thinking this through. >> >> BTW, whoever is providing the BIOS (Lenovo, I assume) may want to have a look >> at these, also: >> >> [ 0.000000] ACPI BIOS Warning (bug): 32/64X length mismatch in >> FADT/Pm1aControlBlock: 16/32 (20150818/tbfadt-623) >> [ 0.000000] ACPI BIOS Warning (bug): Invalid length for >> FADT/Pm1aControlBlock: 32, using default 16 (20150818/tbfadt-704) >> >> Not inherently dangerous, but definitely sloppy and mind-numbingly easy to >> avoid, IIRC. >> > > Here ya go. Okay. There's just a lot of weird stuff out there in ACPI-land. I've attached four minor fixes for the special cases that have been reported (well, the last one is actually a fix for a typo in the spec, but just the same...). These should apply on top of linux-next; would you mind trying them out to make sure I didn't break anything else on your laptop? If they behave as I hope they will, I think I'll have covered all the places where the checking of MADT subtables needs to be be relaxed a bit. These work for me on arm64, but if they work for you and a couple of other testers, then I'll send them to Rafael properly. Many thanks! From 6d3189ccfcbac9a61e6502df70499bd2ee808509 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Tue, 13 Oct 2015 16:31:50 -0600 Subject: [PATCH 4/4] ACPI: for bad_madt_entry(), the GIC ITS table is 20 bytes long, not 16 Correct a typo where bad_madt_entry() expected the MADT GIC ITS subtable to be 16 bytes long, but it is actually 20 bytes. This is a cut'n'paste error picked up from the spec and inadvertently replicated in code. Signed-off-by: Al Stone --- drivers/acpi/tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 790d4b0..1b7c13e 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -292,7 +292,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) * GICD 0xc 24 24 24 * GICv2m MSI 0xd 24 24 * GICR 0xe 16 16 - * GIC ITS 0xf 16 + * GIC ITS 0xf 20 * * In the table, each length entry is what should be in the length * field of the subtable, and -- in general -- it should match the @@ -366,7 +366,7 @@ static struct acpi_madt_subtable_lengths spec_info[] = { .madt_version = 3, .num_types = 16, .lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE, - 16, 16, 12, 80, 24, 24, 16, 16 } + 16, 16, 12, 80, 24, 24, 16, 20 } }, { /* terminator */ .major_version = 0, -- 2.4.3