From: Markus Mayer <mmayer@broadcom.com>
To: Brian Norris <computersforpeace@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Gregory Fong <gregory.0xf0@gmail.com>
Cc: Broadcom Kernel List <bcm-kernel-feedback-list@broadcom.com>,
ARM Kernel List <linux-arm-kernel@lists.infradead.org>,
Markus Mayer <mmayer@broadcom.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 6/8] memory: brcmstb: dpfe: support for deferred firmware download
Date: Tue, 15 Oct 2019 15:45:11 -0700 [thread overview]
Message-ID: <20191015224513.16969-7-mmayer@broadcom.com> (raw)
In-Reply-To: <20191015224513.16969-1-mmayer@broadcom.com>
We add support for deferred downloading of the DPFE firmware. It may be
necessary to do this if the root file system containing the firmware
image is not yet available at the time the driver's probe function is
being called.
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
drivers/memory/brcmstb_dpfe.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/memory/brcmstb_dpfe.c b/drivers/memory/brcmstb_dpfe.c
index f905a0076db7..cf320302d2c0 100644
--- a/drivers/memory/brcmstb_dpfe.c
+++ b/drivers/memory/brcmstb_dpfe.c
@@ -614,10 +614,13 @@ static int brcmstb_dpfe_download_firmware(struct brcmstb_dpfe_priv *priv)
if (!priv->dpfe_api->fw_name)
return -ENODEV;
- ret = request_firmware(&fw, priv->dpfe_api->fw_name, dev);
- /* request_firmware() prints its own error messages. */
+ ret = firmware_request_nowarn(&fw, priv->dpfe_api->fw_name, dev);
+ /*
+ * Defer the firmware download if the firmware file couldn't be found.
+ * The root file system may not be available yet.
+ */
if (ret)
- return ret;
+ return (ret == -ENOENT) ? -EPROBE_DEFER : ret;
ret = __verify_firmware(&init, fw);
if (ret)
@@ -862,7 +865,8 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev)
ret = brcmstb_dpfe_download_firmware(priv);
if (ret) {
- dev_err(dev, "Couldn't download firmware -- %d\n", ret);
+ if (ret != -EPROBE_DEFER)
+ dev_err(dev, "Couldn't download firmware -- %d\n", ret);
return ret;
}
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-10-15 22:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 22:45 [PATCH 0/8] memory: brcmstb: dpfe: introduce DPFE API v2.5 Markus Mayer
2019-10-15 22:45 ` [PATCH 1/8] memory: brcmstb: dpfe: rename struct private_data Markus Mayer
2019-10-15 22:45 ` [PATCH 2/8] memory: brcmstb: dpfe: initialize priv->dev Markus Mayer
2019-10-15 22:45 ` [PATCH 3/8] memory: brcmstb: dpfe: add locking around DCPU enable/disable Markus Mayer
2019-10-15 22:45 ` [PATCH 4/8] memory: brcmstb: dpfe: move init_data into brcmstb_dpfe_download_firmware() Markus Mayer
2019-10-15 22:45 ` [PATCH 5/8] memory: brcmstb: dpfe: pass *priv as argument to brcmstb_dpfe_download_firmware() Markus Mayer
2019-10-15 22:45 ` Markus Mayer [this message]
2019-10-15 22:45 ` [PATCH 7/8] memory: brcmstb: dpfe: Compute checksum at __send_command() time Markus Mayer
2019-10-15 22:45 ` [PATCH 8/8] memory: brcmstb: dpfe: Fixup API version/commands for 7211 Markus Mayer
2019-10-18 17:09 ` [PATCH 0/8] memory: brcmstb: dpfe: introduce DPFE API v2.5 Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191015224513.16969-7-mmayer@broadcom.com \
--to=mmayer@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=gregory.0xf0@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).