public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* SDIO single irq optimization - Spurious interrupt notification to function driver
@ 2012-03-30  4:57 Sujit Reddy Thumma
  2012-03-30 19:05 ` Nicolas Pitre
  0 siblings, 1 reply; 2+ messages in thread
From: Sujit Reddy Thumma @ 2012-03-30  4:57 UTC (permalink / raw)
  To: linux-mmc@vger.kernel.org, nicolas.pitre, per.forlin

Hi,

While I was debugging an issue where the sdio function driver panics 
upon receiving a spurious interrupt notification which is similar to the 
one found on libertas sdio 
http://permalink.gmane.org/gmane.linux.kernel.mmc/8338

I can confirm that my hardware not buggy and is not generating any 
interrupts during initialization and CCCR_INTx is all zero's.

After some analysis, I found that there is a notification of interrupt 
to function handler by sdio_irq_thread() even though there is no 
interrupt. The sequence is as follows.

sdio_claim_host();

sdio_claim_irq():
	...
	sdio_card_irq_get() -> kthread_run(sdio_irq_thread) -> 
wake_up_sdio_irq_thread
	sdio_single_irq_set() -> card->sdio_single_irq = func = sdio_func[i];
	...

sdio_release_host();

Since we woke up sdio_irq_thread(), while this thread get a chance to run:
...
__mmc_claim_host()
process_sdio_pending_irqs() -> since sdio_single_irq is non NULL the 
func->handler is directly called without checking pending interrupt bit 
CCCR_INTx.
mmc_release_host()
...

Irrespective of the function driver state, sdio driver should not call 
func->handler() if it is not real interrupt. I knew that function 
handler should be able to handle these interrupts gracefully. But it is 
just not the right thing for sdio driver to generate spurious interrupts.

I see this notification issue during mmc_sdio_resume() also explained by 
Nicolas:
http://permalink.gmane.org/gmane.linux.kernel.mmc/10871

This leads me to think of reverting commit 06e8935feb "optimized SDIO 
IRQ handling for single irq" instead of hacking every function driver to 
handle spurious interrupt notification gracefully.

Let me know your thoughts on this or suggest any alternate way instead 
of reverting it.

-- 
Thanks & Regards,
Sujit Reddy Thumma

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

end of thread, other threads:[~2012-03-30 19:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30  4:57 SDIO single irq optimization - Spurious interrupt notification to function driver Sujit Reddy Thumma
2012-03-30 19:05 ` Nicolas Pitre

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