public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* omap_hsmmc: race between omap_hsmmc_start_command() and DMA callback
@ 2013-07-18 16:06 Daniel Mack
  2013-07-18 16:30 ` Balaji T K
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Mack @ 2013-07-18 16:06 UTC (permalink / raw)
  To: Balaji T K; +Cc: Linux MMC List, linux-omap@vger.kernel.org, Adrian Hunter

Hi,

I'm facing a NULL pointer dereference in omap_hsmmc_start_command() on
an AM33xx board running 3.11-rc1 (DMA enabled).

A quick debug session showed that DMA engine timing leads to a very
reproducable race condition. In omap_hsmmc_request(), we have:

        host->mrq = req;
        omap_hsmmc_prepare_data()
		omap_hsmmc_start_dma_transfer()
			tx->callback = omap_hsmmc_dma_callback;

	[*]

	omap_hsmmc_start_command()
		if (cmd == host->mrq->stop) [<-- oops]
			...

It turns out that omap_hsmmc_dma_callback() (which sets host->mrq =
NULL) is entered just after the DMA submission, and *before*
omap_hsmmc_start_command() is called, consequently leading to an Oops.

I can debug this in more depth, but maybe someone has an idea already?


Thanks,
Daniel


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

end of thread, other threads:[~2013-07-18 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-18 16:06 omap_hsmmc: race between omap_hsmmc_start_command() and DMA callback Daniel Mack
2013-07-18 16:30 ` Balaji T K

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