mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
brcmfmac: pcie: Fix crashes due to early IRQs
commit b50255c83b914defd61a57fbc81d452334b63f4c upstream.
The driver was enabling IRQs before the message processing was
initialized. This could cause IRQs to come in too early and crash the
driver. Instead, move the IRQ enable and hostready to a bus preinit
function, at which point everything is properly initialized.
Fixes: 9e37f045d5 ("brcmfmac: Adding PCIe bus layer support.")
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Cc: [email protected]
Signed-off-by: Hector Martin <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
51fffd722e
commit
a92f720554
1 changed files with 13 additions and 3 deletions
|
|
@ -1306,6 +1306,18 @@ static void brcmf_pcie_down(struct device *dev)
|
|||
{
|
||||
}
|
||||
|
||||
static int brcmf_pcie_preinit(struct device *dev)
|
||||
{
|
||||
struct brcmf_bus *bus_if = dev_get_drvdata(dev);
|
||||
struct brcmf_pciedev *buspub = bus_if->bus_priv.pcie;
|
||||
|
||||
brcmf_dbg(PCIE, "Enter\n");
|
||||
|
||||
brcmf_pcie_intr_enable(buspub->devinfo);
|
||||
brcmf_pcie_hostready(buspub->devinfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int brcmf_pcie_tx(struct device *dev, struct sk_buff *skb)
|
||||
{
|
||||
|
|
@ -1414,6 +1426,7 @@ static int brcmf_pcie_reset(struct device *dev)
|
|||
}
|
||||
|
||||
static const struct brcmf_bus_ops brcmf_pcie_bus_ops = {
|
||||
.preinit = brcmf_pcie_preinit,
|
||||
.txdata = brcmf_pcie_tx,
|
||||
.stop = brcmf_pcie_down,
|
||||
.txctl = brcmf_pcie_tx_ctlpkt,
|
||||
|
|
@ -1786,9 +1799,6 @@ static void brcmf_pcie_setup(struct device *dev, int ret,
|
|||
|
||||
init_waitqueue_head(&devinfo->mbdata_resp_wait);
|
||||
|
||||
brcmf_pcie_intr_enable(devinfo);
|
||||
brcmf_pcie_hostready(devinfo);
|
||||
|
||||
ret = brcmf_attach(&devinfo->pdev->dev);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
|
|
|||
Loading…
Reference in a new issue