071-v4.9-0003-net-bgmac-Fix-errant-feature-flag-check.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. From 4af1474e6198b10fee7bb20e81f7e033ad1b586c Mon Sep 17 00:00:00 2001
  2. From: Jon Mason <jon.mason@broadcom.com>
  3. Date: Wed, 5 Oct 2016 15:36:49 -0400
  4. Subject: [PATCH] net: bgmac: Fix errant feature flag check
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. During the conversion to the feature flags, a check against
  9. ci->id != BCMA_CHIP_ID_BCM47162
  10. became
  11. bgmac->feature_flags & BGMAC_FEAT_CLKCTLS
  12. instead of
  13. !(bgmac->feature_flags & BGMAC_FEAT_CLKCTLS)
  14. Reported-by: Rafał Miłecki <zajec5@gmail.com>
  15. Signed-off-by: Jon Mason <jon.mason@broadcom.com>
  16. Signed-off-by: David S. Miller <davem@davemloft.net>
  17. ---
  18. drivers/net/ethernet/broadcom/bgmac.c | 2 +-
  19. 1 file changed, 1 insertion(+), 1 deletion(-)
  20. --- a/drivers/net/ethernet/broadcom/bgmac.c
  21. +++ b/drivers/net/ethernet/broadcom/bgmac.c
  22. @@ -1050,7 +1050,7 @@ static void bgmac_enable(struct bgmac *b
  23. mode = (bgmac_read(bgmac, BGMAC_DEV_STATUS) & BGMAC_DS_MM_MASK) >>
  24. BGMAC_DS_MM_SHIFT;
  25. - if (bgmac->feature_flags & BGMAC_FEAT_CLKCTLST || mode != 0)
  26. + if (!(bgmac->feature_flags & BGMAC_FEAT_CLKCTLST) || mode != 0)
  27. bgmac_set(bgmac, BCMA_CLKCTLST, BCMA_CLKCTLST_FORCEHT);
  28. if (bgmac->feature_flags & BGMAC_FEAT_CLKCTLST && mode == 2)
  29. bgmac_cco_ctl_maskset(bgmac, 1, ~0,