From: David Brownell <david-b@pacbell.net>
To: Eugene_Bordenkircher@selinc.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Li Yang <leoli@freescale.com>
Subject: Re: BUG/OOPS: Double Lock in fsl_usb2_udc.c
Date: Thu, 29 May 2008 02:23:39 -0700 [thread overview]
Message-ID: <200805290223.39368.david-b@pacbell.net> (raw)
In-Reply-To: <20080529014535.6065fa39.akpm@linux-foundation.org>
> On Wed, 28 May 2008 15:25:31 -0700 Eugene_Bordenkircher@selinc.com wrote:
>
> > Looking through other drivers, I have seen them releasing the lock
> > immediately before calling disconnect(), however, without being an expert
> > with this driver, I'm not entirely sure that is the best option here.
Yeah, general policy is to drop the UDC spinlock whenever
you call out to gadget driver code, since it may need to
reenter for various reasons. (Though if drivers adopt some
other locking policy that works, that should be fine too.
Multiple locks don't seem to be needed.)
If this particular UDC driver doesn't let disconnect()
disable the endpoints, that's a bug. All gadget drivers
should clean up on disconnect; and while the UDC code
ought to have aborted any pending I/Os, it should never
be disabling things the gadget driver enabled.
And as for calling disconnect() before proceeding with
enumeration ... if the UDC driver can sense disconnect
(most often done with a GPIO hooked up to provide IRQs
on VBUS edge transitions), it should do so then. But
for boards that don't have VBUS sensing, then the only
hook to scrub out all the old/invalid connection state
is the USB reset sequence that starts enumeration. And
that's what seems to be happening here.
- Dave
next prev parent reply other threads:[~2008-05-29 9:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-28 22:25 BUG/OOPS: Double Lock in fsl_usb2_udc.c Eugene_Bordenkircher
2008-05-29 8:45 ` Andrew Morton
2008-05-29 9:23 ` David Brownell [this message]
2008-05-29 10:48 ` Li Yang
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=200805290223.39368.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=Eugene_Bordenkircher@selinc.com \
--cc=akpm@linux-foundation.org \
--cc=leoli@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.