lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1397661299-31342-1-git-send-email-balbi@ti.com>
Date:	Wed, 16 Apr 2014 10:14:59 -0500
From:	Felipe Balbi <balbi@...com>
To:	<dbaryshkov@...il.com>, <dwmw2@...radead.org>
CC:	Linux OMAP Mailing List <linux-omap@...r.kernel.org>,
	Linux ARM Kernel Mailing List 
	<linux-arm-kernel@...ts.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Russell King <linux@....linux.org.uk>,
	Felipe Balbi <balbi@...com>
Subject: [PATCH] power: twl4030_charger: clear IRQs after handling them

TRM says we *must* write 1 to each bit we're handling
in order to clear the IRQ status and bring IRQ line
low. This patch implements that.

Signed-off-by: Felipe Balbi <balbi@...com>
---

Russell, I don't have HW to test, but this should
solve the problem you saw when not using battery
with Zoom board. Let me know if it doesn't.

cheers

 drivers/power/twl4030_charger.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index f141088..b090842 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -301,12 +301,24 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void *arg)
 	ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &irqs1,
 			      TWL4030_INTERRUPTS_BCIISR1A);
 	if (ret < 0)
-		return IRQ_HANDLED;
+		return IRQ_NONE;
+
+	/* clear IRQs early */
+	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs1,
+			TWL4030_INTERRUPTS_BCIISR1A);
+	if (ret < 0)
+		return IRQ_NONE;
 
 	ret = twl_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &irqs2,
 			      TWL4030_INTERRUPTS_BCIISR2A);
 	if (ret < 0)
-		return IRQ_HANDLED;
+		return IRQ_NONE;
+
+	/* clear IRQs early */
+	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, irqs2,
+			      TWL4030_INTERRUPTS_BCIISR2A);
+	if (ret < 0)
+		return IRQ_NONE;
 
 	dev_dbg(bci->dev, "BCI irq %02x %02x\n", irqs2, irqs1);
 
-- 
1.9.1.286.g5172cb3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ