From patchwork Mon Jun 29 12:06:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 6688521 Return-Path: X-Original-To: patchwork-linux-acpi@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 3885EC05AC for ; Mon, 29 Jun 2015 12:06:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4DD6520544 for ; Mon, 29 Jun 2015 12:06:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18E5420253 for ; Mon, 29 Jun 2015 12:06:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750708AbbF2MGr (ORCPT ); Mon, 29 Jun 2015 08:06:47 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:36326 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752424AbbF2MGq (ORCPT ); Mon, 29 Jun 2015 08:06:46 -0400 Received: by widjy10 with SMTP id jy10so1527929wid.1 for ; Mon, 29 Jun 2015 05:06:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rtOZyHwRI5D0NUJQRI+VVWlsX9v4qhykAlSgSjRa5aw=; b=Ccn2w4c9OhwTeAbov4AVP7NTVgHghqsmCw+DyrUcZuHbM6yB8EiK8cac0vkdMq8q0r yODTVbK+pkANg/Ln4DR6XcI+ZTIMuNS1nNreQGA6ed67smNyEzCss2d21D0X9eqE+6Kp UpfjYkr73XS+2pcnJ/jRSlR+MKSukDhIc5h+Th3LnZQN23sO0rDh134XHj3tkPJcN+oJ Nf84993Z4M3P1fFonmuCRMQN7+klL2gn2eQ5Y/tYDh0CfX3Bn0tkDuLnvxBkbG7F68gD jRWZFQ36qI6bUJd9PgejSiJk54Ip7FT97TmH+stEEGIjoG+rJkF0UFlVO6jDSLNNepNQ CERA== X-Gm-Message-State: ALoCoQmU4O9ooCtvSUA54v51m9HjOMoLBy9VZXmKlAkbwlkzETsA3c1NnnOjiSe7t/s8xqTmG24B X-Received: by 10.180.73.244 with SMTP id o20mr22153572wiv.31.1435579605106; Mon, 29 Jun 2015 05:06:45 -0700 (PDT) Received: from localhost ([90.216.251.237]) by mx.google.com with ESMTPSA id q3sm63798980wjr.38.2015.06.29.05.06.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 05:06:44 -0700 (PDT) From: Matt Fleming To: Tom Yan Cc: Josh Triplett , Matthew Garrett , linux-efi@vger.kernel.org, linux-acpi@vger.kernel.org, Matt Fleming Subject: [PATCH] x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT Date: Mon, 29 Jun 2015 13:06:42 +0100 Message-Id: <1435579602-6612-1-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 From: Matt Fleming It's totally legitimate, per the ACPI spec, for the firmware to set the BGRT 'status' field to zero to indicate that the BGRT image isn't being displayed, and we shouldn't be printing an error message in that case because it's just noise for users. So swap pr_err() for pr_debug(). However, Josh points that out it still makes sense to test the validity of the upper 7 bits of the 'status' field, since they're marked as "reserved" in the spec and must be zero. If firmware violates this it really *is* an error. Reported-by: Tom Yan Cc: Josh Triplett Cc: Matthew Garrett Signed-off-by: Matt Fleming Reviewed-by: Josh Triplett --- Tom, if you could test out this patch that would be really helpful. I'll take this one through the EFI git repo. arch/x86/platform/efi/efi-bgrt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c index d7f997f7c26d..ea48449b2e63 100644 --- a/arch/x86/platform/efi/efi-bgrt.c +++ b/arch/x86/platform/efi/efi-bgrt.c @@ -50,11 +50,16 @@ void __init efi_bgrt_init(void) bgrt_tab->version); return; } - if (bgrt_tab->status != 1) { - pr_err("Ignoring BGRT: invalid status %u (expected 1)\n", + if (bgrt_tab->status & 0xfe) { + pr_err("Ignoring BGRT: reserved status bits are non-zero %u\n", bgrt_tab->status); return; } + if (bgrt_tab->status != 1) { + pr_debug("Ignoring BGRT: invalid status %u (expected 1)\n", + bgrt_tab->status); + return; + } if (bgrt_tab->image_type != 0) { pr_err("Ignoring BGRT: invalid image type %u (expected 0)\n", bgrt_tab->image_type);