* Re: WARNING at net/mac80211/sta_info.c:1057 (__sta_info_destroy_part2())
[not found] <CAHk-=wgBuu8PiYpD7uWgxTSY8aUOJj6NJ=ivNQPYjAKO=cRinA@mail.gmail.com>
@ 2019-09-11 18:10 ` Kalle Valo
2019-10-20 15:12 ` Tomislav Požega
[not found] ` <feecebfcceba521703f13c8ee7f5bb9016924cb6.camel@sipsolutions.net>
1 sibling, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2019-09-11 18:10 UTC (permalink / raw)
To: Linus Torvalds
Cc: Netdev, linux-wireless, Linux List Kernel Mailing, ath10k,
Johannes Berg, David S. Miller
+ ath10k list
Linus Torvalds <torvalds@linux-foundation.org> writes:
> So I'm at LCA, reading email, using my laptop more than I normally do,
> and with different networking than I normally do.
>
> And I just had a 802.11 WARN_ON() trigger, followed by essentially a
> dead machine due to some lock held (maybe rtnl_lock).
>
> It's possible that the lock held thing happened before, and is the
> _reason_ for the delay, I don't know. I had to reboot the machine, but
> I gathered as much information as made sense and was obvious before I
> did so. That's appended.
Some notes while investigating this:
> But wait!
>
> ... then 10+ minutes later:
>
> ath10k_pci 0000:02:00.0: wmi command 16387 timeout, restarting hardware
> ath10k_pci 0000:02:00.0: failed to set 5g txpower 23: -11
> ath10k_pci 0000:02:00.0: failed to setup tx power 23: -11
> ath10k_pci 0000:02:00.0: failed to recalc tx power: -11
> ath10k_pci 0000:02:00.0: failed to set inactivity time for vdev 0: -108
> ath10k_pci 0000:02:00.0: failed to setup powersave: -108
>
> That certainly looks like something did try to set a power limit, but
> eventually failed.
I suspect the failing WMI command is called from:
ath10k_bss_info_changed()
ath10k_mac_txpower_recalc()
ath10k_mac_txpower_setup()
ath10k_wmi_pdev_set_param()
ath10k_wmi_cmd_send()
ath10k_wmi_cmd_send_nowait()
ath10k_htc_send()
-11 is -EAGAIN which would mean that the HTC credits have run out some
reason for the WMI command:
if (ep->tx_credits < credits) {
ath10k_dbg(ar, ATH10K_DBG_HTC,
"htc insufficient credits ep %d required %d available %d\n",
eid, credits, ep->tx_credits);
spin_unlock_bh(&htc->tx_lock);
ret = -EAGAIN;
goto err_pull;
}
Credits can run out, for example, if there's a lot of WMI command/event
activity and are not returned during the 3s wait, firmware crashed or
problems with the PCI bus. But when the WMI command timeout happens
ath10k is supposed to restart the firmware and everything should be
usable again.
> Immediately after that:
>
> wlp2s0: deauthenticating from 54:ec:2f:05:70:2c by local choice
> (Reason: 3=DEAUTH_LEAVING)
> ath10k_pci 0000:02:00.0: failed to read hi_board_data address: -16
> ath10k_pci 0000:02:00.0: failed to receive initialized event from
> target: 00000000
> ath10k_pci 0000:02:00.0: failed to receive initialized event from
> target: 00000000
> ath10k_pci 0000:02:00.0: failed to wait for target init: -110
I suspect here ath10k tries to reset the target during stop operation,
"failed to receive initialized event from target" comes from:
ath10k_pci_hif_stop()
ath10k_pci_safe_chip_reset()
ath10k_pci_warm_reset()
ath10k_pci_wait_for_target_init()
It shouldn't fail like that, which makes me suspect either a low level
problem or a bug in qca6174 firmware restart code. To check the latter,
could you please try to force a firmware crash and see if firmware
restart is working for you?
To crash the firmware you need to write either "hard" or "assert" (I
forgot which one QCA6174 firmware supports) to
/sys/kernel/debug/ieee80211/phy*/ath10k/simulate_fw_crash. And what
should happen is that the firmware crashes, ath10k prints a big pile of
warnings, restarts it and in few seconds everything resumes to normal
without user space even noticing it.
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING at net/mac80211/sta_info.c:1057 (__sta_info_destroy_part2())
[not found] ` <feecebfcceba521703f13c8ee7f5bb9016924cb6.camel@sipsolutions.net>
@ 2019-09-11 18:19 ` Kalle Valo
2019-09-11 18:23 ` Johannes Berg
0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2019-09-11 18:19 UTC (permalink / raw)
To: Johannes Berg
Cc: Netdev, linux-wireless, Linux List Kernel Mailing, ath10k,
Linus Torvalds, David S. Miller, Kalle Valo
Johannes Berg <johannes@sipsolutions.net> writes:
>> ath10k_pci 0000:02:00.0: wmi command 16387 timeout, restarting hardware
>> ath10k_pci 0000:02:00.0: failed to set 5g txpower 23: -11
>> ath10k_pci 0000:02:00.0: failed to setup tx power 23: -11
>> ath10k_pci 0000:02:00.0: failed to recalc tx power: -11
>> ath10k_pci 0000:02:00.0: failed to set inactivity time for vdev 0: -108
>> ath10k_pci 0000:02:00.0: failed to setup powersave: -108
>>
>> That certainly looks like something did try to set a power limit, but
>> eventually failed.
>
> Yeah, that does seem a bit fishy. Kalle would have to comment for
> ath10k.
>
>> Immediately after that:
>>
>> wlp2s0: deauthenticating from 54:ec:2f:05:70:2c by local choice
>> (Reason: 3=DEAUTH_LEAVING)
>
> I don't _think_ any of the above would be a reason to disconnect, but it
> clearly looks like the device got stuck at this point, since everything
> just fails afterwards.
Yeah, to me it looks anything ath10k tries to do with the devie fails,
even resetting the device.
> Looks like indeed the driver gives the device at least *3 seconds* for
> every command, see ath10k_wmi_cmd_send(), so most likely this would
> eventually have finished, but who knows how many firmware commands it
> would still have attempted to send...
3 seconds is a bit short but in normal cases it should be enough. Of
course we could increase the delay but I'm skeptic it would help here.
> Perhaps the driver should mark the device as dead and fail quickly once
> it timed out once, or so, but I'll let Kalle comment on that.
Actually we do try to restart the device when a timeout happens in
ath10k_wmi_cmd_send():
if (ret == -EAGAIN) {
ath10k_warn(ar, "wmi command %d timeout, restarting hardware\n",
cmd_id);
queue_work(ar->workqueue, &ar->restart_work);
}
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING at net/mac80211/sta_info.c:1057 (__sta_info_destroy_part2())
2019-09-11 18:19 ` Kalle Valo
@ 2019-09-11 18:23 ` Johannes Berg
2019-09-11 18:48 ` Kalle Valo
0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2019-09-11 18:23 UTC (permalink / raw)
To: Kalle Valo
Cc: Netdev, linux-wireless, Linux List Kernel Mailing, ath10k,
Linus Torvalds, David S. Miller
On Wed, 2019-09-11 at 21:19 +0300, Kalle Valo wrote:
> > Looks like indeed the driver gives the device at least *3 seconds* for
> > every command, see ath10k_wmi_cmd_send(), so most likely this would
> > eventually have finished, but who knows how many firmware commands it
> > would still have attempted to send...
>
> 3 seconds is a bit short but in normal cases it should be enough. Of
> course we could increase the delay but I'm skeptic it would help here.
I was thinking 3 seconds is way too long :-)
> > Perhaps the driver should mark the device as dead and fail quickly once
> > it timed out once, or so, but I'll let Kalle comment on that.
>
> Actually we do try to restart the device when a timeout happens in
> ath10k_wmi_cmd_send():
>
> if (ret == -EAGAIN) {
> ath10k_warn(ar, "wmi command %d timeout, restarting hardware\n",
> cmd_id);
> queue_work(ar->workqueue, &ar->restart_work);
> }
Yeah, and this is the problem, in a sense, I'd think. It seems to me
that at this point the code needs to tag the device as "dead" and
immediately return from any further commands submitted to it with an
error (e.g. -EIO). You can can actually see in the initial report that
while the restart was triggered, it too is waiting to acquire the RTNL:
> Workqueue: events_freezable ieee80211_restart_work [mac80211]
> Call Trace:
> schedule+0x39/0xa0
> schedule_preempt_disabled+0xa/0x10
> __mutex_lock.isra.0+0x263/0x4b0
> ieee80211_restart_work+0x54/0xe0 [mac80211]
> process_one_work+0x1cf/0x370
> worker_thread+0x4a/0x3c0
> kthread+0xfb/0x130
> ret_from_fork+0x35/0x40
So basically all this delay is mac80211 and the driver doing stuff with
the device, but every single thing has to time out and probably some
stuff loops etc., and then it just takes long enough with the RTNL held
that everything goes south.
johannes
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING at net/mac80211/sta_info.c:1057 (__sta_info_destroy_part2())
2019-09-11 18:23 ` Johannes Berg
@ 2019-09-11 18:48 ` Kalle Valo
0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2019-09-11 18:48 UTC (permalink / raw)
To: Johannes Berg
Cc: Netdev, linux-wireless, Linux List Kernel Mailing, ath10k,
Linus Torvalds, David S. Miller
Johannes Berg <johannes@sipsolutions.net> writes:
> On Wed, 2019-09-11 at 21:19 +0300, Kalle Valo wrote:
>> > Looks like indeed the driver gives the device at least *3 seconds* for
>> > every command, see ath10k_wmi_cmd_send(), so most likely this would
>> > eventually have finished, but who knows how many firmware commands it
>> > would still have attempted to send...
>>
>> 3 seconds is a bit short but in normal cases it should be enough. Of
>> course we could increase the delay but I'm skeptic it would help here.
>
> I was thinking 3 seconds is way too long :-)
Heh :)
>> > Perhaps the driver should mark the device as dead and fail quickly once
>> > it timed out once, or so, but I'll let Kalle comment on that.
>>
>> Actually we do try to restart the device when a timeout happens in
>> ath10k_wmi_cmd_send():
>>
>> if (ret == -EAGAIN) {
>> ath10k_warn(ar, "wmi command %d timeout, restarting hardware\n",
>> cmd_id);
>> queue_work(ar->workqueue, &ar->restart_work);
>> }
>
> Yeah, and this is the problem, in a sense, I'd think. It seems to me
> that at this point the code needs to tag the device as "dead" and
> immediately return from any further commands submitted to it with an
> error (e.g. -EIO).
Yeah, ath10k_core_restart() is supposed change to state
ATH10K_STATE_RESTARTING but very few mac80211 ops in ath10k_ops are
checking for it, and to me it looks like quite late even. I think a
proper fix for ops which can sleep is to check ar->state is
ATH10K_STATE_ON and for ops which cannot sleep check
ATH10K_FLAG_CRASH_FLUSH.
But of course this just fixes the symptoms, the root cause for timeouts
needs to be found as well.
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING at net/mac80211/sta_info.c:1057 (__sta_info_destroy_part2())
2019-09-11 18:10 ` WARNING at net/mac80211/sta_info.c:1057 (__sta_info_destroy_part2()) Kalle Valo
@ 2019-10-20 15:12 ` Tomislav Požega
2019-10-21 14:01 ` Ben Greear
0 siblings, 1 reply; 6+ messages in thread
From: Tomislav Požega @ 2019-10-20 15:12 UTC (permalink / raw)
To: kvalo
Cc: netdev, linux-wireless, linux-kernel, ath10k, johannes, torvalds,
davem
> -11 is -EAGAIN which would mean that the HTC credits have run out some
> reason for the WMI command:
>
> if (ep->tx_credits < credits) {
> ath10k_dbg(ar, ATH10K_DBG_HTC,
> "htc insufficient credits ep %d required %d available %d\n",
> eid, credits, ep->tx_credits);
> spin_unlock_bh(&htc->tx_lock);
> ret = -EAGAIN;
> goto err_pull;
> }
>
> Credits can run out, for example, if there's a lot of WMI command/event
> activity and are not returned during the 3s wait, firmware crashed or
> problems with the PCI bus.
Hi
Can this occur if the target memory is not properly allocated?
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING at net/mac80211/sta_info.c:1057 (__sta_info_destroy_part2())
2019-10-20 15:12 ` Tomislav Požega
@ 2019-10-21 14:01 ` Ben Greear
0 siblings, 0 replies; 6+ messages in thread
From: Ben Greear @ 2019-10-21 14:01 UTC (permalink / raw)
To: Tomislav Požega, kvalo
Cc: netdev, linux-wireless, linux-kernel, ath10k, johannes, torvalds,
davem
On 10/20/2019 08:12 AM, Tomislav Požega wrote:
>> -11 is -EAGAIN which would mean that the HTC credits have run out some
>> reason for the WMI command:
>>
>> if (ep->tx_credits < credits) {
>> ath10k_dbg(ar, ATH10K_DBG_HTC,
>> "htc insufficient credits ep %d required %d available %d\n",
>> eid, credits, ep->tx_credits);
>> spin_unlock_bh(&htc->tx_lock);
>> ret = -EAGAIN;
>> goto err_pull;
>> }
>>
>> Credits can run out, for example, if there's a lot of WMI command/event
>> activity and are not returned during the 3s wait, firmware crashed or
>> problems with the PCI bus.
>
> Hi
>
> Can this occur if the target memory is not properly allocated?
I have only seen this on wave-1 cards, and it is usually paired with situations
where the wave-1 stops doing WMI related interrupts properly as best as I can
understand. If I force the firmware to poll instead of waiting for irqs, then
WMI communication will work for a while...I have not implemented that on the
driver side though, so I still see these WMI timeout issues.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-10-21 14:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAHk-=wgBuu8PiYpD7uWgxTSY8aUOJj6NJ=ivNQPYjAKO=cRinA@mail.gmail.com>
2019-09-11 18:10 ` WARNING at net/mac80211/sta_info.c:1057 (__sta_info_destroy_part2()) Kalle Valo
2019-10-20 15:12 ` Tomislav Požega
2019-10-21 14:01 ` Ben Greear
[not found] ` <feecebfcceba521703f13c8ee7f5bb9016924cb6.camel@sipsolutions.net>
2019-09-11 18:19 ` Kalle Valo
2019-09-11 18:23 ` Johannes Berg
2019-09-11 18:48 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox