From: David Gibson <david@gibson.dropbear.id.au>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc: Make uninorth interrupt swizzling identical to Grackle
Date: Tue, 22 Nov 2016 10:05:29 +1100 [thread overview]
Message-ID: <20161121230529.GC8681@umbus.fritz.box> (raw)
In-Reply-To: <20161120231605.D90DD745789@zero.eik.bme.hu>
[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]
On Mon, Nov 21, 2016 at 12:12:31AM +1000, BALATON Zoltan wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> It's currently broken as it uses an incorrect shift, it tries
> to use the slot number but uses the top bits of the bus number
> instead.
>
> Note: Neither implementation matches what OpenBIOS ends up putting
> in the device-tree either, which will have to be fixed separately.
>
> This is not quite correct for modelling a real Mac since Apple
> tend to tie all 4 interrupt lines of a slot together and have
> separate interrupts for every slot and every motherboard devices
> going straight to the PIC but we'll sort that out later.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> hw/pci-host/uninorth.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> This needs a corresponding fix in OpenBIOS but this has to be
> committed first for that. As this is already broken making this change
> should not make things worse as they are now. Could we get this in now
> as a bugfix commit?
Applied to ppc-for-2.8.
>
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index 7aac4d6..df342ac 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -62,9 +62,7 @@ typedef struct UNINState {
>
> static int pci_unin_map_irq(PCIDevice *pci_dev, int irq_num)
> {
> - int devfn = pci_dev->devfn & 0x00FFFFFF;
> -
> - return (((devfn >> 11) & 0x1F) + irq_num) & 3;
> + return (irq_num + (pci_dev->devfn >> 3)) & 3;
> }
>
> static void pci_unin_set_irq(void *opaque, int irq_num, int level)
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-11-22 0:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-20 14:12 [Qemu-devel] [PATCH] ppc: Make uninorth interrupt swizzling identical to Grackle BALATON Zoltan
2016-11-21 10:06 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-11-21 23:05 ` David Gibson [this message]
2016-11-22 0:12 ` Mark Cave-Ayland
2016-11-22 1:34 ` BALATON Zoltan
2016-11-22 2:50 ` Benjamin Herrenschmidt
[not found] <mailman.20732.1479800734.22740.qemu-devel@nongnu.org>
2016-11-22 14:49 ` G 3
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=20161121230529.GC8681@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=balaton@eik.bme.hu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 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.