From: Alan Stern <stern@rowland.harvard.edu>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Jiri Kosina <jikos@jikos.cz>, <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Keyboard stops working after *lock [Was: 2.6.21-rc2-mm1]
Date: Sun, 18 Mar 2007 11:39:14 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.44L0.0703181134020.19508-100000@netrider.rowland.org> (raw)
In-Reply-To: <45FD4E59.3050007@gmail.com>
On Sun, 18 Mar 2007, Jiri Slaby wrote:
> Alan Stern napsal(a):
> > In drivers/usb/host/uhci-q.c, near the start is a function named
> > uhci_fsbr_on(). Put a "return" statement right at its beginning so that
> > the function doesn't do anything. Does that make any difference?
>
> Yes, it works.
Okay. Take out that extra "return" statement and revert the WARN_ON, and
try this patch. I don't like it because it adds extra PCI bus overhead to
the driver, but if some systems need it then there's no choice.
Warning: I just wrote this and haven't tried to test it. Consider
yourself a guinea pig. :-)
Alan Stern
Index: usb-2.6/drivers/usb/host/uhci-q.c
===================================================================
--- usb-2.6.orig/drivers/usb/host/uhci-q.c
+++ usb-2.6/drivers/usb/host/uhci-q.c
@@ -54,22 +54,17 @@ static void uhci_fsbr_on(struct uhci_hcd
/* Find the first FSBR QH. Linear search through the list is
* acceptable because normally FSBR gets turned on as soon as
* one QH needs it. */
- fsbr_qh = NULL;
+ fsbr_qh = uhci->skel_term_qh;
list_for_each_entry_reverse(tqh, &uhci->skel_async_qh->node, node) {
if (tqh->skel < SKEL_FSBR)
break;
fsbr_qh = tqh;
}
- /* No FSBR QH means we must insert the terminating skeleton QH */
- if (!fsbr_qh) {
- uhci->skel_term_qh->link = LINK_TO_QH(uhci->skel_term_qh);
- wmb();
- lqh->link = uhci->skel_term_qh->link;
-
- /* Otherwise loop the last QH to the first FSBR QH */
- } else
- lqh->link = LINK_TO_QH(fsbr_qh);
+ /* The terminating skeleton QH points back to the first FSBR QH */
+ uhci->skel_term_qh->link = LINK_TO_QH(fsbr_qh);
+ wmb();
+ lqh->link = LINK_TO_QH(uhci->skel_term_qh);
}
static void uhci_fsbr_off(struct uhci_hcd *uhci)
@@ -139,10 +134,14 @@ static struct uhci_td *uhci_alloc_td(str
static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td)
{
- if (!list_empty(&td->list))
+ if (!list_empty(&td->list)) {
dev_warn(uhci_dev(uhci), "td %p still in list!\n", td);
- if (!list_empty(&td->fl_list))
+ WARN_ON(1);
+ }
+ if (!list_empty(&td->fl_list)) {
dev_warn(uhci_dev(uhci), "td %p still in fl_list!\n", td);
+ WARN_ON(1);
+ }
dma_pool_free(uhci->td_pool, td, td->dma_handle);
}
@@ -307,8 +306,10 @@ static struct uhci_qh *uhci_alloc_qh(str
static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
{
WARN_ON(qh->state != QH_STATE_IDLE && qh->udev);
- if (!list_empty(&qh->queue))
+ if (!list_empty(&qh->queue)) {
dev_warn(uhci_dev(uhci), "qh %p list not empty!\n", qh);
+ WARN_ON(1);
+ }
list_del(&qh->node);
if (qh->udev) {
@@ -464,9 +465,8 @@ static void link_interrupt(struct uhci_h
*/
static void link_async(struct uhci_hcd *uhci, struct uhci_qh *qh)
{
- struct uhci_qh *pqh, *lqh;
+ struct uhci_qh *pqh;
__le32 link_to_new_qh;
- __le32 *extra_link = &link_to_new_qh;
/* Find the predecessor QH for our new one and insert it in the list.
* The list of QHs is expected to be short, so linear search won't
@@ -476,31 +476,20 @@ static void link_async(struct uhci_hcd *
break;
}
list_add(&qh->node, &pqh->node);
- qh->link = pqh->link;
+ /* Link it into the schedule */
+ qh->link = pqh->link;
+ wmb();
link_to_new_qh = LINK_TO_QH(qh);
+ pqh->link = link_to_new_qh;
/* If this is now the first FSBR QH, take special action */
if (uhci->fsbr_is_on && pqh->skel < SKEL_FSBR &&
qh->skel >= SKEL_FSBR) {
- lqh = list_entry(uhci->skel_async_qh->node.prev,
- struct uhci_qh, node);
- /* If the new QH is also the last one, we must unlink
- * the terminating skeleton QH and make the new QH point
- * back to itself. */
- if (qh == lqh) {
- qh->link = link_to_new_qh;
- extra_link = &uhci->skel_term_qh->link;
-
- /* Otherwise the last QH must point to the new QH */
- } else
- extra_link = &lqh->link;
+ /* The terminating skeleton QH must point to the new QH */
+ uhci->skel_term_qh->link = link_to_new_qh;
}
-
- /* Link it into the schedule */
- wmb();
- *extra_link = pqh->link = link_to_new_qh;
}
/*
@@ -561,31 +550,21 @@ static void unlink_interrupt(struct uhci
*/
static void unlink_async(struct uhci_hcd *uhci, struct uhci_qh *qh)
{
- struct uhci_qh *pqh, *lqh;
+ struct uhci_qh *pqh;
__le32 link_to_next_qh = qh->link;
pqh = list_entry(qh->node.prev, struct uhci_qh, node);
+ pqh->link = link_to_next_qh;
- /* If this is the first FSBQ QH, take special action */
+ /* If this is the first FSBR QH, take special action */
if (uhci->fsbr_is_on && pqh->skel < SKEL_FSBR &&
qh->skel >= SKEL_FSBR) {
- lqh = list_entry(uhci->skel_async_qh->node.prev,
- struct uhci_qh, node);
- /* If this QH is also the last one, we must link in
- * the terminating skeleton QH. */
- if (qh == lqh) {
- link_to_next_qh = LINK_TO_QH(uhci->skel_term_qh);
- uhci->skel_term_qh->link = link_to_next_qh;
- wmb();
- qh->link = link_to_next_qh;
-
- /* Otherwise the last QH must point to the new first FSBR QH */
- } else
- lqh->link = link_to_next_qh;
+ /* The terminating skeleton QH must point to the new
+ * first FSBR QH */
+ uhci->skel_term_qh->link = link_to_next_qh;
}
- pqh->link = link_to_next_qh;
mb();
}
@@ -786,9 +765,11 @@ static void uhci_free_urb_priv(struct uh
{
struct uhci_td *td, *tmp;
- if (!list_empty(&urbp->node))
+ if (!list_empty(&urbp->node)) {
dev_warn(uhci_dev(uhci), "urb %p still on QH's list!\n",
urbp->urb);
+ WARN_ON(1);
+ }
list_for_each_entry_safe(td, tmp, &urbp->td_list, list) {
uhci_remove_td_from_urbp(td);
next prev parent reply other threads:[~2007-03-18 15:39 UTC|newest]
Thread overview: 129+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-02 11:00 2.6.21-rc2-mm1 Andrew Morton
2007-03-02 11:04 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-02 17:30 ` 2.6.21-rc2-mm1 Randy Dunlap
2007-03-04 11:58 ` [Re: 2.6.21-rc2-mm1] #error no ROMFS backing store interface configured Maciej Rutecki
2007-03-04 12:11 ` Andrew Morton
2007-03-04 15:11 ` Maciej Rutecki
2007-03-04 15:11 ` David Howells
2007-03-04 15:25 ` Adrian Bunk
2007-03-04 15:35 ` David Howells
2007-03-05 1:49 ` [-mm patch] fix the ROMFS_* dependencies Adrian Bunk
2007-03-05 13:36 ` David Howells
2007-03-06 23:43 ` Adrian Bunk
2007-03-02 11:04 ` 2.6.21-rc2-mm1 Russell King
2007-03-02 11:08 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-02 11:10 ` 2.6.21-rc2-mm1 Russell King
2007-03-02 11:15 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-03 18:03 ` 2.6.21-rc2-mm1 Russell King
2007-03-05 10:41 ` arm utrace Roland McGrath
2007-03-02 14:05 ` 2.6.21-rc2-mm1: EIP is at ext2_discard_reservation+0x1c/0x52 Alexey Dobriyan
2007-03-02 14:24 ` 2.6.21-rc2-mm1 Bryan Wu
2007-03-02 14:40 ` [-mm patch] cpu_idle: fix build break Frederik Deweerdt
2007-03-02 15:24 ` Venkatesh Pallipadi
2007-03-02 16:24 ` Frederik Deweerdt
2007-03-02 15:42 ` 2.6.21-rc2-mm1 - build error with HOTPLUG_CPU=N, CPU_IDLE=Y Valdis.Kletnieks
2007-03-02 15:56 ` 2.6.21-rc2-mm1 Michal Piotrowski
2007-03-05 10:14 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-05 10:30 ` 2.6.21-rc2-mm1 Antonino A. Daplas
2007-03-02 16:03 ` 2.6.21-rc2-mm1 - fb_ddc_read() not defined Valdis.Kletnieks
2007-03-02 16:31 ` James Simmons
2007-03-02 16:51 ` Valdis.Kletnieks
2007-03-02 16:19 ` [PATCH] longhaul pci_find_device -> pci_get_device conversion (was: Re: 2.6.21-rc2-mm1) Michal Piotrowski
[not found] ` <3888a5cd0703020945r4ca51f3dxe981050b817e7594@mail.gmail.com>
2007-03-02 18:10 ` Michal Piotrowski
2007-03-02 16:32 ` 2.6.21-rc2-mm1 Badari Pulavarty
2007-03-02 17:03 ` [patch -mm] x86_64: fake numa cmdline flag fix David Rientjes
2007-03-02 17:21 ` Badari Pulavarty
2007-03-02 17:10 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-02 17:15 ` 2.6.21-rc2-mm1 Badari Pulavarty
2007-03-02 21:12 ` 2.6.21-rc2-mm1: what about CONFIG_NO_HZ and !CONFIG_SMP ? Laurent Riffard
2007-03-02 20:57 ` Siddha, Suresh B
2007-03-02 22:09 ` Laurent Riffard
2007-03-02 22:52 ` 2.6.21-rc2-mm1: pata_via: wrong cable detection Laurent Riffard
2007-03-02 23:05 ` [PATCH -mm] char/epca.c remove unused function (was: Re: 2.6.21-rc2-mm1) Michal Piotrowski
2007-03-03 0:48 ` Alan Cox
2007-03-02 23:42 ` 2.6.21-rc2-mm1 Michal Piotrowski
2007-03-03 0:40 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-03 1:22 ` 2.6.21-rc2-mm1 Michal Piotrowski
2007-03-03 1:41 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-03 10:08 ` 2.6.21-rc2-mm1 Michal Piotrowski
2007-03-03 12:06 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-03 7:45 ` 2.6.21-rc2-mm1 - build error with CONFIG_NO_HZ=y and CONFIG_SMP=n Antonino A. Daplas
2007-03-03 7:59 ` Andrew Morton
2007-03-03 15:39 ` Keyboard stops working after *lock [Was: 2.6.21-rc2-mm1] Jiri Slaby
2007-03-03 15:54 ` Jiri Slaby
2007-03-03 17:41 ` Andrew Morton
2007-03-09 10:31 ` Jiri Slaby
2007-03-09 14:13 ` Dmitry Torokhov
2007-03-09 14:40 ` Jiri Kosina
2007-03-09 16:01 ` Jiri Kosina
2007-03-09 16:48 ` Jiri Slaby
2007-03-09 17:10 ` Jiri Slaby
2007-03-11 21:39 ` Jiri Slaby
2007-03-11 21:47 ` Jiri Kosina
2007-03-11 21:53 ` Jiri Slaby
2007-03-11 22:11 ` Jiri Slaby
2007-03-12 9:08 ` Jiri Slaby
2007-03-12 15:09 ` Alan Stern
2007-03-12 16:28 ` Jiri Slaby
2007-03-12 19:56 ` Alan Stern
2007-03-12 21:00 ` Jiri Kosina
2007-03-12 22:32 ` Jiri Slaby
2007-03-13 16:01 ` Alan Stern
2007-03-13 16:13 ` Jiri Slaby
2007-03-13 16:30 ` Alan Stern
2007-03-15 20:00 ` Alan Stern
2007-03-16 10:52 ` Jiri Slaby
2007-03-17 22:50 ` Jiri Slaby
2007-03-18 2:39 ` Alan Stern
2007-03-18 8:46 ` Jiri Slaby
2007-03-18 14:26 ` Alan Stern
2007-03-18 14:36 ` Jiri Slaby
2007-03-18 15:39 ` Alan Stern [this message]
2007-03-18 15:45 ` Jiri Slaby
2007-03-18 16:11 ` Alan Stern
2007-03-04 9:07 ` 2.6.21-rc2-mm1 Mariusz Kozlowski
2007-03-04 9:48 ` 2.6.21-rc2-mm1 Mariusz Kozlowski
2007-03-04 11:34 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-04 12:01 ` 2.6.21-rc2-mm1 Mariusz Kozlowski
2007-03-04 17:06 ` 2.6.21-rc2-mm1 Mariusz Kozlowski
2007-03-04 17:13 ` 2.6.21-rc2-mm1 Michal Piotrowski
2007-03-04 17:20 ` 2.6.21-rc2-mm1 Michal Piotrowski
2007-03-05 16:34 ` 2.6.21-rc2-mm1 Zan Lynx
2007-03-05 0:11 ` 2.6.21-rc2-mm1 J.A. Magallón
2007-03-05 0:29 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-05 1:17 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-05 2:25 ` 2.6.21-rc2-mm1 Neil Brown
2007-03-05 15:42 ` 2.6.21-rc2-mm1 Bill Davidsen
2007-03-05 1:47 ` [-mm patch] saa7134: fix MODULES=n compilation Adrian Bunk
2007-03-05 1:47 ` 2.6.21-rc2-mm1: drivers/net/wireless/ compile error Adrian Bunk
2007-03-05 10:41 ` Michael Buesch
2007-03-05 1:47 ` 2.6.21-rc2-mm1: drivers/usb/host/ohci-ssb.c doesn't compile Adrian Bunk
2007-03-05 10:49 ` Michael Buesch
2007-03-05 10:57 ` Michael Buesch
2007-03-05 11:26 ` Michael Buesch
2007-03-05 18:26 ` Greg KH
2007-03-05 18:37 ` Adrian Bunk
2007-03-05 18:42 ` David Brownell
2007-03-05 19:09 ` Michael Buesch
2007-03-05 1:47 ` [-mm patch] arch/i386/kernel/vmi.c must #include <asm/kmap_types.h> Adrian Bunk
2007-03-05 2:57 ` Zachary Amsden
2007-03-05 1:47 ` [-mm patch] remove arch/i386/kernel/tsc.c:custom_sched_clock Adrian Bunk
2007-03-05 2:57 ` Zachary Amsden
2007-03-05 1:47 ` [-mm patch] make drivers/char/drm/drm_vm.c:drm_io_prot() static Adrian Bunk
2007-03-05 1:47 ` [-mm patch] drivers/cpuidle/: make code static Adrian Bunk
2007-03-05 1:49 ` [-mm patch] drivers/media/video/ivtv/: possible cleanups Adrian Bunk
2007-03-05 6:53 ` [v4l-dvb-maintainer] " Hans Verkuil
2007-03-05 1:49 ` [-mm patch] drivers/net/bonding/bond_main.c:make 3 functions static Adrian Bunk
2007-03-05 1:49 ` [-mm patch] make drivers/video/display/display-sysfs.c:display_class static Adrian Bunk
2007-03-05 1:49 ` [-mm patch] make fb_deferred_io_mkwrite() static Adrian Bunk
2007-03-05 1:49 ` [-mm patch] drivers/video/hecubafb.c: make 4 functions static Adrian Bunk
2007-03-05 22:20 ` 2.6.21-rc2-mm1 J.A. Magallón
2007-03-05 23:11 ` 2.6.21-rc2-mm1 Andrew Morton
2007-03-06 6:25 ` [PATCH] sched: fix idle at tick Con Kolivas
[not found] ` <20070305230240.9c2741d1.akpm@linux-foundation.org>
2007-03-06 7:41 ` Con Kolivas
2007-03-06 8:38 ` J.A. Magallón
2007-03-06 0:16 ` i2c vs nVidia [Re: 2.6.21-rc2-mm1] J.A. Magallón
2007-03-06 0:33 ` Andrew Morton
2007-03-06 0:44 ` Greg KH
2007-03-06 8:45 ` Jean Delvare
2007-03-06 10:56 ` Jean Delvare
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=Pine.LNX.4.44L0.0703181134020.19508-100000@netrider.rowland.org \
--to=stern@rowland.harvard.edu \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=jikos@jikos.cz \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).