From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Date: Mon, 01 Sep 2014 09:20:58 +0000 Subject: [PATCH 1/7] mmc: add blk_size_workaround for HW bug Message-Id: <87ppffzog7.wl%kuninori.morimoto.gx@gmail.com> List-Id: References: <87r3zvzohj.wl%kuninori.morimoto.gx@gmail.com> In-Reply-To: <87r3zvzohj.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Ulf Hansson , Chris Ball , Simon Cc: Kuninori Morimoto , Linux-SH , linux-mmc From: Kuninori Morimoto Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag for HW bug workaround, but it should be implemented under driver, not framework. This patch is prepare for it Signed-off-by: Kuninori Morimoto --- drivers/mmc/card/block.c | 5 +++++ include/linux/mmc/host.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index ede41f0..e946067 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1402,6 +1402,11 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ && rq_data_dir(req) = READ) brq->data.blocks = 1; + + /* Some controllers needs workaround */ + if (card->host->ops->blk_size_workaround) + brq->data.blocks = card->host->ops->blk_size_workaround( + card, req, brq->data.blocks); } if (brq->data.blocks > 1 || do_rel_wr) { diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 4cbf614..95bd903 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -139,6 +139,10 @@ struct mmc_host_ops { int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); void (*hw_reset)(struct mmc_host *host); void (*card_event)(struct mmc_host *host); + + /* optional callback for mmc block HW bug workaround */ + int (*blk_size_workaround)(struct mmc_card *card, + struct request *req, int blk_size); }; struct mmc_card; -- 1.7.9.5