]> git.baikalelectronics.ru Git - kernel.git/commit
iwlwifi: pcie: reschedule in long-running memory reads
authorJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jan 2021 11:05:58 +0000 (13:05 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 25 Jan 2021 13:53:11 +0000 (15:53 +0200)
commit977d806db5f4c5ff84155e34d8bb479d5c1dde5d
tree206aa0879b013da97a31ef9c9d2c51427805e609
parentbcbdd1ff66b24c7e463d23de4a0c0f1f7c080ff4
iwlwifi: pcie: reschedule in long-running memory reads

If we spin for a long time in memory reads that (for some reason in
hardware) take a long time, then we'll eventually get messages such
as

  watchdog: BUG: soft lockup - CPU#2 stuck for 24s! [kworker/2:2:272]

This is because the reading really does take a very long time, and
we don't schedule, so we're hogging the CPU with this task, at least
if CONFIG_PREEMPT is not set, e.g. with CONFIG_PREEMPT_VOLUNTARY=y.

Previously I misinterpreted the situation and thought that this was
only going to happen if we had interrupts disabled, and then fixed
this (which is good anyway, however), but that didn't always help;
looking at it again now I realized that the spin unlock will only
reschedule if CONFIG_PREEMPT is used.

In order to avoid this issue, change the code to cond_resched() if
we've been spinning for too long here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: 0d5e285c5a66 ("iwlwifi: pcie: limit memory read spin time")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20210115130253.217a9d6a6a12.If964cb582ab0aaa94e81c4ff3b279eaafda0fd3f@changeid
drivers/net/wireless/intel/iwlwifi/pcie/trans.c