From patchwork Wed Nov 1 01:37:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 10035821 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 F2BBA603B5 for ; Wed, 1 Nov 2017 01:39:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF10E28B26 for ; Wed, 1 Nov 2017 01:39:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B16E528B2D; Wed, 1 Nov 2017 01:39:19 +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=-0.2 required=2.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB autolearn=no 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 5916F28B26 for ; Wed, 1 Nov 2017 01:39:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754056AbdKABjS (ORCPT ); Tue, 31 Oct 2017 21:39:18 -0400 Received: from lucky1.263xmail.com ([211.157.147.131]:47175 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754044AbdKABjR (ORCPT ); Tue, 31 Oct 2017 21:39:17 -0400 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.29]) by lucky1.263xmail.com (Postfix) with ESMTP id 620EB96A9A; Wed, 1 Nov 2017 09:39:14 +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 78C183D3; Wed, 1 Nov 2017 09:39:12 +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 31982EY39N2; Wed, 01 Nov 2017 09:39:14 +0800 (CST) From: Shawn Lin To: Ulf Hansson Cc: Jaehoon Chung , linux-mmc@vger.kernel.org, Adrian Hunter , Jan Glauber , Shawn Lin Subject: [PATCH v2 2/3] mmc: test: prepare sbc for preceding ACMD23 multiple block write Date: Wed, 1 Nov 2017 09:37:12 +0800 Message-Id: <1509500233-133821-2-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509500233-133821-1-git-send-email-shawn.lin@rock-chips.com> References: <1509500233-133821-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 Enable preceding ACMD23 for testing multiple block write for the sd cards which don't claim to support CMD23. Signed-off-by: Shawn Lin --- Changes in v2: None drivers/mmc/core/mmc_test.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c index 4788698..c941ba9 100644 --- a/drivers/mmc/core/mmc_test.c +++ b/drivers/mmc/core/mmc_test.c @@ -198,17 +198,26 @@ static void mmc_test_prepare_sbc(struct mmc_test_card *test, struct mmc_request *mrq, unsigned int blocks) { struct mmc_card *card = test->card; + bool need_acmd23 = false; if (!mrq->sbc || !mmc_host_cmd23(card->host) || !mmc_test_card_cmd23(card) || !mmc_op_multi(mrq->cmd->opcode) || (card->quirks & MMC_QUIRK_BLK_NO_CMD23)) { + need_acmd23 = mmc_card_sd(card) && + mrq->cmd->opcode == MMC_WRITE_MULTIPLE_BLOCK; + if (need_acmd23) + goto prepare_sbc; + mrq->sbc = NULL; return; } +prepare_sbc: mrq->sbc->opcode = MMC_SET_BLOCK_COUNT; mrq->sbc->arg = blocks; mrq->sbc->flags = MMC_RSP_R1 | MMC_CMD_AC; + if (need_acmd23) + mrq->sbc->flags |= MMC_CMD_SD_APP; } /*