]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
brcmfmac: sdio: Fix OOB interrupt initialization on brcm43362
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Thu, 26 Dec 2019 09:20:33 +0000 (10:20 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Sun, 26 Jan 2020 15:41:18 +0000 (17:41 +0200)
Commit 262f2b53f679 ("brcmfmac: call brcmf_attach() just before calling
brcmf_bus_started()") changed the initialization order of the brcmfmac
SDIO driver. Unfortunately since brcmf_sdiod_intr_register() is now
called before the sdiodev->bus_if initialization, it reads the wrong
chip ID and fails to initialize the GPIO on brcm43362. Thus the chip
cannot send interrupts and fails to probe:

[   12.517023] brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
[   12.531214] ieee80211 phy0: brcmf_bus_started: failed: -110
[   12.536976] ieee80211 phy0: brcmf_attach: dongle is not responding: err=-110
[   12.566467] brcmfmac: brcmf_sdio_firmware_callback: brcmf_attach failed

Initialize the bus interface earlier to ensure that
brcmf_sdiod_intr_register() properly sets up the OOB interrupt.

BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908438
Fixes: 262f2b53f679 ("brcmfmac: call brcmf_attach() just before calling brcmf_bus_started()")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

index f9df95bc7fa12d84a97f6b7b7b333495f74c7fd3..f9047db6a11d883e2e7bef6967fdaebfe73eec62 100644 (file)
@@ -4243,6 +4243,12 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
        }
 
        if (err == 0) {
+               /* Assign bus interface call back */
+               sdiod->bus_if->dev = sdiod->dev;
+               sdiod->bus_if->ops = &brcmf_sdio_bus_ops;
+               sdiod->bus_if->chip = bus->ci->chip;
+               sdiod->bus_if->chiprev = bus->ci->chiprev;
+
                /* Allow full data communication using DPC from now on. */
                brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA);
 
@@ -4259,12 +4265,6 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
 
        sdio_release_host(sdiod->func1);
 
-       /* Assign bus interface call back */
-       sdiod->bus_if->dev = sdiod->dev;
-       sdiod->bus_if->ops = &brcmf_sdio_bus_ops;
-       sdiod->bus_if->chip = bus->ci->chip;
-       sdiod->bus_if->chiprev = bus->ci->chiprev;
-
        err = brcmf_alloc(sdiod->dev, sdiod->settings);
        if (err) {
                brcmf_err("brcmf_alloc failed\n");