From: Gonglei <arei.gonglei@huawei.com>
To: Lin Ma <lma@suse.com>, qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Re-attach usb device to kernel while usb_host_open fails
Date: Tue, 23 Jun 2015 16:29:56 +0800 [thread overview]
Message-ID: <55891904.9060508@huawei.com> (raw)
In-Reply-To: <1435033463-13185-1-git-send-email-lma@suse.com>
On 2015/6/23 12:24, Lin Ma wrote:
> Signed-off-by: Lin Ma <lma@suse.com>
> ---
> hw/usb/host-libusb.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
> index 10f4735..7258c4d 100644
> --- a/hw/usb/host-libusb.c
> +++ b/hw/usb/host-libusb.c
> @@ -888,6 +888,11 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev)
> fail:
> trace_usb_host_open_failure(bus_num, addr);
> if (s->dh != NULL) {
> + qemu_remove_exit_notifier(&s->exit);
> + QTAILQ_REMOVE(&hostdevs, s, next);
This change will cause a regression. For example, if an usb device's
(assume that it's usb1.0 device) speed does not match the ehci adapter,
then then invoking usb_host_open failed. if somebody changes the usb
device to an usb 2.0 device, it will not auto check because the device has
removed from the global hostdevs list.
So I think we don't need do the above operations.
Regards,
-Gonglei
> + usb_host_release_interfaces(s);
> + libusb_reset_device(s->dh);
> + usb_host_attach_kernel(s);
> libusb_close(s->dh);
> s->dh = NULL;
> s->dev = NULL;
>
next prev parent reply other threads:[~2015-06-23 8:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 4:24 [Qemu-devel] [PATCH] Re-attach usb device to kernel while usb_host_open fails Lin Ma
2015-06-23 8:29 ` Gonglei [this message]
2015-06-23 14:49 ` Lin Ma
2015-06-24 1:12 ` Gonglei
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=55891904.9060508@huawei.com \
--to=arei.gonglei@huawei.com \
--cc=kraxel@redhat.com \
--cc=lma@suse.com \
--cc=qemu-devel@nongnu.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).