[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <955f3b68-f1aa-767c-2539-7b8362372a60@broadcom.com>
Date: Thu, 6 Jan 2022 11:19:38 +0100
From: Arend van Spriel <arend.vanspriel@...adcom.com>
To: Hector Martin <marcan@...can.st>,
Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
Arend van Spriel <aspriel@...il.com>,
Franky Lin <franky.lin@...adcom.com>,
Hante Meuleman <hante.meuleman@...adcom.com>,
Chi-hsien Lin <chi-hsien.lin@...ineon.com>,
Wright Feng <wright.feng@...ineon.com>,
Dmitry Osipenko <digetx@...il.com>
Cc: Sven Peter <sven@...npeter.dev>,
Alyssa Rosenzweig <alyssa@...enzweig.io>,
Mark Kettenis <kettenis@...nbsd.org>,
Rafał Miłecki <zajec5@...il.com>,
Pieter-Paul Giesberts <pieter-paul.giesberts@...adcom.com>,
Linus Walleij <linus.walleij@...aro.org>,
Hans de Goede <hdegoede@...hat.com>,
"John W. Linville" <linville@...driver.com>,
"brian m. carlson" <sandals@...stytoothpaste.net>,
Andy Shevchenko <andy.shevchenko@...il.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org, brcm80211-dev-list.pdl@...adcom.com,
SHA-cyfmac-dev-list@...ineon.com
Subject: Re: [PATCH v2 03/35] brcmfmac: firmware: Handle per-board clm_blob
files
On 1/4/2022 8:26 AM, Hector Martin wrote:
> Teach brcm_alt_fw_paths to correctly split off variable length
> extensions, and enable alt firmware lookups for the CLM blob firmware
> requests.
>
> Apple platforms have per-board CLM blob files.
Are you sure? I am not involved in development for Apple platforms, but
in general we build a CLM blob specific for a chip revision. As always
with the blobs they are created at a certain point in time and that is
mostly why you need another one for a newer platform. Apple tends to do
things a bit different so you could be right though. Anyway, despite my
doubts on this it does not change the need for per-board firmware files.
Reviewed-by: Arend van Spriel <arend.vanspriel@...adcom.com>
> Acked-by: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Hector Martin <marcan@...can.st>
> ---
> .../broadcom/brcm80211/brcmfmac/firmware.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
> index 0eb13e5df517..0497b721136a 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
> @@ -595,16 +595,16 @@ static int brcmf_fw_complete_request(const struct firmware *fw,
> static char *brcm_alt_fw_path(const char *path, const char *board_type)
> {
> char alt_path[BRCMF_FW_NAME_LEN];
> - char suffix[5];
> + const char *suffix;
>
> - strscpy(alt_path, path, BRCMF_FW_NAME_LEN);
> - /* At least one character + suffix */
> - if (strlen(alt_path) < 5)
> + suffix = strrchr(path, '.');
> + if (!suffix || suffix == path)
> return NULL;
>
> - /* strip .txt or .bin at the end */
> - strscpy(suffix, alt_path + strlen(alt_path) - 4, 5);
> - alt_path[strlen(alt_path) - 4] = 0;
> + /* strip extension at the end */
> + strscpy(alt_path, path, BRCMF_FW_NAME_LEN);
> + alt_path[suffix - path] = 0;
> +
> strlcat(alt_path, ".", BRCMF_FW_NAME_LEN);
> strlcat(alt_path, board_type, BRCMF_FW_NAME_LEN);
> strlcat(alt_path, suffix, BRCMF_FW_NAME_LEN);
> @@ -619,7 +619,7 @@ static int brcmf_fw_request_firmware(const struct firmware **fw,
> int ret;
>
> /* Files can be board-specific, first try a board-specific path */
> - if (cur->type == BRCMF_FW_TYPE_NVRAM && fwctx->req->board_type) {
> + if (fwctx->req->board_type) {
> char *alt_path;
>
> alt_path = brcm_alt_fw_path(cur->path, fwctx->req->board_type);
So all firmware files are attempted with board-specific path now.
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4219 bytes)
Powered by blists - more mailing lists