You are not logged in.

#1 2019-04-28 11:47:08

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

How to I can make use of an old kernel in archlinux? [SOLVED]

Hi guys,

I have been experiencing a compatibility problem with Qualcomm Atheros QCA9565 / AR9565 (ath9k) wiriless internet controller in the latest kernels, packet latency and packet loss are high to the point of making acceptable Internet access impossible.
Before you ask, I've used all the possible driver configuration combinations, starting with the most often suggested to fix the problem: in "/etc/modprobe.d/ath9k.conf add options ath9k nohwcrypt = 1".
So I decided to compile an older version of the linux kernel, where the ath9k module worked perfectly (version 4.4.35). To do this I used the PKGBUILD located at https://git.archlinux.org/svntogit/pack … eda705fa03. The compilation process ends successfully, however, I can not get it to boot, it does not load and the computer simply reboots it by selecting it from the grub menu.
The question is, do you have any idea how I can make use of an old kernel in archlinux?

Last edited by Junio_Calu (2019-05-14 11:22:43)

Offline

#2 2019-04-28 11:54:52

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

You can build the kernel yourself but using unmaintained kernels is ill-advised.  See kernel.org for what is currently maintained.  Note that you will have to build all out-of-tree modules you use (if any).  Have you tried the linux-lts package (4.19.x currently)?  The advantage there is that you won't have to build any.

Offline

#3 2019-04-28 12:04:31

loqs
Member
Registered: 2014-03-06
Posts: 18,930

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

Even if the kernel does boot, 4.4 does not have statx which was added in 4.11.
So you would need to build linux-api-headers->glibc->binutils->gcc->binutils->glibc
then rebuild any packages using statx or other API additions or to be safe everything linked to glibc.

Last edited by loqs (2019-04-28 12:05:22)

Offline

#4 2019-04-28 12:38:58

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

graysky wrote:

You can build the kernel yourself but using unmaintained kernels is ill-advised.  See kernel.org for what is currently maintained.  Note that you will have to build all out-of-tree modules you use (if any).  Have you tried the linux-lts package (4.19.x currently)?  The advantage there is that you won't have to build any.

Yes, I already tested this version, in fact I did an exhaustive work of tests with different kernels recent, LTS or not.

Offline

#5 2019-04-28 12:44:03

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

loqs wrote:

Even if the kernel does boot, 4.4 does not have statx which was added in 4.11.
So you would need to build linux-api-headers->glibc->binutils->gcc->binutils->glibc
then rebuild any packages using statx or other API additions or to be safe everything linked to glibc.

That sounds like a lot of trouble... I realize this isn't what the OP asked, but it seems the lower energy path would be to try to get the hardware/module working on a modern kernel.

Offline

#6 2019-04-28 12:47:14

loqs
Member
Registered: 2014-03-06
Posts: 18,930

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

Yes attempting to build the ath9k from 4.4.35 as an external module for 4.19 or 5.0 or reverting commits on the in tree ath9k module would be the approaches I would investigate.

Offline

#7 2019-04-28 12:54:04

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

loqs wrote:

Yes attempting to build the ath9k from 4.4.35 as an external module for 4.19 or 5.0 or reverting commits on the in tree ath9k module would be the approaches I would investigate.

I will do this.

Offline

#8 2019-04-28 19:08:37

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

loqs wrote:

Yes attempting to build the ath9k from 4.4.35 as an external module for 4.19 or 5.0 or reverting commits on the in tree ath9k module would be the approaches I would investigate.

I did a "git bisect" tracking, I need to find through a binary search a "good" version and a "bad" version between the commit of the most recent and problematic change of the ath9k module, and that of its old functional version, so the program could return the file changes that caused the bug at some point. There are over 1800 such commits, in a time span between the years 2016 and 2017.
In the first search the program led me to commit the first half of the 1800s total, which is equivalent to version 4.4.70 of the kernel, which is also not bootable in the current system.

Regarding the first suggested approach (build the ath9k from 4.4.35 as an external module for 4.19 or 5.0), I think it may not work, there are modules correlated with each other indirectly.

I'll find alternatives, new suggestions are welcome.

Last edited by Junio_Calu (2019-04-28 19:10:48)

Offline

#9 2019-04-28 19:51:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,104

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

Are you sure it broke in 4.5.0 (and is disfunctional on eg. 4.11)?
Did you try to add the "debug" parameter to ath9k in order to maybe get a better idea on the problems at hand?

To rule out the d'ooh: the typical cause for 2.4GHz connections is bluetooth interference - does your device have BT and did you try 5GHz behavior?

Offline

#10 2019-04-28 20:13:52

loqs
Member
Registered: 2014-03-06
Posts: 18,930

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

Could you please post a dmesg from a boot with the issue and a boot without the issue?
Is the good kernel 4.4.35 newly built?  I would expect it to need either an older compiler or some patches to work with the current toolchain.

Offline

#11 2019-04-28 20:23:25

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

seth wrote:

Are you sure it broke in 4.5.0 (and is disfunctional on eg. 4.11)?
Did you try to add the "debug" parameter to ath9k in order to maybe get a better idea on the problems at hand?

To rule out the d'ooh: the typical cause for 2.4GHz connections is bluetooth interference - does your device have BT and did you try 5GHz behavior?

I used the debug parameter at startup, the problem is that it kernel restarts immediately, it does not display any messages. I'm going to test version 4.11, I've deactivated bluetooth and the problem persists, my controller is limited to 2.4 GHz.

Offline

#12 2019-04-28 20:27:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,104

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

I meant w/ a recent kernel. Debug on the "good" kernel is probably unspectacular.

Edit: you should try as recent binary kernels as you can before going for a bisect, should vastly speed up things.

Last edited by seth (2019-04-28 20:28:22)

Offline

#13 2019-04-28 20:42:22

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

loqs wrote:

Could you please post a dmesg from a boot with the issue and a boot without the issue?
Is the good kernel 4.4.35 newly built?  I would expect it to need either an older compiler or some patches to work with the current toolchain.

was newly compiled, I used an old PKGBUILD from projects.archlinux.org, built it successfully. To get a dmesg of a problem-free boot, you may need to use another distro, or an old live version of Arch. I'll find a way.

Offline

#14 2019-04-28 20:45:29

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

seth wrote:

I meant w/ a recent kernel. Debug on the "good" kernel is probably unspectacular.

Edit: you should try as recent binary kernels as you can before going for a bisect, should vastly speed up things.

I got it wrong, I'll do it (debug).

Offline

#15 2019-04-28 20:51:35

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

seth wrote:

I meant w/ a recent kernel. Debug on the "good" kernel is probably unspectacular.

Edit: you should try as recent binary kernels as you can before going for a bisect, should vastly speed up things.

This is a recurring problem, even the Arch reference in its documentation

https://wiki.archlinux.org/index.php/Wi … tion#ath9k

the solution may not be trivial.

Last edited by Junio_Calu (2019-04-28 20:52:33)

Offline

#16 2019-04-29 00:30:58

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

seth wrote:

Are you sure it broke in 4.5.0 (and is disfunctional on eg. 4.11)?
Did you try to add the "debug" parameter to ath9k in order to maybe get a better idea on the problems at hand?

To rule out the d'ooh: the typical cause for 2.4GHz connections is bluetooth interference - does your device have BT and did you try 5GHz behavior?

the kernel 4.11 was built successfully, but it also did not boot, I'm using modprobed-db to speed compilation process, I had a "0x0: frame pointer state mismatch" warning during compilation.

the CONFIG_ATH_DEBUG configuration is responsible for enabling module debugging, and it is not enabled by default, I will build a new kernel with this option.

Last edited by Junio_Calu (2019-04-29 00:32:02)

Offline

#17 2019-04-29 01:05:01

loqs
Member
Registered: 2014-03-06
Posts: 18,930

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

I tested building 4.4.35 and  it does compile with numerous warnings (appears to be one per compilation unit) such as

In file included from include/linux/kernel.h:11,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from init/main.c:15:
include/linux/log2.h:22:1: warning: ignoring attribute ‘noreturn’ because it conflicts with attribute ‘const’ [-Wattributes]
 int ____ilog2_NaN(void);

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785 no longer produces the build failure I was expecting.

Offline

#18 2019-04-29 13:23:21

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

loqs wrote:

I tested building 4.4.35 and  it does compile with numerous warnings (appears to be one per compilation unit) such as

In file included from include/linux/kernel.h:11,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from init/main.c:15:
include/linux/log2.h:22:1: warning: ignoring attribute ‘noreturn’ because it conflicts with attribute ‘const’ [-Wattributes]
 int ____ilog2_NaN(void);

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785 no longer produces the build failure I was expecting.

I was surprised that it has compiled without patches as well, since 4.11 needed corrections.

Offline

#19 2019-04-29 13:42:45

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

Junio_Calu wrote:
loqs wrote:

I tested building 4.4.35 and  it does compile with numerous warnings (appears to be one per compilation unit) such as

In file included from include/linux/kernel.h:11,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from init/main.c:15:
include/linux/log2.h:22:1: warning: ignoring attribute ‘noreturn’ because it conflicts with attribute ‘const’ [-Wattributes]
 int ____ilog2_NaN(void);

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785 no longer produces the build failure I was expecting.

I was surprised that it has compiled without patches as well, since 4.11 needed corrections.

4.11 patch:

--- a/tools/lib/subcmd/pager.c
+++ b/tools/lib/subcmd/pager.c
@@ -30,10 +30,13 @@ static void pager_preexec(void)
      * have real input
      */
     fd_set in;
+    fd_set exception;

     FD_ZERO(&in);
+    FD_ZERO(&exception);
     FD_SET(0, &in);
-    select(1, &in, NULL, &in, NULL);
+    FD_SET(0, &exception);
+    select(1, &in, NULL, &exception, NULL);

     setenv("LESS", "FRSX", 0);
}
--- a/tools/lib/str_error_r.c
+++ b/tools/lib/str_error_r.c
@@ -21,6 +21,6 @@ char *str_error_r(int errnum, char *buf, size_t buflen)
{
     int err = strerror_r(errnum, buf, buflen);
     if (err)
-        snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err);
+        snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d)=%d", errnum, err);
     return buf;
}

Last edited by Junio_Calu (2019-04-29 13:43:22)

Offline

#20 2019-04-29 15:49:47

loqs
Member
Registered: 2014-03-06
Posts: 18,930

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

Offline

#21 2019-05-14 11:19:00

Junio_Calu
Member
Registered: 2014-09-07
Posts: 25

Re: How to I can make use of an old kernel in archlinux? [SOLVED]

I'm closing the topic, replacing NetworkManager with Connman and wpa_supplicant by iwd the wireless connection improves quality significantly, thank you all!

reference: https://wiki.archlinux.org/index.php/Co … supplicant

Offline

Board footer

Powered by FluxBB