From patchwork Wed Sep 27 03:40:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9973013 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 8123E60375 for ; Wed, 27 Sep 2017 03:41:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 708B629067 for ; Wed, 27 Sep 2017 03:41:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6545D29069; Wed, 27 Sep 2017 03:41:58 +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=-5.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB 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 D7C4929067 for ; Wed, 27 Sep 2017 03:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969865AbdI0Dl5 (ORCPT ); Tue, 26 Sep 2017 23:41:57 -0400 Received: from lucky1.263xmail.com ([211.157.147.135]:52490 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969846AbdI0Dl4 (ORCPT ); Tue, 26 Sep 2017 23:41:56 -0400 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.236]) by lucky1.263xmail.com (Postfix) with ESMTP id 233F812BD; Wed, 27 Sep 2017 11:41:54 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id CD8F5369; Wed, 27 Sep 2017 11:41:49 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: ulf.hansson@linaro.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from unknown (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith SMTP id 49763RTV90; Wed, 27 Sep 2017 11:41:53 +0800 (CST) From: Shawn Lin To: Ulf Hansson Cc: Adrian Hunter , Jaehoon Chung , Wolfram Sang , "Steven J. Hill" , Jan Glauber , linux-mmc@vger.kernel.org, Shawn Lin Subject: [PATCH 3/3] mmc: cavium: Add ACMD23 support for dma's multiple mode Date: Wed, 27 Sep 2017 11:40:38 +0800 Message-Id: <1506483638-115756-3-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506483638-115756-1-git-send-email-shawn.lin@rock-chips.com> References: <1506483638-115756-1-git-send-email-shawn.lin@rock-chips.com> 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 Still need prepare for dma's multiple mode if it's a preceding ACMD23 since it indicates a multiple block write is coming. Cc: "Steven J. Hill" Cc: Jan Glauber Signed-off-by: Shawn Lin --- Just compile only, so need to do a solid test for sure the ACMD23 support won't break cavium host. I'm also suprised to see cavium relies on SD_SCR_CMD23_SUPPORT to do some preparation for dma, but personly I think it's wrong and should use a more legit way for that. drivers/mmc/host/cavium.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/cavium.c b/drivers/mmc/host/cavium.c index fbd29f0..56bf0e0 100644 --- a/drivers/mmc/host/cavium.c +++ b/drivers/mmc/host/cavium.c @@ -637,7 +637,8 @@ static u64 prepare_ext_dma(struct mmc_host *mmc, struct mmc_request *mrq) set_bus_id(&emm_dma, slot->bus_id); if (mmc_card_mmc(mmc->card) || (mmc_card_sd(mmc->card) && - (mmc->card->scr.cmds & SD_SCR_CMD23_SUPPORT))) + ((mmc->card->scr.cmds & SD_SCR_CMD23_SUPPORT) || + mrq->sbc->flags & MMC_CMD_SD_APP))) emm_dma |= FIELD_PREP(MIO_EMM_DMA_MULTI, 1); pr_debug("[%s] blocks: %u multi: %d\n",