linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* regd: sleeping in atomic
@ 2010-03-16 13:26 Jiri Slaby
  2010-03-16 16:18 ` Luis R. Rodriguez
  2010-03-16 19:49 ` [PATCH] wireless: convert reg_regdb_search_lock to mutex John W. Linville
  0 siblings, 2 replies; 15+ messages in thread
From: Jiri Slaby @ 2010-03-16 13:26 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: John W. Linville, LKML

Hi,

Stanse found an atomic error in reg_copy_regd:

static int reg_copy_regd(const struct ieee80211_regdomain **dst_regd,
                          const struct ieee80211_regdomain *src_regd)
{
         struct ieee80211_regdomain *regd;
         int size_of_regd = 0;
         unsigned int i;

         size_of_regd = sizeof(struct ieee80211_regdomain) +
           ((src_regd->n_reg_rules + 1) * sizeof(struct 
ieee80211_reg_rule));

         regd = kzalloc(size_of_regd, GFP_KERNEL);       <---- here

Called from:

static void reg_regdb_search(struct work_struct *work)
{
         spin_lock(&reg_regdb_search_lock);
         while (!list_empty(&reg_regdb_search_list)) {
...
                 for (i=0; i<reg_regdb_size; i++) {
                         curdom = reg_regdb[i];

                         if (!memcmp(request->alpha2, curdom->alpha2, 2)) {
                                 r = reg_copy_regd(&regdom, curdom);
...
         spin_unlock(&reg_regdb_search_lock);
}

Whole error temporarily available at:
http://decibel.fi.muni.cz/~xslaby/stanse/error.cgi?db=34-rc&id=578

It is introduced by 3b377ea9d4efc94dc52fe41b4dfdb463635ab298.

Do you plan to extend it somehow or may the spinlock be converted to 
mutex? If not how much may size_of_regd be -- can we safely switch to 
GFP_ATOMIC?

-- 
js

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-03-18 21:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-16 13:26 regd: sleeping in atomic Jiri Slaby
2010-03-16 16:18 ` Luis R. Rodriguez
2010-03-16 18:42   ` Jiri Slaby
2010-03-16 20:36     ` Luis R. Rodriguez
2010-03-16 19:49 ` [PATCH] wireless: convert reg_regdb_search_lock to mutex John W. Linville
2010-03-16 10:03   ` Senthil Balasubramanian
2010-03-17  0:24     ` John W. Linville
2010-03-16 12:24       ` Senthil Balasubramanian
2010-03-17  2:56         ` John W. Linville
2010-03-17  3:24           ` Johannes Berg
2010-03-17  1:26             ` Senthil Balasubramanian
2010-03-17 12:55             ` John W. Linville
2010-03-17 13:01               ` John W. Linville
2010-03-17 19:33   ` [PATCH v2] " John W. Linville
2010-03-18 20:47     ` [PATCH v3] " John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).