All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] Mixed USB 1.1 and USB 2.0 on the same port
@ 2012-01-04 12:02 erik.rull
  2012-01-04 16:52 ` Erik Rull
  0 siblings, 1 reply; 5+ messages in thread
From: erik.rull @ 2012-01-04 12:02 UTC (permalink / raw)
  To: qemu-devel

> On 12/31/11 13:11, Erik Rull wrote:
> > Hi all,
> >
> > how can I use a USB 1.1 device on the USB 2.0 bus? Currently the EHCI
> > implementation complains that the device is mismatches the USB version.
> 
> -readconfig docs/ich9-ehci-uhci.cfg
> 
> cheers,
>   Gerd

Thanks for the hint.

It looks better now. But some things are still a bit strange.

Sequence:
device_add usb-host,bus=ehci.0,hostbus=2,hostport=1.4
Plug in a USB 2.0 printer
(gets detected by the guest, printing is possible, no bluescreen, it just
works)
Remove the USB 2.0 printer
Plug in a USB 1.1 dongle
Gets detected, etc., fine
Remove the USB 1.1 dongle
Plug in the USB 2.0 printer again
Guest complains now, that a USB 2.0 device was plugged into a USB 1.1 port
=> printer is now 1.1 and does not work as if EHCI is missing now
=> reboot guest, everything is fine again??

Any idea what could have happened here?
Same behavior when using a 2.0 USB key and the USB 1.1 dongle - also on
other ports - the transfer rate is horrible after having removed the USB
1.1 device and reconnected the 2.0 device.
Exchanging the two USB 2.0 devices on the same port without having the 1.1
device plugged in is fine!

Any hint what is wrong here would be great.

Best regards,

Erik

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Mixed USB 1.1 and USB 2.0 on the same port
  2012-01-04 12:02 [Qemu-devel] Mixed USB 1.1 and USB 2.0 on the same port erik.rull
@ 2012-01-04 16:52 ` Erik Rull
  2012-01-13 13:37   ` Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: Erik Rull @ 2012-01-04 16:52 UTC (permalink / raw)
  To: qemu-devel

erik.rull@rdsoftware.de wrote:
>> On 12/31/11 13:11, Erik Rull wrote:
>>> Hi all,
>>>
>>> how can I use a USB 1.1 device on the USB 2.0 bus? Currently the EHCI
>>> implementation complains that the device is mismatches the USB version.
>>
>> -readconfig docs/ich9-ehci-uhci.cfg
>>
>> cheers,
>>    Gerd
>
> Thanks for the hint.
>
> It looks better now. But some things are still a bit strange.
>
> Sequence:
> device_add usb-host,bus=ehci.0,hostbus=2,hostport=1.4
> Plug in a USB 2.0 printer
> (gets detected by the guest, printing is possible, no bluescreen, it just
> works)
> Remove the USB 2.0 printer
> Plug in a USB 1.1 dongle
> Gets detected, etc., fine
> Remove the USB 1.1 dongle
> Plug in the USB 2.0 printer again
> Guest complains now, that a USB 2.0 device was plugged into a USB 1.1 port
> =>  printer is now 1.1 and does not work as if EHCI is missing now
> =>  reboot guest, everything is fine again??
>
> Any idea what could have happened here?
> Same behavior when using a 2.0 USB key and the USB 1.1 dongle - also on
> other ports - the transfer rate is horrible after having removed the USB
> 1.1 device and reconnected the 2.0 device.
> Exchanging the two USB 2.0 devices on the same port without having the 1.1
> device plugged in is fine!
>
> Any hint what is wrong here would be great.
>
> Best regards,
>
> Erik
>

Additional Information:
This behavior is present on a Linux guest as well! After having removed the 
1.1 Dongle and plugged in the printer, the Linux guest detects the hardware 
via the UHCI kernel drivers and tells me to use a faster hub for max. 
performance.
It looks as if the speed downgrade by the 1.1 device cannot be reversed at 
runtime.

Best regards,

Erik

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Mixed USB 1.1 and USB 2.0 on the same port
  2012-01-04 16:52 ` Erik Rull
@ 2012-01-13 13:37   ` Hans de Goede
  0 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2012-01-13 13:37 UTC (permalink / raw)
  To: Erik Rull; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1951 bytes --]



On 01/04/2012 05:52 PM, Erik Rull wrote:
> erik.rull@rdsoftware.de wrote:
>>> On 12/31/11 13:11, Erik Rull wrote:
>>>> Hi all,
>>>>
>>>> how can I use a USB 1.1 device on the USB 2.0 bus? Currently the EHCI
>>>> implementation complains that the device is mismatches the USB version.
>>>
>>> -readconfig docs/ich9-ehci-uhci.cfg
>>>
>>> cheers,
>>> Gerd
>>
>> Thanks for the hint.
>>
>> It looks better now. But some things are still a bit strange.Hi,
>>
>> Sequence:
>> device_add usb-host,bus=ehci.0,hostbus=2,hostport=1.4
>> Plug in a USB 2.0 printer
>> (gets detected by the guest, printing is possible, no bluescreen, it just
>> works)
>> Remove the USB 2.0 printer
>> Plug in a USB 1.1 dongle
>> Gets detected, etc., fine
>> Remove the USB 1.1 dongle
>> Plug in the USB 2.0 printer again
>> Guest complains now, that a USB 2.0 device was plugged into a USB 1.1 port
>> => printer is now 1.1 and does not work as if EHCI is missing now
>> => reboot guest, everything is fine again??
>>
>> Any idea what could have happened here?
>> Same behavior when using a 2.0 USB key and the USB 1.1 dongle - also on
>> other ports - the transfer rate is horrible after having removed the USB
>> 1.1 device and reconnected the 2.0 device.
>> Exchanging the two USB 2.0 devices on the same port without having the 1.1
>> device plugged in is fine!
>>
>> Any hint what is wrong here would be great.
>>
>> Best regards,
>>
>> Erik
>>
>
> Additional Information:
> This behavior is present on a Linux guest as well! After having removed the 1.1 Dongle and plugged in the printer, the Linux guest detects the hardware via the UHCI kernel drivers and tells me to use a faster hub for max. performance.
> It looks as if the speed downgrade by the 1.1 device cannot be reversed at runtime.

I've managed to reproduce this and written a fix for it. I've just send
a patch for this to the list. I've also attached this patch here for
your convenience.

Regards,

Hans

[-- Attachment #2: 0001-usb-ehci-Clear-the-portstatus-powner-bit-on-device-d.patch --]
[-- Type: text/x-patch, Size: 1186 bytes --]

>From 0b5059a8c0ae45c66caf5947f66b5c5cae81f622 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 13 Jan 2012 14:26:26 +0100
Subject: [PATCH] usb-ehci: Clear the portstatus powner bit on device
 disconnect

According to the EHCI spec port ownerhsip should revert to the EHCI controller
on device disconnect. This fixes the problem of a port getting stuck on USB 1
when using redirection and plugging in a USB 2 device after a USB 1 device
has been redirected.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/usb-ehci.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index a946e1d..69bcc4b 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -764,6 +764,11 @@ static void ehci_detach(USBPort *port)
         USBPort *companion = s->companion_ports[port->index];
         companion->ops->detach(companion);
         companion->dev = NULL;
+        /*
+         * EHCI spec 4.2.2: "When a disconnect occurs... On the event,
+         * the port ownership is returned immediately to the EHCI controller."
+         */
+        *portsc &= ~PORTSC_POWNER;
         return;
     }
 
-- 
1.7.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Mixed USB 1.1 and USB 2.0 on the same port
  2011-12-31 12:11 Erik Rull
@ 2012-01-03 15:24 ` Gerd Hoffmann
  0 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2012-01-03 15:24 UTC (permalink / raw)
  To: Erik Rull; +Cc: qemu-devel

On 12/31/11 13:11, Erik Rull wrote:
> Hi all,
> 
> how can I use a USB 1.1 device on the USB 2.0 bus? Currently the EHCI
> implementation complains that the device is mismatches the USB version.

-readconfig docs/ich9-ehci-uhci.cfg

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Mixed USB 1.1 and USB 2.0 on the same port
@ 2011-12-31 12:11 Erik Rull
  2012-01-03 15:24 ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Erik Rull @ 2011-12-31 12:11 UTC (permalink / raw)
  To: qemu-devel

Hi all,

how can I use a USB 1.1 device on the USB 2.0 bus? Currently the EHCI 
implementation complains that the device is mismatches the USB version.

I want to offer one root port for both USB 2.0 and USB 1.1 devices using 
usb-host,... Routings to the guest.

Maybe only some parameters need to be added to the qemu commandline?

Any hint would be helpful.

Thanks.

Best regards,

Erik

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-13 13:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-04 12:02 [Qemu-devel] Mixed USB 1.1 and USB 2.0 on the same port erik.rull
2012-01-04 16:52 ` Erik Rull
2012-01-13 13:37   ` Hans de Goede
  -- strict thread matches above, loose matches on Subject: below --
2011-12-31 12:11 Erik Rull
2012-01-03 15:24 ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.