linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmci.c: CMD23 support
@ 2012-02-01  4:17 Saugata Das
  2012-02-01 20:07 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Saugata Das @ 2012-02-01  4:17 UTC (permalink / raw)
  To: linux-mmc

From: Saugata Das <saugata.das@linaro.org>

Support added for transmission of CMD23 during multi block read or write. In order to activate this feature, MMC_CAP_CMD23 flag needs to be enabled in the capabilities field. Note that CMD23 support is mandatory to support features like reliable write, data tag, context ID, packed command

Signed-off-by: Saugata Das <saugata.das@linaro.org>
---
 drivers/mmc/host/mmci.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 8eabf99..21f75da 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -726,7 +726,7 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
 			/* The error clause is handled above, success! */
 			data->bytes_xfered = data->blksz * data->blocks;
 
-		if (!data->stop) {
+		if (!data->stop || host->mrq->sbc) {
 			mmci_request_end(host, data->mrq);
 		} else {
 			mmci_start_command(host, data->stop, 0);
@@ -739,6 +739,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
 	     unsigned int status)
 {
 	void __iomem *base = host->base;
+	bool sbc = !!(host->mrq->sbc && (host->mrq->sbc == host->cmd));
 
 	host->cmd = NULL;
 
@@ -753,10 +754,12 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
 		cmd->resp[3] = readl(base + MMCIRESPONSE3);
 	}
 
-	if (!cmd->data || cmd->error) {
+	if ((!sbc && !cmd->data) || cmd->error) {
 		if (host->data)
 			mmci_stop_data(host);
 		mmci_request_end(host, cmd->mrq);
+	} else if (sbc) {
+		mmci_start_command(host, host->mrq->cmd, 0);
 	} else if (!(cmd->data->flags & MMC_DATA_READ)) {
 		mmci_start_data(host, cmd->data);
 	}
@@ -998,7 +1001,10 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 	if (mrq->data && mrq->data->flags & MMC_DATA_READ)
 		mmci_start_data(host, mrq->data);
 
-	mmci_start_command(host, mrq->cmd, 0);
+	if (mrq->sbc)
+		mmci_start_command(host, mrq->sbc, 0);
+	else
+		mmci_start_command(host, mrq->cmd, 0);
 
 	spin_unlock_irqrestore(&host->lock, flags);
 }
-- 
1.7.4.3


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

* Re: [PATCH] mmci.c: CMD23 support
  2012-02-01  4:17 [PATCH] mmci.c: CMD23 support Saugata Das
@ 2012-02-01 20:07 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2012-02-01 20:07 UTC (permalink / raw)
  To: Saugata Das; +Cc: linux-mmc

On Wed, Feb 1, 2012 at 5:17 AM, Saugata Das <saugata.das@stericsson.com> wrote:

> From: Saugata Das <saugata.das@linaro.org>
>
> Support added for transmission of CMD23 during multi block read or write. In order to activate this feature, MMC_CAP_CMD23 flag needs to be enabled in the capabilities field. Note that CMD23 support is mandatory to support features like reliable write, data tag, context ID, packed command

Please linebreak this at 70 characters or so...

> Signed-off-by: Saugata Das <saugata.das@linaro.org>

Apart from the long lines this looks good to me:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Please put this into Russell's patch tracker if it is not
dependent on any other patches (you may
need to register in the system first):
http://www.arm.linux.org.uk/developer/patches/

Yours,
Linus Walleij

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

end of thread, other threads:[~2012-02-01 20:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01  4:17 [PATCH] mmci.c: CMD23 support Saugata Das
2012-02-01 20:07 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).