[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.2.4 28/34] hw/gpio/imx_gpio: Fix interpretation of GDIR polari
From: |
Michael Tokarev |
Subject: |
[Stable-9.2.4 28/34] hw/gpio/imx_gpio: Fix interpretation of GDIR polarity |
Date: |
Wed, 14 May 2025 15:57:50 +0300 |
From: Bernhard Beschow <shentey@gmail.com>
According to the i.MX 8M Plus reference manual, a GPIO pin is
configured as an output when the corresponding bit in the GDIR
register is set. The function imx_gpio_set_int_line() is intended to
be a no-op if the pin is configured as an output, returning early in
such cases. However, it inverts the condition. Fix this by
returning early when the bit is set.
cc: qemu-stable@nongnu.org
Fixes: f44272809779 ("i.MX: Add GPIO device")
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-id: 20250501183445.2389-4-shentey@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit eba837a31b9579e30cc6d7ecb4b5c2662a6ffaba)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
index 27535a577f..e3ed6b2a63 100644
--- a/hw/gpio/imx_gpio.c
+++ b/hw/gpio/imx_gpio.c
@@ -79,7 +79,7 @@ static void imx_gpio_update_int(IMXGPIOState *s)
static void imx_gpio_set_int_line(IMXGPIOState *s, int line, IMXGPIOLevel
level)
{
/* if this signal isn't configured as an input signal, nothing to do */
- if (!extract32(s->gdir, line, 1)) {
+ if (extract32(s->gdir, line, 1)) {
return;
}
--
2.39.5
- [Stable-9.2.4 21/34] hw/core: Get default_cpu_type calling machine_class_default_cpu_type(), (continued)
- [Stable-9.2.4 21/34] hw/core: Get default_cpu_type calling machine_class_default_cpu_type(), Michael Tokarev, 2025/05/14
- [Stable-9.2.4 25/34] meson: Remove CONFIG_STATX and CONFIG_STATX_MNT_ID, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 22/34] hw/core/cpu: gdb_arch_name string should not be freed, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 27/34] target/arm: Don't assert() for ISB/SB inside IT block, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 19/34] target/i386/hvf: fix lflags_to_rflags, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 31/34] gitlab: use --refetch in check-patch/check-dco jobs, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 32/34] hw/i2c/imx: Always set interrupt status bit if interrupt condition occurs, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 26/34] accel/tcg: Don't use TARGET_LONG_BITS in decode_sleb128, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 24/34] meson: Use has_header_symbol() to check getcpu(), Michael Tokarev, 2025/05/14
- [Stable-9.2.4 29/34] target/i386: do not trigger IRQ shadow for LSS, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 28/34] hw/gpio/imx_gpio: Fix interpretation of GDIR polarity,
Michael Tokarev <=
- [Stable-9.2.4 30/34] target/i386: do not block singlestep for STI, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 33/34] 9pfs: fix concurrent v9fs_reclaim_fd() calls, Michael Tokarev, 2025/05/14
- [Stable-9.2.4 34/34] 9pfs: fix FD leak and reduce latency of v9fs_reclaim_fd(), Michael Tokarev, 2025/05/14