mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Question] is it a race condition in acking PMIC sub-interrupt?
@ 2014-06-19 12:34 Yi Zhang
  2014-06-22 11:12 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Yi Zhang @ 2014-06-19 12:34 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Yi Zhang, zhangwm, shayp, zhouqiao

Hi, Mark:

Sorry to trouble you, I met a question related the interrupt ack
sequence in regmap framework; could you please share your advice on
this? thank you very much;

1) the following is the connection related to PMIC on my development board:

     PMIC ---> GPIO --> GIC

     the GPIO is edge triggered interrupt controller, while GIC is
level triggered;
2)  there are several interrupt ack registers in PMIC; in
regmap_irq_thread(), we acked them one by one; but if before we finish
acking all the registers, another interrupt on the "has-been-acked
register" is triggered, the interrupt line will be pulled up or down,
in the 1) case, because GPIO is edge triggered, it cannot "see" this
interrupt, then GIC cannot know either; while in regmap_irq_thread(),
the software thinks it has acked all the interrupt, then goes on; but
actually the interrupt is missed and cannot be resumed in the 1)
scenario;

Please point out what I'm wrong; thanks;

So if this is true, what about using the following methods to fix it?
a) disable all the interrupts just before ack, then enable them after
ack finished; the cons are a) the interrupt is ignored in the process;
b) we need to manipulate the registers more frequently, after all, I2C
is a slow bus;
b) polling until the interrupts are acked; but I think it's hard to
guarantee that because the interrupt is asynchronous;

and one more question:
Seems we shouldn't connect an interrupt controller as PMIC with an
edge triggered interrupt controller? Could you please share your
opinion? we can modify the hardware connection accordingly;

thank you very much; :)

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

end of thread, other threads:[~2014-06-22 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 12:34 [Question] is it a race condition in acking PMIC sub-interrupt? Yi Zhang
2014-06-22 11:12 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®