From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHRda-0005Id-Ip for qemu-devel@nongnu.org; Wed, 13 Aug 2014 02:02:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHRdV-0008AW-Ad for qemu-devel@nongnu.org; Wed, 13 Aug 2014 02:02:18 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:58259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHRdV-0008AH-2Q for qemu-devel@nongnu.org; Wed, 13 Aug 2014 02:02:13 -0400 Received: by mail-pd0-f174.google.com with SMTP id fp1so13802095pdb.5 for ; Tue, 12 Aug 2014 23:02:11 -0700 (PDT) Message-ID: <53EAFF5C.3030608@ozlabs.ru> Date: Wed, 13 Aug 2014 16:02:04 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <53E8406C.2010304@ozlabs.ru> <33183CC9F5247A488A2544077AF1902086C29AB8@SZXEMA503-MBS.china.huawei.com> <53E9AEA5.5010708@ozlabs.ru> <53EAEF2B.5040106@ozlabs.ru> <33183CC9F5247A488A2544077AF1902086C302E0@SZXEMA503-MBS.china.huawei.com> In-Reply-To: <33183CC9F5247A488A2544077AF1902086C302E0@SZXEMA503-MBS.china.huawei.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] USB PCI host bus adapter hot plug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" , "qemu-devel@nongnu.org" Cc: Michael Roth , Tyrel Datwyler , "kraxel@redhat.com" On 08/13/2014 03:00 PM, Gonglei (Arei) wrote: >>>>> I noticed that QMP's "device_add usb-ehci,id=i2,bus=pci.0" fails on PCI >>>>> hotplug. The same for pci-ohci and this is because their initfn() do >>>>> "dc->hotpluggable = false". So I removed those and now I can hotplug >> USB >>>>> hosts but none of them is able to actually work: >>>>> >>>>> root@aiktest-le:~# echo 1 >/sys/bus/pci/rescan >>>>> [ 41.143062] ohci-pci 0000:00:01.0: init err (c8700000 0000) >>>>> [ 41.143133] ohci-pci 0000:00:01.0: can't start >>>>> [ 41.143227] ohci-pci 0000:00:01.0: startup error -75 >>>>> [ 41.144202] ohci-pci 0000:00:01.0: init 0000:00:01.0 fail, -75 >>>>> >>>>> >>>>> root@aiktest-le:~# echo 1 >/sys/bus/pci/rescan >>>>> [ 43.691067] ehci-pci 0000:00:01.0: can't setup: -110 >>>>> [ 43.692424] ehci-pci 0000:00:01.0: init 0000:00:01.0 fail, -110 >>>>> >>>>> >>>>> Why is that? Is QEMU just missing some bits or there is some fundamental >>>>> issue which I just do not see? Thanks! >>>>> >>>> Cc'ing Gerd. >>>> >>>> Actually I have post a patch serials for supporting usb host adapter >> hotplugging, >>>> Which has been involved in Gerd's (the USB mantainer) usb-next tree. Please >> see: >>>> https://www.kraxel.org/cgit/qemu/log/?h=rebase/usb-next >>>> >>>> The function of usb host adapter hotplugging is ok. You are welcome to test >> it. >>> >>> It does not work for me though. The device appears in the system but the >>> driver fails to bring it up: >>> >>> [root@localhost ~]# echo 1 >/sys/bus/pci/rescan >>> >>> [ 43.482378] pci 0000:00:01.0: BAR 0: assigned [mem >>> 0x100a0000000-0x100a0000fff] >>> [ 43.488851] ehci-pci 0000:00:01.0: EHCI Host Controller >>> >>> [ 43.490153] ehci-pci 0000:00:01.0: new USB bus registered, assigned bus >>> number 1 >>> [ 43.504957] ehci-pci 0000:00:01.0: can't setup: -110 >>> >>> [ 43.505028] ehci-pci 0000:00:01.0: USB bus 1 deregistered >>> >>> [ 43.507660] ehci-pci 0000:00:01.0: init 0000:00:01.0 fail, -110 >>> >>> [ 43.507808] ehci-pci: probe of 0000:00:01.0 failed with error -110 >>> >>> >>> >>>> BTW, What's your guest os type? >>> >>> Fedora20/ppc64 or Ubuntu14/ppc64le. >>> >>> I tried your tree merged with >>> https://github.com/mdroth/qemu/tree/spapr-pci-hotplug-ppc-next-cleanup2 >>> >>> I am adding PCIhotplug-on-PPC experts to the thread, may be they have >> ideas... >> >> >> More precise - this fails: >> >> drivers/usb/host/ehci-hcd.c: >> >> int ehci_handshake(struct ehci_hcd *ehci, void __iomem *ptr, >> u32 mask, u32 done, int usec) >> { >> u32 result; >> >> do { >> result = ehci_readl(ehci, ptr); >> if (result == ~(u32)0) /* card removed */ >> return -ENODEV; >> result &= mask; >> if (result == done) >> return 0; >> udelay (1); >> usec--; >> } while (usec > 0); >> return -ETIMEDOUT; // <------------------ >> } >> >> -- >> Alexey > > Hi, Alexey. > > Does this work when you configure > EHCI at the command line, not hotplugging? Yes, all possible USB hosts work just fine when added in the command line. > BTW, I'm not familiar with PCIhotplug-on-PPC. Sorry for this. I doubt this is because of PPC but there is always a chance :) -- Alexey