<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/wireless/reg.c, branch v3.0.95</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>wireless: regulatory: fix channel disabling race condition</title>
<updated>2013-05-08T02:57:27+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-04-16T12:32:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2a51f02ccc6fac30f8cdb7e5f2791b2fe43d129'/>
<id>d2a51f02ccc6fac30f8cdb7e5f2791b2fe43d129</id>
<content type='text'>
commit 990de49f74e772b6db5208457b7aa712a5f4db86 upstream.

When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz
part of the scan disables a 5.2 GHz channel due to, e.g. receiving
country or frequency information, that 5.2 GHz channel might already
be in the list of channels to scan next. Then, when the driver checks
if it should do a passive scan, that will return false and attempt an
active scan. This is not only wrong but can also lead to the iwlwifi
device firmware crashing since it checks regulatory as well.

Fix this by not setting the channel flags to just disabled but rather
OR'ing in the disabled flag. That way, even if the race happens, the
channel will be scanned passively which is still (mostly) correct.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 990de49f74e772b6db5208457b7aa712a5f4db86 upstream.

When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz
part of the scan disables a 5.2 GHz channel due to, e.g. receiving
country or frequency information, that 5.2 GHz channel might already
be in the list of channels to scan next. Then, when the driver checks
if it should do a passive scan, that will return false and attempt an
active scan. This is not only wrong but can also lead to the iwlwifi
device firmware crashing since it checks regulatory as well.

Fix this by not setting the channel flags to just disabled but rather
OR'ing in the disabled flag. That way, even if the race happens, the
channel will be scanned passively which is still (mostly) correct.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>wireless: allow 40 MHz on world roaming channels 12/13</title>
<updated>2012-11-26T19:34:35+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2012-11-12T09:51:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7e2c753a06883b35bf627c13211785b15002de0f'/>
<id>7e2c753a06883b35bf627c13211785b15002de0f</id>
<content type='text'>
commit 43c771a1963ab461a2f194e3c97fded1d5fe262f upstream.

When in world roaming mode, allow 40 MHz to be used
on channels 12 and 13 so that an AP that is, e.g.,
using HT40+ on channel 9 (in the UK) can be used.

Reported-by: Eddie Chapman &lt;eddie@ehuk.net&gt;
Tested-by: Eddie Chapman &lt;eddie@ehuk.net&gt;
Acked-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 43c771a1963ab461a2f194e3c97fded1d5fe262f upstream.

When in world roaming mode, allow 40 MHz to be used
on channels 12 and 13 so that an AP that is, e.g.,
using HT40+ on channel 9 (in the UK) can be used.

Reported-by: Eddie Chapman &lt;eddie@ehuk.net&gt;
Tested-by: Eddie Chapman &lt;eddie@ehuk.net&gt;
Acked-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cfg80211: fix possible circular lock on reg_regdb_search()</title>
<updated>2012-10-02T16:47:37+00:00</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@do-not-panic.com</email>
</author>
<published>2012-09-14T22:36:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2cfb6b1d3632beffef774aad1f7b906fe1934fb2'/>
<id>2cfb6b1d3632beffef774aad1f7b906fe1934fb2</id>
<content type='text'>
commit a85d0d7f3460b1a123b78e7f7e39bf72c37dfb78 upstream.

When call_crda() is called we kick off a witch hunt search
for the same regulatory domain on our internal regulatory
database and that work gets kicked off on a workqueue, this
is done while the cfg80211_mutex is held. If that workqueue
kicks off it will first lock reg_regdb_search_mutex and
later cfg80211_mutex but to ensure two CPUs will not contend
against cfg80211_mutex the right thing to do is to have the
reg_regdb_search() wait until the cfg80211_mutex is let go.

The lockdep report is pasted below.

cfg80211: Calling CRDA to update world regulatory domain

======================================================
[ INFO: possible circular locking dependency detected ]
3.3.8 #3 Tainted: G           O
-------------------------------------------------------
kworker/0:1/235 is trying to acquire lock:
 (cfg80211_mutex){+.+...}, at: [&lt;816468a4&gt;] set_regdom+0x78c/0x808 [cfg80211]

but task is already holding lock:
 (reg_regdb_search_mutex){+.+...}, at: [&lt;81646828&gt;] set_regdom+0x710/0x808 [cfg80211]

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #2 (reg_regdb_search_mutex){+.+...}:
       [&lt;800a8384&gt;] lock_acquire+0x60/0x88
       [&lt;802950a8&gt;] mutex_lock_nested+0x54/0x31c
       [&lt;81645778&gt;] is_world_regdom+0x9f8/0xc74 [cfg80211]

-&gt; #1 (reg_mutex#2){+.+...}:
       [&lt;800a8384&gt;] lock_acquire+0x60/0x88
       [&lt;802950a8&gt;] mutex_lock_nested+0x54/0x31c
       [&lt;8164539c&gt;] is_world_regdom+0x61c/0xc74 [cfg80211]

-&gt; #0 (cfg80211_mutex){+.+...}:
       [&lt;800a77b8&gt;] __lock_acquire+0x10d4/0x17bc
       [&lt;800a8384&gt;] lock_acquire+0x60/0x88
       [&lt;802950a8&gt;] mutex_lock_nested+0x54/0x31c
       [&lt;816468a4&gt;] set_regdom+0x78c/0x808 [cfg80211]

other info that might help us debug this:

Chain exists of:
  cfg80211_mutex --&gt; reg_mutex#2 --&gt; reg_regdb_search_mutex

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(reg_regdb_search_mutex);
                               lock(reg_mutex#2);
                               lock(reg_regdb_search_mutex);
  lock(cfg80211_mutex);

 *** DEADLOCK ***

3 locks held by kworker/0:1/235:
 #0:  (events){.+.+..}, at: [&lt;80089a00&gt;] process_one_work+0x230/0x460
 #1:  (reg_regdb_work){+.+...}, at: [&lt;80089a00&gt;] process_one_work+0x230/0x460
 #2:  (reg_regdb_search_mutex){+.+...}, at: [&lt;81646828&gt;] set_regdom+0x710/0x808 [cfg80211]

stack backtrace:
Call Trace:
[&lt;80290fd4&gt;] dump_stack+0x8/0x34
[&lt;80291bc4&gt;] print_circular_bug+0x2ac/0x2d8
[&lt;800a77b8&gt;] __lock_acquire+0x10d4/0x17bc
[&lt;800a8384&gt;] lock_acquire+0x60/0x88
[&lt;802950a8&gt;] mutex_lock_nested+0x54/0x31c
[&lt;816468a4&gt;] set_regdom+0x78c/0x808 [cfg80211]

Reported-by: Felix Fietkau &lt;nbd@openwrt.org&gt;
Tested-by: Felix Fietkau &lt;nbd@openwrt.org&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@do-not-panic.com&gt;
Reviewed-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a85d0d7f3460b1a123b78e7f7e39bf72c37dfb78 upstream.

When call_crda() is called we kick off a witch hunt search
for the same regulatory domain on our internal regulatory
database and that work gets kicked off on a workqueue, this
is done while the cfg80211_mutex is held. If that workqueue
kicks off it will first lock reg_regdb_search_mutex and
later cfg80211_mutex but to ensure two CPUs will not contend
against cfg80211_mutex the right thing to do is to have the
reg_regdb_search() wait until the cfg80211_mutex is let go.

The lockdep report is pasted below.

cfg80211: Calling CRDA to update world regulatory domain

======================================================
[ INFO: possible circular locking dependency detected ]
3.3.8 #3 Tainted: G           O
-------------------------------------------------------
kworker/0:1/235 is trying to acquire lock:
 (cfg80211_mutex){+.+...}, at: [&lt;816468a4&gt;] set_regdom+0x78c/0x808 [cfg80211]

but task is already holding lock:
 (reg_regdb_search_mutex){+.+...}, at: [&lt;81646828&gt;] set_regdom+0x710/0x808 [cfg80211]

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #2 (reg_regdb_search_mutex){+.+...}:
       [&lt;800a8384&gt;] lock_acquire+0x60/0x88
       [&lt;802950a8&gt;] mutex_lock_nested+0x54/0x31c
       [&lt;81645778&gt;] is_world_regdom+0x9f8/0xc74 [cfg80211]

-&gt; #1 (reg_mutex#2){+.+...}:
       [&lt;800a8384&gt;] lock_acquire+0x60/0x88
       [&lt;802950a8&gt;] mutex_lock_nested+0x54/0x31c
       [&lt;8164539c&gt;] is_world_regdom+0x61c/0xc74 [cfg80211]

-&gt; #0 (cfg80211_mutex){+.+...}:
       [&lt;800a77b8&gt;] __lock_acquire+0x10d4/0x17bc
       [&lt;800a8384&gt;] lock_acquire+0x60/0x88
       [&lt;802950a8&gt;] mutex_lock_nested+0x54/0x31c
       [&lt;816468a4&gt;] set_regdom+0x78c/0x808 [cfg80211]

other info that might help us debug this:

Chain exists of:
  cfg80211_mutex --&gt; reg_mutex#2 --&gt; reg_regdb_search_mutex

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(reg_regdb_search_mutex);
                               lock(reg_mutex#2);
                               lock(reg_regdb_search_mutex);
  lock(cfg80211_mutex);

 *** DEADLOCK ***

3 locks held by kworker/0:1/235:
 #0:  (events){.+.+..}, at: [&lt;80089a00&gt;] process_one_work+0x230/0x460
 #1:  (reg_regdb_work){+.+...}, at: [&lt;80089a00&gt;] process_one_work+0x230/0x460
 #2:  (reg_regdb_search_mutex){+.+...}, at: [&lt;81646828&gt;] set_regdom+0x710/0x808 [cfg80211]

stack backtrace:
Call Trace:
[&lt;80290fd4&gt;] dump_stack+0x8/0x34
[&lt;80291bc4&gt;] print_circular_bug+0x2ac/0x2d8
[&lt;800a77b8&gt;] __lock_acquire+0x10d4/0x17bc
[&lt;800a8384&gt;] lock_acquire+0x60/0x88
[&lt;802950a8&gt;] mutex_lock_nested+0x54/0x31c
[&lt;816468a4&gt;] set_regdom+0x78c/0x808 [cfg80211]

Reported-by: Felix Fietkau &lt;nbd@openwrt.org&gt;
Tested-by: Felix Fietkau &lt;nbd@openwrt.org&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@do-not-panic.com&gt;
Reviewed-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cfg80211: fix potential deadlock in regulatory</title>
<updated>2012-07-16T15:47:48+00:00</updated>
<author>
<name>Eliad Peller</name>
<email>eliad@wizery.com</email>
</author>
<published>2012-06-12T09:53:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c229e2f6bab8ed64bf44110831d36221c648e1bf'/>
<id>c229e2f6bab8ed64bf44110831d36221c648e1bf</id>
<content type='text'>
commit fe20b39ec32e975f1054c0b7866c873a954adf05 upstream.

reg_timeout_work() calls restore_regulatory_settings() which
takes cfg80211_mutex.

reg_set_request_processed() already holds cfg80211_mutex
before calling cancel_delayed_work_sync(reg_timeout),
so it might deadlock.

Call the async cancel_delayed_work instead, in order
to avoid the potential deadlock.

This is the relevant lockdep warning:

cfg80211: Calling CRDA for country: XX

======================================================
[ INFO: possible circular locking dependency detected ]
3.4.0-rc5-wl+ #26 Not tainted
-------------------------------------------------------
kworker/0:2/1391 is trying to acquire lock:
 (cfg80211_mutex){+.+.+.}, at: [&lt;bf28ae00&gt;] restore_regulatory_settings+0x34/0x418 [cfg80211]

but task is already holding lock:
 ((reg_timeout).work){+.+...}, at: [&lt;c0059e94&gt;] process_one_work+0x1f0/0x480

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #2 ((reg_timeout).work){+.+...}:
       [&lt;c008fd44&gt;] validate_chain+0xb94/0x10f0
       [&lt;c0090b68&gt;] __lock_acquire+0x8c8/0x9b0
       [&lt;c0090d40&gt;] lock_acquire+0xf0/0x114
       [&lt;c005b600&gt;] wait_on_work+0x4c/0x154
       [&lt;c005c000&gt;] __cancel_work_timer+0xd4/0x11c
       [&lt;c005c064&gt;] cancel_delayed_work_sync+0x1c/0x20
       [&lt;bf28b274&gt;] reg_set_request_processed+0x50/0x78 [cfg80211]
       [&lt;bf28bd84&gt;] set_regdom+0x550/0x600 [cfg80211]
       [&lt;bf294cd8&gt;] nl80211_set_reg+0x218/0x258 [cfg80211]
       [&lt;c03c7738&gt;] genl_rcv_msg+0x1a8/0x1e8
       [&lt;c03c6a00&gt;] netlink_rcv_skb+0x5c/0xc0
       [&lt;c03c7584&gt;] genl_rcv+0x28/0x34
       [&lt;c03c6720&gt;] netlink_unicast+0x15c/0x228
       [&lt;c03c6c7c&gt;] netlink_sendmsg+0x218/0x298
       [&lt;c03933c8&gt;] sock_sendmsg+0xa4/0xc0
       [&lt;c039406c&gt;] __sys_sendmsg+0x1e4/0x268
       [&lt;c0394228&gt;] sys_sendmsg+0x4c/0x70
       [&lt;c0013840&gt;] ret_fast_syscall+0x0/0x3c

-&gt; #1 (reg_mutex){+.+.+.}:
       [&lt;c008fd44&gt;] validate_chain+0xb94/0x10f0
       [&lt;c0090b68&gt;] __lock_acquire+0x8c8/0x9b0
       [&lt;c0090d40&gt;] lock_acquire+0xf0/0x114
       [&lt;c04734dc&gt;] mutex_lock_nested+0x48/0x320
       [&lt;bf28b2cc&gt;] reg_todo+0x30/0x538 [cfg80211]
       [&lt;c0059f44&gt;] process_one_work+0x2a0/0x480
       [&lt;c005a4b4&gt;] worker_thread+0x1bc/0x2bc
       [&lt;c0061148&gt;] kthread+0x98/0xa4
       [&lt;c0014af4&gt;] kernel_thread_exit+0x0/0x8

-&gt; #0 (cfg80211_mutex){+.+.+.}:
       [&lt;c008ed58&gt;] print_circular_bug+0x68/0x2cc
       [&lt;c008fb28&gt;] validate_chain+0x978/0x10f0
       [&lt;c0090b68&gt;] __lock_acquire+0x8c8/0x9b0
       [&lt;c0090d40&gt;] lock_acquire+0xf0/0x114
       [&lt;c04734dc&gt;] mutex_lock_nested+0x48/0x320
       [&lt;bf28ae00&gt;] restore_regulatory_settings+0x34/0x418 [cfg80211]
       [&lt;bf28b200&gt;] reg_timeout_work+0x1c/0x20 [cfg80211]
       [&lt;c0059f44&gt;] process_one_work+0x2a0/0x480
       [&lt;c005a4b4&gt;] worker_thread+0x1bc/0x2bc
       [&lt;c0061148&gt;] kthread+0x98/0xa4
       [&lt;c0014af4&gt;] kernel_thread_exit+0x0/0x8

other info that might help us debug this:

Chain exists of:
  cfg80211_mutex --&gt; reg_mutex --&gt; (reg_timeout).work

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock((reg_timeout).work);
                               lock(reg_mutex);
                               lock((reg_timeout).work);
  lock(cfg80211_mutex);

 *** DEADLOCK ***

2 locks held by kworker/0:2/1391:
 #0:  (events){.+.+.+}, at: [&lt;c0059e94&gt;] process_one_work+0x1f0/0x480
 #1:  ((reg_timeout).work){+.+...}, at: [&lt;c0059e94&gt;] process_one_work+0x1f0/0x480

stack backtrace:
[&lt;c001b928&gt;] (unwind_backtrace+0x0/0x12c) from [&lt;c0471d3c&gt;] (dump_stack+0x20/0x24)
[&lt;c0471d3c&gt;] (dump_stack+0x20/0x24) from [&lt;c008ef70&gt;] (print_circular_bug+0x280/0x2cc)
[&lt;c008ef70&gt;] (print_circular_bug+0x280/0x2cc) from [&lt;c008fb28&gt;] (validate_chain+0x978/0x10f0)
[&lt;c008fb28&gt;] (validate_chain+0x978/0x10f0) from [&lt;c0090b68&gt;] (__lock_acquire+0x8c8/0x9b0)
[&lt;c0090b68&gt;] (__lock_acquire+0x8c8/0x9b0) from [&lt;c0090d40&gt;] (lock_acquire+0xf0/0x114)
[&lt;c0090d40&gt;] (lock_acquire+0xf0/0x114) from [&lt;c04734dc&gt;] (mutex_lock_nested+0x48/0x320)
[&lt;c04734dc&gt;] (mutex_lock_nested+0x48/0x320) from [&lt;bf28ae00&gt;] (restore_regulatory_settings+0x34/0x418 [cfg80211])
[&lt;bf28ae00&gt;] (restore_regulatory_settings+0x34/0x418 [cfg80211]) from [&lt;bf28b200&gt;] (reg_timeout_work+0x1c/0x20 [cfg80211])
[&lt;bf28b200&gt;] (reg_timeout_work+0x1c/0x20 [cfg80211]) from [&lt;c0059f44&gt;] (process_one_work+0x2a0/0x480)
[&lt;c0059f44&gt;] (process_one_work+0x2a0/0x480) from [&lt;c005a4b4&gt;] (worker_thread+0x1bc/0x2bc)
[&lt;c005a4b4&gt;] (worker_thread+0x1bc/0x2bc) from [&lt;c0061148&gt;] (kthread+0x98/0xa4)
[&lt;c0061148&gt;] (kthread+0x98/0xa4) from [&lt;c0014af4&gt;] (kernel_thread_exit+0x0/0x8)
cfg80211: Calling CRDA to update world regulatory domain
cfg80211: World regulatory domain updated:
cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

Signed-off-by: Eliad Peller &lt;eliad@wizery.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit fe20b39ec32e975f1054c0b7866c873a954adf05 upstream.

reg_timeout_work() calls restore_regulatory_settings() which
takes cfg80211_mutex.

reg_set_request_processed() already holds cfg80211_mutex
before calling cancel_delayed_work_sync(reg_timeout),
so it might deadlock.

Call the async cancel_delayed_work instead, in order
to avoid the potential deadlock.

This is the relevant lockdep warning:

cfg80211: Calling CRDA for country: XX

======================================================
[ INFO: possible circular locking dependency detected ]
3.4.0-rc5-wl+ #26 Not tainted
-------------------------------------------------------
kworker/0:2/1391 is trying to acquire lock:
 (cfg80211_mutex){+.+.+.}, at: [&lt;bf28ae00&gt;] restore_regulatory_settings+0x34/0x418 [cfg80211]

but task is already holding lock:
 ((reg_timeout).work){+.+...}, at: [&lt;c0059e94&gt;] process_one_work+0x1f0/0x480

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #2 ((reg_timeout).work){+.+...}:
       [&lt;c008fd44&gt;] validate_chain+0xb94/0x10f0
       [&lt;c0090b68&gt;] __lock_acquire+0x8c8/0x9b0
       [&lt;c0090d40&gt;] lock_acquire+0xf0/0x114
       [&lt;c005b600&gt;] wait_on_work+0x4c/0x154
       [&lt;c005c000&gt;] __cancel_work_timer+0xd4/0x11c
       [&lt;c005c064&gt;] cancel_delayed_work_sync+0x1c/0x20
       [&lt;bf28b274&gt;] reg_set_request_processed+0x50/0x78 [cfg80211]
       [&lt;bf28bd84&gt;] set_regdom+0x550/0x600 [cfg80211]
       [&lt;bf294cd8&gt;] nl80211_set_reg+0x218/0x258 [cfg80211]
       [&lt;c03c7738&gt;] genl_rcv_msg+0x1a8/0x1e8
       [&lt;c03c6a00&gt;] netlink_rcv_skb+0x5c/0xc0
       [&lt;c03c7584&gt;] genl_rcv+0x28/0x34
       [&lt;c03c6720&gt;] netlink_unicast+0x15c/0x228
       [&lt;c03c6c7c&gt;] netlink_sendmsg+0x218/0x298
       [&lt;c03933c8&gt;] sock_sendmsg+0xa4/0xc0
       [&lt;c039406c&gt;] __sys_sendmsg+0x1e4/0x268
       [&lt;c0394228&gt;] sys_sendmsg+0x4c/0x70
       [&lt;c0013840&gt;] ret_fast_syscall+0x0/0x3c

-&gt; #1 (reg_mutex){+.+.+.}:
       [&lt;c008fd44&gt;] validate_chain+0xb94/0x10f0
       [&lt;c0090b68&gt;] __lock_acquire+0x8c8/0x9b0
       [&lt;c0090d40&gt;] lock_acquire+0xf0/0x114
       [&lt;c04734dc&gt;] mutex_lock_nested+0x48/0x320
       [&lt;bf28b2cc&gt;] reg_todo+0x30/0x538 [cfg80211]
       [&lt;c0059f44&gt;] process_one_work+0x2a0/0x480
       [&lt;c005a4b4&gt;] worker_thread+0x1bc/0x2bc
       [&lt;c0061148&gt;] kthread+0x98/0xa4
       [&lt;c0014af4&gt;] kernel_thread_exit+0x0/0x8

-&gt; #0 (cfg80211_mutex){+.+.+.}:
       [&lt;c008ed58&gt;] print_circular_bug+0x68/0x2cc
       [&lt;c008fb28&gt;] validate_chain+0x978/0x10f0
       [&lt;c0090b68&gt;] __lock_acquire+0x8c8/0x9b0
       [&lt;c0090d40&gt;] lock_acquire+0xf0/0x114
       [&lt;c04734dc&gt;] mutex_lock_nested+0x48/0x320
       [&lt;bf28ae00&gt;] restore_regulatory_settings+0x34/0x418 [cfg80211]
       [&lt;bf28b200&gt;] reg_timeout_work+0x1c/0x20 [cfg80211]
       [&lt;c0059f44&gt;] process_one_work+0x2a0/0x480
       [&lt;c005a4b4&gt;] worker_thread+0x1bc/0x2bc
       [&lt;c0061148&gt;] kthread+0x98/0xa4
       [&lt;c0014af4&gt;] kernel_thread_exit+0x0/0x8

other info that might help us debug this:

Chain exists of:
  cfg80211_mutex --&gt; reg_mutex --&gt; (reg_timeout).work

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock((reg_timeout).work);
                               lock(reg_mutex);
                               lock((reg_timeout).work);
  lock(cfg80211_mutex);

 *** DEADLOCK ***

2 locks held by kworker/0:2/1391:
 #0:  (events){.+.+.+}, at: [&lt;c0059e94&gt;] process_one_work+0x1f0/0x480
 #1:  ((reg_timeout).work){+.+...}, at: [&lt;c0059e94&gt;] process_one_work+0x1f0/0x480

stack backtrace:
[&lt;c001b928&gt;] (unwind_backtrace+0x0/0x12c) from [&lt;c0471d3c&gt;] (dump_stack+0x20/0x24)
[&lt;c0471d3c&gt;] (dump_stack+0x20/0x24) from [&lt;c008ef70&gt;] (print_circular_bug+0x280/0x2cc)
[&lt;c008ef70&gt;] (print_circular_bug+0x280/0x2cc) from [&lt;c008fb28&gt;] (validate_chain+0x978/0x10f0)
[&lt;c008fb28&gt;] (validate_chain+0x978/0x10f0) from [&lt;c0090b68&gt;] (__lock_acquire+0x8c8/0x9b0)
[&lt;c0090b68&gt;] (__lock_acquire+0x8c8/0x9b0) from [&lt;c0090d40&gt;] (lock_acquire+0xf0/0x114)
[&lt;c0090d40&gt;] (lock_acquire+0xf0/0x114) from [&lt;c04734dc&gt;] (mutex_lock_nested+0x48/0x320)
[&lt;c04734dc&gt;] (mutex_lock_nested+0x48/0x320) from [&lt;bf28ae00&gt;] (restore_regulatory_settings+0x34/0x418 [cfg80211])
[&lt;bf28ae00&gt;] (restore_regulatory_settings+0x34/0x418 [cfg80211]) from [&lt;bf28b200&gt;] (reg_timeout_work+0x1c/0x20 [cfg80211])
[&lt;bf28b200&gt;] (reg_timeout_work+0x1c/0x20 [cfg80211]) from [&lt;c0059f44&gt;] (process_one_work+0x2a0/0x480)
[&lt;c0059f44&gt;] (process_one_work+0x2a0/0x480) from [&lt;c005a4b4&gt;] (worker_thread+0x1bc/0x2bc)
[&lt;c005a4b4&gt;] (worker_thread+0x1bc/0x2bc) from [&lt;c0061148&gt;] (kthread+0x98/0xa4)
[&lt;c0061148&gt;] (kthread+0x98/0xa4) from [&lt;c0014af4&gt;] (kernel_thread_exit+0x0/0x8)
cfg80211: Calling CRDA to update world regulatory domain
cfg80211: World regulatory domain updated:
cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

Signed-off-by: Eliad Peller &lt;eliad@wizery.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cfg80211: warn if db.txt is empty with CONFIG_CFG80211_INTERNAL_REGDB</title>
<updated>2012-06-01T07:12:53+00:00</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@frijolero.org</email>
</author>
<published>2012-03-23T14:23:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ec8f0159dc6f3f39db5a644d94fd25709c301934'/>
<id>ec8f0159dc6f3f39db5a644d94fd25709c301934</id>
<content type='text'>
commit 80007efeff0568375b08faf93c7aad65602cb97e upstream.

It has happened twice now where elaborate troubleshooting has
undergone on systems where CONFIG_CFG80211_INTERNAL_REGDB [0]
has been set but yet net/wireless/db.txt was not updated.

Despite the documentation on this it seems system integrators could
use some more help with this, so throw out a kernel warning at boot time
when their database is empty.

This does mean that the error-prone system integrator won't likely
realize the issue until they boot the machine but -- it does not seem
to make sense to enable a build bug breaking random build testing.

[0] http://wireless.kernel.org/en/developers/Regulatory/CRDA#CONFIG_CFG80211_INTERNAL_REGDB

Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Youngsin Lee &lt;youngsin@qualcomm.com&gt;
Cc: Raja Mani &lt;rmani@qca.qualcomm.com&gt;
Cc: Senthil Kumar Balasubramanian &lt;senthilb@qca.qualcomm.com&gt;
Cc: Vipin Mehta &lt;vipimeht@qca.qualcomm.com&gt;
Cc: yahuan@qca.qualcomm.com
Cc: jjan@qca.qualcomm.com
Cc: vthiagar@qca.qualcomm.com
Cc: henrykim@qualcomm.com
Cc: jouni@qca.qualcomm.com
Cc: athiruve@qca.qualcomm.com
Cc: cjkim@qualcomm.com
Cc: philipk@qca.qualcomm.com
Cc: sunnykim@qualcomm.com
Cc: sskwak@qualcomm.com
Cc: kkim@qualcomm.com
Cc: mattbyun@qualcomm.com
Cc: ryanlee@qualcomm.com
Cc: simbap@qualcomm.com
Cc: krislee@qualcomm.com
Cc: conner@qualcomm.com
Cc: hojinkim@qualcomm.com
Cc: honglee@qualcomm.com
Cc: johnwkim@qualcomm.com
Cc: jinyong@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@frijolero.org&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 80007efeff0568375b08faf93c7aad65602cb97e upstream.

It has happened twice now where elaborate troubleshooting has
undergone on systems where CONFIG_CFG80211_INTERNAL_REGDB [0]
has been set but yet net/wireless/db.txt was not updated.

Despite the documentation on this it seems system integrators could
use some more help with this, so throw out a kernel warning at boot time
when their database is empty.

This does mean that the error-prone system integrator won't likely
realize the issue until they boot the machine but -- it does not seem
to make sense to enable a build bug breaking random build testing.

[0] http://wireless.kernel.org/en/developers/Regulatory/CRDA#CONFIG_CFG80211_INTERNAL_REGDB

Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Youngsin Lee &lt;youngsin@qualcomm.com&gt;
Cc: Raja Mani &lt;rmani@qca.qualcomm.com&gt;
Cc: Senthil Kumar Balasubramanian &lt;senthilb@qca.qualcomm.com&gt;
Cc: Vipin Mehta &lt;vipimeht@qca.qualcomm.com&gt;
Cc: yahuan@qca.qualcomm.com
Cc: jjan@qca.qualcomm.com
Cc: vthiagar@qca.qualcomm.com
Cc: henrykim@qualcomm.com
Cc: jouni@qca.qualcomm.com
Cc: athiruve@qca.qualcomm.com
Cc: cjkim@qualcomm.com
Cc: philipk@qca.qualcomm.com
Cc: sunnykim@qualcomm.com
Cc: sskwak@qualcomm.com
Cc: kkim@qualcomm.com
Cc: mattbyun@qualcomm.com
Cc: ryanlee@qualcomm.com
Cc: simbap@qualcomm.com
Cc: krislee@qualcomm.com
Cc: conner@qualcomm.com
Cc: hojinkim@qualcomm.com
Cc: honglee@qualcomm.com
Cc: johnwkim@qualcomm.com
Cc: jinyong@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@frijolero.org&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cfg80211: amend regulatory NULL dereference fix</title>
<updated>2011-12-09T16:52:45+00:00</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@qca.qualcomm.com</email>
</author>
<published>2011-11-28T21:47:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7e06614ab127e8c9de4af2e8f9d66953d3e68297'/>
<id>7e06614ab127e8c9de4af2e8f9d66953d3e68297</id>
<content type='text'>
commit 0bac71af6e66dc798bf07d0c0dd14ee5503362f9 upstream.

Johannes' patch for "cfg80211: fix regulatory NULL dereference"
broke user regulaotry hints and it did not address the fact that
last_request was left populated even if the previous regulatory
hint was stale due to the wiphy disappearing.

Fix user reguluatory hints by only bailing out if for those
regulatory hints where a request_wiphy is expected. The stale last_request
considerations are addressed through the previous fixes on last_request
where we reset the last_request to a static world regdom request upon
reset_regdomains(). In this case though we further enhance the effect
by simply restoring reguluatory settings completely.

Cc: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Reviewed-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0bac71af6e66dc798bf07d0c0dd14ee5503362f9 upstream.

Johannes' patch for "cfg80211: fix regulatory NULL dereference"
broke user regulaotry hints and it did not address the fact that
last_request was left populated even if the previous regulatory
hint was stale due to the wiphy disappearing.

Fix user reguluatory hints by only bailing out if for those
regulatory hints where a request_wiphy is expected. The stale last_request
considerations are addressed through the previous fixes on last_request
where we reset the last_request to a static world regdom request upon
reset_regdomains(). In this case though we further enhance the effect
by simply restoring reguluatory settings completely.

Cc: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Reviewed-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cfg80211: fix race on init and driver registration</title>
<updated>2011-12-09T16:52:45+00:00</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@qca.qualcomm.com</email>
</author>
<published>2011-11-28T21:47:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3ed26be17352133a2dadbc4212a5d23b403b0980'/>
<id>3ed26be17352133a2dadbc4212a5d23b403b0980</id>
<content type='text'>
commit a042994dd377d86bff9446ee76151ceb6267c9ba upstream.

There is a theoretical race that if hit will trigger
a crash. The race is between when we issue the first
regulatory hint, regulatory_hint_core(), gets processed
by the workqueue and between when the first device
gets registered to the wireless core. This is not easy
to reproduce but it was easy to do so through the
regulatory simulator I have been working on. This
is a port of the fix I implemented there [1].

[1] https://github.com/mcgrof/regsim/commit/a246ccf81f059cb662eee288aa13100f631e4cc8

Cc: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a042994dd377d86bff9446ee76151ceb6267c9ba upstream.

There is a theoretical race that if hit will trigger
a crash. The race is between when we issue the first
regulatory hint, regulatory_hint_core(), gets processed
by the workqueue and between when the first device
gets registered to the wireless core. This is not easy
to reproduce but it was easy to do so through the
regulatory simulator I have been working on. This
is a port of the fix I implemented there [1].

[1] https://github.com/mcgrof/regsim/commit/a246ccf81f059cb662eee288aa13100f631e4cc8

Cc: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cfg80211: fix regulatory NULL dereference</title>
<updated>2011-12-09T16:52:32+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2011-11-21T09:44:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6cb4e0db2f318c0730f31622fc5812a19e7ff379'/>
<id>6cb4e0db2f318c0730f31622fc5812a19e7ff379</id>
<content type='text'>
commit de3584bd62d87b4c250129fbc46ca52c80330add upstream.

By the time userspace returns with a response to
the regulatory domain request, the wiphy causing
the request might have gone away. If this is so,
reject the update but mark the request as having
been processed anyway.

Cc: Luis R. Rodriguez &lt;lrodriguez@qca.qualcomm.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit de3584bd62d87b4c250129fbc46ca52c80330add upstream.

By the time userspace returns with a response to
the regulatory domain request, the wiphy causing
the request might have gone away. If this is so,
reject the update but mark the request as having
been processed anyway.

Cc: Luis R. Rodriguez &lt;lrodriguez@qca.qualcomm.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cfg80211: fix bug on regulatory core exit on access to last_request</title>
<updated>2011-11-26T17:09:55+00:00</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@qca.qualcomm.com</email>
</author>
<published>2011-11-08T22:28:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5c02e3ae0a16cfc2fb86549cca9898ead2b0d666'/>
<id>5c02e3ae0a16cfc2fb86549cca9898ead2b0d666</id>
<content type='text'>
commit 58ebacc66bd11be2327edcefc79de94bd6f5bb4a upstream.

Commit 4d9d88d1 by Scott James Remnant &lt;keybuk@google.com&gt; added
the .uevent() callback for the regulatory device used during
the platform device registration. The change was done to account
for queuing up udev change requests through udevadm triggers.
The change also meant that upon regulatory core exit we will now
send a uevent() but the uevent() callback, reg_device_uevent(),
also accessed last_request. Right before commiting device suicide
we free'd last_request but never set it to NULL so
platform_device_unregister() would lead to bogus kernel paging
request. Fix this and also simply supress uevents right before
we commit suicide as they are pointless.

This fix is required for kernels &gt;= v2.6.39

$ git describe --contains 4d9d88d1
v2.6.39-rc1~468^2~25^2^2~21

The impact of not having this present is that a bogus paging
access may occur (only read) upon cfg80211 unload time. You
may also get this BUG complaint below. Although Johannes
could not reproduce the issue this fix is theoretically correct.

mac80211_hwsim: unregister radios
mac80211_hwsim: closing netlink
BUG: unable to handle kernel paging request at ffff88001a06b5ab
IP: [&lt;ffffffffa030df9a&gt;] reg_device_uevent+0x1a/0x50 [cfg80211]
PGD 1836063 PUD 183a063 PMD 1ffcb067 PTE 1a06b160
Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
CPU 0
Modules linked in: cfg80211(-) [last unloaded: mac80211]

Pid: 2279, comm: rmmod Tainted: G        W   3.1.0-wl+ #663 Bochs Bochs
RIP: 0010:[&lt;ffffffffa030df9a&gt;]  [&lt;ffffffffa030df9a&gt;] reg_device_uevent+0x1a/0x50 [cfg80211]
RSP: 0000:ffff88001c5f9d58  EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffff88001d2eda88 RCX: ffff88001c7468fc
RDX: ffff88001a06b5a0 RSI: ffff88001c7467b0 RDI: ffff88001c7467b0
RBP: ffff88001c5f9d58 R08: 000000000000ffff R09: 000000000000ffff
R10: 0000000000000000 R11: 0000000000000001 R12: ffff88001c7467b0
R13: ffff88001d2eda78 R14: ffffffff8164a840 R15: 0000000000000001
FS:  00007f8a91d8a6e0(0000) GS:ffff88001fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: ffff88001a06b5ab CR3: 000000001c62e000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process rmmod (pid: 2279, threadinfo ffff88001c5f8000, task ffff88000023c780)
Stack:
 ffff88001c5f9d98 ffffffff812ff7e5 ffffffff8176ab3d ffff88001c7468c2
 000000000000ffff ffff88001d2eda88 ffff88001c7467b0 ffff880000114820
 ffff88001c5f9e38 ffffffff81241dc7 ffff88001c5f9db8 ffffffff81040189
Call Trace:
 [&lt;ffffffff812ff7e5&gt;] dev_uevent+0xc5/0x170
 [&lt;ffffffff81241dc7&gt;] kobject_uevent_env+0x1f7/0x490
 [&lt;ffffffff81040189&gt;] ? sub_preempt_count+0x29/0x60
 [&lt;ffffffff814cab1a&gt;] ? _raw_spin_unlock_irqrestore+0x4a/0x90
 [&lt;ffffffff81305307&gt;] ? devres_release_all+0x27/0x60
 [&lt;ffffffff8124206b&gt;] kobject_uevent+0xb/0x10
 [&lt;ffffffff812fee27&gt;] device_del+0x157/0x1b0
 [&lt;ffffffff8130377d&gt;] platform_device_del+0x1d/0x90
 [&lt;ffffffff81303b76&gt;] platform_device_unregister+0x16/0x30
 [&lt;ffffffffa030fffd&gt;] regulatory_exit+0x5d/0x180 [cfg80211]
 [&lt;ffffffffa032bec3&gt;] cfg80211_exit+0x2b/0x45 [cfg80211]
 [&lt;ffffffff8109a84c&gt;] sys_delete_module+0x16c/0x220
 [&lt;ffffffff8108a23e&gt;] ? trace_hardirqs_on_caller+0x7e/0x120
 [&lt;ffffffff814cba02&gt;] system_call_fastpath+0x16/0x1b
Code: &lt;all your base are belong to me&gt;
RIP  [&lt;ffffffffa030df9a&gt;] reg_device_uevent+0x1a/0x50 [cfg80211]
 RSP &lt;ffff88001c5f9d58&gt;
CR2: ffff88001a06b5ab
---[ end trace 147c5099a411e8c0 ]---

Reported-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Scott James Remnant &lt;keybuk@google.com&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 58ebacc66bd11be2327edcefc79de94bd6f5bb4a upstream.

Commit 4d9d88d1 by Scott James Remnant &lt;keybuk@google.com&gt; added
the .uevent() callback for the regulatory device used during
the platform device registration. The change was done to account
for queuing up udev change requests through udevadm triggers.
The change also meant that upon regulatory core exit we will now
send a uevent() but the uevent() callback, reg_device_uevent(),
also accessed last_request. Right before commiting device suicide
we free'd last_request but never set it to NULL so
platform_device_unregister() would lead to bogus kernel paging
request. Fix this and also simply supress uevents right before
we commit suicide as they are pointless.

This fix is required for kernels &gt;= v2.6.39

$ git describe --contains 4d9d88d1
v2.6.39-rc1~468^2~25^2^2~21

The impact of not having this present is that a bogus paging
access may occur (only read) upon cfg80211 unload time. You
may also get this BUG complaint below. Although Johannes
could not reproduce the issue this fix is theoretically correct.

mac80211_hwsim: unregister radios
mac80211_hwsim: closing netlink
BUG: unable to handle kernel paging request at ffff88001a06b5ab
IP: [&lt;ffffffffa030df9a&gt;] reg_device_uevent+0x1a/0x50 [cfg80211]
PGD 1836063 PUD 183a063 PMD 1ffcb067 PTE 1a06b160
Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
CPU 0
Modules linked in: cfg80211(-) [last unloaded: mac80211]

Pid: 2279, comm: rmmod Tainted: G        W   3.1.0-wl+ #663 Bochs Bochs
RIP: 0010:[&lt;ffffffffa030df9a&gt;]  [&lt;ffffffffa030df9a&gt;] reg_device_uevent+0x1a/0x50 [cfg80211]
RSP: 0000:ffff88001c5f9d58  EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffff88001d2eda88 RCX: ffff88001c7468fc
RDX: ffff88001a06b5a0 RSI: ffff88001c7467b0 RDI: ffff88001c7467b0
RBP: ffff88001c5f9d58 R08: 000000000000ffff R09: 000000000000ffff
R10: 0000000000000000 R11: 0000000000000001 R12: ffff88001c7467b0
R13: ffff88001d2eda78 R14: ffffffff8164a840 R15: 0000000000000001
FS:  00007f8a91d8a6e0(0000) GS:ffff88001fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: ffff88001a06b5ab CR3: 000000001c62e000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process rmmod (pid: 2279, threadinfo ffff88001c5f8000, task ffff88000023c780)
Stack:
 ffff88001c5f9d98 ffffffff812ff7e5 ffffffff8176ab3d ffff88001c7468c2
 000000000000ffff ffff88001d2eda88 ffff88001c7467b0 ffff880000114820
 ffff88001c5f9e38 ffffffff81241dc7 ffff88001c5f9db8 ffffffff81040189
Call Trace:
 [&lt;ffffffff812ff7e5&gt;] dev_uevent+0xc5/0x170
 [&lt;ffffffff81241dc7&gt;] kobject_uevent_env+0x1f7/0x490
 [&lt;ffffffff81040189&gt;] ? sub_preempt_count+0x29/0x60
 [&lt;ffffffff814cab1a&gt;] ? _raw_spin_unlock_irqrestore+0x4a/0x90
 [&lt;ffffffff81305307&gt;] ? devres_release_all+0x27/0x60
 [&lt;ffffffff8124206b&gt;] kobject_uevent+0xb/0x10
 [&lt;ffffffff812fee27&gt;] device_del+0x157/0x1b0
 [&lt;ffffffff8130377d&gt;] platform_device_del+0x1d/0x90
 [&lt;ffffffff81303b76&gt;] platform_device_unregister+0x16/0x30
 [&lt;ffffffffa030fffd&gt;] regulatory_exit+0x5d/0x180 [cfg80211]
 [&lt;ffffffffa032bec3&gt;] cfg80211_exit+0x2b/0x45 [cfg80211]
 [&lt;ffffffff8109a84c&gt;] sys_delete_module+0x16c/0x220
 [&lt;ffffffff8108a23e&gt;] ? trace_hardirqs_on_caller+0x7e/0x120
 [&lt;ffffffff814cba02&gt;] system_call_fastpath+0x16/0x1b
Code: &lt;all your base are belong to me&gt;
RIP  [&lt;ffffffffa030df9a&gt;] reg_device_uevent+0x1a/0x50 [cfg80211]
 RSP &lt;ffff88001c5f9d58&gt;
CR2: ffff88001a06b5ab
---[ end trace 147c5099a411e8c0 ]---

Reported-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Scott James Remnant &lt;keybuk@google.com&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>wireless: Reset beacon_found while updating regulatory</title>
<updated>2011-10-03T18:40:40+00:00</updated>
<author>
<name>Rajkumar Manoharan</name>
<email>rmanohar@qca.qualcomm.com</email>
</author>
<published>2011-09-14T08:58:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cb49a34465aff5bb9c5209e2b8e775cead9712c7'/>
<id>cb49a34465aff5bb9c5209e2b8e775cead9712c7</id>
<content type='text'>
commit aa3d7eef398dd4f29045e9889b817d5161afe03e upstream.

During the association, the regulatory is updated by country IE
that reaps the previously found beacons. The impact is that
after a STA disconnects *or* when for any reason a regulatory
domain change happens the beacon hint flag is not cleared
therefore preventing future beacon hints to be learned.
This is important as a regulatory domain change or a restore
of regulatory settings would set back the passive scan and no-ibss
flags on the channel. This is the right place to do this given that
it covers any regulatory domain change.

Reviewed-by: Luis R. Rodriguez &lt;mcgrof@gmail.com&gt;
Signed-off-by: Rajkumar Manoharan &lt;rmanohar@qca.qualcomm.com&gt;
Acked-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit aa3d7eef398dd4f29045e9889b817d5161afe03e upstream.

During the association, the regulatory is updated by country IE
that reaps the previously found beacons. The impact is that
after a STA disconnects *or* when for any reason a regulatory
domain change happens the beacon hint flag is not cleared
therefore preventing future beacon hints to be learned.
This is important as a regulatory domain change or a restore
of regulatory settings would set back the passive scan and no-ibss
flags on the channel. This is the right place to do this given that
it covers any regulatory domain change.

Reviewed-by: Luis R. Rodriguez &lt;mcgrof@gmail.com&gt;
Signed-off-by: Rajkumar Manoharan &lt;rmanohar@qca.qualcomm.com&gt;
Acked-by: Luis R. Rodriguez &lt;mcgrof@qca.qualcomm.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
</feed>
