diff mbox

i.MX: Fix GPIO ISR register write

Message ID 1477361005-18646-1-git-send-email-linux@roeck-us.net
State New
Headers show

Commit Message

Guenter Roeck Oct. 25, 2016, 2:03 a.m. UTC
Writing the ISR register is supposed to clear interrupt status bits,
not to set them.

This patch makes '-M sabrelite' work without devicetree changes (Linux
kernel versions 3.18 to 4.7 with imx_v6_v7_defconfig and up to v4.8 with
multi_v7_defconfig; mainline has different problems).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 hw/gpio/imx_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jean-Christophe Dubois Oct. 25, 2016, 9:47 a.m. UTC | #1
Le 25/10/2016 à 04:03, Guenter Roeck a écrit :
> Writing the ISR register is supposed to clear interrupt status bits,
> not to set them.
>
> This patch makes '-M sabrelite' work without devicetree changes (Linux
> kernel versions 3.18 to 4.7 with imx_v6_v7_defconfig and up to v4.8 with
> multi_v7_defconfig; mainline has different problems).
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>   hw/gpio/imx_gpio.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
> index f3574aa..c36c394 100644
> --- a/hw/gpio/imx_gpio.c
> +++ b/hw/gpio/imx_gpio.c
> @@ -237,7 +237,7 @@ static void imx_gpio_write(void *opaque, hwaddr offset, uint64_t value,
>           break;
>   
>       case ISR_ADDR:
> -        s->isr |= ~value;
> +        s->isr &= ~value;
>           imx_gpio_set_all_int_lines(s);
>           break;
>   

acked-by: Jean-Christophe Dubois <jcd@tribudubois.net>

Thanks.

JC
Peter Maydell Oct. 25, 2016, 11:11 a.m. UTC | #2
On 25 October 2016 at 03:03, Guenter Roeck <linux@roeck-us.net> wrote:
> Writing the ISR register is supposed to clear interrupt status bits,
> not to set them.
>
> This patch makes '-M sabrelite' work without devicetree changes (Linux
> kernel versions 3.18 to 4.7 with imx_v6_v7_defconfig and up to v4.8 with
> multi_v7_defconfig; mainline has different problems).
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  hw/gpio/imx_gpio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
> index f3574aa..c36c394 100644
> --- a/hw/gpio/imx_gpio.c
> +++ b/hw/gpio/imx_gpio.c
> @@ -237,7 +237,7 @@ static void imx_gpio_write(void *opaque, hwaddr offset, uint64_t value,
>          break;
>
>      case ISR_ADDR:
> -        s->isr |= ~value;
> +        s->isr &= ~value;
>          imx_gpio_set_all_int_lines(s);
>          break;



Applied to target-arm.next, thanks.

-- PMM
diff mbox

Patch

diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
index f3574aa..c36c394 100644
--- a/hw/gpio/imx_gpio.c
+++ b/hw/gpio/imx_gpio.c
@@ -237,7 +237,7 @@  static void imx_gpio_write(void *opaque, hwaddr offset, uint64_t value,
         break;
 
     case ISR_ADDR:
-        s->isr |= ~value;
+        s->isr &= ~value;
         imx_gpio_set_all_int_lines(s);
         break;