[PATCH v2 0/2] hw/arm: Fix STM32L4x5 EXTI to CPU irq fan-in connections

Inès Varhol posted 2 patches 6 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240220184145.106107-1-ines.varhol@telecom-paris.fr
Maintainers: Arnaud Minier <arnaud.minier@telecom-paris.fr>, "Inès Varhol" <ines.varhol@telecom-paris.fr>, Peter Maydell <peter.maydell@linaro.org>, Alistair Francis <alistair@alistair23.me>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
include/hw/arm/stm32l4x5_soc.h    |  4 ++
hw/arm/stm32l4x5_soc.c            | 80 +++++++++++++++++++++++++++----
tests/qtest/stm32l4x5_exti-test.c | 37 ++++++++++++++
3 files changed, 111 insertions(+), 10 deletions(-)
[PATCH v2 0/2] hw/arm: Fix STM32L4x5 EXTI to CPU irq fan-in connections
Posted by Inès Varhol 6 months, 2 weeks ago
The original code was connecting several outbounds qemu_irqs to the
same qemu_irq without using a TYPE_OR_IRQ.

This patch fixes the issue by using OR gates when necessary (1st commit).

I attempted to check that the problem is fixed by using a QTest (2nd commit)
but actually the test is passing even before the fix :
when any fan-in input line is raised, the output is raised too.

Changes from v1 :
- using SoC State fields for EXTI OR gates
- correcting length of array `exti_or_gates_num_lines_in`
- using a for loop in the test for more clarity
- correcting typo in test comment

Fixes: 52671f69f7a4 ("[PATCH v8 0/3] Add device STM32L4x5 EXTI")
Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>

Inès Varhol (2):
  hw/arm: Use TYPE_OR_IRQ when connecting STM32L4x5 EXTI fan-in IRQs
  tests/qtest: Check that EXTI fan-in irqs are correctly connected

 include/hw/arm/stm32l4x5_soc.h    |  4 ++
 hw/arm/stm32l4x5_soc.c            | 80 +++++++++++++++++++++++++++----
 tests/qtest/stm32l4x5_exti-test.c | 37 ++++++++++++++
 3 files changed, 111 insertions(+), 10 deletions(-)

-- 
2.43.2
Re: [PATCH v2 0/2] hw/arm: Fix STM32L4x5 EXTI to CPU irq fan-in connections
Posted by Peter Maydell 6 months, 2 weeks ago
On Tue, 20 Feb 2024 at 18:41, Inès Varhol <ines.varhol@telecom-paris.fr> wrote:
>
> The original code was connecting several outbounds qemu_irqs to the
> same qemu_irq without using a TYPE_OR_IRQ.
>
> This patch fixes the issue by using OR gates when necessary (1st commit).
>
> I attempted to check that the problem is fixed by using a QTest (2nd commit)
> but actually the test is passing even before the fix :
> when any fan-in input line is raised, the output is raised too.
>
> Changes from v1 :
> - using SoC State fields for EXTI OR gates
> - correcting length of array `exti_or_gates_num_lines_in`
> - using a for loop in the test for more clarity
> - correcting typo in test comment
>
> Fixes: 52671f69f7a4 ("[PATCH v8 0/3] Add device STM32L4x5 EXTI")
> Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
>
> Inès Varhol (2):
>   hw/arm: Use TYPE_OR_IRQ when connecting STM32L4x5 EXTI fan-in IRQs
>   tests/qtest: Check that EXTI fan-in irqs are correctly connected



Applied to target-arm.next, thanks.

-- PMM