Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2189967ybc; Sun, 17 Nov 2019 15:49:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyPKUilv4//2D5heAf+g2bcy6/qJDLZga7dvcz11bp8e4XoHytI9cPCLM62eN033Y4a3sho X-Received: by 2002:a17:906:fad4:: with SMTP id lu20mr22363022ejb.9.1574034544934; Sun, 17 Nov 2019 15:49:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574034544; cv=none; d=google.com; s=arc-20160816; b=cereSe9cpBhRrS38FnqXUXqr4xDFKZ6/72T052j8rWX7qGtOLwMKMk9aPWXimB3dOf dx5l9/edbwZfyLbj85zhuTiWWit9+iyrLgrMhqFRf50uPyTfpnsaVwq0ksKLBPxgIn7a +WUS2ovbJhZT/mI1MN3YhpCrBt+rFqtLcSBEAhrGKYPrvgTWnCMfEqxKkskNB06TlORk HRg84wGNxxAXuStfbQZH8SCdoHkZTubQjWKQzGZ71TAE59Di/OgrsZqKP7BQdc40wHlh Huoj/3kGzmCEHh4p/Z45SVNFz9quDsnm2CFsxsLDLaUPhzgFCgnr8khPG9BTZCi7U4JO m4lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CP8Q2/vOOx5A1SI+kyJUz9PaS/YTLf7lk3YxS8mhKsc=; b=gNLpTFpy014kur3lJCNNxCRRyO2kQz6VUzMCtH+FxoqCHFGTHCXW1jGrJ+P8kVgQum ztWkTU6xKKbKAxfOKuDfR6K8tiSdU7WQ6LudKIpiPg7myGyTEnF13PPnzwJlwFSu7/BM Y3cAV6vuF8pZDrQljiOYOk8YpXNBkWUwcCg3W83ZIgdAcDz2P/2QfGWJJHBrMJo2Metw xpQtxsSuWJlUWqiXBe8RmjfGkEFwECoVCe4spPSCcDzxcCprnsqVY6Vghw5ysMzbUfQN 40OvkB5d6MT6cpCIjh68Lc3Eq31Cq4fBBi/p/DJTJTGUetx5p4qYLsZbClQc5A5biXhC 2Kpg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si10630421ejc.27.2019.11.17.15.48.40; Sun, 17 Nov 2019 15:49:04 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726316AbfKQXrn (ORCPT + 99 others); Sun, 17 Nov 2019 18:47:43 -0500 Received: from smtp.gentoo.org ([140.211.166.183]:54110 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbfKQXrm (ORCPT ); Sun, 17 Nov 2019 18:47:42 -0500 Received: from grubbs.orbis-terrarum.net (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AE51234CF2F for ; Sun, 17 Nov 2019 23:47:41 +0000 (UTC) Received: (qmail 22676 invoked by uid 129); 17 Nov 2019 23:47:34 -0000 X-HELO: bohr-int.orbis-terrarum.net Authentication-Results: orbis-terrarum.net; auth=pass (plain) smtp.auth=robbat2-bohr@orbis-terrarum.net; iprev=fail; iprev=fail Received: from node-1w7jr9qta5qnztyeulvvtjk1k.ipv6.telus.net (HELO bohr-int.orbis-terrarum.net) (2001:569:7c26:ae00:4988:d144:fb03:3538) by orbis-terrarum.net (qpsmtpd/0.95) with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted); Sun, 17 Nov 2019 23:47:33 +0000 Received: (nullmailer pid 27161 invoked by uid 10000); Sun, 17 Nov 2019 23:47:35 -0000 From: "Robin H. Johnson" To: mcgrof@kernel.org Cc: linux-kernel@vger.kernel.org, sir@cmpwn.com, ~sircmpwn/public-inbox@lists.sr.ht, gregkh@linuxfoundation.org, rafael@kernel.org, "Robin H. Johnson" Subject: [PATCH v3] firmware: log name & outcome of loaded firmware Date: Sun, 17 Nov 2019 15:47:34 -0800 Message-Id: <20191117234734.27101-1-robbat2@gentoo.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on orbis-terrarum.net Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's non-trivial to figure out names of firmware that was actually loaded, add a debug statement at the end of _request_firmware that logs the name & result of each firmware. This is esp. valuable early in boot, before logging of UEVENT is available. v3: - Log at dev_dbg level per maintainer. - HOWTO: Enable at boot via kernel boot param dyndbg="func _request_firmware +p" - Credit to Drew DeVault for parallel creation and help promoting the idea. Alternate-Creation: Drew DeVault Signed-off-by: Robin H. Johnson --- drivers/base/firmware_loader/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index bf44c79beae9..84a879608ca4 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -791,6 +791,13 @@ _request_firmware(const struct firmware **firmware_p, const char *name, fw = NULL; } + /* Provide a consistent way to capture the result of trying to load any + * firmware. As a potential future improvement, this might include + * persistent state that firmware is loaded (or failed to load for some + * reason). See Message-ID: <20191113205010.GY11244@42.do-not-panic.com> + * for background */ + dev_dbg(device, "%s %s ret=%d\n", __func__, name, ret); + *firmware_p = fw; return ret; } -- 2.24.0