[kernel] Re-enable CONFIG_BRCMFMAC builds (found work-around for GCC 4.7 builds)

John W. Linville linville at fedoraproject.org
Mon Jan 16 18:53:01 UTC 2012


commit 912fdfca681d38f1ec1eca0051a9a9c16cb4c9a0
Author: John W. Linville <linville at tuxdriver.com>
Date:   Mon Jan 16 13:51:57 2012 -0500

    Re-enable CONFIG_BRCMFMAC builds (found work-around for GCC 4.7 builds)

 brcmfmac-gcc47.patch                |   27 +++++++++++++++++++++++++++
 compat-wireless-config-fixups.patch |    9 ---------
 kernel.spec                         |    7 +++++++
 3 files changed, 34 insertions(+), 9 deletions(-)
---
diff --git a/brcmfmac-gcc47.patch b/brcmfmac-gcc47.patch
new file mode 100644
index 0000000..751876c
--- /dev/null
+++ b/brcmfmac-gcc47.patch
@@ -0,0 +1,27 @@
+Alexandre Oliva <oliva at lsd.ic.unicamp.br> sent me a patch:
+
+"I see you ran into the same problem I did in brcmfmac.  I wasn't sure a
+build with compat-wireless would run into the same problem I did without
+it and with Linux-libre.
+
+It's an issue brought about by GCC 4.7's partial-inlining, that ends up
+splitting the udelay function just at the wrong spot, in such a way that
+some sanity checks for constants fails, and we end up calling
+bad_udelay.
+
+This patch fixes the problem.  Feel free to push it upstream if it makes
+sense to you."
+
+diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+index 5eddabe..eda1d4e 100644
+--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
++++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+@@ -2463,7 +2463,7 @@ static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv)
+ 	return err;
+ }
+ 
+-static void brcmf_delay(u32 ms)
++static __always_inline void brcmf_delay(u32 ms)
+ {
+ 	if (ms < 1000 / HZ) {
+ 		cond_resched();
diff --git a/compat-wireless-config-fixups.patch b/compat-wireless-config-fixups.patch
index 3ec33a0..938f35c 100644
--- a/compat-wireless-config-fixups.patch
+++ b/compat-wireless-config-fixups.patch
@@ -29,15 +29,6 @@ diff -up compat-wireless-2011-12-18/config.mk.orig compat-wireless-2011-12-18/co
  CONFIG_RT2800USB_UNKNOWN=y
  endif #CONFIG_CRC_CCITT
  CONFIG_RT2X00_LIB_USB=m
-@@ -615,7 +618,7 @@ CONFIG_ATH6KL=m
- endif #CONFIG_COMPAT_KERNEL_2_6_27
- 
- ifndef CONFIG_COMPAT_KERNEL_2_6_29
--CONFIG_BRCMFMAC=m
-+# CONFIG_BRCMFMAC=m
- endif #CONFIG_COMPAT_KERNEL_2_6_29
- 
- endif #CONFIG_MMC
 diff -up compat-wireless-2011-12-18/drivers/misc/eeprom/Makefile.orig compat-wireless-2011-12-18/drivers/misc/eeprom/Makefile
 --- compat-wireless-2011-12-18/drivers/misc/eeprom/Makefile.orig	2012-01-05 13:54:21.214595837 -0500
 +++ compat-wireless-2011-12-18/drivers/misc/eeprom/Makefile	2012-01-05 13:54:27.274520077 -0500
diff --git a/kernel.spec b/kernel.spec
index 2c0fd37..3d21966 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -770,6 +770,8 @@ Patch50001: compat-wireless-pr_fmt-warning-avoidance.patch
 Patch50002: compat-wireless-integrated-build.patch
 Patch50003: compat-wireless-rtl8192cu-Fix-WARNING-on-suspend-resume.patch
 
+Patch50100: brcmfmac-gcc47.patch
+
 %endif
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1550,6 +1552,8 @@ ApplyPatch compat-wireless-integrated-build.patch
 ApplyPatch compat-wireless-rtl8192cu-Fix-WARNING-on-suspend-resume.patch
 ApplyPatch mac80211-fix-rx-key-NULL-ptr-deref-in-promiscuous-mode.patch
 
+ApplyPatch brcmfmac-gcc47.patch
+
 cd ..
 
 %endif
@@ -2318,6 +2322,9 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Mon Jan 16 2012 John W. Linville <linville at redhat.com>
+- Re-enable CONFIG_BRCMFMAC builds (found work-around for GCC 4.7 builds)
+
 * Sun Jan 15 2012 Josh Boyer <jwboyer at redhat.com>
 - Avoid packaging symlinks for kernel-doc files (rhbz 767351)
 - Apply mac80211 NULL ptr deref fix to compat-wireless too (rhbz 769766)


More information about the scm-commits mailing list