From patchwork Mon May 13 14:33:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 16885 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A38025E14 for ; Mon, 13 May 2013 14:34:44 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id s10sf7915217qcv.3 for ; Mon, 13 May 2013 07:34:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :from:to:cc:subject:date:message-id:x-mailer:mime-version :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=UdMUtkSKi6d55j7HoRst1N/lM9hbyM6gpYqQi4l/GC4=; b=gohASsFG76p8hkuzEQeyY/ZE725QNEbDA35tUydVHm0zkOqZSpOvOrBV19q0pHsjOv TNPjsngfqdpFUt9yFGJeb5AO/7bW7IGrQbL1tUCAg3vcWWijaMH80C9TSCd8jGr12fTa jBxDHy3YZ9bNQoqO4RhRxOniGyyRqI/38NRj+8Oolld/yo1J2tJmNemwlBnKrcIo9tZg vRLl/9frg+sh8jRD9ureeOZqDLed5mfOgzSOs+JfOKPu2l4zH2S2yr84xnCitMv2gkWy CgpfePotPXF/utR2sO7wcqSd8/rCXy/P7auvJFTX4LX6u52WgXXoNtJQqrEa/zBtd/95 YpLg== X-Received: by 10.236.148.38 with SMTP id u26mr13389680yhj.48.1368455651660; Mon, 13 May 2013 07:34:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.207 with SMTP id t15ls1730838qeq.67.gmail; Mon, 13 May 2013 07:34:11 -0700 (PDT) X-Received: by 10.59.0.226 with SMTP id bb2mr18710501ved.1.1368455651483; Mon, 13 May 2013 07:34:11 -0700 (PDT) Received: from mail-vb0-x22c.google.com (mail-vb0-x22c.google.com [2607:f8b0:400c:c02::22c]) by mx.google.com with ESMTPS id wl5si8575905vec.7.2013.05.13.07.34.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 May 2013 07:34:11 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22c; Received: by mail-vb0-f44.google.com with SMTP id e13so5235833vbg.17 for ; Mon, 13 May 2013 07:34:11 -0700 (PDT) X-Received: by 10.220.11.1 with SMTP id r1mr883206vcr.14.1368455651345; Mon, 13 May 2013 07:34:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.217.15 with SMTP id hk15csp21212vcb; Mon, 13 May 2013 07:34:10 -0700 (PDT) X-Received: by 10.14.3.4 with SMTP id 4mr20427735eeg.8.1368455650128; Mon, 13 May 2013 07:34:10 -0700 (PDT) Received: from eu1sys200aog111.obsmtp.com (eu1sys200aog111.obsmtp.com [207.126.144.131]) by mx.google.com with SMTP id r44si11123901eep.15.2013.05.13.07.33.45 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 07:34:10 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.131; Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP ID DSNKUZD5xeSGWOCXmx8fyDgrEV7eCcQjix80@postini.com; Mon, 13 May 2013 14:34:10 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 81B551BC; Mon, 13 May 2013 14:33:36 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9CCBB540D; Mon, 13 May 2013 14:33:25 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 34DD424C2AB; Mon, 13 May 2013 16:33:28 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 13 May 2013 16:33:35 +0200 From: Ulf Hansson To: , Russell King Cc: , Chris Ball , Ulf Hansson Subject: [PATCH] mmc: mmci: Support for CMD23 Date: Mon, 13 May 2013 16:33:32 +0200 Message-ID: <1368455612-20786-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnTI9Vxln1ldBHNnkjgtZJK6y9MDm7HhRecgpR7P/QE0qQ4JuEGyCrDk1vpqBIp+lEkwJsI X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ulf Hansson 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. This patch is based upon a patch from Saugata Das. Signed-off-by: Ulf Hansson Acked-by: Linus Walleij --- drivers/mmc/host/mmci.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f4f3038..27f29bb 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -842,7 +842,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); @@ -855,6 +855,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, unsigned int status) { void __iomem *base = host->base; + bool sbc = (cmd == host->mrq->sbc); host->cmd = NULL; @@ -869,7 +870,7 @@ 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) { /* Terminate the DMA transfer */ if (dma_inprogress(host)) { @@ -878,7 +879,9 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, } mmci_stop_data(host); } - mmci_request_end(host, cmd->mrq); + mmci_request_end(host, host->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); } @@ -1119,7 +1122,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); }