public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: rmk@arm.linux.org.uk
Cc: zaitcev@redhat.com, david-b@pacbell.net,
	linux-kernel@vger.kernel.org, greg@kroah.com
Subject: usbmon, usb core, ARM
Date: Tue, 18 Jan 2005 21:20:33 -0800	[thread overview]
Message-ID: <20050118212033.26e1b6f0@localhost.localdomain> (raw)

Dear Russell:

I have a favour to ask of you. I need the following patch to be applied
to the USB core:

diff -urpN -X dontdiff linux-2.6.11-rc1-bk4/drivers/usb/core/hcd.c linux-2.6.11-rc1-bk4-lem/drivers/usb/core/hcd.c
--- linux-2.6.11-rc1-bk4/drivers/usb/core/hcd.c	2005-01-12 16:35:53.000000000 -0800
+++ linux-2.6.11-rc1-bk4-lem/drivers/usb/core/hcd.c	2005-01-17 21:38:51.000000000 -0800
@@ -1099,14 +1104,12 @@ static int hcd_submit_urb (struct urb *u
 	urb = usb_get_urb (urb);
 	atomic_inc (&urb->use_count);
 
-	if (urb->dev == hcd->self.root_hub) {
+	if (usb_pipedevice(urb->pipe) == 1) {
 		/* NOTE:  requirement on hub callers (usbfs and the hub
 		 * driver, for now) that URBs' urb->transfer_buffer be
 		 * valid and usb_buffer_{sync,unmap}() not be needed, since
 		 * they could clobber root hub response data.
 		 */
-		urb->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP
-					| URB_NO_SETUP_DMA_MAP);
 		status = rh_urb_enqueue (hcd, urb);
 		goto done;
 	}
@@ -1168,7 +1171,7 @@ unlink1 (struct usb_hcd *hcd, struct urb
 {
 	int		value;
 
-	if (urb->dev == hcd->self.root_hub)
+	if (usb_pipedevice(urb->pipe) == 1)
 		value = usb_rh_urb_dequeue (hcd, urb);
 	else {
 
@@ -1258,7 +1261,7 @@ static int hcd_unlink_urb (struct urb *u
 	 * finish unlinking the initial failed usb_set_address()
 	 * or device descriptor fetch.
 	 */
-	if (!hcd->saw_irq && hcd->self.root_hub != urb->dev) {
+	if (!hcd->saw_irq && usb_pipedevice(urb->pipe) != 1) {
 		dev_warn (hcd->self.controller, "Unlink after no-IRQ?  "
 			"Controller is probably using the wrong IRQ."
 			"\n");
@@ -1465,12 +1468,8 @@ void usb_hcd_giveback_urb (struct usb_hc
 {
 	urb_unlink (urb);
 
-	// NOTE:  a generic device/urb monitoring hook would go here.
-	// hcd_monitor_hook(MONITOR_URB_FINISH, urb, dev)
-	// It would catch exit/unlink paths for all urbs.
-
 	/* lower level hcd code should use *_dma exclusively */
-	if (hcd->self.controller->dma_mask) {
+	if (hcd->self.controller->dma_mask && usb_pipedevice(urb->pipe) != 1) {
 		if (usb_pipecontrol (urb->pipe)
 			&& !(urb->transfer_flags & URB_NO_SETUP_DMA_MAP))
 			dma_unmap_single (hcd->self.controller, urb->setup_dma,

However, David objects to the patch on the grounds that it can damage ARM.
I am sure that what I do matches perfectly what ARM needs, based on this:
 http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.5/usb-core-2-2.5.33.patch

#    This was first noticed on ARM (no surprises here); the root hub
#    code, rh_call_control(), placed data into the buffer and then
#    called usb_hcd_giveback_urb().  This function called
#    pci_unmap_single() on this region which promptly destroyed the
#    data that rh_call_control() had placed there.  This lead to a
#    corrupted device descriptor and the "too many configurations"
#    message.

So, it would help me a lot if you tested the patch on a system with SA-1111
against a regression and thus buried this silly ARM canard decisively.

Please let me know if you have time to help me out.

Thank you,
-- Pete

             reply	other threads:[~2005-01-19  5:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-19  5:20 Pete Zaitcev [this message]
2005-01-19  6:14 ` usbmon, usb core, ARM David Brownell
2005-01-19 15:42   ` Pete Zaitcev
2005-01-19 15:54     ` Oliver Neukum
2005-01-19 17:08     ` David Brownell
2005-01-20 19:35       ` Pete Zaitcev
2005-01-21  6:28         ` David Brownell
2005-01-22  8:12           ` Pete Zaitcev
2005-01-23 23:34             ` [linux-usb-devel] " David Brownell
2005-01-24  1:17               ` Pete Zaitcev
2005-01-24  2:08                 ` David Brownell

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=20050118212033.26e1b6f0@localhost.localdomain \
    --to=zaitcev@redhat.com \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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