View Issue Details

IDProjectCategoryView StatusLast Update
0000931channel: elrepo/el7kmod-ath5kpublic2019-10-11 11:55
Reporteranglican Assigned Topperry  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Summary0000931: suggested patch to get kmod-ath5k to compile with recent kernels
DescriptionFor some time the kmod for ath5k has not compiled. The attached patch gets it to compile and it works on my Acer Aspire One ZG5 (Atheros 2425).
TagsNo tags attached.
Attached Files
ath5k-0.0.patch (473 bytes)   
diff -ru ath5k-0.0.orig/ath5k/ath5k.h ath5k-0.0/ath5k/ath5k.h
--- ath5k-0.0.orig/ath5k/ath5k.h	2016-10-22 11:07:05.000000000 +0100
+++ ath5k-0.0/ath5k/ath5k.h	2019-09-03 14:41:35.000000000 +0100
@@ -30,6 +30,9 @@
 #include <linux/leds.h>
 #include <net/mac80211.h>
 #include <net/cfg80211.h>
+#define RX_FLAG_SHORTPRE (1<<8 )
+#define RX_FLAG_10MHZ (1<<28)
+#define RX_FLAG_5MHZ (1<<29)
 
 /* RX/TX descriptor hw structs
  * TODO: Driver part should only see sw structs */
ath5k-0.0.patch (473 bytes)   
ath5k-0.0.1.patch (501 bytes)   
diff -ru ath5k-0.0.orig/ath5k/ath5k.h ath5k-0.0/ath5k/ath5k.h
--- ath5k-0.0.orig/ath5k/ath5k.h	2019-09-09 11:58:33.970685283 +0100
+++ ath5k-0.0/ath5k/ath5k.h	2019-09-09 11:55:41.600636339 +0100
@@ -1252,7 +1252,7 @@
 #define ATH5K_TXQ_LEN_MAX	(ATH_TXBUF / 4)		/* bufs per queue */
 #define ATH5K_TXQ_LEN_LOW	(ATH5K_TXQ_LEN_MAX / 2)	/* low mark */
 
-DECLARE_EWMA(beacon_rssi, 10, 8)
+DECLARE_EWMA(beacon_rssi, 1024, 8)
 
 /* Driver state associated with an instance of a device */
 struct ath5k_hw {
ath5k-0.0.1.patch (501 bytes)   
Reported upstream

Activities

toracat

2019-09-06 10:15

administrator   ~0006433

Thanks for the patch. We will try building the kmod against the current kernel.

pperry

2019-09-07 06:07

administrator   ~0006440

Hi,

We still see a lot of errors building ath5k (backported from 4.14.142 to match the wireless stack in el7.7), even after applying your patch. These all look fixable if you wish to submit further patches.

You can submit patches to our git repo if you prefer which I will update to the latest 4.14.142 branch (https://github.com/elrepo/packages/tree/master/ath5k-kmod/el7)

In file included from include/uapi/linux/stddef.h:1:0,
                 from include/linux/stddef.h:4,
                 from ./include/uapi/linux/posix_types.h:4,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from include/linux/io.h:21,
                 from /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ath5k.h:26,
                 from /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ani.c:19:
In function 'ewma_beacon_rssi_read',
    inlined from 'ath5k_ani_lower_immunity' at /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ani.c:312:34,
    inlined from 'ath5k_ani_calibration' at /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ani.c:516:28:
include/linux/compiler.h:437:20: error: call to '__compiletime_assert_1258' declared with attribute error: BUILD_BUG_ON failed: (8) == 0 || (((8) & ((8) - 1)) != 0)
    prefix ## suffix(); \
                    ^
include/linux/compiler.h:442:2: note: in expansion of macro '__compiletime_assert'
  __compiletime_assert(condition, msg, prefix, suffix)
  ^
include/linux/compiler.h:454:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
include/linux/bug.h:53:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^
include/linux/bug.h:77:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^
include/linux/bug.h:30:2: note: in expansion of macro 'BUILD_BUG_ON'
  BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
  ^
include/linux/average.h:47:3: note: in expansion of macro 'BUILD_BUG_ON_NOT_POWER_OF_2'
   BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
   ^
/home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ath5k.h:1258:1: note: in expansion of macro 'DECLARE_EWMA'
 DECLARE_EWMA(beacon_rssi, 10, 8)
 ^
In function 'ewma_beacon_rssi_read',
    inlined from 'ath5k_ani_raise_immunity' at /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ani.c:226:34,
    inlined from 'ath5k_ani_calibration' at /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ani.c:505:27:
include/linux/compiler.h:437:20: error: call to '__compiletime_assert_1258' declared with attribute error: BUILD_BUG_ON failed: (8) == 0 || (((8) & ((8) - 1)) != 0)
    prefix ## suffix(); \
                    ^
include/linux/compiler.h:442:2: note: in expansion of macro '__compiletime_assert'
  __compiletime_assert(condition, msg, prefix, suffix)
  ^
include/linux/compiler.h:454:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
include/linux/bug.h:53:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^
include/linux/bug.h:77:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^
include/linux/bug.h:30:2: note: in expansion of macro 'BUILD_BUG_ON'
  BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
  ^
include/linux/average.h:47:3: note: in expansion of macro 'BUILD_BUG_ON_NOT_POWER_OF_2'
   BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
   ^
/home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ath5k.h:1258:1: note: in expansion of macro 'DECLARE_EWMA'
 DECLARE_EWMA(beacon_rssi, 10, 8)
 ^
include/linux/compiler.h:437:20: error: call to '__compiletime_assert_1258' declared with attribute error: BUILD_BUG_ON failed: (8) == 0 || (((8) & ((8) - 1)) != 0)
    prefix ## suffix(); \
                    ^
include/linux/compiler.h:442:2: note: in expansion of macro '__compiletime_assert'
  __compiletime_assert(condition, msg, prefix, suffix)
  ^
include/linux/compiler.h:454:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
include/linux/bug.h:53:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^
include/linux/bug.h:77:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^
include/linux/bug.h:30:2: note: in expansion of macro 'BUILD_BUG_ON'
  BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
  ^
include/linux/average.h:47:3: note: in expansion of macro 'BUILD_BUG_ON_NOT_POWER_OF_2'
   BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
   ^
/home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ath5k.h:1258:1: note: in expansion of macro 'DECLARE_EWMA'
 DECLARE_EWMA(beacon_rssi, 10, 8)
 ^
make[2]: *** [/home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ani.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from include/uapi/linux/stddef.h:1:0,
                 from include/linux/stddef.h:4,
                 from ./include/uapi/linux/posix_types.h:4,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from include/linux/list.h:4,
                 from include/linux/module.h:9,
                 from /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/base.c:45:
In function 'ewma_beacon_rssi_init',
    inlined from 'ath5k_reset' at /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/base.c:2941:23:
include/linux/compiler.h:437:20: error: call to '__compiletime_assert_1258' declared with attribute error: BUILD_BUG_ON failed: (8) == 0 || (((8) & ((8) - 1)) != 0)
    prefix ## suffix(); \
                    ^
include/linux/compiler.h:442:2: note: in expansion of macro '__compiletime_assert'
  __compiletime_assert(condition, msg, prefix, suffix)
  ^
include/linux/compiler.h:454:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
include/linux/bug.h:53:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^
include/linux/bug.h:77:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^
include/linux/bug.h:30:2: note: in expansion of macro 'BUILD_BUG_ON'
  BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
  ^
include/linux/average.h:38:3: note: in expansion of macro 'BUILD_BUG_ON_NOT_POWER_OF_2'
   BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
   ^
/home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ath5k.h:1258:1: note: in expansion of macro 'DECLARE_EWMA'
 DECLARE_EWMA(beacon_rssi, 10, 8)
 ^
In function 'ewma_beacon_rssi_add',
    inlined from 'ath5k_receive_frame' at /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/base.c:1433:23,
    inlined from 'ath5k_tasklet_rx' at /home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/base.c:1591:23:
include/linux/compiler.h:437:20: error: call to '__compiletime_assert_1258' declared with attribute error: BUILD_BUG_ON failed: (8) == 0 || (((8) & ((8) - 1)) != 0)
    prefix ## suffix(); \
                    ^
include/linux/compiler.h:442:2: note: in expansion of macro '__compiletime_assert'
  __compiletime_assert(condition, msg, prefix, suffix)
  ^
include/linux/compiler.h:454:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
include/linux/bug.h:53:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^
include/linux/bug.h:77:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^
include/linux/bug.h:30:2: note: in expansion of macro 'BUILD_BUG_ON'
  BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
  ^
include/linux/average.h:60:3: note: in expansion of macro 'BUILD_BUG_ON_NOT_POWER_OF_2'
   BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
   ^
/home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/ath5k.h:1258:1: note: in expansion of macro 'DECLARE_EWMA'
 DECLARE_EWMA(beacon_rssi, 10, 8)
 ^
make[2]: *** [/home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k/base.o] Error 1
make[1]: *** [/home/phil/rpmbuild/BUILD/ath5k-0.0/ath5k] Error 2
make: *** [_module_/home/phil/rpmbuild/BUILD/ath5k-0.0] Error 2
make: Leaving directory `/usr/src/kernels/3.10.0-1062.el7.x86_64'
error: Bad exit status from /var/tmp/rpm-tmp.CjwU3v (%build)

anglican

2019-09-09 01:26

reporter   ~0006451

Right, I hadn't made it clear. My patch applies to the older version of the driver code that previously compiled, specifically that in:

ath5k-kmod-0.0-10.el7.elrepo.src.rpm

With the patch it seems to compile and produce a working module. With the new driver code I get the same errors as you when attempting to compile... I'm sure it's also patchable, just not by me.

anglican

2019-09-09 05:10

reporter   ~0006452

Actually, the fix is much simpler than I anticipated. There is a typo in the file ath5k.h, the attached patch file ath5k-0.0.1.patch fixes it. The line:

DECLARE_EWMA(beacon_rssi, 10, 8)

should be:

DECLARE_EWMA(beacon_rssi, 1024, 8)

the second argument to this macro must be an integer power of two, which 10 isn't. At some point the additional "24" seems to have been accidentally deleted by someone.

pperry

2019-09-09 12:31

administrator   ~0006453

Nice catch - thank you.

Confirmed, this fixes the build issue. New packages have been built for el7.7 and released to the main elrepo repository.

Marking resolved

pperry

2019-09-09 12:37

administrator   ~0006454

For reference, the original commit is here:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/net/wireless/ath/ath5k/ath5k.h?h=v4.18.20&id=eb1e011a14748a1d9df9a7d7df9a5711721a1bdb

toracat

2019-09-09 13:06

administrator   ~0006455

Back to "assigned" because the submitter might like to add a note.

anglican

2019-09-10 01:47

reporter   ~0006456

So, not a typo. DECLARE_EWMA was changed for kernel v.4.11 to have the precision as the second argument, 1024 == 2^10. All is now clear. Thanks for getting the fix out so quickly.

Issue History

Date Modified Username Field Change
2019-09-06 08:04 anglican New Issue
2019-09-06 08:04 anglican Status new => assigned
2019-09-06 08:04 anglican Assigned To => pperry
2019-09-06 08:04 anglican File Added: ath5k-0.0.patch
2019-09-06 10:15 toracat Note Added: 0006433
2019-09-07 06:07 pperry Note Added: 0006440
2019-09-08 11:58 toracat Status assigned => feedback
2019-09-09 01:26 anglican Note Added: 0006451
2019-09-09 05:06 anglican File Added: ath5k-0.0.1.patch
2019-09-09 05:10 anglican Note Added: 0006452
2019-09-09 12:31 pperry Note Added: 0006453
2019-09-09 12:31 pperry Status feedback => resolved
2019-09-09 12:31 pperry Resolution open => fixed
2019-09-09 12:37 pperry Note Added: 0006454
2019-09-09 13:06 toracat Note Added: 0006455
2019-09-09 13:06 toracat Status resolved => assigned
2019-09-10 01:47 anglican Note Added: 0006456
2019-10-11 11:55 toracat Status assigned => resolved