From patchwork Tue Oct 17 18:15:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 116153 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp5196294qgn; Tue, 17 Oct 2017 11:15:48 -0700 (PDT) X-Received: by 10.98.233.20 with SMTP id j20mr6801784pfh.281.1508264148845; Tue, 17 Oct 2017 11:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508264148; cv=none; d=google.com; s=arc-20160816; b=AUV66yABmJ1MT2IptQ/tRBhQQnY3ovvAD6CpDoVdse49NWc2AKLciF53gJM+/DXwge 3QGyVh+UhBsu28StkLC9jWecJ2sGTy9uPaCIWIvvek7KTlINxKpq22DMG6zk7YwibJOb mLcMl7t+n8iP7KqBMsRtuaIDptoMb1Axv0SRv9Y2aDtgTKbpQsNOTPLxhbZoIqdceyx8 9hDGW1QArNu8u0coS8YBpPVtqNHQ5AvRwduDQ1LxpSLVDOWjdRV3bjd31BM0STImOh9q 1rNnQMfCJqo6hL/SDc6KS+GG2yEgc8+blp6DYmqX2kAXqFtDdrtiqDZhqeClKV4pKwfX Hr4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Krrt0P6vfIFERDsy2SJon4hrkYw1y6rsSa4SeJ1FuI4=; b=uZZ8qK286woz9DcN2HEy7cjRrBky6PQ6u/ZJorjKz+sGZtFz2KZLx0PKbgE/vaeAt8 zDXfzsTE0cvYXUUI0U3nKaLinbNXC+OJBL+shFLyjL6kShc9RLh9nzUrwiodgwkZ2xG0 hqCrTxcBAqMNj8ThWZZ8sj2Rnz/raHdahUMZlskCCaZ1xdNmdCB+0kHW31FwF+Muo3fH CapdFiaYyD1we7rwTSF+EZdQmnN3w+nVsxIl1apWbTxxelXemU6QzmINRk8BuMoR2/li 7AyLbpwIzh0WDATVO/6fIjCdCy6ah5zGeJGhbcoDHFxiIRqvFKS2bDoYw+YByVU3DSVt PvXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IUEguPu3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d92si2215495pld.544.2017.10.17.11.15.48; Tue, 17 Oct 2017 11:15:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IUEguPu3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937331AbdJQSPq (ORCPT + 27 others); Tue, 17 Oct 2017 14:15:46 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:49424 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937315AbdJQSPo (ORCPT ); Tue, 17 Oct 2017 14:15:44 -0400 Received: by mail-wr0-f182.google.com with SMTP id g90so2620984wrd.6 for ; Tue, 17 Oct 2017 11:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Krrt0P6vfIFERDsy2SJon4hrkYw1y6rsSa4SeJ1FuI4=; b=IUEguPu36XSFBQ8Fa70qe5NWHVvSTQTwG9OjCWBLEkb+tNVZBtGaihgrHqHf0vzCIm 8u3/keJtH9bIal1haM3v+cbwQhqmXmRWvvUcdzBvH+PvozNtVb9st9tuKBh6O3e8Pyfc 3UK4iXb9ncn1OgkK+cocbmm+P/8l3uoUQ60n0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Krrt0P6vfIFERDsy2SJon4hrkYw1y6rsSa4SeJ1FuI4=; b=HCxoodynd8peb02gCkuQtct/ga7Ios3OM1+8hj/Ku44EEbcTRfFj29d+7kbRpGue5o B6azozu+6iM8+RAetB4oGUgLou0Uq/VdlCZaWkU9Iij9cUZb+Erx1xAGrkV9cdVoV2OR 75KxQQ+8SbpigcFDgP5BF/175LwAvnA8QJE6Xvt1oCUYrmuwYdMSxJ7yW453+6htiI5q t9FfmsnB/FeCFLQXgXG1gSflup5puJ62TVCNAkJjCJ9T2+YbdketFCTGchOmv/PvW7IF aOPMu2nyOpYGLKnauz/YUildzIZ7DS2IHXeMdSU8lpDDWyc6dnYVm5VHP78JPQH8FF8y 64zA== X-Gm-Message-State: AMCzsaXzCs+LVPsTLQfUu2zZvHFaiPJbccmy6jGmNdYy21XGBfw6h8+6 mjLY8mw3ZtQf0eQ5hqmqPz7OxRi0wOM= X-Google-Smtp-Source: ABhQp+TfiwwUDQQ9kV5SOiuqOaKN8GACR32E3PnWbcYWoZVQSpLLGJs/Li5vHv0TcABDPmzjhX+f9Q== X-Received: by 10.223.143.66 with SMTP id p60mr4852092wrb.142.1508264143322; Tue, 17 Oct 2017 11:15:43 -0700 (PDT) Received: from localhost.localdomain ([154.144.50.139]) by smtp.gmail.com with ESMTPSA id h21sm7894662wrf.47.2017.10.17.11.15.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2017 11:15:42 -0700 (PDT) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, jdelvare@suse.com Cc: Ard Biesheuvel Subject: [PATCH v2] firmware: dmi: handle missing DMI data gracefully Date: Tue, 17 Oct 2017 19:15:37 +0100 Message-Id: <20171017181537.32540-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, when booting a kernel with DMI support on a platform that has no DMI tables, the following output is emitted into the kernel log: [ 0.128818] DMI not present or invalid. ... [ 1.306659] dmi: Firmware registration failed. ... [ 2.908681] dmi-sysfs: dmi entry is absent. The first one is a pr_info(), but the subsequent ones are pr_err()s that complain about a condition that is not really an error to begin with. So let's clean this up, and give up silently if dma_available is not set. Signed-off-by: Ard Biesheuvel --- v2: - don't use dmi_available in dmi-sysfs because it is not exported, instead, change pr_err to pr_debug drivers/firmware/dmi-sysfs.c | 2 +- drivers/firmware/dmi_scan.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) -- 2.11.0 diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c index d5de6ee8466d..ecf2eeb5f6f9 100644 --- a/drivers/firmware/dmi-sysfs.c +++ b/drivers/firmware/dmi-sysfs.c @@ -652,7 +652,7 @@ static int __init dmi_sysfs_init(void) int val; if (!dmi_kobj) { - pr_err("dmi-sysfs: dmi entry is absent.\n"); + pr_debug("dmi-sysfs: dmi entry is absent.\n"); error = -ENODATA; goto err; } diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 783041964439..17a7425063c2 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -715,10 +715,8 @@ static int __init dmi_init(void) u8 *dmi_table; int ret = -ENOMEM; - if (!dmi_available) { - ret = -ENODATA; - goto err; - } + if (!dmi_available) + return 0; /* * Set up dmi directory at /sys/firmware/dmi. This entry should stay