[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFT] Re: [Patch] [bug #26237] multiple problems with usb devices

From: Aleš Nesrsta
Subject: Re: [RFT] Re: [Patch] [bug #26237] multiple problems with usb devices
Date: Tue, 01 Jun 2010 23:14:13 +0200

Hi Vladimir,

even I am too busy to do any development or "research", I tried at least
to shortly test the usb branch code, as you wrote here:

Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> I've merged your latest patch into usb branch too, fixing some
> problems
> it would have on yeeloong. Compile tested only.
> Can someone give it a good test? If it works on both yeeloong and pc,
> I'll merge it into mainline ASAP.

I tested 9 devices which all were working on both HCs before.
Result of my testing:
UHCI - 7 devices from 9 are working
OHCI - 7 devices from 9 are working, some of them were very slow,
probably lot of timeouts happened

So some mistakes are somewhere...

On both HCs was not working device which has max. packet length for
control endpoint lower than 64. As I remember that this patch was
relative simple, I shortly looked into usb.c and usbtrans.c and there is

--- usbtrans.c
+++ usbtrans_corrected.c        
@@ -76,7 +76,7 @@
   setupdata_addr = grub_dma_get_phys (setupdata_chunk);
   /* Determine the maximum packet size.  */
-  if (dev->initialized && dev->descdev.maxsize0)
+  if (dev->descdev.maxsize0)
     max = dev->descdev.maxsize0;
     max = 64;

dev->initialized is set to TRUE too late (after address setting
transaction) so we have to ignore it in control transfers - we must use
value from dev->descdev.maxsize0 immediately after successful reading of
first 8 bytes of device descriptor (where is this value included) - as
is (probably not clearly, sorry) described by me in this part of usb.c

 /* First we have to read first 8 bytes only and determine
   * max. size of packet */
  dev->descdev.maxsize0 = 0; /* invalidating, for safety only, can be
removed if it is sure it is zero here */
  err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_DEVICE,
                                 0, 8, (char *) &dev->descdev);
  if (err)
    return err;

  /* Now we have valid value in dev->descdev.maxsize0,
   * so we can read whole device descriptor */
  err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_DEVICE,
                                 0, sizeof (struct grub_usb_desc_device),
                                 (char *) &dev->descdev);

There is probably some new problem in OHCI because some devices are now
very slow on this controller. Unfortunately I currently have no time to
discover why - I am expecting some mistake probably in "toggling" and
related code in ohci.c.

On UHCI does not work my mobile phone. But I am not 100% sure if it
worked before on UHCI and I have no time to try it now. I am 100% sure
it worked on OHCI - so maybe it is similar problem as with my card

And some old (but probably not critical) problem remains in UHCI - there
is still not properly working sequence:
rmmod usbms, rmmod uhci, <removing of old device and connecting of new
device>, insmod uhci, insmod usbms
- it works on OHCI but on UHCI it does not work - for first look it is
working (for example commands "ls" and "ls (usb0,1)" are working if
these commands are used as first commands after device change) but for
second look does not (for example command "ls (usb0,1)/<some directory>"
reports USB mass storage stalled).

Best regards

reply via email to

[Prev in Thread] Current Thread [Next in Thread]