Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp566446rwe; Wed, 31 Aug 2022 07:25:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR4inlSyjMOGwz+od7VnZuZd9fQa+5k4+o8g20Kq9r9NW8+KwHTBioX3GO2zAXmjT5ZjM0bU X-Received: by 2002:a17:90b:384e:b0:1fd:fc3e:a502 with SMTP id nl14-20020a17090b384e00b001fdfc3ea502mr3666883pjb.35.1661955911729; Wed, 31 Aug 2022 07:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661955911; cv=none; d=google.com; s=arc-20160816; b=GLmLlWKxB+XlzUnDwZ3rSA9Sy4oPtEmem9H/xTS0kMbmSLcPGTaIu+MaHoXFMYFKu7 Wb24GQp3dtiAcET68mczLWxuIwZN3vefEMoeQfzGk/AJ6Js9U1/JxWTp/UT7v5zRTwpO +LxOewqV2rxksLIdox1NeeSMw933qNn3VKkp+ZiswdDpMA9u90NW+Kn12wLZTyNtRSb+ wHL3JEtnZBNsQXyR2vHDnC0F2G8tbGJsrQSmNoIUxAGXqynfN5CAENYXDuRBelJ6KnXK jF3aGbURP70tl6Vo2SUTzupJGie4lVzhcy2hrHsA+eezrGdPpIeK6xNX26Y14SleiDRf +lMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=ClRxCU4LcrGSVp2+Un1hHhG7RXtZmYfUzIm0/36WZCU=; b=Y8V+j+bfEdNBhuMpLMlDt0xmDzL/WGSUmXv0OpfbVjtuubVPlpI29q+j2Q1S4KZd+x h6CxBtIgv7drIzWTTsMXGPd3uFIGXUZHG0iD0EuRebttOzdlUjvnb4mYHephQHw2VjhQ tipUueaboJIBh45sO3qYVsCfyxxy9aB/NzzeKRWATfttr2/caIjPNzcDwanroyH65n4Z 1xpvqW2ifE4yhEZT5HFDcVbVyIlvgAH15iCjhouxB7/oZwlJCqWIMgfnsPMfn5fsV4f+ yU70qbXTMlfEHYfHXLUvm4/ONnpCi92WEqVTQqnyy0UQCBC/51mJJvvxvhYAD0SpjRQH VOxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G88TbNbf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl18-20020a17090b385200b001fac2623306si2297576pjb.95.2022.08.31.07.25.00; Wed, 31 Aug 2022 07:25:11 -0700 (PDT) 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=@intel.com header.s=Intel header.b=G88TbNbf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231910AbiHaNuN (ORCPT + 99 others); Wed, 31 Aug 2022 09:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231428AbiHaNuI (ORCPT ); Wed, 31 Aug 2022 09:50:08 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97E131F2DB; Wed, 31 Aug 2022 06:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661953804; x=1693489804; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=StgOlXRVFmodsSKsgmXwtU3XrkGBQwDW/2gFO7/DX/M=; b=G88TbNbf1tjs6UeE+guoUyA1r2BHft7DhvHozHDpSlYUAu8uf7d3jtlf jcADjHYUynxdlwdeChlnV8aQMfLCnhL3C07alzT96Ik749IxAuUwwfW68 hw0Ph3m6Ok8HnE+GYSHJOAMhORxc/xjYZo9T58i1UJZOI5S1UrZd8v8Lp 1C0jYAVAeP0IjvlAyqR42xzWBpRKUgy0rkOmPnr72UTRILUDTYwuGFV1Q 4+H0v0gj10pnEgVFxqEenKYtM6Yh6m8w/wwSYLawucGMVQEJCchJ0M1KJ tYWll6sRON8EOxAVjtP4FLL64WNf/HUJpNfWOmbp841UlYcd2bn90eXMR Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="275851947" X-IronPort-AV: E=Sophos;i="5.93,278,1654585200"; d="scan'208";a="275851947" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 06:49:56 -0700 X-IronPort-AV: E=Sophos;i="5.93,278,1654585200"; d="scan'208";a="641877383" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.53.241]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 06:49:53 -0700 Message-ID: <7c02ec7c-fc6c-77a1-5ccd-bb35bddbe79d@intel.com> Date: Wed, 31 Aug 2022 16:49:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: =?UTF-8?B?UmU6IOWbnuWkjTogW1BBVENIIFYxIDEvMV0gbW1jOnNkaGNpOkZpeCB0?= =?UTF-8?Q?he_SD_tuning_CMD_parameter_issue_that_the_SDHCI=5fTRANSFER=5fMODE?= =?UTF-8?Q?_is_cleared_from_read_direction_to_write_direction_incorrectly?= Content-Language: en-US To: "Chevron Li (WH)" , "Charl Liu (WH)" , "ulf.hansson@linaro.org" , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: "Shaper Liu (WH)" , "Thomas Hu(WH)" , "XiaoGuang Yu (WH)" , "Shirley Her(SC)" References: <20220720123737.117-1-charl.liu@bayhubtech.com> <69334100-1ba7-50e1-5d0e-83081c2241d7@intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On 31/08/22 15:04, Chevron Li (WH) wrote: > Hi, Adrian, > > Sorry response you so late. > > Does your comment "mmc_op_tuning() could be used here" means that we should use mmc_send_tuning() instead of sdhci_send_tuning? I just meant, instead of: - if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) + if ((cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) && + (cmd->opcode != MMC_SEND_TUNING_BLOCK)) this is simpler: - if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) + if (!mmc_op_tuning(cmd->opcode)) > > If yes, I think we need add below patch commit by Charl Liu for those reasons: > 1.Bayhub host tuning command does not have a data payload and our hardware does it automatically, so mmc_send_tuning() will return -EIO. > 2.Bayhub host can be used for both SD and eMMC cards. > 3.Both MMC_SEND_TUNING_BLOCK and MMC_SEND_TUNING_BLOCK_HS200 are tuning command opcode, maybe the same logical at here is better? > > BR, > Chevron > > -----邮件原件----- > 发件人: Adrian Hunter > 发送时间: Sunday, July 24, 2022 15:22 > 收件人: Charl Liu (WH) ; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org > 抄送: Shaper Liu (WH) ; Chevron Li (WH) ; Thomas Hu(WH) ; XiaoGuang Yu (WH) ; Shirley Her(SC) > 主题: Re: [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 > > On 20/07/22 15:37, Charl Liu wrote: >> 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)) > > mmc_op_tuning() could be used here > >> sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE); >> } else { >> /* clear Auto CMD settings for no data CMDs */ >