linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: david-b@pacbell.net (David Brownell)
To: linux-arm-kernel@lists.infradead.org
Subject: [BUG] pxa27x_udc: possible recursive locking detected in pxa_ep_queue
Date: Sun, 6 Dec 2009 12:13:38 -0800	[thread overview]
Message-ID: <200912061213.39183.david-b@pacbell.net> (raw)
In-Reply-To: <87638k9cj6.fsf@free.fr>

On Sunday 06 December 2009, Robert Jarzmik wrote:
> I may modify the locking model of pxa27x_udc : whenether I call the gadget
> complete() method, I relax the ep->lock, and take it just after. That makes me a
> bit nervous, but I'll do it if this is the thing to do.
> 
> David, could you give me the point of view of the gadget architecture please ?

Dropping the lock before complete() is exactly the right thing to do.

But make sure your ep_queue() method understands that sometimes it's
only supposed to *queue* and not activate tx/rx.

So the IRQ handler sets some "don't touch the hardware" flag before
it drops that lock, reentrant queue() sees it, complete() returns with
the only change being queue updates ... and before the IRQ handler
returns, it looks to see if there's work to be done on that EP.

Most UDC drivers don't have hardware queues to worry about, so the
completion callback should also be able to dequeue() requests that
aren't yet being handled by the HW ... another nuance, but one that
won't usually mean extra work.

- Dave

  parent reply	other threads:[~2009-12-06 20:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-05 10:57 [BUG] pxa27x_udc: possible recursive locking detected in pxa_ep_queue Antonio Ospite
2009-12-06 18:34 ` Robert Jarzmik
2009-12-06 20:01   ` Alan Stern
2009-12-06 20:23     ` David Brownell
2009-12-10 17:58       ` Robert Jarzmik
2009-12-10 21:01         ` David Brownell
2009-12-06 20:13   ` David Brownell [this message]
2009-12-10 17:49     ` Robert Jarzmik
2009-12-12 14:28 ` Robert Jarzmik
2009-12-12 16:31   ` Antonio Ospite
2009-12-20 18:36     ` Robert Jarzmik
2009-12-22 23:53       ` Antonio Ospite
2009-12-28 20:23         ` Robert Jarzmik
2009-12-28 23:03           ` Antonio Ospite
2010-01-17 12:41             ` Antonio Ospite
2010-01-17 19:33               ` Robert Jarzmik
2010-03-30 21:26           ` Michael Trimarchi

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=200912061213.39183.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).