From patchwork Wed Jul 20 12:37:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charl Liu X-Patchwork-Id: 592316 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC375C433EF for ; Wed, 20 Jul 2022 12:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240873AbiGTMh5 (ORCPT ); Wed, 20 Jul 2022 08:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237242AbiGTMh4 (ORCPT ); Wed, 20 Jul 2022 08:37:56 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2097.outbound.protection.outlook.com [40.107.244.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 293214D178; Wed, 20 Jul 2022 05:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VX61y7Ah9d28fp+fe3TIYp0cnfswB3TZss1FwJJUa++1LzeIhincAzg8Idpk3B1btySSZQtgpWJVuAzOA0SbSAtt4QK/LEnL6FnnVE7g3BZmYedg5+hYQfWLuFAubhelGYD/UP6yyVKHYY6+VbmyAK6sw4LMtaqryCa3xu4tqGKw//ilwwYzJUKMOFBxrYd1hV1kysOY9R3mCE6NL0qucX/F0EVFUKGTFCsgevMRutmVf/wKPgv9F+dzJMtOYdms92xJnNfu/Ab45eC5HGySt37ZnhoW3DcQ1h4SuFkp1eh0jADJbTwUq7ee/G1NYslJhL1srJylhzAnG7HWoT61zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0C41/IRngKs6LTJV1/XfPR9Oyc/CqLQoR4aH7qGpgoE=; b=Akn6Hx9fu9VnOWhGKgkN/kSeIqEuiOdpvzyh99wQkEsNb3eGYVfvcdiYMYDpvm6C5hscqzo/Mzv7IaEnbSZ+E7q/qgRWwgqE87qT0XE6SpLVXVhLqbZBS+vBu7h3ogLBvVMLZZDVxi+RaMWT6FX5OBocTTdAMnjyieWIDSc8e5dAx3dkAUWwmSg4Y2r5+maFAT7JZ3SMh4kU+TIbt29jkE6jpGFb1rnCKqHZlHuNc/LqNJ14gnzyCdpBSWPaDhsyn/ZCjqLR7wT2/3EmWv3UExiRJBGQzDN+fN+VnxhxqjDhWFcOHY8lsv/T5JeqjdpDpWrIL5hnCAh+uogIxRxHqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bayhubtech.com; dmarc=pass action=none header.from=bayhubtech.com; dkim=pass header.d=bayhubtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=towerbridgetechnology.onmicrosoft.com; s=selector2-towerbridgetechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0C41/IRngKs6LTJV1/XfPR9Oyc/CqLQoR4aH7qGpgoE=; b=l012jmP6FQujazfWg8K1MxdaiuViSdPeR/Q0tkWbs8RgPNdn4ZiUTYHmamclE1I62wtTesYo/hgkJZ+efqllaxgUPDt6ETK5f1J2Nzd9EAwmyG8M+BtQREg7f8ubx5p6kxGnNkUu5cAV7xuWkro3EjvQa9CwtOejO5N6eWOJc4E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=bayhubtech.com; Received: from MN2PR16MB2781.namprd16.prod.outlook.com (2603:10b6:208:e3::30) by DM5PR1601MB1273.namprd16.prod.outlook.com (2603:10b6:3:e1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Wed, 20 Jul 2022 12:37:52 +0000 Received: from MN2PR16MB2781.namprd16.prod.outlook.com ([fe80::84d9:ad3:ef5b:166b]) by MN2PR16MB2781.namprd16.prod.outlook.com ([fe80::84d9:ad3:ef5b:166b%7]) with mapi id 15.20.5438.023; Wed, 20 Jul 2022 12:37:52 +0000 From: Charl Liu To: adrian.hunter@intel.com, ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: shaper.liu@bayhubtech.com, chevron.li@bayhubtech.com, thomas.hu@bayhubtech.com, xiaoguang.yu@bayhubtech.com, shirley.her@bayhubtech.com Subject: [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly Date: Wed, 20 Jul 2022 05:37:37 -0700 Message-Id: <20220720123737.117-1-charl.liu@bayhubtech.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: TYCPR01CA0147.jpnprd01.prod.outlook.com (2603:1096:400:2b7::12) To MN2PR16MB2781.namprd16.prod.outlook.com (2603:10b6:208:e3::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4ba0dfa-bfda-4a62-545c-08da6a4ca99b X-MS-TrafficTypeDiagnostic: DM5PR1601MB1273:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /sVr6RQheDDnbLUfD1AF2Fu2SEWDAqeqkkgJ1Eh0Ae/NapoeTVvDX0AmVihTUtMvzfkIr5YHfxFndduw1RQgf0Agyv7SzmfB0a9KXEbcRCZCb2pKyhih/JYLHgjrk+6+OWQ5D/DItCoBK+I7pRXzLukf3cCdnNuISZd/1TIRyWqRFGYGpHtTK09ucDZJrdNzNojlyPPSi1Affswsuv/HS2pnshODbiGL64Fxn8ghz41zwM7oqlVq0uEV54iq1pw5yhMaWsbv1FrWLOCBa0XR5Juw+pqM5DTN9K0lmm3zu/9Qyc1vYEH/x3i7JWe3qVqkMLbMYzu2RhoWrozEULtteP4wOuE9YnZuyxm63uMClErXPh507XUyC9dNK2+Cb5IPebepOUJ7Bwdeoh2LSMzXSK8vcvu7Lvt/0Pe3VwUDlWJBupQPRByQ7PhbajUDVA7qLZTmgrmMiXQiwBoubQfXFa3Kgk8LtbJW8RmYpAKjDJTGTmKz4inN75nFiO0YulYD+hIe3+PjrE2hoW/abf7VRD3/2eNeBIFOkJmL0IQzmnMELNZ8LMYUuag5N4cHAKADkXv2jtjBMyoaKO4xl8oXsslPHU3QQDTKpBLvr90XnNvhvvDutc0bLLCUCrpSWweIpOcmF68C11MExLIFuoOjKWp+uToOyrIxL/U0cZYhWjQU6ynVGO+IBZpfqR+n/ia/o3KoLzo/nKKtseaRD3a2HdzJnoTNgO+tDY1ibqVUoK/dQ/xEg8/k3GQinyQ/yLwa X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR16MB2781.namprd16.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39840400004)(376002)(136003)(346002)(366004)(396003)(4744005)(316002)(6486002)(52116002)(44832011)(2616005)(107886003)(86362001)(36756003)(6666004)(66556008)(2906002)(8936002)(66476007)(4326008)(8676002)(66946007)(5660300002)(83380400001)(1076003)(478600001)(6506007)(186003)(41300700001)(38100700002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: //k45XTWJd8t9MbjTBQTSjo66WwXg1Q0S9Kgz6hxk/syd4hLcGQlUmRAAiHNw+5Y35CJ13U27pakKINC1zEpfWdsXe/bmB+H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w0msDwp9Xi+qfe4z+p5UmqUjRYzrAGQ7m8t15bQZVpz7VW532A/d+MjKLFTMdGw7UkfEqiD5hMWZBMF6drG5nPQC+im3HfWUh3ob5fIQ1T77kkFxh50lT2R/E8QglzYa3kpZZJVkRFcQFLaIHjY3gZUrUldcrTUsELheIbtKm9KYFBMLRjczH3UNeDdXtR2gcW7MbBNo1qUL0wLC5dTud8tLpDurPmUnq8OANH/bCl4MehbAlaVaRpeX9DQQGn1JAVg9qtbpfD8BT7gOwbQ91XhLTSiTbsYGxAap4MGj+4Bk2kkXkxbjtNfQI7HoLQf4bsW5q6z8Y9XwE0SqMHcHOBgdAHQjQTbdESUdEXBsMacwwI96dhUXOIeCJB7d38pjtM72UpJ80EzUcEXgoqemftj48+OUN9kLlHNBgxTz+/TbFgW4QI2foESQOoYRCJTfIgU4e8Rp8niuRSpLWjXqUj8Ag2+z1+L7mTtLp0bd1o+D1MIG3BDsChD6TjmuC6FVkQ== X-OriginatorOrg: bayhubtech.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4ba0dfa-bfda-4a62-545c-08da6a4ca99b X-MS-Exchange-CrossTenant-AuthSource: MN2PR16MB2781.namprd16.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 12:37:52.5371 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0a7aae2b-8f2e-44df-ba2f-42de7f93c642 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TMtwsd4KfLnVGdk5WLjrDoVSZkp05ZOQRHv6p9IDid+zV8EhYmTb4OZp6bmxTLzhPQlvfZoQLf5VNoTjFQuGIQjJ2M1K+qCYpMqi+C/dsr0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1601MB1273 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org When cmd->opcode == MMC_SEND_TUNING_BLOCK, the SDHCI_TRANSFER_MODE should also be kept Signed-off-by: Charl Liu --- Change in V1: Keeping the SDHCI_TRANSFER_MODE when cmd->opcode == MMC_END_TUNING_ BLOCK --- drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 22152029e14c..6a0f6725dadb 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1430,7 +1430,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, if (host->quirks2 & SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD) { /* must not clear SDHCI_TRANSFER_MODE when tuning */ - if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) + if ((cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) && + (cmd->opcode != MMC_SEND_TUNING_BLOCK)) sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE); } else { /* clear Auto CMD settings for no data CMDs */