Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Patrik, Kluba" <pkluba@dension.com>
To: "Patrik, Kluba" <pkluba@dension.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>, linux-wireless@vger.kernel.org
Subject: Re: bug: deadlock in rtl8192cu
Date: Wed, 13 Mar 2013 16:11:21 +0100	[thread overview]
Message-ID: <20130313161121.210ff4fd.pkluba@dension.com> (raw)
In-Reply-To: <20130313152505.7dc3466c.pkluba@dension.com>

On Wed, 13 Mar 2013 15:25:05 +0100
"Patrik, Kluba" <pkluba@dension.com> wrote:

> According to http://lwn.net/Articles/37889/ no sleeping functions
> should be called inside an rcu_read_lock() region. No sleeping can
> not be guaranteed for USB transfers.

To correct myself: for synchronous USB transfers. usb_submit_urb() and
friends are safe. Rewriting things in rtlwifi to do async transfers is
a tremendous job, and might not help at all as the termination of the
callback has still be waited under RCU. 

But how about something like this?


rcu_read_lock();
sta = ...
increase_reference_count();
rcu_read_unlock();

... do all the might-sleeping things here ...

decrease_reference_count_and_call_callback_if_necessary();



I have found an example for rcu_read_lock() + kref_get() here:
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2011-February/004234.html

Regards,
Patrik

-- 
Patrik KLUBA
Software Developer at

DENSION Audio Systems Ltd.
H-1116 Budapest, Sztregova u. 1
Phone: +36 1 463 0470
Fax:   +36 1 463 0479
Web:   www.dension.com

  reply	other threads:[~2013-03-13 15:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 15:30 bug: deadlock in rtl8192cu Patrik, Kluba
2013-03-12 15:33 ` Patrik, Kluba
2013-03-12 16:34 ` Larry Finger
2013-03-13 14:25   ` Patrik, Kluba
2013-03-13 15:11     ` Patrik, Kluba [this message]
2013-03-13 15:13     ` Larry Finger
2013-03-13 15:26       ` John W. Linville
2013-03-13 15:51       ` Patrik, Kluba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130313161121.210ff4fd.pkluba@dension.com \
    --to=pkluba@dension.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox