Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TPLink TL-Wn722n wireless card weird behaviour
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
rafa_99
n00b
n00b


Joined: 10 Feb 2020
Posts: 11

PostPosted: Sun Mar 29, 2020 12:00 am    Post subject: TPLink TL-Wn722n wireless card weird behaviour Reply with quote

Hi, I use a TPLink TL-Wn722n wireless card and I just finished my gentoo base install. When I set up the kernel, I've enabled the ath9k_htc module in device drivers -> networking support -> Wireless Lan and also installed the linux-firmware package.
Then, after booting up my computer, it doesn't turn on my wireless card, only if I unplug and plug it back in my back usb ports. Weirdly, if I plug the wireless card in the front usb panel and turn on my computer, the wireless card starts working flawlessly. I had arch linux on this computer and the wireless card didn't used to behave like this. I've typed dmesg and this is the result when the pc is booting with my wireless card in the back usb ports

Code:
[    1.358129] usb 1-1: new high-speed USB device number 2 using ehci-pci
[    1.370122] tsc: Refined TSC clocksource calibration: 2503.444 MHz
[    1.370127] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2415ef7273a, max_idle_ns: 440795327296 ns
[    1.370147] clocksource: Switched to clocksource tsc
[    1.506987] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= 1.08
[    1.506989] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[    1.506991] usb 1-1: Product: USB2.0 WLAN
[    1.506993] usb 1-1: Manufacturer: ATHEROS
[    1.506995] usb 1-1: SerialNumber: 12345
[    1.507265] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[    1.507392] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[    1.507395] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[    1.507406] usb 1-1: Direct firmware load for htc_9271.fw failed with error -2
[    1.507408] usb 1-1: no suitable firmware found!
[    1.507409] usb 1-1: ath9k_htc: Failed to get firmware htc_9271.fw
[    1.688029] random: fast init done
[    1.739697] EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: (null)
[    1.853985] sh (2390) used greatest stack depth: 13464 bytes left
[    2.118435] test (2409) used greatest stack depth: 13000 bytes left
[    2.166114] usb 2-2: new low-speed USB device number 2 using uhci_hcd
[    2.342150] usb 2-2: New USB device found, idVendor=17ef, idProduct=608d, bcdDevice= 1.00
[    2.342152] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.342154] usb 2-2: Product: Lenovo USB Optical Mouse
[    2.342156] usb 2-2: Manufacturer: PixArt
[    2.358232] usb 1-1: ath9k_htc: USB layer deinitialized
[    2.361650] input: PixArt Lenovo USB Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/0003:17EF:608D.0001/input/input3
[    2.361737] hid-generic 0003:17EF:608D.0001: input,hidraw0: USB HID v1.11 Mouse [PixArt Lenovo USB Optical Mouse] on usb-0000:00:1d.0-2/input0
[    2.491221] random: crng init done
[    2.748832] init-early.sh (2415) used greatest stack depth: 12968 bytes left
[    4.668052] udevd[2857]: starting version 3.2.9
[    4.871405] udevd[2857]: starting eudev-3.2.9
[    5.150938] r8169 0000:01:00.0 enp1s0: renamed from eth0
[    6.527282] EXT4-fs (sda8): re-mounted. Opts: (null)
[    6.777590] Adding 6291452k swap on /dev/sda5.  Priority:-2 extents:1 across:6291452k
[    6.887509] EXT4-fs (sda7): mounted filesystem with ordered data mode. Opts: (null)
[    7.575120] ip (3471) used greatest stack depth: 12336 bytes left
[    9.203870] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[    9.296239] RTL8211B Gigabit Ethernet r8169-100:00: attached PHY driver [RTL8211B Gigabit Ethernet] (mii_bus:phy_addr=r8169-100:00, irq=IGNORE)
[    9.427171] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[   65.202151] usb 2-2: USB disconnect, device number 2
[   66.990109] usb 2-2: new low-speed USB device number 3 using uhci_hcd
[   67.166145] usb 2-2: New USB device found, idVendor=17ef, idProduct=608d, bcdDevice= 1.00
[   67.166148] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   67.166149] usb 2-2: Product: Lenovo USB Optical Mouse
[   67.166151] usb 2-2: Manufacturer: PixArt
[   67.185651] input: PixArt Lenovo USB Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/0003:17EF:608D.0002/input/input4
[   67.185721] hid-generic 0003:17EF:608D.0002: input,hidraw0: USB HID v1.11 Mouse [PixArt Lenovo USB Optical Mouse] on usb-0000:00:1d.0-2/input0

If anybody can help me with this issue, then thanks in advance

[Moderator edit: added [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
grumblebear
Apprentice
Apprentice


Joined: 26 Feb 2008
Posts: 172

PostPosted: Sun Mar 29, 2020 9:17 am    Post subject: Reply with quote

Firmware loading failed. Did you compile ath9k_htc directly into the kernel and not as a module? Then it might be neccessary to put the firmware into the kernel image, too.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45435
Location: 56N 3W

PostPosted: Sun Mar 29, 2020 11:27 am    Post subject: Reply with quote

rafa_99,

Code:
[    1.507392] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[    1.739697] EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: (null)


You tried to start your wifi before the firmware could be read.
Either make the Wifi a kernel module or include the firmware in the kernel banary.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rafa_99
n00b
n00b


Joined: 10 Feb 2020
Posts: 11

PostPosted: Sun Mar 29, 2020 11:36 am    Post subject: Reply with quote

grumblebear wrote:
Firmware loading failed. Did you compile ath9k_htc directly into the kernel and not as a module? Then it might be neccessary to put the firmware into the kernel image, too.


NeddySeagoon wrote:
rafa_99,

Code:
[    1.507392] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[    1.739697] EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: (null)


You tried to start your wifi before the firmware could be read.
Either make the Wifi a kernel module or include the firmware in the kernel banary.


Thanks for the replies, I'll try to compile the kernel with the firmware binary. Here is my kernel config:

Code:
CONFIG_ATH9K_HW=y
CONFIG_ATH9K_COMMON=y
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=y
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
# CONFIG_ATH9K_DEBUGFS is not set
# CONFIG_ATH9K_DYNACK is not set
# CONFIG_ATH9K_WOW is not set
CONFIG_ATH9K_RFKILL=y
# CONFIG_ATH9K_CHANNEL_CONTEXT is not set
CONFIG_ATH9K_PCOEM=y
CONFIG_ATH9K_HTC=y
# CONFIG_ATH9K_HTC_DEBUGFS is not set
# CONFIG_ATH9K_HWRNG is not set


Either way I was trying still, to startup network manager at boot up with
Code:
rc-update add NetworkManager default
, maybe thats also the problem, it starts network manager before loading the firmware.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45435
Location: 56N 3W

PostPosted: Sun Mar 29, 2020 11:58 am    Post subject: Reply with quote

rafa_99,

That's the wrong piece of your kernel .config. Its always a good idea to put the whole .config file onto a pastebin site.

You need entries at
Code:
CONFIG_EXTRA_FIRMWARE=
CONFIG_EXTRA_FIRMWARE_DIR=
then when the kernel is rebuilt, it will include the firmware.

You can add in updated CPU microcode too, if you need it.

When you reboot, check
Code:
uname -a

Code:
$ uname -a
Linux NeddySeagoon_Static 5.5.2-gentoo-r1 #1 SMP PREEMPT Mon Feb 10 17:16:30 GMT 2020 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux

The date and time Mon Feb 10 17:16:30 GMT 2020 is the build date and time of the running kernel.
If you have just rebooted into a new kernel, it will be nowish. If its old, you are not running the kernel you think you are.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rafa_99
n00b
n00b


Joined: 10 Feb 2020
Posts: 11

PostPosted: Sun Mar 29, 2020 2:00 pm    Post subject: Reply with quote

NeddySeagoon wrote:
rafa_99,

That's the wrong piece of your kernel .config. Its always a good idea to put the whole .config file onto a pastebin site.

You need entries at
Code:
CONFIG_EXTRA_FIRMWARE=
CONFIG_EXTRA_FIRMWARE_DIR=
then when the kernel is rebuilt, it will include the firmware.

You can add in updated CPU microcode too, if you need it.

When you reboot, check
Code:
uname -a

Code:
$ uname -a
Linux NeddySeagoon_Static 5.5.2-gentoo-r1 #1 SMP PREEMPT Mon Feb 10 17:16:30 GMT 2020 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux

The date and time Mon Feb 10 17:16:30 GMT 2020 is the build date and time of the running kernel.
If you have just rebooted into a new kernel, it will be nowish. If its old, you are not running the kernel you think you are.


I included the firmware in my kernel binary, still have this error:
Code:

[    1.280953] usbcore: registered new interface driver ath9k_htc
[    1.768421] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[    1.768560] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[    1.768563] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[    1.768577] usb 1-1: ath9k_htc: Failed to get firmware htc_9271.fw
[    2.621407] usb 1-1: ath9k_htc: USB layer deinitialized


I did add this to my kernel config:
Code:

CONFIG_EXTRA_FIRMWARE="htc_9271-1.4.0.fw"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware/ath9k_htc"


If you want to check my current kernel config, I just posted it on pastebin like you said

https://pastebin.com/K4VYF8R9

And yes, I removed my old kernel and installed the most recent one, just like you said, i typed
Code:
 uname -a
and it outputted the kernel I just compiled with the date from like 30~40 minutes ago

The weird part is that if I plug the wireless card in my front usb panel, it works flawlessly and shows me this in dmesg:

Code:

[    1.302976] usbcore: registered new interface driver ath9k_htc
[    2.517703] usb 1-5: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[    2.937055] usb 1-5: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[    3.189440] ath9k_htc 1-5:1.0: ath9k_htc: HTC initialized with 33 credits
[    3.457449] ath9k_htc 1-5:1.0: ath9k_htc: FW Version: 1.4
[    3.457452] ath9k_htc 1-5:1.0: FW RMW support: On
[    5.450538] ath9k_htc 1-5:1.0 wlp0s29f7u5: renamed from wlan0
Back to top
View user's profile Send private message
grumblebear
Apprentice
Apprentice


Joined: 26 Feb 2008
Posts: 172

PostPosted: Sun Mar 29, 2020 3:57 pm    Post subject: Reply with quote

You should try with CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware" and CONFIG_EXTRA_FIRMWARE="htc_9271.fw".

But why mess around with all this? The clearly preferred way is to build ath9k_htc as a module like all drivers not directly needed for booting.
Back to top
View user's profile Send private message
rafa_99
n00b
n00b


Joined: 10 Feb 2020
Posts: 11

PostPosted: Sun Mar 29, 2020 5:38 pm    Post subject: Reply with quote

grumblebear wrote:
You should try with CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware" and CONFIG_EXTRA_FIRMWARE="htc_9271.fw".

But why mess around with all this? The clearly preferred way is to build ath9k_htc as a module like all drivers not directly needed for booting.


WOW

Tbh I never messed around with kernel modules because I've never used them and never understood them, but now I've read the wiki and loaded up the ath9k_htk module on /etc/modules-load.d and worked out of the box, thanks to everyone who tried to help me =) :D :D
Back to top
View user's profile Send private message
grumblebear
Apprentice
Apprentice


Joined: 26 Feb 2008
Posts: 172

PostPosted: Sun Mar 29, 2020 6:19 pm    Post subject: Reply with quote

You don't even need to list that in /etc/modules-load.d, because the kernel and udev autodetect the stick when it is plugged in or present at boot time. modules-load.d is there for the very rare cases where autodetection is not possible.
Back to top
View user's profile Send private message
rafa_99
n00b
n00b


Joined: 10 Feb 2020
Posts: 11

PostPosted: Tue Mar 31, 2020 10:52 pm    Post subject: Reply with quote

grumblebear wrote:
You don't even need to list that in /etc/modules-load.d, because the kernel and udev autodetect the stick when it is plugged in or present at boot time. modules-load.d is there for the very rare cases where autodetection is not possible.


Thank you very much :D

Just updated my kernel and removed the /etc/modules-load.d folder and it still worked out of the box.

Thanks everyone =)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum