All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] i2c: omap: correct usage of the interrupt enable register
@ 2013-05-30 15:56 ` Oleksandr Dmytryshyn
  0 siblings, 0 replies; 10+ messages in thread
From: Oleksandr Dmytryshyn @ 2013-05-30 15:56 UTC (permalink / raw)
  To: Tony Lindgren, Wolfram Sang
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

I've just added a detailed description of the problem that is being solved
to the cover letter and commit message in the patch.

If the i2c controller during suspend will generate an interrupt, it
can lead to unpredictable behaviour in the kernel.

Based on the logic of the kernel code interrupts from i2c should be
prohibited during suspend. Kernel writes 0 to the I2C_IE register in
the omap_i2c_runtime_suspend() function. In the other side kernel
writes saved interrupt flags to the I2C_IE register in
omap_i2c_runtime_resume() function. I.e. interrupts should be disabled
during suspend.

This works for chips with version1 registers scheme. Interrupts are
disabled during suspend. For chips with version2 scheme registers
writting 0 to the I2C_IE register does nothing (because now the
I2C_IRQENABLE_SET register is located at this address). This register
is used to enable interrupts. For disabling interrupts
I2C_IRQENABLE_CLR register should be used.

Because the registers I2C_IRQENABLE_SET and I2C_IE have the same
addresses, the interrupt enabling procedure is unchanged.

I've checked that interrupts in the i2c controller are still enabled
after writting 0 to the I2C_IE register. But with my patch interrupts
are disabled in the omap_i2c_runtime_suspend() function. 

Next patch fixes it.

Patch is based on:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
tag: v3.10-rc2

Verified on OMAP4430.

Oleksandr Dmytryshyn (1):
  i2c: omap: correct usage of the interrupt enable register

 drivers/i2c/busses/i2c-omap.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

-- 
1.8.2.rc2

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-05-31 17:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-30 15:56 [PATCH v2 0/1] i2c: omap: correct usage of the interrupt enable register Oleksandr Dmytryshyn
2013-05-30 15:56 ` Oleksandr Dmytryshyn
     [not found] ` <1369929379-19165-1-git-send-email-oleksandr.dmytryshyn-l0cyMroinI0@public.gmane.org>
2013-05-30 15:56   ` [PATCH v2 1/1] " Oleksandr Dmytryshyn
2013-05-30 15:56     ` Oleksandr Dmytryshyn
     [not found]     ` <1369929379-19165-2-git-send-email-oleksandr.dmytryshyn-l0cyMroinI0@public.gmane.org>
2013-05-30 16:46       ` Kevin Hilman
2013-05-30 16:46         ` Kevin Hilman
     [not found]         ` <87vc604dr9.fsf-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-05-31  8:19           ` Oleksandr Dmytryshyn
2013-05-31  8:19             ` Oleksandr Dmytryshyn
     [not found]             ` <51A85CFC.2000904-l0cyMroinI0@public.gmane.org>
2013-05-31 17:24               ` Kevin Hilman
2013-05-31 17:24                 ` Kevin Hilman

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.