329-v4.17-0001-brcmfmac-move-brcmf_bus_preinit-call-just-after-chan.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From da472385a29f1fddcac7cfa0499482704310bd16 Mon Sep 17 00:00:00 2001
  2. From: Arend Van Spriel <arend.vanspriel@broadcom.com>
  3. Date: Tue, 20 Feb 2018 00:14:18 +0100
  4. Subject: [PATCH] brcmfmac: move brcmf_bus_preinit() call just after changing
  5. bus state
  6. Moving the brcmf_bus_preinit() call allows the bus code to do some
  7. required initialization before handling firmware control messages.
  8. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
  9. Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
  10. Reviewed-by: Franky Lin <franky.lin@broadcom.com>
  11. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  12. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  13. ---
  14. drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 3 ---
  15. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 5 +++++
  16. 2 files changed, 5 insertions(+), 3 deletions(-)
  17. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
  18. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
  19. @@ -215,9 +215,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
  20. /* Enable tx beamforming, errors can be ignored (not supported) */
  21. (void)brcmf_fil_iovar_int_set(ifp, "txbf", 1);
  22. -
  23. - /* do bus specific preinit here */
  24. - err = brcmf_bus_preinit(ifp->drvr->bus_if);
  25. done:
  26. return err;
  27. }
  28. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  29. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  30. @@ -1030,6 +1030,11 @@ int brcmf_bus_started(struct device *dev
  31. /* signal bus ready */
  32. brcmf_bus_change_state(bus_if, BRCMF_BUS_UP);
  33. + /* do bus specific preinit here */
  34. + ret = brcmf_bus_preinit(ifp->drvr->bus_if);
  35. + if (ret < 0)
  36. + goto fail;
  37. +
  38. /* Bus is ready, do any initialization */
  39. ret = brcmf_c_preinit_dcmds(ifp);
  40. if (ret < 0)