From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Bernhard Beschow <shentey@gmail.com>, qemu-devel@nongnu.org
Cc: Huacai Chen <chenhuacai@kernel.org>,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: Re: [PATCH] hw/isa/vt82c686: Respect SCI interrupt assignment
Date: Wed, 4 Oct 2023 08:25:25 +0200 [thread overview]
Message-ID: <0784106e-44da-7d1f-85d9-8ea83acf4694@linaro.org> (raw)
In-Reply-To: <20231003214437.29302-1-shentey@gmail.com>
Hi Bernhard,
On 3/10/23 23:44, Bernhard Beschow wrote:
> According to the datasheet, SCI interrupts of the power management function
> aren't triggered through the PCI pins but rather directly to the integrated PIC.
> The routing is configurable through the ACPI interrupt select register at offset
> 42 in the PCI configuration space of the ISA function.
You describe 42 but use 0x42 (66). Clearer would be to add a definition,
maybe:
#define PCI_ACPI_INTR_SELECT_OFS 0x42
#define PCI_ACPI_INTR_SELECT_MSK 0xf
Alternatively self-document with function name:
static unsigned via_isa_get_pm_irq_index(ViaISAState *s)
{
return pci_get_byte(s->pm.dev.config + 0x42) & 0xf;
}
Otherwise LGTM.
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> hw/isa/vt82c686.c | 43 +++++++++++++++++++++++++++++++------------
> 1 file changed, 31 insertions(+), 12 deletions(-)
> +static void via_isa_set_pm_irq(void *opaque, int n, int level)
> +{
> + ViaISAState *s = opaque;
> + uint8_t irq = pci_get_byte(s->pm.dev.config + 0x42) & 0xf;
> +
> + if (irq == 2) {
> + qemu_log_mask(LOG_GUEST_ERROR, "IRQ 2 for PM controller is reserved");
> + return;
> + }
> +
> + if (irq != 0) {
> + qemu_set_irq(s->isa_irqs_in[irq], level);
> + }
> +}
next prev parent reply other threads:[~2023-10-04 6:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 21:44 [PATCH] hw/isa/vt82c686: Respect SCI interrupt assignment Bernhard Beschow
2023-10-04 6:25 ` Philippe Mathieu-Daudé [this message]
2023-10-04 12:08 ` BALATON Zoltan
2023-10-04 13:33 ` Bernhard Beschow
2023-10-04 14:52 ` BALATON Zoltan
2023-10-05 7:10 ` Bernhard Beschow
2023-10-05 11:20 ` BALATON Zoltan
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=0784106e-44da-7d1f-85d9-8ea83acf4694@linaro.org \
--to=philmd@linaro.org \
--cc=chenhuacai@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.com \
/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).