323-v4.13-0004-brcmfmac-initialize-oob-irq-data-before-request_irq.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 3f426c96895556bb49adfa52f3aeafdedb2d02e7 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <mirq-linux@rere.qmqm.pl>
  3. Date: Tue, 13 Jun 2017 18:02:03 +0200
  4. Subject: [PATCH] brcmfmac: initialize oob irq data before request_irq()
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This fixes spin-forever in irq handler when IRQ is already asserted
  9. at request_irq() time.
  10. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
  11. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  12. ---
  13. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 8 +++-----
  14. 1 file changed, 3 insertions(+), 5 deletions(-)
  15. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  16. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  17. @@ -107,12 +107,14 @@ int brcmf_sdiod_intr_register(struct brc
  18. int ret = 0;
  19. u8 data;
  20. u32 addr, gpiocontrol;
  21. - unsigned long flags;
  22. pdata = &sdiodev->settings->bus.sdio;
  23. if (pdata->oob_irq_supported) {
  24. brcmf_dbg(SDIO, "Enter, register OOB IRQ %d\n",
  25. pdata->oob_irq_nr);
  26. + spin_lock_init(&sdiodev->irq_en_lock);
  27. + sdiodev->irq_en = true;
  28. +
  29. ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler,
  30. pdata->oob_irq_flags, "brcmf_oob_intr",
  31. &sdiodev->func[1]->dev);
  32. @@ -121,10 +123,6 @@ int brcmf_sdiod_intr_register(struct brc
  33. return ret;
  34. }
  35. sdiodev->oob_irq_requested = true;
  36. - spin_lock_init(&sdiodev->irq_en_lock);
  37. - spin_lock_irqsave(&sdiodev->irq_en_lock, flags);
  38. - sdiodev->irq_en = true;
  39. - spin_unlock_irqrestore(&sdiodev->irq_en_lock, flags);
  40. ret = enable_irq_wake(pdata->oob_irq_nr);
  41. if (ret != 0) {