From patchwork Sat Jan 14 17:29:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 9517067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8F56607D6 for ; Sat, 14 Jan 2017 17:31:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A76BB284D0 for ; Sat, 14 Jan 2017 17:31:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9865F284CF; Sat, 14 Jan 2017 17:31:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 14B4D284CF for ; Sat, 14 Jan 2017 17:31:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cSSAP-0006Wz-Sn; Sat, 14 Jan 2017 17:31:01 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cSSAL-0006Ut-GF for linux-arm-kernel@lists.infradead.org; Sat, 14 Jan 2017 17:31:00 +0000 Received: from localhost.localdomain ([95.91.4.8]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M9oN6-1cHTm72ttA-00B4Cw; Sat, 14 Jan 2017 18:29:31 +0100 From: Stefan Wahren To: Ulf Hansson Subject: [PATCH RFC] mmc: mxs-mmc: Implement CMD23 support Date: Sat, 14 Jan 2017 17:29:18 +0000 Message-Id: <1484414958-2665-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 1.7.9.5 X-Provags-ID: V03:K0:uE4QhYeo70iy2xQJirvHi0OoefBycasCApx32ysgr5dmvhi3Ckj g1hnPHY6yI63bc8YBh3F/PfFsIZ8xxfC+VPiFSjfFSHTjizeIJhkgc7OXu/Bgpoh5Clz9P4 fQDfOvDgw9LNcDNS2SKCYDKj45wd9qQ62dKxwNsAK/DZjDK8dJIGgtUuQREiv/FBGkS1Ja2 8fFEmI99MT1+PC0oqdP0g== X-UI-Out-Filterresults: notjunk:1; V01:K0:ydksc15xBuM=:9eT4cpq2eriXKze9144jqB 14BwSH/7SRmLZHBEDjE6aj7JJimfLYFvYjI+TEzCAdvOqg2c3y0GOGv2SYeDKLYYh/n84Sr+X wLhRXDsGGGWMXrfwolekh46Y0rYIoQ1PHFcPhpR5YwB9o0e2u75wpylZI16d736jIqEAGOHho B/tuROFaoDKk65yn13ujzr+4llBHY89cIA/nXfYgBdAtpOtpChVTbr+HS2t0+K4wWpU8GRxUN iZ6nFL3/bzwxM0wtE8K9qGyw/I3gApFcNk1yrRokGt2ZvWBwLLE+sV9v99r8bIs2iYBd1/qbd 6tJ8UEbMzh8g4t+Zb76BOjBxc0dnZcxdvP+j1lbEOG7uR1EIDojhaCsEi4pU/09fK5NB5KWcf jVSyGHxmrS9oo1JnACPh6dSGdOkV2o3AwitYqYGfvEMfTdmT3BPAgIiuGA1AyqXvLBAy9Dnn/ OTs679Ewsm+7ARqHOtCgjEmwR6ml1fwc6v/CnAFZ2kyavAwT00R7x9J6mI6VGRioA0Qid5uKJ REtObIl8pO38m2c2XH7Hr4IdhCK7+lPlgc1qkrEL0hyxSXesLkBxCO/PKZgkCvb0Wr7yvIPoX LKkvLYrVDSUBLWXJ+YbuEl5s7z0Ev7cS44u7OCpJVD4y9S3keml1ICzULZ5wXdBGIeQZmmSWG +quZ1U9ZzAmqGunPEMKkcIzwx+1Z/RiXRHOq3g5B8i+YvCxe4um/b4nTnH81a/FrhtRI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170114_093057_886786_7A23A3B4 X-CRM114-Status: GOOD ( 10.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Stefan Wahren , =?UTF-8?q?J=C3=B6rg=20Krause?= , linux-mmc@vger.kernel.org, Fabio Estevam , linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch implements support for multiblock transfers bounded by SET_BLOCK_COUNT (CMD23) on the MXS MMC host driver. Signed-off-by: Stefan Wahren --- drivers/mmc/host/mxs-mmc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index c8b8ac6..add1e70 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -153,7 +153,11 @@ static void mxs_mmc_request_done(struct mxs_mmc_host *host) } } - if (data) { + if (cmd == mrq->sbc) { + /* Finished CMD23, now send actual command. */ + mxs_mmc_start_cmd(host, mrq->cmd); + return; + } else if (data) { dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, ssp->dma_dir); /* @@ -166,7 +170,7 @@ static void mxs_mmc_request_done(struct mxs_mmc_host *host) data->bytes_xfered = 0; host->data = NULL; - if (mrq->stop) { + if (data->stop && (data->error || !mrq->sbc)) { mxs_mmc_start_cmd(host, mrq->stop); return; } @@ -495,7 +499,11 @@ static void mxs_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) WARN_ON(host->mrq != NULL); host->mrq = mrq; - mxs_mmc_start_cmd(host, mrq->cmd); + + if (mrq->sbc) + mxs_mmc_start_cmd(host, mrq->sbc); + else + mxs_mmc_start_cmd(host, mrq->cmd); } static void mxs_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) @@ -642,7 +650,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) /* set mmc core parameters */ mmc->ops = &mxs_mmc_ops; mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | - MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL; + MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL | MMC_CAP_CMD23; host->broken_cd = of_property_read_bool(np, "broken-cd");