Skip to contentSkip to conversation

question on mmc_queue_bounce_pre()/post() in block.c

DISCUSSION J Freyensee 1 participant 1 message Jul 12, 2011 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

I have a question concerning the following block of code in ~/drivers/mmc/card/block.c:

		mmc_queue_bounce_pre(mq);

		/*
		 * Before issuing a user req, host driver should
		 * wait for the BKOPS is done or just use HPI to
		 * interrupt it.
		 */
		if (mmc_wait_for_bkops(card))
			goto cmd_err;
		mmc_wait_for_req(card->host, &brq.mrq);
		mmc_queue_bounce_post(mq);

What is the purpose of mmc_queue_bounce_pre() and mmc_queue_bounce_post()? At first when I looked at the code, I thought it was implementing some type of sw cache- mmc_queue_bounce_pre(mq) would be stored in a buffer, available for reads even before the data gets eventually written to the SSD from the mmc_wait_for_req() call. But the way the code is written, a read from the buffer won't happen until AFTER the mmc_wait_for_req(), which kind-of defeats the purpose of cache. This is independent of the work Per Forlin and co. are doing to make mmc_wait_for_req() non-blocking. So with the way that the code is written today, I am not really sure what benefit mmc_queue_bounce_pre()/*_post() is providing.

I'm still ramping up in this area of the linux kernel, like I don't yet understand the purpose of a scatterlist. But I'm looking to contribute to this area of Linux in some regard.

Thanks for the help,
Jay