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: 9517069 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 E3ABE607D8 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 E297E284CF for ; Sat, 14 Jan 2017 17:31:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7513284D0; 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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DF06284D1 for ; Sat, 14 Jan 2017 17:31:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751476AbdANRbI (ORCPT ); Sat, 14 Jan 2017 12:31:08 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:60758 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbdANRbH (ORCPT ); Sat, 14 Jan 2017 12:31:07 -0500 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 Cc: =?UTF-8?q?J=C3=B6rg=20Krause?= , Marek Vasut , =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= , Fabio Estevam , linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Stefan Wahren 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= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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");