Re: [PATCH AUTOSEL 5.10 082/137] wlcore/wl12xx: Fix wl12xx get_mac error if device is in ELP
From: Pavel Machek
Date: Mon Jul 12 2021 - 18:03:48 EST
Hi!
> From: Tony Lindgren <tony@xxxxxxxxxxx>
>
> [ Upstream commit 11ef6bc846dcdce838f0b00c5f6a562c57e5d43b ]
>
> At least on wl12xx, reading the MAC after boot can fail with a warning
> at drivers/net/wireless/ti/wlcore/sdio.c:78 wl12xx_sdio_raw_read.
> The failed call comes from wl12xx_get_mac() that wlcore_nvs_cb() calls
> after request_firmware_work_func().
> +++ b/drivers/net/wireless/ti/wl12xx/main.c
> @@ -1503,6 +1503,13 @@ static int wl12xx_get_fuse_mac(struct wl1271 *wl)
> u32 mac1, mac2;
> int ret;
>
> + /* Device may be in ELP from the bootloader or kexec */
> + ret = wlcore_write32(wl, WL12XX_WELP_ARM_COMMAND, WELP_ARM_COMMAND_VAL);
> + if (ret < 0)
> + goto out;
> +
> + usleep_range(500000, 700000);
> +
While this probably improves things.... I don't believe delaying boot
by extra 200msec is good idea. This should simply be msleep(500),
AFAICT.
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Attachment:
signature.asc
Description: Digital signature