hostap driver hangs "hard"

Holger Schurig hs4233 at mail.mn-solutions.de
Thu Dec 22 06:06:17 EST 2005


Because prism2_read_pda() was always hanging, I did an experiment:

  static int prism2_hw_init2(struct net_device *dev, int initial)
  {
        struct hostap_interface *iface = dev->priv;
        local_info_t *local = iface->local;
        int i;

  printk("%s()\n", __FUNCTION__);
  #ifdef PRISM2_DOWNLOAD_SUPPORT
        kfree(local->pda);
  //HS    if (local->no_pri)
                local->pda = NULL;
  //HS    else
  //HS            local->pda = prism2_read_pda(dev);
  printk("%s: pda %p\n", __FUNCTION__, local->pda);
  #endif /* PRISM2_DOWNLOAD_SUPPORT */

after this, I got ONCE this output, which looked way better:

[   22.160000] hostap_crypt: registered algorithm 'NULL'
[   22.530000] hostap_cs: CVS (Jouni Malinen <jkmaline at cc.hut.fi>)
[   22.830000] prism2_init_local_data()
[   23.120000] hostap_cs: Registered netdevice wifi0
[   23.170000] hostap_cs: index 0x01: Vcc 3.3, irq 45, io 
0xc88a0000-0xc88a003f
[   23.170000] prism2_hw_config()
[   23.180000] prism2_hw_init()
[   23.180000] hfa384x_cmd_no_wait()
[   23.180000] __hfa384x_cmd_no_wait()
[   23.190000] prism2_hw_init: hfa384x_cmd_no_wait returned 0
[   23.190000] prism2_hw_init: first 1
[   23.190000] prism2_hw_init: EVSTAT 8000
[   23.200000] prism2_hw_init: while loop start
[   23.470000] prism2_hw_init: while loop end
[   23.470000] prism2_hw_init: initialized in 270 ms
[   23.480000] prism2_hw_init: return 0
[   23.480000] prism2_hw_init2()
[   23.480000] prism2_hw_init2: pda 00000000
[   23.490000] hfa384x_disable_interrupts()
[   23.490000] prism2_hw_init2: initial 1, pri_only 0
[   23.500000] hfa384x_events_only_cmd()
[   23.500000] prism2_get_version_info(rid fd0b, txt NIC)
[   23.510000] hfa384x_get_rid()
[   23.510000] hfa384x_cmd()
[   23.510000] hfa384x_cmd_issue()
[   23.510000] prism2_interrupt()
[   23.520000] prism2_check_magic()
[   23.520000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   23.530000] prism2_interrupt: ev 8010
[   23.530000] prism2_cmd_ev()
[   23.530000] hostap_cmd_queue_free()
[   23.540000] __hostap_cmd_queue_free()
[   23.550000] hostap_cmd_queue_free()
[   23.560000] __hostap_cmd_queue_free()
[   23.560000] hfa384x_setup_bap()
[   23.560000] hfa384x_wait_offset()
[   23.570000] hfa384x_wait_offset()
[   23.570000] wifi0: NIC: id=0x801b v1.0.0
[   23.570000] prism2_get_version_info: return 0
[   23.580000] prism2_get_version_info(rid fd02, txt PRI)
[   23.580000] hfa384x_get_rid()
[   23.590000] hfa384x_cmd()
[   23.590000] hfa384x_cmd_issue()
[   23.590000] prism2_interrupt()
[   23.590000] prism2_check_magic()
[   23.600000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   23.600000] prism2_interrupt: ev 8010
[   23.610000] prism2_cmd_ev()
[   23.610000] hostap_cmd_queue_free()
[   23.610000] __hostap_cmd_queue_free()
[   23.620000] hostap_cmd_queue_free()
[   23.630000] __hostap_cmd_queue_free()
[   23.630000] hfa384x_setup_bap()
[   23.630000] hfa384x_wait_offset()
[   23.640000] hfa384x_wait_offset()
[   23.640000] wifi0: PRI: id=0x15 v1.1.1
[   23.650000] prism2_get_version_info: return 0
[   23.650000] prism2_get_version_info(rid fd20, txt STA)
[   23.650000] hfa384x_get_rid()
[   23.660000] hfa384x_cmd()
[   23.660000] hfa384x_cmd_issue()
[   23.660000] prism2_interrupt()
[   23.670000] prism2_check_magic()
[   23.670000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   23.680000] prism2_interrupt: ev 8010
[   23.680000] prism2_cmd_ev()
[   23.680000] hostap_cmd_queue_free()
[   23.690000] __hostap_cmd_queue_free()
[   23.690000] hostap_cmd_queue_free()
[   23.690000] __hostap_cmd_queue_free()
[   23.700000] hfa384x_setup_bap()
[   23.700000] hfa384x_wait_offset()
[   23.700000] hfa384x_wait_offset()
[   23.710000] wifi0: STA: id=0x1f v1.8.0
[   23.710000] prism2_get_version_info: return 0
[   23.710000] hfa384x_disable_interrupts()
[   23.720000] prism2_hw_init2: allocate TX FIDs
[   23.720000] hfa384x_allocate_fid()
[   23.730000] hfa384x_cmd_wait()
[   23.730000] __hfa384x_cmd_no_wait()
[   23.750000] hfa384x_allocate_fid()
[   23.750000] hfa384x_cmd_wait()
[   23.750000] __hfa384x_cmd_no_wait()
[   24.150000] hfa384x_allocate_fid()
[   24.150000] hfa384x_cmd_wait()
[   24.150000] __hfa384x_cmd_no_wait()
[   24.160000] hfa384x_allocate_fid()
[   24.160000] hfa384x_cmd_wait()
[   24.170000] __hfa384x_cmd_no_wait()
[   24.170000] hfa384x_allocate_fid()
[   24.180000] hfa384x_cmd_wait()
[   24.180000] __hfa384x_cmd_no_wait()
[   24.190000] hfa384x_allocate_fid()
[   24.190000] hfa384x_cmd_wait()
[   24.190000] __hfa384x_cmd_no_wait()
[   24.200000] hfa384x_allocate_fid()
[   24.200000] hfa384x_cmd_wait()
[   24.200000] __hfa384x_cmd_no_wait()
[   24.210000] hfa384x_allocate_fid()
[   24.210000] hfa384x_cmd_wait()
[   24.220000] __hfa384x_cmd_no_wait()
[   24.220000] hfa384x_events_only_cmd()
[   24.230000] prism2_check_sta_fw_version()
[   24.230000] hfa384x_get_rid()
[   24.230000] hfa384x_cmd()
[   24.240000] hfa384x_cmd_issue()
[   24.240000] prism2_interrupt()
[   24.240000] prism2_check_magic()
[   24.250000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   24.250000] prism2_interrupt: ev 8010
[   24.260000] prism2_cmd_ev()
[   24.260000] hostap_cmd_queue_free()
[   24.260000] __hostap_cmd_queue_free()
[   24.270000] hostap_cmd_queue_free()
[   24.270000] __hostap_cmd_queue_free()
[   24.270000] hfa384x_setup_bap()
[   24.280000] hfa384x_wait_offset()
[   24.280000] hfa384x_wait_offset()
[   24.280000] prism2_hw_init2: get MAC
[   24.290000] hfa384x_get_rid()
[   24.290000] hfa384x_cmd()
[   24.290000] hfa384x_cmd_issue()
[   24.300000] prism2_interrupt()
[   24.300000] prism2_check_magic()
[   24.300000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   24.310000] prism2_interrupt: ev 8010
[   24.310000] prism2_cmd_ev()
[   24.310000] hostap_cmd_queue_free()
[   24.320000] __hostap_cmd_queue_free()
[   24.320000] hostap_cmd_queue_free()
[   24.320000] __hostap_cmd_queue_free()
[   24.330000] hfa384x_setup_bap()
[   24.330000] hfa384x_wait_offset()
[   24.340000] hfa384x_wait_offset()
[   24.340000] prism2_hw_init2: setup rids
[   24.340000] prism2_setup_rids()
[   24.350000] hfa384x_set_rid()
[   24.350000] hfa384x_setup_bap()
[   24.350000] hfa384x_wait_offset()
[   24.350000] hfa384x_wait_offset()
[   24.360000] hfa384x_cmd()
[   24.360000] hfa384x_cmd_issue()
[   24.360000] prism2_interrupt()
[   24.370000] prism2_check_magic()
[   24.370000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   24.380000] prism2_interrupt: ev 8010
[   24.380000] prism2_cmd_ev()
[   24.380000] hostap_cmd_queue_free()
[   24.390000] __hostap_cmd_queue_free()
[   24.390000] hostap_cmd_queue_free()
[   24.390000] __hostap_cmd_queue_free()
[   24.400000] hfa384x_set_rid()
[   24.400000] hfa384x_setup_bap()
[   24.400000] hfa384x_wait_offset()
[   24.410000] hfa384x_wait_offset()
[   24.410000] hfa384x_cmd()
[   24.410000] hfa384x_cmd_issue()
[   24.420000] prism2_interrupt()
[   24.420000] prism2_check_magic()
[   24.420000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   24.430000] prism2_interrupt: ev 0010
[   24.430000] prism2_cmd_ev()
[   24.430000] hostap_cmd_queue_free()
[   24.440000] __hostap_cmd_queue_free()
[   24.440000] hostap_cmd_queue_free()
[   24.450000] __hostap_cmd_queue_free()
[   24.450000] hfa384x_set_rid()
[   24.450000] hfa384x_setup_bap()
[   24.450000] hfa384x_wait_offset()
[   24.460000] prism2_interrupt()
[   24.460000] prism2_check_magic()
[   24.460000] prism2_check_magic: SWSUPPORT0 != HFA384X_MAGIC
[   24.470000] prism2_check_magic: !local->hw_ready
[   24.470000] prism2_interrupt: ev 0000
[   24.480000] hfa384x_wait_offset()
[   24.480000] hfa384x_cmd()
[   24.480000] hfa384x_cmd_issue()
[   24.830000] hostap_tick_timer()
[   26.490000] wifi0: hfa384x_cmd: entry still in list? (entry=c3b79e60, 
type=0, res=0)
[   26.490000] wifi0: hfa384x_cmd: command was not completed (res=0, 
entry=c3b79e60, type=0, cmd=0x0121, param0=0xfc04, EVSTAT=b4c0 INTEN=b4c0)
[   26.510000] hostap_cmd_queue_free()
[   26.510000] __hostap_cmd_queue_free()
[   26.510000] wifi0: hfa384x_set_rid: CMDCODE_ACCESS_WRITE failed (res=-110, 
rid=fc04, len=34)
[   26.520000] wifi0: AP own SSID setting failed
[   26.530000] prism2_hw_init2: return 0
[   26.530000] prism2_hw_config: local->pri_only 0, initial 1, 
local->num_dev_open 0
[   26.540000] prism2_hw_config: return 0
[   26.540000] hostap_hw_ready()
[   26.560000] wifi0: registered netdevice wlan0
[   26.830000] hostap_tick_timer()
[   28.830000] hostap_tick_timer()
[   30.830000] hostap_tick_timer()
[   32.830000] hostap_tick_timer()
[   34.830000] hostap_tick_timer()

That was the first time the thingy didn't expose the hangup.

However, with a "grep . /proc/net/hostap/wlan0/*" I brought the driver into a 
hard hang again. The culprit was "aux_dump", where in 
prism2_download_aux_dump() the function prism2_enable_aux_port() was hanging.

After the next reboot (and after disabling the printk of hostap_tick_timer), 
the thingy couldn't complete prism2_hw_init2() correctly:

[   16.210000] hostap_crypt: registered algorithm 'NULL'
[   16.340000] hostap_cs: CVS (Jouni Malinen <jkmaline at cc.hut.fi>)
[   16.640000] prism2_init_local_data()
[   16.930000] hostap_cs: Registered netdevice wifi0
[   16.980000] hostap_cs: index 0x01: Vcc 3.3, irq 45, io 
0xc88a0000-0xc88a003f
[   16.980000] prism2_hw_config()
[   16.990000] prism2_hw_init()
[   16.990000] hfa384x_cmd_no_wait()
[   16.990000] __hfa384x_cmd_no_wait()
[   17.000000] prism2_hw_init: hfa384x_cmd_no_wait returned 0
[   17.000000] prism2_hw_init: first 1
[   17.000000] prism2_hw_init: EVSTAT 8000
[   17.010000] prism2_hw_init: while loop start
[   17.290000] prism2_hw_init: while loop end
[   17.290000] prism2_hw_init: initialized in 280 ms
[   17.290000] prism2_hw_init: return 0
[   17.300000] prism2_hw_init2()
[   17.300000] prism2_hw_init2: pda 00000000
[   17.310000] hfa384x_disable_interrupts()
[   17.310000] prism2_hw_init2: initial 1, pri_only 0
[   17.310000] hfa384x_events_only_cmd()
[   17.320000] prism2_get_version_info(rid fd0b, txt NIC)
[   17.320000] hfa384x_get_rid()
[   17.330000] hfa384x_cmd()
[   17.330000] hfa384x_cmd_issue()
[   17.330000] prism2_interrupt()
[   17.340000] prism2_check_magic()
[   17.340000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   17.340000] prism2_interrupt: ev 8010
[   17.350000] prism2_cmd_ev()
[   17.350000] hostap_cmd_queue_free()
[   17.350000] __hostap_cmd_queue_free()
[   17.370000] hostap_cmd_queue_free()
[   17.370000] __hostap_cmd_queue_free()
[   17.380000] hfa384x_setup_bap()
[   17.380000] hfa384x_wait_offset()
[   17.380000] hfa384x_wait_offset()
[   17.390000] wifi0: NIC: id=0x801b v1.0.0
[   17.390000] prism2_get_version_info: return 0
[   17.400000] prism2_get_version_info(rid fd02, txt PRI)
[   17.400000] hfa384x_get_rid()
[   17.400000] hfa384x_cmd()
[   17.410000] hfa384x_cmd_issue()
[   17.410000] prism2_interrupt()
[   17.410000] prism2_check_magic()
[   17.420000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   17.420000] prism2_interrupt: ev 8010
[   17.420000] prism2_cmd_ev()
[   17.430000] hostap_cmd_queue_free()
[   17.430000] __hostap_cmd_queue_free()
[   17.450000] hostap_cmd_queue_free()
[   17.450000] __hostap_cmd_queue_free()
[   17.450000] hfa384x_setup_bap()
[   17.460000] hfa384x_wait_offset()
[   17.460000] hfa384x_wait_offset()
[   17.460000] prism2_interrupt()
[   17.470000] prism2_check_magic()
[   17.470000] prism2_check_magic: SWSUPPORT0 != HFA384X_MAGIC
[   17.480000] prism2_check_magic: !local->hw_ready
[   17.480000] prism2_interrupt: ev 0000
[   17.480000] Could not get RID for component PRI
[   17.490000] prism2_hw_init2: failed to READ NIC or PRI
[   17.490000] hfa384x_disable_interrupts()
[   17.500000] hostap_cs: Initialization failed
[   17.500000] prism2_hw_init2: return 1
[   17.510000] prism2_hw_config: prism2_hw_init2() != 0, return 1

And at the next reboot again something different:

[   67.880000] hostap_crypt: registered algorithm 'NULL'
[   68.240000] hostap_cs: CVS (Jouni Malinen <jkmaline at cc.hut.fi>)
[   68.530000] prism2_init_local_data()
[   68.820000] hostap_cs: Registered netdevice wifi0
[   68.870000] hostap_cs: index 0x01: Vcc 3.3, irq 45, io 
0xc88a0000-0xc88a003f
[   68.870000] prism2_hw_config()
[   68.880000] prism2_hw_init()
[   68.880000] hfa384x_cmd_no_wait()
[   68.880000] __hfa384x_cmd_no_wait()
[   68.890000] prism2_hw_init: hfa384x_cmd_no_wait returned 0
[   68.890000] prism2_hw_init: first 1
[   68.890000] prism2_hw_init: EVSTAT 8000
[   68.900000] prism2_hw_init: while loop start
[   69.360000] prism2_hw_init: while loop end
[   69.360000] prism2_hw_init: initialized in 460 ms
[   69.370000] prism2_hw_init: return 0
[   69.370000] prism2_hw_init2()
[   69.370000] prism2_hw_init2: pda 00000000
[   69.380000] hfa384x_disable_interrupts()
[   69.380000] prism2_hw_init2: initial 1, pri_only 0
[   69.390000] hfa384x_events_only_cmd()
[   69.390000] prism2_get_version_info(rid fd0b, txt NIC)
[   69.400000] hfa384x_get_rid()
[   69.400000] hfa384x_cmd()
[   69.400000] hfa384x_cmd_issue()
[   69.410000] prism2_interrupt()
[   69.410000] prism2_check_magic()
[   69.410000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   69.420000] prism2_interrupt: ev 8010
[   69.420000] prism2_cmd_ev()
[   69.420000] hostap_cmd_queue_free()
[   69.430000] __hostap_cmd_queue_free()
[   69.440000] hostap_cmd_queue_free()
[   69.450000] __hostap_cmd_queue_free()
[   69.450000] hfa384x_setup_bap()
[   69.450000] hfa384x_wait_offset()
[   69.460000] hfa384x_wait_offset()
[   69.460000] wifi0: NIC: id=0x801b v1.0.0
[   69.460000] prism2_get_version_info: return 0
[   69.470000] prism2_get_version_info(rid fd02, txt PRI)
[   69.470000] hfa384x_get_rid()
[   69.480000] hfa384x_cmd()
[   69.480000] hfa384x_cmd_issue()
[   69.480000] prism2_interrupt()
[   69.490000] prism2_check_magic()
[   69.490000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   69.500000] prism2_interrupt: ev 8010
[   69.500000] prism2_cmd_ev()
[   69.500000] hostap_cmd_queue_free()
[   69.510000] __hostap_cmd_queue_free()
[   69.520000] hostap_cmd_queue_free()
[   69.520000] __hostap_cmd_queue_free()
[   69.530000] hfa384x_setup_bap()
[   69.530000] hfa384x_wait_offset()
[   69.530000] hfa384x_wait_offset()
[   69.540000] wifi0: PRI: id=0x15 v1.1.1
[   69.540000] prism2_get_version_info: return 0
[   69.540000] prism2_get_version_info(rid fd20, txt STA)
[   69.550000] hfa384x_get_rid()
[   69.550000] hfa384x_cmd()
[   69.560000] hfa384x_cmd_issue()
[   69.560000] prism2_interrupt()
[   69.560000] prism2_check_magic()
[   69.570000] prism2_check_magic: SWSUPPORT0 == HFA384X_MAGIC
[   69.570000] prism2_interrupt: ev 8010
[   69.570000] prism2_cmd_ev()
[   69.580000] hostap_cmd_queue_free()
[   69.580000] __hostap_cmd_queue_free()
[   69.580000] hostap_cmd_queue_free()
[   69.590000] __hostap_cmd_queue_free()
[   69.590000] hfa384x_setup_bap()
[   69.600000] hfa384x_wait_offset()
[   69.600000] hfa384x_wait_offset()
[   69.600000] wifi0: STA: id=0x1f v1.8.0
[   69.610000] prism2_get_version_info: return 0
[   69.610000] hfa384x_disable_interrupts()
[   69.610000] prism2_hw_init2: allocate TX FIDs
[   69.620000] hfa384x_allocate_fid()
[   69.620000] hfa384x_cmd_wait()
[   69.620000] __hfa384x_cmd_no_wait()
[   69.660000] hfa384x_allocate_fid()
[   69.670000] hfa384x_cmd_wait()
[   69.670000] __hfa384x_cmd_no_wait()
[   69.680000] hfa384x_allocate_fid()
[   69.680000] hfa384x_cmd_wait()
[   69.680000] __hfa384x_cmd_no_wait()
[   69.690000] hfa384x_allocate_fid()
[   69.690000] hfa384x_cmd_wait()
[   69.700000] __hfa384x_cmd_no_wait()
[   69.700000] hfa384x_allocate_fid()
[   69.710000] hfa384x_cmd_wait()
[   69.710000] __hfa384x_cmd_no_wait()
[   69.720000] hfa384x_allocate_fid()
[   69.720000] hfa384x_cmd_wait()
[   69.720000] __hfa384x_cmd_no_wait()
[   69.730000] hfa384x_allocate_fid()
[   69.730000] hfa384x_cmd_wait()
[   69.740000] __hfa384x_cmd_no_wait()
[   69.740000] prism2_interrupt()
[   69.740000] prism2_check_magic()
[   69.750000] prism2_check_magic: SWSUPPORT0 != HFA384X_MAGIC
[   69.750000] prism2_check_magic: !local->hw_ready
[   69.760000] prism2_interrupt: ev 0000
...
[1223925642.479551] wifi0: fid allocate, len=2364 - timeout
[1223925642.479551] hfa384x_allocate_fid()
[1223925642.489551] hfa384x_cmd_wait()

This time it hanged hard again.





All of this is weird. I had cards in my device where I used the Agere Hermes1 
driver (wlags49_h2_cs.ko), the Orinoco driver, some serial_cs based GPS 
module. Never did I get three different results when I inserted one of those 
cards.



More information about the HostAP mailing list