iwlegacy: mark il_adjust_beacon_interval as noinline
PATCH 1/1 iwlegacy: mark il_adjust_beacon_interval as noinline
With the new optimized do_div() code, some versions of gcc produce obviously incorrect code that leads to a link error in iwlegacy/common.o:
drivers/built-in.o: In function `il_send_rxon_timing':
:(.text+0xa6b4d4): undefined reference to ____ilog2_NaN' :(.text+0xa6b4f0): undefined reference to __aeabi_uldivmod'
In a few thousand randconfig builds, I have seen this problem a couple of times in this file, but never anywhere else in the kernel, so we can try to work around this in the only file that shows the behavior, by marking the il_adjust_beacon_interval function as noinline, which convinces gcc to use the unoptimized do_div() all the time.
drivers/net/wireless/intel/iwlegacy/common.c +1 -1
@@ -3602,7 +3602,7 @@ il_is_ht40_tx_allowed(struct il_priv *il, struct ieee80211_sta_ht_cap *ht_cap) }EXPORT_SYMBOL (il_is_ht40_tx_allowed); -static u16 +static u16 noinlineil_adjust_beacon_interval (u16 beacon_val,u16 max_beacon_val) {u16 new_val;
Quoted 8 lines · Arnd Bergmann
With the new optimized
do_div()code, some versions of gcc produce obviously incorrect code that leads to a link error iniwlegacy/common.o:
drivers/built-in.o: In function `il_send_rxon_timing':
:(.text+0xa6b4d4): undefined reference to____ilog2_NaN' :(.text+0xa6b4f0): undefined reference to__aeabi_uldivmod'
Quoted 8 lines
In a few thousand randconfig builds, I have seen this problem a couple of times in this file, but never anywhere else in the kernel, so we can try to work around this in the only file that shows the behavior, by marking the
il_adjust_beacon_intervalfunction as noinline, which convinces gcc to use the unoptimizeddo_div()all the time.Signed-off-by Arnd Bergmann <[email protected]>
Quoted 16 lines
drivers/net/wireless/intel/iwlegacy/common.c +1
-1@@ -3602,7 +3602,7 @@ il_is_ht40_tx_allowed(struct il_priv *il, struct ieee80211_sta_ht_cap *ht_cap) }EXPORT_SYMBOL (il_is_ht40_tx_allowed); -static u16 +static u16 noinlineil_adjust_beacon_interval (u16 beacon_val,u16 max_beacon_val) {u16 new_val;
Quoted 8 lines · Arnd Bergmann
With the new optimized
do_div()code, some versions of gcc produce obviously incorrect code that leads to a link error iniwlegacy/common.o:
drivers/built-in.o: In function `il_send_rxon_timing':
:(.text+0xa6b4d4): undefined reference to____ilog2_NaN' :(.text+0xa6b4f0): undefined reference to__aeabi_uldivmod'
Quoted 6 lines
In a few thousand randconfig builds, I have seen this problem a couple of times in this file, but never anywhere else in the kernel, so we can try to work around this in the only file that shows the behavior, by marking the
il_adjust_beacon_intervalfunction as noinline, which convinces gcc to use the unoptimizeddo_div()all the time.
I don't think this is good way to "fix" the issue, but also have nothing against to this particular change.
Kalle Valo
AppliedQuoted 16 lines
With the new optimized
do_div()code, some versions of gcc produce obviously incorrect code that leads to a link error iniwlegacy/common.o:
drivers/built-in.o: In function `il_send_rxon_timing':
:(.text+0xa6b4d4): undefined reference to____ilog2_NaN' :(.text+0xa6b4f0): undefined reference to__aeabi_uldivmod'In a few thousand randconfig builds, I have seen this problem a couple of times in this file, but never anywhere else in the kernel, so we can try to work around this in the only file that shows the behavior, by marking the
il_adjust_beacon_intervalfunction as noinline, which convinces gcc to use the unoptimizeddo_div()all the time.
Quoted 3 lines
Signed-off-by Arnd Bergmann <[email protected]>Acked-by Nicolas Pitre <[email protected]>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo