From patchwork Wed Sep 27 03:40:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9973009 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 1296B60375 for ; Wed, 27 Sep 2017 03:41:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB0C929067 for ; Wed, 27 Sep 2017 03:41:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE5BB2906B; Wed, 27 Sep 2017 03:41:55 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 CC7BA29067 for ; Wed, 27 Sep 2017 03:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969860AbdI0Dlx (ORCPT ); Tue, 26 Sep 2017 23:41:53 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:38951 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969859AbdI0Dlw (ORCPT ); Tue, 26 Sep 2017 23:41:52 -0400 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.236]) by lucky1.263xmail.com (Postfix) with ESMTP id 373AF1BE0; Wed, 27 Sep 2017 11:41:49 +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 B1B803BF; Wed, 27 Sep 2017 11:41:46 +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: <8e195dff8fe5b38bb8c0971d9a2d0957> 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 49760HER84; Wed, 27 Sep 2017 11:41:48 +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 2/3] mmc: test: prepare sbc for preceding ACMD23 multiple block write Date: Wed, 27 Sep 2017 11:40:37 +0800 Message-Id: <1506483638-115756-2-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 Enable preceding ACMD23 for testing multiple block write for the sd cards which don't claim to support CMD23. Signed-off-by: Shawn Lin --- 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; } /*