Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2080028rwb; Fri, 11 Nov 2022 04:56:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf4weFYjePpWCAKdiv9jpJ2eRg68uS3X0S0JGHME4v6IK+4/uRnDDC2JOpd5VF9ZY3UzblYC X-Received: by 2002:a17:902:ef50:b0:17f:799b:297d with SMTP id e16-20020a170902ef5000b0017f799b297dmr2452606plx.72.1668171405424; Fri, 11 Nov 2022 04:56:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668171405; cv=pass; d=google.com; s=arc-20160816; b=Lxy22r165XCBm00Li7gwAmRZqzzoJqWvMD3d0xn0uYOkVCtY1ykwAoUweQdCQ7t/N0 U0vIsaxKHEDhpdT/c9GrzE0wdoVoXtXlDBfURS/YwS716QPD4nxvAIiNE5wt2ihWv6Ra F5Wp8TbpRJOZbQ/reybawkAC6zXJjxnTsgqwnsEC2bwCi6Lw4gRYzT4Tet4E5aOjSw81 hlEnmGH1SD1xQdjH3Wg4dqNjOWYymvhKw4c4eNRabasdSZz68tsJtpURh48h3fDQOT6x iYHBFGnMrRbg4MFaJnSrTluF/2xMxUp7CL1dCNv1DWhPZ+2acX+ZRmdPThOH9jxipo98 6VZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=RFnBryl2gJ+sM6vwmfRHWj2Pvb1Wrs9UWmrLGcDNpYw=; b=AIUO/6n02gLNr8PhUHg0LmlrGjGFkXqxpE1PLJCRMaJkzr5CdC1ffhGhcDdCJGgT/z V3DOTpVHX7OPgnxMdDE6v6Y/OX7lYQMNFl2xUrKt5sa1fLAb3Fp9VRAgPrEdmWJyKSne 4ZG9AyK49n4fVDHWSmaETRQTvyvVwhObsiON5W6+lCnRTA1UF9ynkCrhtNZqyfCkD4nN Ft9u/bdEJaIG4Elht1/S8Dr5+U2/qryu0biogfRUzRBGueAFoDBAEyyxeVtHTorlh0O4 xt4p2JQHIsRbQ3uhKgOgdxoJi65zxc7GMi7JLVWMvXYPTpkZjZXN/TaEXrkkbF9sC6TY K4FA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@towerbridgetechnology.onmicrosoft.com header.s=selector2-towerbridgetechnology-onmicrosoft-com header.b=IaYPSA+g; arc=pass (i=1 spf=pass spfdomain=bayhubtech.com dkim=pass dkdomain=bayhubtech.com dmarc=pass fromdomain=bayhubtech.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 145-20020a630497000000b004704bc7855bsi2298647pge.153.2022.11.11.04.56.32; Fri, 11 Nov 2022 04:56:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@towerbridgetechnology.onmicrosoft.com header.s=selector2-towerbridgetechnology-onmicrosoft-com header.b=IaYPSA+g; arc=pass (i=1 spf=pass spfdomain=bayhubtech.com dkim=pass dkdomain=bayhubtech.com dmarc=pass fromdomain=bayhubtech.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233247AbiKKMXg (ORCPT + 93 others); Fri, 11 Nov 2022 07:23:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230270AbiKKMXe (ORCPT ); Fri, 11 Nov 2022 07:23:34 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5165D13D2F; Fri, 11 Nov 2022 04:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTJuA+M05Gk9TCugVZO/GpraIkpqfglvATu8hGVb8MDvupJ8XjHbocjToE3tgT5ZEo0vFbqcV4ZPpGjMyR2ehJKVKEvVz8cLmN41rx2hFQiCgI9CFIsTl2DalZZtgjVlNWkOSjIxUZ8plwxzlNuTjSb9YgRmMliDnUBHqdma37jDr8lkrlqUmLjsrBiuA/Fro0tx4Nuuc/4Pbc1vVOVNMnoDo1wSzILmZNHJp3lgROTWLsw5dO26QQcavOWMUf0qSsTIhr26MTr2SZHvsPHiIikEvfbrGfoBYjKvI4sB5JXHCeTbgsEc/Fow+DS/1GLMVMhOo27dNHtZ07upUoOaRw== 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=RFnBryl2gJ+sM6vwmfRHWj2Pvb1Wrs9UWmrLGcDNpYw=; b=dU6M7S5eL1U+PKN7+CuusXHYlxpAms6BtJYo6KYwd2tuzXWVV8KRzcjcpBLOEO53BrrPRZA4GC6H3V883z5zOrzgzUKbsRD+OYK+a84/ckAyoq33riE3+3xrhDdeMcaNe/bu2lDugvBJI+QXlIGpIfFFGoNc7de9/YCrvIf8GlmfMCOkcgdQRp+z2FZLajEB5ls7XccF9sJogKFSgz36taPcC662QfyIzdg4Tt8yA0eV2HNUqblCGD2OsKMj4HoOWgYBLO9y7fpU6pZzuLSQOtkCKunKf9HfkkFzFMX3NppsjCfQ/swrHBP1WAHtcmVBhXtJFeWyBqSQjAoK8Lrl4Q== 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=RFnBryl2gJ+sM6vwmfRHWj2Pvb1Wrs9UWmrLGcDNpYw=; b=IaYPSA+gbG8hmYfVxOHUlMwWb3/5d0vHbSDwgOx7v+RO2LW8iD2oKI100CXyqSNlQPT7ZigjLgm3ocdcshsuqAefVJbvLt2wUuNSSUEBmy+1nwr6YBXsQsfvCbST/z1+up7NrFVGVN7f89Nv4JLPovJsd2uU+wr1HKJLMSY7t9g= 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 DM5PR16MB2261.namprd16.prod.outlook.com (2603:10b6:4:b6::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Fri, 11 Nov 2022 12:23:30 +0000 Received: from MN2PR16MB2781.namprd16.prod.outlook.com ([fe80::19cd:13c4:ebe3:4284]) by MN2PR16MB2781.namprd16.prod.outlook.com ([fe80::19cd:13c4:ebe3:4284%7]) with mapi id 15.20.5791.027; Fri, 11 Nov 2022 12:23:30 +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 V3 1/1] mmc: sdhci: Fix the SD tuning issue that the SDHCI_TRANSFER_MODE is cleared incorrectly Date: Fri, 11 Nov 2022 04:23:14 -0800 Message-Id: <20221111122314.307-1-charl.liu@bayhubtech.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PS2PR02CA0040.apcprd02.prod.outlook.com (2603:1096:300:59::28) To MN2PR16MB2781.namprd16.prod.outlook.com (2603:10b6:208:e3::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR16MB2781:EE_|DM5PR16MB2261:EE_ X-MS-Office365-Filtering-Correlation-Id: cab2b696-d6d2-4680-faef-08dac3df8ab3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TG5ToS/mp0lx4LWFzTZr6wcyM3YSlOfc2bf9OdGBObGLFmWGujYk3sUPqa9AQS57t/L6TQoEbHHaVa3SGaSDHi0nrygXftuPt10dO9II+IrXo3ff/FEfoOr+tUuX/rdD3/XwES6rGGm7QAe6zsUBDljtRo2kYA/Rw/0CPa+DXuSOgu8AnJMnEdzVbwigquLDRfFHCJ69rZQpUUQPHdsr1IwnEy0FaUlZwgydJyqSoSrgBRm/H3Bzl0bCr3DApDrn78c+PC61Tm2QMgpO0uhvzu2HAM3sl+1paebutAQrcO9ohlSSvE4Hcz7mJUaETtCg/X7Xdq94M1zbLIHAKawBmkr+zHE93bCSKARdYJCp2dPslVHPhBPFiUcWZBiG30htVXCS1QZf503CucPFtef6fRHWjqZc5VU+LH49gIyRfOsl0vE05bU0hAh+581bq0QBSFp4+1oBUZtCjl+wzjvCMhVAiGWh3MmKBdCm1mCYxFYqTrrz1V+riEPh0idYBwdDXnG7sK/yYTQyGrkolqq8GHe0Qkn2UL6/2i1X1O+IYX4rTp2TyXOIYERcguULNGRNsjhqhzvBaKlQoeQPol/m43Ea0Frf8G774ujeMkdwHZ9x70AQtgQ1JIN42tpn04/lQXM0tbCzBjkT86xMRd6LNv1rZtS5IZuHw9RXAi2ueZ+QkeX6kjDm1lrIVZZ4vU7r1KjPUlO7szOqsW6QaHdbwA== 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:(13230022)(376002)(346002)(136003)(366004)(396003)(39830400003)(451199015)(1076003)(5660300002)(2906002)(478600001)(8936002)(186003)(6486002)(44832011)(83380400001)(2616005)(316002)(41300700001)(4326008)(6512007)(66556008)(36756003)(52116002)(38100700002)(66476007)(8676002)(66946007)(6666004)(6506007)(107886003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bMyUvEv/rB4oYtgsx+Lri6uJ+IdgigKfR5ydqgPjxsQym894QrMQOaZGhsHu?= =?us-ascii?Q?30kNwmLgaEU4snh22yjo0WMYnkP3FNx++HVj2U4bLIFUBXOo1U0nyrVd4Zhf?= =?us-ascii?Q?FjTOSuCBO1zk/42U2EzqTp1/RqWweOH+ug64qxZe9zYR0zsK9zccGnt4wiX6?= =?us-ascii?Q?b0+oQUw4EmltzaW5WktDrJUaHWXoMO7uuAgDMtulNMbgvwSDq/BOzDb3LKq5?= =?us-ascii?Q?4jWdiz/RvgnrLdOuf9wa0uhx8KDkqqMQN3BpHO5qSd3/kpmJeYYKNnKqVpa5?= =?us-ascii?Q?IoBolOONQfZIl8Qd0E+c0U0pOb4dDpkUFA1mG0b6uSWWZ/GHPM43Hf7lmiUJ?= =?us-ascii?Q?vo4KZGYcLskzzzBRpwP6m6H/AXuqSk/sFWKRCB0HbQIi9bMHSvGqduJedPpy?= =?us-ascii?Q?UqBRL1iqWa+iT+LeO1s0ercxEpB4g1To8j1hovepeDdCPI4hz50Nn379E+zy?= =?us-ascii?Q?izNJzK7+IeFAwddnINGhJj+tC8P6E3KA4ZEmuhC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kz3F1ctbMfYHI0mVMv4KbF7l/ku4aWZnM1WVMpX9SdYNHjF5QgnZkUonCG?= =?us-ascii?Q?UmVM9WeILu7foayYaCpMXNDdRa31wiueCYxvwCAMJBG3b3iPd9mhtDYA267H?= =?us-ascii?Q?fYhbu/aOdWO/lbQ7XM+ZZGgqzN82rFX3qDJFSidwTFrb4RN3IvtSsG6Janwt?= =?us-ascii?Q?eXEZcN/w7eSXONh6ZesMebxRmLzBDWtEyfFKRlJxRCSRbh4K5OdbmIdW0K8Y?= =?us-ascii?Q?IkxfzFU16vi64TTdMbnxkOwF1mFqTvvhUffS3rXXYEt9x36yLfSMJpswLo0k?= =?us-ascii?Q?zrsFhQ=3D=3D?= X-OriginatorOrg: bayhubtech.com X-MS-Exchange-CrossTenant-Network-Message-Id: cab2b696-d6d2-4680-faef-08dac3df8ab3 X-MS-Exchange-CrossTenant-AuthSource: MN2PR16MB2781.namprd16.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2022 12:23:30.1958 (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: rgdgHnQQl4GoSV50DPjVBKl6gP/rF8qGPnJCdyk1yIP8OqJbOyOxE4A1FdRCLzMIUDt3gmivNBk2w6uZsJF6dxJfrYNrErzEs7bMOFkAOlI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR16MB2261 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 change in V2: add the mmc_op_tuning interface to judge if the opcode is tuning CMD change in V3: cancel the redundant code --- drivers/mmc/host/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index fef03de85b99..98ee688de50d 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1465,7 +1465,7 @@ 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 (!mmc_op_tuning(cmd->opcode)) sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE); } else { /* clear Auto CMD settings for no data CMDs */ -- 2.32.0