1
0
Files
linux/drivers/net
Reinette Chatre fbc9f97bbf iwlwifi: do not cancel delayed work inside spin_lock_irqsave
Calling cancel_delayed_work() from inside
spin_lock_irqsave, introduces a potential deadlock.

As explained by Johannes Berg <johannes@sipsolutions.net>

A - lock
T - timer

phase                   CPU 1           CPU 2
---------------------------------------------

some place that calls
cancel_timer_sync()
(which is the | code)
                                        lock-irq(A)
|                                       "lock-irq"(T)
|                                       "unlock"(T)
|                                       wait(T)
                                        unlock(A)

timer softirq
                        "lock"(T)
                        run(T)
                        "unlock"(T)

irq handler
          lock(A)
          unlock(A)

Now all that again, interleaved, leading to deadlock:

                                        lock-irq(A)
                        "lock"(T)
                         run(T)
IRQ during or maybe
before run(T) -->        lock(A)
                                        "lock-irq"(T)
                                        wait(T)

We fix this by moving the call to cancel_delayed_work() into workqueue.
There are cases where the work may not actually be queued or running
at the time we are trying to cancel it, but cancel_delayed_work() is
able to deal with this.

Also cleanup iwl_set_mode related to this call. This function
(iwl_set_mode) is only called when bringing interface up and there will
thus not be any scanning done. No need to try to cancel scanning.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=13224, which was also
reported at http://marc.info/?l=linux-wireless&m=124081921903223&w=2 .

Tested-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-20 14:29:53 -04:00
..
2009-04-13 15:16:33 -07:00
2009-05-04 21:28:13 -07:00
2009-05-04 11:06:37 -07:00
2009-04-11 02:06:43 -07:00
2009-05-04 12:01:43 -07:00
2009-03-27 00:46:38 -07:00
2009-04-22 00:43:24 -07:00
2009-04-14 21:57:00 -07:00
2009-04-11 02:53:46 -07:00
2009-04-14 21:57:02 -07:00
2009-04-14 21:57:03 -07:00
2009-04-04 16:51:14 -07:00
2009-05-06 16:46:47 -07:00
2009-04-04 16:51:14 -07:00
2009-03-02 22:32:48 -08:00
2009-02-15 23:32:01 -08:00
2009-02-15 23:32:01 -08:00
2009-02-15 23:32:01 -08:00
2009-03-02 22:32:43 -08:00
2009-04-14 21:57:04 -07:00
2009-04-08 15:56:33 -07:00
2009-04-08 15:44:45 -07:00
2009-02-01 00:58:26 -08:00
2009-04-27 02:40:51 -07:00
2009-04-02 13:57:30 -07:00
2009-02-04 16:43:44 -08:00
2009-04-02 01:13:47 -07:00
2009-02-26 21:02:19 -08:00
2009-04-13 15:16:31 -07:00
2009-04-20 02:15:01 -07:00
2009-03-27 00:46:48 -07:00
2009-04-13 15:16:29 -07:00
2009-04-13 15:16:26 -07:00
2009-04-04 16:38:42 -07:00
2009-03-27 00:46:53 -07:00
2009-03-27 00:46:53 -07:00
2009-03-28 23:37:27 -07:00
2009-04-08 15:52:16 -07:00
2009-03-13 16:09:12 -07:00
2009-03-13 16:09:12 -07:00
2009-03-13 16:09:12 -07:00
2009-04-08 15:50:43 -07:00
2009-04-13 15:16:25 -07:00
2009-03-27 00:46:48 -07:00
2009-03-20 00:51:22 -07:00
2009-04-13 15:16:23 -07:00
2009-04-20 14:52:29 -07:00
2009-04-13 15:16:21 -07:00