public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Ingo Molnar <mingo@elte.hu>, Greg KH <gregkh@suse.de>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [USB boot crash, -git] ecm_do_notify(), list_add corruption. prev->next should be next (ffff88003b8f82f8)
Date: Sat, 26 Jul 2008 08:06:24 -0700	[thread overview]
Message-ID: <200807260806.24859.david-b@pacbell.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0807240931220.3494-100000@netrider.rowland.org>

On Thursday 24 July 2008, Alan Stern wrote:
> Can you make the necessary change and try it out?

This resolves the problem for me ... and, I'd expect, for Ingo.


======= CUT HERE
From: David Brownell <dbrownell@users.sourceforge.net>

This fixes a BUG() turned up by Ingo via randconfig testing, where
CONFIG_LIST_DEBUG turned up list corruption.  The corruption was
caused by the dummy_hcd (single-machine test harness for gadget and
HCD code) trashing the request queue when driven by the new CDC
composite gadget an I/O pattern that was previously uncommon.
Fix suggested by Alan Stern.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
 drivers/usb/gadget/dummy_hcd.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/usb/gadget/dummy_hcd.c	2008-07-24 18:27:52.000000000 -0700
+++ b/drivers/usb/gadget/dummy_hcd.c	2008-07-26 07:35:12.000000000 -0700
@@ -542,13 +542,14 @@ dummy_queue (struct usb_ep *_ep, struct 
 		req->req.context = dum;
 		req->req.complete = fifo_complete;
 
+		list_add_tail(&req->queue, &ep->queue);
 		spin_unlock (&dum->lock);
 		_req->actual = _req->length;
 		_req->status = 0;
 		_req->complete (_ep, _req);
 		spin_lock (&dum->lock);
-	}
-	list_add_tail (&req->queue, &ep->queue);
+	}  else
+		list_add_tail(&req->queue, &ep->queue);
 	spin_unlock_irqrestore (&dum->lock, flags);
 
 	/* real hardware would likely enable transfers here, in case


  parent reply	other threads:[~2008-07-26 15:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 22:30 [GIT PATCH] USB patches for 2.6.26 Greg KH
2008-07-22  8:54 ` Benny Halevy
2008-07-22 15:27   ` Greg KH
2008-07-22 13:40 ` [USB boot crash, -git] ecm_do_notify(), list_add corruption. prev->next should be next (ffff88003b8f82f8) Ingo Molnar
2008-07-23  0:10   ` Greg KH
2008-07-23  0:22     ` David Brownell
2008-07-23 23:37   ` David Brownell
2008-07-24  3:46     ` Alan Stern
2008-07-24  7:40       ` David Brownell
2008-07-25  3:57         ` Alan Stern
2008-07-26  1:18           ` David Brownell
2008-07-26 15:06           ` David Brownell [this message]
2008-07-26 15:19             ` Ingo Molnar

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=200807260806.24859.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    /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