mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Jiri Kosina <jikos@jikos.cz>
Cc: linux-usb-devel@lists.sourceforge.net,
	dbrownell@users.sourceforge.net, weissg@vienna.at,
	linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [linux-usb-devel] [PATCH] USB: consolidate error values from EHCI, UHCI and OHCI _suspend()
Date: Tue, 19 Sep 2006 09:13:11 -0700	[thread overview]
Message-ID: <200609190913.12563.david-b@pacbell.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0609191238030.26418@twin.jikos.cz>

On Tuesday 19 September 2006 3:43 am, Jiri Kosina wrote:

> (by the way, EHCI and OHCI seem to have broken (read: missing) locking 
> when accessing the hcd->state. Should I fix it by per-hcd spinlock, or 
> does the patch already exist somewhere?)

They should only ever access it while holding their internal spinlocks;
which are held during most driver operations, easy to miss.  And except
for hardware faults, the HCD state changes only when usbcore pushes an
HCD through driver model state transitions like probe(), suspend(), and
their inverses.  I see some dodgey code in the OHCI IRQ handler, but
even that shouldn't make trouble.

Admittedly the usbcore access to that field is a bit problematic, since
it doesn't handle the hardware faulting cases very cleanly.  For those
cases, other problems are more severe ... like basic cleanup of all the
pending transactions, and removal of the usb devices, didn't work the
last time I tripped over such cases.


Eventually we want hcd->state to vanish, but until it does it sure seems
like a problem if usbcore can't rely on all HCDs to treat it the same.

- Dave

  parent reply	other threads:[~2006-09-19 18:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-19  1:44 [PATCH] USB: consolidate error values from EHCI,UHCI " Jiri Kosina
2006-09-19  2:09 ` [linux-usb-devel] [PATCH] USB: consolidate error values from EHCI, UHCI " David Brownell
2006-09-19 10:43   ` Jiri Kosina
2006-09-19 14:25     ` Alan Stern
2006-09-19 16:13     ` David Brownell [this message]
2006-09-19 20:32       ` Alan Stern

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=200609190913.12563.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@osdl.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=jikos@jikos.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=weissg@vienna.at \
    /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

Powered by JetHome