diff mbox series

[21/21] hw/gpio/imx_gpio: Don't clear input GPIO values upon reset

Message ID 20250120203748.4687-22-shentey@gmail.com
State New
Headers show
Series Add i.MX 8M Plus EVK machine | expand

Commit Message

Bernhard Beschow Jan. 20, 2025, 8:37 p.m. UTC
Input GPIO values such as a present SD card may get notified before the GPIO
controller itself gets reset. Claring the input values thus loses data. Assuming
that input GPIO events are only fired when the state changes, the input values
shouldn't be reset.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/gpio/imx_gpio.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Gustavo Romero Jan. 28, 2025, 2:33 p.m. UTC | #1
Hi,

On 1/20/25 17:37, Bernhard Beschow wrote:
> Input GPIO values such as a present SD card may get notified before the GPIO
> controller itself gets reset. Claring the input values thus loses data. Assuming

                                 ^- nit: Clearing


Cheers,
Gustavo

> that input GPIO events are only fired when the state changes, the input values
> shouldn't be reset.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/gpio/imx_gpio.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
> index 549a281ed7..25546221e0 100644
> --- a/hw/gpio/imx_gpio.c
> +++ b/hw/gpio/imx_gpio.c
> @@ -298,7 +298,6 @@ static void imx_gpio_reset(DeviceState *dev)
>   
>       s->dr       = 0;
>       s->gdir     = 0;
> -    s->psr      = 0;
>       s->icr      = 0;
>       s->imr      = 0;
>       s->isr      = 0;
Bernhard Beschow Feb. 3, 2025, 11:06 p.m. UTC | #2
Am 28. Januar 2025 14:33:27 UTC schrieb Gustavo Romero <gustavo.romero@linaro.org>:
>Hi,
>
>On 1/20/25 17:37, Bernhard Beschow wrote:
>> Input GPIO values such as a present SD card may get notified before the GPIO
>> controller itself gets reset. Claring the input values thus loses data. Assuming
>
>                                ^- nit: Clearing
>
>

Peter asked for a three-way reset in inbound devices while keeping the logic here as is. I'd drop this patch then.

Best regards,
Bernhard

>Cheers,
>Gustavo
>
>> that input GPIO events are only fired when the state changes, the input values
>> shouldn't be reset.
>> 
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> ---
>>   hw/gpio/imx_gpio.c | 1 -
>>   1 file changed, 1 deletion(-)
>> 
>> diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
>> index 549a281ed7..25546221e0 100644
>> --- a/hw/gpio/imx_gpio.c
>> +++ b/hw/gpio/imx_gpio.c
>> @@ -298,7 +298,6 @@ static void imx_gpio_reset(DeviceState *dev)
>>         s->dr       = 0;
>>       s->gdir     = 0;
>> -    s->psr      = 0;
>>       s->icr      = 0;
>>       s->imr      = 0;
>>       s->isr      = 0;
>
diff mbox series

Patch

diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
index 549a281ed7..25546221e0 100644
--- a/hw/gpio/imx_gpio.c
+++ b/hw/gpio/imx_gpio.c
@@ -298,7 +298,6 @@  static void imx_gpio_reset(DeviceState *dev)
 
     s->dr       = 0;
     s->gdir     = 0;
-    s->psr      = 0;
     s->icr      = 0;
     s->imr      = 0;
     s->isr      = 0;