All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Gabriel L. Somlo" <gsomlo@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: agraf@suse.de, reza.jelveh@tuhh.de,
	edk2-devel@lists.sourceforge.net,
	Gerd Hoffmann <kraxel@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] OVMF, Q35 and USB keyboard/mouse
Date: Mon, 15 Sep 2014 17:01:21 +0200	[thread overview]
Message-ID: <5416FF41.7010800@redhat.com> (raw)
In-Reply-To: <20140915145005.GM1825@ERROL.INI.CMU.EDU>

On 09/15/14 16:50, Gabriel L. Somlo wrote:
> On Fri, Sep 12, 2014 at 03:59:52PM -0400, Gabriel L. Somlo wrote:
>> On Fri, Sep 12, 2014 at 08:26:01PM +0200, Paolo Bonzini wrote:
>>> So it could be an OVMF bug related to multifunction devices.
>>>
>>> Well, you could try moving devices around in different functions.
>>> You could try moving ehci1 to 0 and the UHCIs to 1/2/7.
>>>
>>> Or drop uhci2/uhci3 and move the two remaining devices around.  Once you
>>> have three combinations that work (e.g. 0/4, 0/6, 0/7) you could use it
>>> to add three UHCI controllers (in the above examples, it would be 0/1/2/7).
>>>
>>> Remember that one of the two must be xx.0, the other can be anything
>>> from xx.1 to xx.7.
>>
>> I moved things around as you suggested (from hw/usb/hcd-ehci-pci.c and
>> the ich9_1d[] array).
>>
>> No matter which PCI function gets assigned to which device, and no
>> matter which order the uhci1/2/3 devices are listed in ich9_1d[],
>> it's *always* uhci3 (dev.id. 2936) and ehci being shown, and uhci1&2
>> end up missing.
>>
>> Interestingly, if I comment out uhci3, it's only ehci that shows up,
>> not uhci1 or uhci2 (even though one of them is 00:1d.0). 
>>
>>
>> Feels like there's some thing "magical" about the uhci3 name or device
>> ID. Maybe at this point I should go fishing in the edk2 source :) 
> 
> Even more interesting, if I use uhci3 for all three uhci devices in
> qemu:
> 
> 
> diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
> index 289ca3b..bb230f1 100644
> --- a/hw/usb/hcd-ehci-pci.c
> +++ b/hw/usb/hcd-ehci-pci.c
> @@ -208,8 +208,8 @@ struct ehci_companions {
>  };
>  
>  static const struct ehci_companions ich9_1d[] = {
> -    { .name = "ich9-usb-uhci1", .func = 0, .port = 0 },
> -    { .name = "ich9-usb-uhci2", .func = 1, .port = 2 },
> +    { .name = "ich9-usb-uhci3", .func = 0, .port = 0 },
> +    { .name = "ich9-usb-uhci3", .func = 1, .port = 2 },
>      { .name = "ich9-usb-uhci3", .func = 2, .port = 4 },
>  };
> 
> 
> they *all* get detected and work great on ovmf+osx. Slow kbd+mouse
> get routed automatically to one of them, and work fine. The only
> differences I can see between them (in hw/usb/hcd-uhci.c) is
> the name string and "irq_pin" field. Not sure yet if that's likely
> to point to an explanation...

It is actually extremely relevant, the irq_pin field. I'm not exactly
sure how just yet, but it is. Maybe check the interrupt routing in OSX
somehow? Do you have a dmesg-like log in OSX, with a PRT dump from the
DSDT, and messages about interrupt routing setup? Do you have in OSX
anything that corresponds to /proc/interrupts under Linux?

Laszlo

  reply	other threads:[~2014-09-15 15:01 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 22:00 [Qemu-devel] OVMF, Q35 and USB keyboard/mouse Gabriel L. Somlo
2014-09-10  0:40 ` Laszlo Ersek
2014-09-10  6:31 ` Gerd Hoffmann
2014-09-10  7:59   ` Laszlo Ersek
2014-09-10 14:06     ` Gabriel L. Somlo
2014-09-10 23:08       ` [Qemu-devel] [edk2] " Paolo Bonzini
2014-09-11 15:42         ` [Qemu-devel] " Gabriel L. Somlo
2014-09-11 15:49           ` Paolo Bonzini
2014-09-11 16:35             ` Gabriel L. Somlo
2014-09-11 16:40               ` Paolo Bonzini
2014-09-11 17:11                 ` Gabriel L. Somlo
2014-09-11 17:15                   ` [Qemu-devel] [edk2] " Paolo Bonzini
2014-09-11 20:16                 ` [Qemu-devel] " Gabriel L. Somlo
2014-09-11 20:46                   ` Laszlo Ersek
2014-09-11 21:34                     ` Alexander Graf
2014-09-11 23:21                       ` Gabriel L. Somlo
2014-09-12  9:17                         ` BALATON Zoltan
2014-09-12 17:58                           ` Gabriel L. Somlo
2014-09-12  6:46                   ` Gerd Hoffmann
2014-09-12 18:18                     ` Gabriel L. Somlo
2014-09-12 18:26                       ` Paolo Bonzini
2014-09-12 19:59                         ` Gabriel L. Somlo
2014-09-13  5:06                           ` Laszlo Ersek
2014-09-15 14:50                           ` Gabriel L. Somlo
2014-09-15 15:01                             ` Laszlo Ersek [this message]
2014-09-15 15:07                               ` Gabriel L. Somlo
2014-09-15 18:02                                 ` Laszlo Ersek
2014-09-15 19:23                                   ` Gabriel L. Somlo
2014-09-15 19:56                                     ` BALATON Zoltan
2014-09-16  8:15                                     ` Gerd Hoffmann
2014-09-21 20:00                                       ` Gabriel L. Somlo
2014-09-21 22:10                                   ` Gabriel L. Somlo
2014-09-21 22:43                                     ` Laszlo Ersek
2014-09-22 16:44                                       ` [Qemu-devel] [edk2] " Paolo Bonzini
2014-09-22 16:59                                         ` Gabriel L. Somlo
2014-09-22 20:40                                         ` Laszlo Ersek
2014-09-24 22:03                                           ` Gabriel L. Somlo

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=5416FF41.7010800@redhat.com \
    --to=lersek@redhat.com \
    --cc=agraf@suse.de \
    --cc=edk2-devel@lists.sourceforge.net \
    --cc=gsomlo@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=reza.jelveh@tuhh.de \
    /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 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.