511f24dd7214b9a105af49481870ef1e537c3899
[openwrt/openwrt.git] /
1 From a1f5aac1765afbeace9581afa27da34085f68e1d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Tue, 3 Sep 2019 06:29:28 +0200
4 Subject: [PATCH 3/3] brcmfmac: don't realloc wiphy during PCIe reset
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Providing a new wiphy on every PCIe reset was confusing and was causing
10 configuration problems for some users (supplicant and authenticators).
11 Sticking to the existing wiphy should make error recovery much simpler
12 and more reliable.
13
14 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
15 Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
16 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
17 ---
18 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 8 ++++----
19 1 file changed, 4 insertions(+), 4 deletions(-)
20
21 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
22 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
23 @@ -1430,7 +1430,6 @@ static int brcmf_pcie_reset(struct devic
24 brcmf_pcie_bus_console_read(devinfo, true);
25
26 brcmf_detach(dev);
27 - brcmf_free(dev);
28
29 brcmf_pcie_release_irq(devinfo);
30 brcmf_pcie_release_scratchbuffers(devinfo);
31 @@ -1826,9 +1825,6 @@ static void brcmf_pcie_setup(struct devi
32 brcmf_pcie_intr_enable(devinfo);
33 brcmf_pcie_hostready(devinfo);
34
35 - ret = brcmf_alloc(&devinfo->pdev->dev, devinfo->settings);
36 - if (ret)
37 - goto fail;
38 ret = brcmf_attach(&devinfo->pdev->dev);
39 if (ret)
40 goto fail;
41 @@ -1931,6 +1927,10 @@ brcmf_pcie_probe(struct pci_dev *pdev, c
42 bus->wowl_supported = pci_pme_capable(pdev, PCI_D3hot);
43 dev_set_drvdata(&pdev->dev, bus);
44
45 + ret = brcmf_alloc(&devinfo->pdev->dev, devinfo->settings);
46 + if (ret)
47 + goto fail_bus;
48 +
49 fwreq = brcmf_pcie_prepare_fw_request(devinfo);
50 if (!fwreq) {
51 ret = -ENOMEM;