From: Davide Berardi <berardi.dav@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org,
Andrew Baumann <Andrew.Baumann@microsoft.com>
Subject: Re: [PATCH] Raspberry PI GPIO interrupt support
Date: Wed, 10 Feb 2021 15:32:19 +0100 [thread overview]
Message-ID: <20210210143219.GA95384@carpenter.lan> (raw)
In-Reply-To: <355f1271-09c9-715a-a909-c0f05060dfe5@amsat.org>
Dear Philippe, thank you for your kind response.
I will send a new version for the patch with the modifications you've
highlighted, but first I've some question on the best way to implement
them.
On Tue, Feb 09, 2021 at 12:30:32PM +0100, Philippe Mathieu-Daudé wrote:
>Hi Davide,
>On 2/9/21 12:02 PM, Davide Berardi wrote:
>> The bcm2835 GPIOs now generate interrupts.
>> This modification enables QTEST clients to trigger interrupt-based
>> interfaces.
>
>Thanks for your patch!
>
>Can you provide QTEST client example? Even better would be a qtest!
>
The minimal client I've developed can be found at
https://github.com/berdav/qemu-rpi-gpio
As I have introduced, I'm building a qtest but I've found a problem: In
my test, I want to check if the IRQs of the named GPIOs
/machine/soc/peripherals/ic/gpu-irq are correctly handled by the
controller. I was thinking to use irq_intercept_in to get the status of
the IRQ lines using something similar to the following:
qtest_irq_intercept_in(s, "/machine/soc/peripherals/ic");
And then check it using
qtest_get_irq(s, 49 + irqline);
But it isn't triggering.
Looking in the source of qtest I've found this check in the
qtest_irq_intercept_in function:
QLIST_FOREACH(ngl, &dev->gpios, node) {
/* We don't support intercept of named GPIOs yet */
if (ngl->name) {
continue;
}
I've removed the if and the qtests seems to work just fine.
Is there particular caveats or details to implement this part of the
framework?
I can send separated patches if you have some details on the desiderata
of the support, or maybe start a new thread with this question.
Otherwise, I can remove the part of my qtest to not check the
IRQs, but I don't know if it would be the best choice.
>
>I wonder how you generated your patch, it doesn't apply:
>
>Applying: Raspberry PI GPIO interrupt support
>error: patch failed: hw/arm/bcm2835_peripherals.c:114
>error: hw/arm/bcm2835_peripherals.c: patch does not apply
>error: patch failed: hw/gpio/bcm2835_gpio.c:7
>error: hw/gpio/bcm2835_gpio.c: patch does not apply
>error: patch failed: hw/intc/bcm2835_ic.c:57
>error: hw/intc/bcm2835_ic.c: patch does not apply
>error: patch failed: include/hw/gpio/bcm2835_gpio.h:7
>error: include/hw/gpio/bcm2835_gpio.h: patch does not apply
>Patch failed at 0001 Raspberry PI GPIO interrupt support
>
>You can find the guidelines here:
>https://wiki.qemu.org/Contribute/SubmitAPatch#Submitting_your_Patches
>
I have just created the patch using git format patch -s , it does not
give me any error applying it over the master branch on
https://github.com/qemu/QEMU . I will take more care and apply it on the
master branch of https://git.qemu.org/git/qemu.git/ , thank you.
> [... cut ...]
>
>Regards,
>
>Phil.
I'm adapting the patch using the Coding style script now.
I've also introduced a new costant for the number of GPIOs.
Thank you for your time,
D.
next prev parent reply other threads:[~2021-02-10 14:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 11:02 [PATCH] Raspberry PI GPIO interrupt support Davide Berardi
2021-02-09 11:30 ` Philippe Mathieu-Daudé
2021-02-10 14:32 ` Davide Berardi [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-02-09 9:03 Davide Berardi
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=20210210143219.GA95384@carpenter.lan \
--to=berardi.dav@gmail.com \
--cc=Andrew.Baumann@microsoft.com \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@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.