All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org, Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Subject: [PATCH 03/28] omap: gpio: fix incorrect matching of IRQ_TYPE_EDGE_BOTH
Date: Fri, 23 Apr 2010 16:11:07 -0700	[thread overview]
Message-ID: <20100423231107.31953.72733.stgit@baageli.muru.com> (raw)
In-Reply-To: <20100423230829.31953.17334.stgit@baageli.muru.com>

From: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>

Since IRQ_TYPE_EDGE_BOTH is defined as (IRQ_TYPE_EDGE_FALLING |
IRQ_TYPE_EDGE_RISING), testing against it with a bitwise AND also matches
both single-edge cases in addition to the intended both edges case. Fix it,
replacing with a more accurate expression.

Created and tested againts linux-2.6.34-rc3.
Applicable to 2.6.33-stable as well.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/gpio.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 76a347b..45a225d 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -798,7 +798,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 	case METHOD_MPUIO:
 		reg += OMAP_MPUIO_GPIO_INT_EDGE;
 		l = __raw_readl(reg);
-		if (trigger & IRQ_TYPE_EDGE_BOTH)
+		if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
 			bank->toggle_mask |= 1 << gpio;
 		if (trigger & IRQ_TYPE_EDGE_RISING)
 			l |= 1 << gpio;
@@ -812,7 +812,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 	case METHOD_GPIO_1510:
 		reg += OMAP1510_GPIO_INT_CONTROL;
 		l = __raw_readl(reg);
-		if (trigger & IRQ_TYPE_EDGE_BOTH)
+		if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
 			bank->toggle_mask |= 1 << gpio;
 		if (trigger & IRQ_TYPE_EDGE_RISING)
 			l |= 1 << gpio;
@@ -846,7 +846,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 	case METHOD_GPIO_7XX:
 		reg += OMAP7XX_GPIO_INT_CONTROL;
 		l = __raw_readl(reg);
-		if (trigger & IRQ_TYPE_EDGE_BOTH)
+		if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
 			bank->toggle_mask |= 1 << gpio;
 		if (trigger & IRQ_TYPE_EDGE_RISING)
 			l |= 1 << gpio;


WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/28] omap: gpio: fix incorrect matching of IRQ_TYPE_EDGE_BOTH
Date: Fri, 23 Apr 2010 16:11:07 -0700	[thread overview]
Message-ID: <20100423231107.31953.72733.stgit@baageli.muru.com> (raw)
In-Reply-To: <20100423230829.31953.17334.stgit@baageli.muru.com>

From: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>

Since IRQ_TYPE_EDGE_BOTH is defined as (IRQ_TYPE_EDGE_FALLING |
IRQ_TYPE_EDGE_RISING), testing against it with a bitwise AND also matches
both single-edge cases in addition to the intended both edges case. Fix it,
replacing with a more accurate expression.

Created and tested againts linux-2.6.34-rc3.
Applicable to 2.6.33-stable as well.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/gpio.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 76a347b..45a225d 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -798,7 +798,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 	case METHOD_MPUIO:
 		reg += OMAP_MPUIO_GPIO_INT_EDGE;
 		l = __raw_readl(reg);
-		if (trigger & IRQ_TYPE_EDGE_BOTH)
+		if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
 			bank->toggle_mask |= 1 << gpio;
 		if (trigger & IRQ_TYPE_EDGE_RISING)
 			l |= 1 << gpio;
@@ -812,7 +812,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 	case METHOD_GPIO_1510:
 		reg += OMAP1510_GPIO_INT_CONTROL;
 		l = __raw_readl(reg);
-		if (trigger & IRQ_TYPE_EDGE_BOTH)
+		if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
 			bank->toggle_mask |= 1 << gpio;
 		if (trigger & IRQ_TYPE_EDGE_RISING)
 			l |= 1 << gpio;
@@ -846,7 +846,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 	case METHOD_GPIO_7XX:
 		reg += OMAP7XX_GPIO_INT_CONTROL;
 		l = __raw_readl(reg);
-		if (trigger & IRQ_TYPE_EDGE_BOTH)
+		if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
 			bank->toggle_mask |= 1 << gpio;
 		if (trigger & IRQ_TYPE_EDGE_RISING)
 			l |= 1 << gpio;

  parent reply	other threads:[~2010-04-23 23:11 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23 23:10 [PATCH 00/28] omap fixes for v2.6.34-rc5 Tony Lindgren
2010-04-23 23:10 ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 01/28] omap: fix clocksource_32k to start from zero Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 02/28] arm: omap1: remove dead code from timer32k.c Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` Tony Lindgren [this message]
2010-04-23 23:11   ` [PATCH 03/28] omap: gpio: fix incorrect matching of IRQ_TYPE_EDGE_BOTH Tony Lindgren
2010-04-23 23:11 ` [PATCH 04/28] omap: DMA: Init CDAC to zero Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 05/28] omap4: Fix build break when used with gcc-4.4.1 (2009-q3) Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 06/28] omap2: Fix ARM processor check for 24xx Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 07/28] omap: Fix n8x0 mmc_mmc_init compile warnings and typos Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 08/28] omap3: Fix EHCI port for IGEP v2 board Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 09/28] OMAP4-HSMMC: FIX for MMC5 Controller IRQ Base Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 10/28] OMAP4: Fix for CONTROL register Base Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 11/28] omap: Devkit8000: Fix wrong usb port on Devkit8000 Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 12/28] OMAP4: Clocks: Change SPI Instance Names Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 13/28] omap: fix the compile error if CONFIG_MTD_NAND_OMAP2 is notenabled Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 14/28] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 15/28] AM3517: initialize i2c subsystem after mux subsystem Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 16/28] omap: fix a gpmc nand problem Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 17/28] omap: rx51_defconfig: Remove duplicate phonet Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 18/28] omap: rx51_defconfig: Remove CONFIG_SYSFS_DEPRECATED*=y options Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 19/28] omap4: Fix McBSP4 base address Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 20/28] omap: board-sdp-flash.c: Fix typos in debug output Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 21/28] n8x0_defconfig: remove CONFIG_NILFS2_FS override Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 22/28] omap: Devkit8000: Fix typo in supplies Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:11 ` [PATCH 23/28] omap: Devkit8000: Add missing package selection Tony Lindgren
2010-04-23 23:11   ` Tony Lindgren
2010-04-23 23:12 ` [PATCH 24/28] omap: Devkit8000: Fix typo in pin name Tony Lindgren
2010-04-23 23:12   ` Tony Lindgren
2010-04-23 23:12 ` [PATCH 25/28] omap: Devkit8000: Remove unnecessary include file Tony Lindgren
2010-04-23 23:12   ` Tony Lindgren
2010-04-23 23:12 ` [PATCH 26/28] omap: Devkit8000: Change position of init calls Tony Lindgren
2010-04-23 23:12   ` Tony Lindgren
2010-04-23 23:12 ` [PATCH 27/28] omap: Devkit8000: Remove unused pins Tony Lindgren
2010-04-23 23:12   ` Tony Lindgren
2010-04-23 23:12 ` [PATCH 28/28] omap: delete unused bootloader tag variables Tony Lindgren
2010-04-23 23:12   ` Tony Lindgren

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=20100423231107.31953.72733.stgit@baageli.muru.com \
    --to=tony@atomide.com \
    --cc=jkrzyszt@tis.icnet.pl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.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.