All of lore.kernel.org
 help / color / mirror / Atom feed
From: BALATON Zoltan via <qemu-devel@nongnu.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-ppc <qemu-ppc@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Guenter Roeck <linux@roeck-us.net>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v2 3/3] sam460ex: Clean up irq mapping
Date: Thu, 31 Dec 2020 21:58:11 +0100 (CET)	[thread overview]
Message-ID: <c1ab3a3b-1357-fdea-e042-28945e19319@eik.bme.hu> (raw)
In-Reply-To: <79681dc2-d689-4518-a83-dead38dd6e8@eik.bme.hu>

On Thu, 31 Dec 2020, BALATON Zoltan via wrote:
> On Thu, 31 Dec 2020, Peter Maydell wrote:
>> On Thu, 31 Dec 2020 at 15:11, Peter Maydell <peter.maydell@linaro.org> 
>> wrote:
>>> On Thu, 31 Dec 2020 at 11:20, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>>>> 
>>>> Avoid mapping multiple interrupts to the same irq. Instead map them to
>>>> the 4 PCI interrupts and use an or-gate in the board to connect them
>>>> to the interrupt controller. This does not fix any known problem but
>>>> does not seem to cause a new problem either and may be cleaner at least.
>>>> 
>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>> Tested-by: Guenter Roeck <linux@roeck-us.net>
>>> 
>>> So, this patch is a behavioural change, but I think it's
>>> probably a change to the right behaviour. The difference
>>> is relatively slight, but you would see it if there are two
>>> different PCI cards and they both assert a different PCI
>>> interrupt, and then one of them lowers the interrupt
>>> before the other:
>> 
>> This turns out to be wrong -- I hadn't looked at the QEMU PCI
>> code, but it has an internal implementation of logic that
>> gives the same behaviour as an explicit OR gate. Basically
>> pci_change_irq_level() tracks how many assert/deasserts of
>> the (mapped) IRQ lines have happened, so it only calls the
>> controller's set_irq function when the count of asserted
>> inputs goes down to 0. So both the current code and this
>> patch's change are functionally correct.
>
> I've remembered we had this discussion before and arrived to the same 
> conclusion that current code was equivalently working but could not recall 
> the reason.
>
>> I'm not sure which would be nominally closer to the "real hardware":
>> the 440ex CPU/SoC datasheet lists a single PCI0INT signal, but
>> it says it is an output, not an input, so I'm pretty sure there's
>> something I don't understand about PCI here. (Also, unlike the
>> 440EP it provides PCI Express as well as PCI.)
>
> The SoC is called 460EX (despite having a PPC 440 core not 460 one) but I 
> think you've looked at the right data sheet and it's just a typo. I also 
> don't know how the board is wired so I think in this case I prefer dropping 
> this patch and keeping the current code just for simplicity but to avoid 
> going through this again maybe we should add a comment saying why it's 
> working. Can you please suggest a test for such comment pointing to the

I mean "text" not "test" above.

> relevant part of pci_change_irq_level() you refer to above? I don't think I 
> understand it enough to document it.
>
> Thank you,
> BALATON Zoltan
>
>


  reply	other threads:[~2020-12-31 20:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 11:11 [PATCH v2 0/3] Clean up sam460ex irq mapping BALATON Zoltan via
2020-12-25 20:12 ` [PATCH v2 2/3] sam460ex: Remove FDT_PPC dependency from KConfig BALATON Zoltan via
2020-12-31 16:08   ` Philippe Mathieu-Daudé
2021-01-04  1:51   ` BALATON Zoltan via
2021-01-04 11:48     ` Peter Maydell
2021-01-05 12:50     ` Paolo Bonzini
2020-12-31 11:11 ` [PATCH v2 1/3] ppc4xx: Move common dependency on serial to common option BALATON Zoltan via
2021-01-04  0:31   ` David Gibson
2021-01-04  1:25     ` BALATON Zoltan via
2020-12-31 11:11 ` [PATCH v2 3/3] sam460ex: Clean up irq mapping BALATON Zoltan via
2020-12-31 15:11   ` Peter Maydell
2020-12-31 15:51     ` Peter Maydell
2020-12-31 20:54       ` BALATON Zoltan via
2020-12-31 20:58         ` BALATON Zoltan via [this message]
2021-01-01 12:03         ` Peter Maydell
2021-01-03  1:46           ` BALATON Zoltan via

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=c1ab3a3b-1357-fdea-e042-28945e19319@eik.bme.hu \
    --to=qemu-devel@nongnu.org \
    --cc=balaton@eik.bme.hu \
    --cc=david@gibson.dropbear.id.au \
    --cc=linux@roeck-us.net \
    --cc=peter.maydell@linaro.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.