mac80211: brcmfmac: backport fixes from the 5.0-rc1
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / brcm / 326-v5.0-brcmfmac-Call-brcmf_dmi_probe-before-brcmf_of_probe.patch
1 From 554da3868eb1d7174710c18b4ddd6ff01f6d612c Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Fri, 23 Nov 2018 10:11:48 +0100
4 Subject: [PATCH] brcmfmac: Call brcmf_dmi_probe before brcmf_of_probe
5
6 ARM systems with UEFI may have both devicetree (of) and DMI data in this
7 case we end up setting brcmf_mp_device.board_type twice.
8
9 In this case we should prefer the devicetree data, because:
10 1) The devicerree data is more reliable
11 2) Some ARM systems (e.g. the Raspberry Pi 3 models) support both UEFI and
12 classic uboot booting, the devicetree data is always there, so using it
13 makes sure we ask for the same nvram file independent of how we booted.
14
15 This commit moves the brcmf_dmi_probe call to before the brcmf_of_probe
16 call, so that the latter can override the value of the first if both are
17 set.
18
19 Fixes: bd1e82bb420a ("brcmfmac: Set board_type from DMI on x86 based ...")
20 Cc: Peter Robinson <pbrobinson@gmail.com>
21 Tested-and-reported-by: Peter Robinson <pbrobinson@gmail.com>
22 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
23 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
24 ---
25 drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
29 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
30 @@ -449,8 +449,8 @@ struct brcmf_mp_device *brcmf_get_module
31 }
32 if (!found) {
33 /* No platform data for this device, try OF and DMI data */
34 - brcmf_of_probe(dev, bus_type, settings);
35 brcmf_dmi_probe(settings, chip, chiprev);
36 + brcmf_of_probe(dev, bus_type, settings);
37 }
38 return settings;
39 }