From patchwork Wed Oct 14 21:26:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 54967 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 2F34F20490 for ; Wed, 14 Oct 2015 21:26:51 +0000 (UTC) Received: by wicid10 with SMTP id id10sf765121wic.2 for ; Wed, 14 Oct 2015 14:26:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=AWxIrjZ5YiqQQW94HhE4elM5jLFZ6xpRLcKZdGBiozo=; b=cn8sqpGjWSavugsOo2HjRXpAEajR5geRlvlkvXvthnlpN7pF69tfQUgO+lIyPH0/y7 cBhs2UmbsDWP+PJGC2XRGIUa6d7pjpgfTgABPrxjYsQeh091fsrCjopdnkBnscCnmvur 0TEMCnRyqO+BRoR6RyYdZWEyby7JuzTCptvak8urpgWw7WkYN3GUCi1ApfAlHVAbiHJy g/7DvrUL9BMo5dEwzVPJ4jro9id4kouEBa0G/oJuziQASLb0xs3Fuw/DUEsd7N+S2VgY 84dnprka+iW5Mey6ZOBMTFKlq+zdP8NAKxOXq6uI5GM+Y9qFhBjL2HkOsanJdOYF5Eee KIZQ== X-Gm-Message-State: ALoCoQn9yWH0DU89/XS/oGT+bzqefe+IxKHrrFZPlYsh58pwCqJld1QbcTYx9Ftlb/tAIypw6wGn X-Received: by 10.180.10.135 with SMTP id i7mr1377871wib.2.1444858010525; Wed, 14 Oct 2015 14:26:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.89.207 with SMTP id n198ls79865lfb.54.gmail; Wed, 14 Oct 2015 14:26:50 -0700 (PDT) X-Received: by 10.112.13.34 with SMTP id e2mr2156991lbc.120.1444858010378; Wed, 14 Oct 2015 14:26:50 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id v9si4857246lby.76.2015.10.14.14.26.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 14:26:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbpp2 with SMTP id pp2so26639848lbb.0 for ; Wed, 14 Oct 2015 14:26:50 -0700 (PDT) X-Received: by 10.112.17.34 with SMTP id l2mr2712587lbd.117.1444858009598; Wed, 14 Oct 2015 14:26:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.59.35 with SMTP id w3csp239247lbq; Wed, 14 Oct 2015 14:26:48 -0700 (PDT) X-Received: by 10.50.43.170 with SMTP id x10mr6863231igl.12.1444858001751; Wed, 14 Oct 2015 14:26:41 -0700 (PDT) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by mx.google.com with ESMTPS id t2si8941032ioe.182.2015.10.14.14.26.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 14:26:41 -0700 (PDT) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 209.85.223.181 as permitted sender) client-ip=209.85.223.181; Received: by ioii196 with SMTP id i196so69757614ioi.3 for ; Wed, 14 Oct 2015 14:26:41 -0700 (PDT) X-Received: by 10.107.25.143 with SMTP id 137mr5713635ioz.52.1444858001418; Wed, 14 Oct 2015 14:26:41 -0700 (PDT) Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by smtp.googlemail.com with ESMTPSA id d7sm4385194igl.1.2015.10.14.14.26.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 14:26:40 -0700 (PDT) From: Al Stone To: linux-acpi@vger.kernel.org Cc: linaro-acpi@lists.linaro.org, linaro-kernel@lists.linaro.org, patches@linaro.org, Al Stone Subject: [PATCH 3/4] ACPI: workaround FADT always being revision 2 Date: Wed, 14 Oct 2015 15:26:24 -0600 Message-Id: <1444857985-28844-4-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444857985-28844-1-git-send-email-al.stone@linaro.org> References: <1444857985-28844-1-git-send-email-al.stone@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In some environments, the FADT revision number is always 2, independent of any other factors indicating that it may be a newer revision. So, we cannot rely on the FADT and MADT revisions being in proper sync. For those environments, relax the checking so we only enforce the size check, even if we do issue warnings on other problems. If we do not relax the rules, these systems will not boot as they have in the past. Signed-off-by: Al Stone --- drivers/acpi/tables.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 3b5ddfb..790d4b0 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -416,7 +416,6 @@ static int __init bad_madt_entry(struct acpi_table_header *table, /* ... but relax it on legacy systems so they boot */ pr_warn("undefined version for either FADT %d.%d or MADT %d\n", major, minor, madt->header.revision); - return 0; } } @@ -430,16 +429,41 @@ static int __init bad_madt_entry(struct acpi_table_header *table, /* ... but relax it on legacy systems so they boot */ pr_warn("undefined MADT subtable type for FADT %d.%d: %d (length %d)\n", major, minor, entry->type, entry->length); - return 0; } } /* verify that the table is allowed for this version of the spec */ len = ms->lengths[entry->type]; if (!len) { - pr_err("MADT subtable %d not defined for FADT %d.%d\n", - entry->type, major, minor); - return 1; + if (IS_ENABLED(CONFIG_ARM64)) { + pr_err("MADT subtable %d not defined for FADT %d.%d\n", + entry->type, major, minor); + return 1; + } else { + pr_warn("MADT subtable %d not defined for FADT %d.%d\n", + entry->type, major, minor); + } + } + + /* + * When we get this far, we may have issued warnings on either + * a mismatch in FADT/MADT revisions, or have noted that the subtable + * ID is not defined for the MADT revision we're using. On some + * architectures, this is an error, but for legacy systems, we need + * to push on with other checks of the subtable. + * + * In fact, there are environments where the *only* value the FADT + * revision will ever have is 2, regardless of anything else. So, + * for those systems to boot, we have to pretend the MADT is the + * latest version to allow all known subtables since we have no way + * to determine what revision it should be. + */ + if (!IS_ENABLED(CONFIG_ARM64) && major == 2) { + ms = spec_info; + while (ms->num_types != 0) + ms++; + ms--; + len = ms->lengths[entry->type]; } /* verify that the length is what we expect */