Re: OMAP: Add TI TWL92330/Menelaus Power Management chip driver

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Trilok Soni <soni.trilok@...>, <i2c@...>, Jean Delvare <khali@...>, Tony Lindgren <tony@...>, <drzeus-mmc@...>, <linux-kernel@...>, <amit.kucheria@...>
Date: Thursday, July 12, 2007 - 10:22 pm

On Thursday 12 July 2007, Andrew Morton wrote:


Two 8-bit registers for IRQ status, so total of 16 potential handlers.
Of course, I think several of those bits aren't actually used.



How could it do that?



Right.  ISTR that the "sync" version waits for any active
IRQ handler to complete.  That is, it's specified to cause
a self-deadlock in this call context (wait for self) ...



Evidently the "we cannot use I2C in interrupt context" comment was
excessively subtle.  ;)

The whole I2C stack is synchronous; *EVERY* request to perform I/O
requires a can-sleep task context.  It's not like USB or SPI, where
the IRQ handler can submit I/O requests which will complete later.

Which is why every I2C driver that needs to handle an IRQ will need
to arrange some task context ... ergo the workqueue.  It's something
far more common in embedded systems than in the original "sensors"
context from which the I2C stack evolved.



It's just paranoia.  If it ever *did* happen there would be
extreme confusion; it's easy to prevent, and useful to be
very explicit about this rule.


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [i2c] OMAP: Add TI TWL92330/Menelaus Power Management ch..., Guennadi Liakhovetski, (Sat Jul 14, 7:21 pm)
Re: OMAP: Add TI TWL92330/Menelaus Power Management chip dri..., David Brownell, (Thu Jul 12, 10:22 pm)