Wifi cai aleatoriamente

0

Então meu computador roda no Ubuntu 18.04 e desde que o instalei o WiFi cai aleatoriamente e não consigo reiniciá-lo porque ele não faz nada com a GUI e quando eu digito "service network-manager restart" ele faz um loop e exibe: "iwlwifi 0000: 02: 00.0: Falha ao executar o código INIT: -5" e "Falha ao iniciar o código RT: -5". Eu já tentei instalar os drivers do site da Intel para a minha placa de rede que é um Intel 3160 e isso não mudou nada. Obrigado

Aqui está a saída do dmesg depois que o wifi cai.

    [ 1606.095583] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.13.0-36-generic #40~16.04.1-Ubuntu

    [ 1606.095585] Hardware name: LENOVO 80M0/Mini, BIOS C0CN23WW 03/31/2015

    [ 1606.095589] task: ffff89bb7a44c200 task.stack: ffffa42fc06ac000

    [ 1606.095615] RIP: 0010:iwl_trans_pcie_grab_nic_access+0xe7/0xf0 [iwlwifi]

    [ 1606.095619] RSP: 0018:ffff89bb7fd83db8 EFLAGS: 00010086

    [ 1606.095624] RAX: 000000000000003d RBX: ffff89bb765d0018 RCX: 0000000000000000

    [ 1606.095628] RDX: 0000000000000000 RSI: 00000000000000f6 RDI: 0000000000000300

    [ 1606.095631] RBP: ffff89bb7fd83dd8 R08: 0000000000000001 R09: 000000000000032b

    [ 1606.095634] R10: 0000000000000007 R11: 000000000000032b R12: 0000000000000000

    [ 1606.095638] R13: ffff89bb765d8f20 R14: ffff89bb7fd83de8 R15: ffff89bb765d0018

    [ 1606.095643] FS:  0000000000000000(0000) GS:ffff89bb7fd80000(0000) knlGS:0000000000000000

    [ 1606.095646] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033

    [ 1606.095650] CR2: 00007fd4b6fc6000 CR3: 0000000018c0a000 CR4: 00000000001006e0

    [ 1606.095653] Call Trace:

    [ 1606.095658]  <IRQ>

    [ 1606.095683]  iwl_read_prph+0x38/0x90 [iwlwifi]

    [ 1606.095710]  iwl_trans_pcie_log_scd_error+0x126/0x1f0 [iwlwifi]

    [ 1606.095734]  ? iwl_pcie_txq_inc_wr_ptr+0xf0/0xf0 [iwlwifi]

    [ 1606.095758]  iwl_pcie_txq_stuck_timer+0x4b/0x70 [iwlwifi]

    [ 1606.095767]  call_timer_fn+0x37/0x140

    [ 1606.095773]  run_timer_softirq+0x1f1/0x460

    [ 1606.095780]  ? ktime_get+0x3e/0xa0

    [ 1606.095787]  ? lapic_next_deadline+0x26/0x30

    [ 1606.095794]  __do_softirq+0xf2/0x287

    [ 1606.095803]  irq_exit+0xb6/0xc0

    [ 1606.095809]  smp_trace_apic_timer_interrupt+0x74/0xa0

    [ 1606.095815]  smp_apic_timer_interrupt+0xe/0x10

    [ 1606.095820]  apic_timer_interrupt+0x1af/0x1c0

    [ 1606.095824]  </IRQ>

    [ 1606.095831] RIP: 0010:cpuidle_enter_state+0x135/0x2f0

    [ 1606.095835] RSP: 0018:ffffa42fc06afe68 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff10

    [ 1606.095841] RAX: 0000000000000000 RBX: 0000000000000005 RCX: 000000000000001f

    [ 1606.095844] RDX: 0000000000000000 RSI: 000000003b19be84 RDI: 0000000000000000

    [ 1606.095848] RBP: ffffa42fc06afea0 R08: 000000000000742c R09: 0000000000000018

    [ 1606.095851] R10: ffffa42fc06afe38 R11: 00000000000019d4 R12: 0000000000000005

    [ 1606.095855] R13: ffff89bb7fdab020 R14: ffffffff95f7a218 R15: 00000175ec205011

    [ 1606.095864]  ? cpuidle_enter_state+0x123/0x2f0

    [ 1606.095871]  cpuidle_enter+0x17/0x20

    [ 1606.095877]  call_cpuidle+0x23/0x40

    [ 1606.095882]  do_idle+0x18c/0x1f0

    [ 1606.095888]  cpu_startup_entry+0x73/0x80

    [ 1606.095893]  start_secondary+0x193/0x1d0

    [ 1606.095900]  secondary_startup_64+0x9f/0xa0

    [ 1606.095905] Code: 00 00 e8 9d 59 c0 d4 eb ab 48 89 df be 24 00 00 00 c6 05 69 f1 01 00 01 e8 67 eb fe ff 48 c7 c7 c8 2e 92 c0 89 c6 e8 5a e7 3d d4 <0f> ff eb c1 0f 1f 44 00 00 0f 1f 44 00 00 55 49 c7 c0 08 2f 92 

    [ 1606.096025] ---[ end trace f4a85b56dc9c8220 ]---

    [ 1606.195965] iwlwifi 0000:02:00.0: Queue 10 is active on fifo 2 and stuck for 10000 ms. SW [104, 110] HW [90, 90] FH TRB=0x05a5a5a5a

    [ 1608.000851] iwlwifi 0000:02:00.0: Failed to wake NIC for hcmd

    [ 1608.001110] iwlwifi 0000:02:00.0: Error sending ADD_STA: enqueue_hcmd failed: -5

    [ 1618.230154] iwlwifi 0000:02:00.0: Queue 5 is active on fifo 2 and stuck for 10000 ms. SW [13, 14] HW [90, 90] FH TRB=0x05a5a5a5a
    
por Chams 27.05.2018 / 22:59

1 resposta

1

Isto não conserta o problema, já que o wifi vai acabar extinguindo-se novamente - tudo isso faz com que você tenha wifi novamente sem precisar reiniciar (salve como fixwifi.sh e execute como sudo):

#!/bin/sh

# If an interface name was not passed in then assume that wlan0 is the interface name.
if [ -z "$1" ]; then
    interface="wlan0"
else
    interface=$1
fi

# Figure out what pci slot Linux has assigned the Network controller: Intel Corporation Wireless 7260
wirelessPCI=$(lspci |grep "Wireless 7260")
pci=$(echo ${wirelessPCI} | awk '{ print $1 }')
devicePath="/sys/bus/pci/devices/0000:$pci/remove"

# Not the best solution as this script can hang. 
# But since if this script fails the ONLY way to revive the wifi anyway is a reboot...
# Feel free to improve the script if you have the scriptfu ninja skills to do so.
while true; do

    # Tell Linux to remove the wifi card from the PCI device list only if it exists in the first place.
    if [ -f $devicePath ]; then
        echo 1 | sudo tee $devicePath > /dev/null
        sleep 1
    fi

    # Reprobe the driver modules in case we have removed them in a failed attempt to wake the network card.
    sudo modprobe iwlmvm
    sudo modprobe iwlwifi

    # Try to have Linux bring the network card back online as a PCI device. 
    echo 1 | sudo tee /sys/bus/pci/rescan > /dev/null
    sleep 1

    # Check if Linux managed to bring the network card back online as a PCI device.
    if [ -f $devicePath ]; then

        # Looks like we are back in business. 
        # So we try to set the PCI slot with some voodoo I don't understand that the Intel devs told me to try.
        # https://bugzilla.kernel.org/show_bug.cgi?id=191601
        sudo setpci -s $pci 0x50.B=0x40

        # Bring the wireless network interface up.
        sudo ifconfig $interface up

        # Did the wifi interface actually go live?
        exitCode=$?
        if [ $exitCode -eq 0 ];then

            # Not sure why in the hell this is not the default for wireless intefaces.
            # It is well documented that: (power_management === ON) === Wifi-Stupidity
            sudo iwconfig $interface power off

            # The exit code will be the exit code of our attempt at turning power management off for $interface/wlan0.
            break
        fi
    else
        # It's worse than that the wifi's dead Jim! Dead Jim! Dead!
        # We tell Linux to remove the the wifi driver modules and loop back in an attempt to revive the wifi.
        sudo modprobe -r iwlmvm
        sudo modprobe -r iwlwifi
    fi
done
    
por 26.09.2018 / 12:01

Tags