# Re: \[PATCH AUTOSEL 5.10 082/137\] wlcore/wl12xx: Fix wl12xx get\_mac error if device is in ELP

- From: Pavel Machek \<hidden\>
- Date: 2021-07-12 22:03:48 
- List: stable
- Page: https://ratatoskr.run/stable/2021/07/1442349
- Thread: https://ratatoskr.run/stable/2021/07/1434202/t/2.md

```text
Hi!

> From: Tony Lindgren <tony@atomide.com>
> 
> [ 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
```

## Attachments

- [signature.asc](https://ratatoskr.run/stable/2021/07/1442349/attachment/0) (application/pgp-signature, 181 bytes)
