From: Greg KH <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Nishanth Menon <nm@ti.com>, Samuel Ortiz <sameo@linux.intel.com>
Subject: [ 36/42] mfd: Clear twl6030 IRQ status register only once
Date: Wed, 11 Apr 2012 16:13:43 -0700 [thread overview]
Message-ID: <20120411231313.718251989@linuxfoundation.org> (raw)
In-Reply-To: <20120411231443.GA808@kroah.com>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nishanth Menon <nm@ti.com>
commit 3f8349e6e98ba0455437724589072523865eae5e upstream.
TWL6030 family of PMIC use a shadow interrupt status register
while kernel processes the current interrupt event.
However, any write(0 or 1) to register INT_STS_A, INT_STS_B or
INT_STS_C clears all 3 interrupt status registers.
Since clear of the interrupt is done on 32k clk, depending on I2C
bus speed, we could in-adverently clear the status of a interrupt
status pending on shadow register in the current implementation.
This is due to the fact that multi-byte i2c write operation into
three seperate status register could result in multiple load
and clear of status and result in lost interrupts.
Instead, doing a single byte write to INT_STS_A register with 0x0
will clear all three interrupt status registers without the related
risk.
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mfd/twl6030-irq.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/drivers/mfd/twl6030-irq.c
+++ b/drivers/mfd/twl6030-irq.c
@@ -145,8 +145,17 @@ static int twl6030_irq_thread(void *data
}
local_irq_enable();
}
- ret = twl_i2c_write(TWL_MODULE_PIH, sts.bytes,
- REG_INT_STS_A, 3); /* clear INT_STS_A */
+
+ /*
+ * NOTE:
+ * Simulation confirms that documentation is wrong w.r.t the
+ * interrupt status clear operation. A single *byte* write to
+ * any one of STS_A to STS_C register results in all three
+ * STS registers being reset. Since it does not matter which
+ * value is written, all three registers are cleared on a
+ * single byte write, so we just use 0x0 to clear.
+ */
+ ret = twl_i2c_write_u8(TWL_MODULE_PIH, 0x00, REG_INT_STS_A);
if (ret)
pr_warning("twl6030: I2C error in clearing PIH ISR\n");
next prev parent reply other threads:[~2012-04-11 23:13 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-11 23:14 [ 00/42] 3.0.28-stable review Greg KH
2012-04-11 23:13 ` [ 01/42] x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND Greg KH
2012-04-11 23:13 ` [ 02/42] rose_dev: fix memcpy-bug in rose_set_mac_address Greg KH
2012-04-11 23:13 ` [ 03/42] net: usb: cdc_eem: fix mtu Greg KH
2012-04-11 23:13 ` [ 04/42] mtd: sst25l: initialize writebufsize Greg KH
2012-04-11 23:13 ` [ 05/42] mtd: block2mtd: " Greg KH
2012-04-11 23:13 ` [ 06/42] mtd: lart: " Greg KH
2012-04-11 23:13 ` [ 07/42] mtd: m25p80: set writebufsize Greg KH
2012-04-11 23:13 ` [ 08/42] ACPI: Do cpufreq clamping for throttling per package v2 Greg KH
2012-04-11 23:13 ` [ 09/42] PNPACPI: Fix device ref leaking in acpi_pnp_match Greg KH
2012-04-11 23:13 ` [ 10/42] ACPICA: Fix regression in FADT revision checks Greg KH
2012-04-11 23:13 ` [ 11/42] modpost: fix ALL_INIT_DATA_SECTIONS Greg KH
2012-04-11 23:13 ` [ 12/42] genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value Greg KH
2012-04-11 23:13 ` [ 13/42] tracing: Fix ftrace stack trace entries Greg KH
2012-04-11 23:13 ` [ 14/42] m68k/mac: Add missing platform check before registering platform devices Greg KH
2012-04-11 23:13 ` [ 15/42] mac80211: fix possible tid_rx->reorder_timer use after free Greg KH
2012-04-11 23:13 ` [ 16/42] drm: Validate requested virtual size against allocated fb size Greg KH
2012-04-11 23:13 ` [ 17/42] drm/radeon/kms: fix fans after resume Greg KH
2012-04-11 23:13 ` [ 18/42] drm/i915: no-lvds quirk on MSI DC500 Greg KH
2012-04-11 23:13 ` [ 19/42] drm/i915: Sanitize BIOS debugging bits from PIPECONF Greg KH
2012-04-11 23:13 ` [ 20/42] drm/i915: Add lock on drm_helper_resume_force_mode Greg KH
2012-04-11 23:13 ` [ 21/42] drm/i915: quirk away broken OpRegion VBT Greg KH
2012-04-11 23:13 ` [ 22/42] kgdb,debug_core: pass the breakpoint struct instead of address and memory Greg KH
2012-04-11 23:13 ` [ 23/42] kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA Greg KH
2012-04-11 23:13 ` [ 24/42] kgdbts: (1 of 2) fix single step awareness to work correctly with SMP Greg KH
2012-04-11 23:13 ` [ 25/42] kgdbts: (2 " Greg KH
2012-04-11 23:13 ` [ 26/42] x86,kgdb: Fix DEBUG_RODATA limitation using text_poke() Greg KH
2012-04-11 23:13 ` [ 27/42] mmc: atmel-mci: correct data timeout computation Greg KH
2012-04-11 23:13 ` [ 28/42] sysctl: fix write access to dmesg_restrict/kptr_restrict Greg KH
2012-04-11 23:13 ` [ 29/42] modpost: Fix modposts license checking V3 Greg KH
2012-04-11 23:13 ` [ 30/42] modpost: Fix modpost license checking of vmlinux.o Greg KH
2012-04-11 23:13 ` [ 31/42] x86/PCI: use host bridge _CRS info on MSI MS-7253 Greg KH
2012-04-11 23:13 ` [ 32/42] x86/PCI: do not tie MSI MS-7253 use_crs quirk to BIOS version Greg KH
2012-04-11 23:13 ` [ 33/42] Revert "x86/ioapic: Add register level checks to detect bogus io-apic entries" Greg KH
2012-04-11 23:13 ` [ 34/42] acer-wmi: No wifi rfkill on Sony machines Greg KH
2012-04-11 23:13 ` [ 35/42] sched/x86: Fix overflow in cyc2ns_offset Greg KH
2012-04-11 23:13 ` Greg KH [this message]
2012-04-11 23:13 ` [ 37/42] USB: Add Motorola Rokr E6 Id to the USBNet driver "zaurus" Greg KH
2012-04-11 23:13 ` [ 38/42] ASoC: ak4642: fixup: mute needs +1 step Greg KH
2012-04-11 23:13 ` [ 39/42] cred: copy_process() should clear child->replacement_session_keyring Greg KH
2012-04-11 23:13 ` [ 40/42] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume Greg KH
2012-04-11 23:13 ` [ 41/42] TOMOYO: Fix mount flags checking order Greg KH
2012-04-11 23:13 ` [ 42/42] Bluetooth: Fix l2cap conn failures for ssp devices Greg KH
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=20120411231313.718251989@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=nm@ti.com \
--cc=sameo@linux.intel.com \
--cc=santosh.shilimkar@ti.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).