Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp917441rwd; Thu, 8 Jun 2023 09:23:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6BHRbXrVUe6QnhpSofbFWVaNsI5cZ+YsY/yMECvZbNVi6nCGuSZPzkt5zKRkaVLvNtk86G X-Received: by 2002:a05:6a21:339c:b0:111:366:eea4 with SMTP id yy28-20020a056a21339c00b001110366eea4mr8037846pzb.57.1686241382310; Thu, 08 Jun 2023 09:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686241382; cv=none; d=google.com; s=arc-20160816; b=whx0SPJEBsKuVFvtC2OEmRi/f2qe9O2Iz65eGOTuMQCFFwT+0DZ/WXQRmMIom1GF6q Br2vaFhvaPrnVSn3cAM600dSAQvnkm9BE20QMYf4PUK2kOcGbrdDIG8DSYq0zy45wJ0J lZxoQ02weQx3q3DJc8Yfd/8NLh8/Nre/+hQu0OZ0YLLJxOU1vZrTat976ai6mlA8RLs1 vcZTi9d1wrXfFY9HzaBY2i9xiDMfVrKbcWcnGN/hTaau+E0kPkS6lYy/aB0911eqQvNm 97F8SfhxzX81IaUgEFminIGXrvpBn1Aguvgx/FHDG1ZlmogSje3esXs339CfydF+nZBx h2jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pxePCXhbkXDkGLZszuq4c29muOAB+INqMiCN3qHM0SM=; b=IZYpFGZzi5CKEwEfnFHYe0hZYw3my6CYdVk0ROCK54uHc/5pAD/SfFJeDjhLL3xZFL 5IXDuei/qbv7/qinNaCIcn2zIjpdi/3TNsnOdPuSR+vZkZFmEUG5n+98KQAxPLdsCdu+ 7uQoA7E9ZW9BWYouOVq4y5TFPTNE0T+ZW53ALzNKIQuE7+heiJOYDNOzCUdFw+cPk/j6 QUmQACaOh72aQbWJgnECrbz5i6/bnH2tV+7YCAImxuQQ5nZTEx3jRavMPTqVLZg/OfpC U2mIadcHo1oNihTt43WfDFZAI2xGQHsM+NccxQ72rZsy+9jIBHZpYyV0oXg2q/kxsoV8 ZelA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WzaTNE+2; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b005138de75d17si1222802pgw.116.2023.06.08.09.22.47; Thu, 08 Jun 2023 09:23:02 -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=@linaro.org header.s=google header.b=WzaTNE+2; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233160AbjFHPyN (ORCPT + 99 others); Thu, 8 Jun 2023 11:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237054AbjFHPyK (ORCPT ); Thu, 8 Jun 2023 11:54:10 -0400 Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35A5B30F8 for ; Thu, 8 Jun 2023 08:53:45 -0700 (PDT) Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-559409cc490so456098eaf.3 for ; Thu, 08 Jun 2023 08:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686239620; x=1688831620; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pxePCXhbkXDkGLZszuq4c29muOAB+INqMiCN3qHM0SM=; b=WzaTNE+2AyDdAiv4hIj6pu6kIJRvQQbxLsvHBdBrMu2hTP3olWmRJ0STyfyIrPLcrK w1lhJJOaseGCvxWcn3GGjbXfSP16U6dolkqAjc1qMxEDa7Rnvnz31cbV6B93vxXVTwFX ALijgHlJexuCb7j46KfX14okNdAXqpqlUHfvswzpjD/Y3ql+EWBPpu+s+WbDJJDMyfWy wXHeSeD9pt930/YbmuOPRq4lIpsb5iA6FMQ39SyCQXL18PbumCSEeoSIR8nLhdA7axbh w1cnbvu9EXw5mRghXN7VecD5YEBZOOuWcC/km75GQr1IaxmcsbWX2qB7gkUbTkXjB5P0 f/vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686239620; x=1688831620; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pxePCXhbkXDkGLZszuq4c29muOAB+INqMiCN3qHM0SM=; b=M+fjOCo7VyNnIMJvnzSBkqng9E/HkaCR/Gq3SoZNSqScnvZmPuAaw5HOlZvH9zd3NK gvYrc9ERZ8CGFPmj2RvIyctY2IMlJPHrLWISdvdUOaHae6Qkhgh97o2JE3pNpnCJSG+I NiDFKhEfM97qBM+NVmac7mpacOymTZWOCbYyfCOmGLkBLhqlwFXDwETO2fq9NjwG1mXL qjase90weksMxWZ4JCCrrmsaVzNyLMRNElSQEaqhoGxhWBGDq6Sk/25blaoyD92i7jzH cu8PzK1R2461SfZfw2u9VwhPOimJdooVryKrb4o0ryH51+Bh1uhhFMXhGwcIH4H1eYwM 16TA== X-Gm-Message-State: AC+VfDyVV1omCgWcTjeSGmL2h2p5DzvHAKzoMqSdflYwyGxZ072XgqpD UREaa0Q/uouv2zLPZEC8DcWu4sAtytKUUEOkgrTiFg5qIAI3FNFr X-Received: by 2002:a54:480e:0:b0:39a:bcbd:d0d5 with SMTP id j14-20020a54480e000000b0039abcbdd0d5mr6349007oij.51.1686239620304; Thu, 08 Jun 2023 08:53:40 -0700 (PDT) MIME-Version: 1.0 References: <20230523111114.18124-1-chevron_li@126.com> In-Reply-To: <20230523111114.18124-1-chevron_li@126.com> From: Ulf Hansson Date: Thu, 8 Jun 2023 17:53:04 +0200 Message-ID: Subject: Re: [PATCH V1 1/1] mmc: sdhci: fix DMA configure compatibility issue when 64bit DMA mode is used. To: Chevron Li Cc: adrian.hunter@intel.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, shirley.her@bayhubtech.com, xiaoguang.yu@bayhubtech.com, shaper.liu@bayhubtech.com, justin.wang@bayhubtech.com, Chevron Li Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 Tue, 23 May 2023 at 13:12, Chevron Li wrote: > > From: Chevron Li > > Bayhub SD host has hardware limitation: > 1.The upper 32bit address is inhibited to be written at SD Host Register > [03E][13]=0 (32bits addressing) mode, is admitted to be written only at > SD Host Register [03E][13]=1 (64bits addressing) mode. > 2.Because of above item#1, need to configure SD Host Register [03E][13] to > 1(64bits addressing mode) before set 64bit ADMA system address's higher > 32bits SD Host Register [05F~05C] if 64 bits addressing mode is used. > > The hardware limitation is reasonable for below reasons: > 1.Normal flow should set DMA working mode first, then do > DMA-transfer-related configuration, such as system address. > 2.The hardware limitation may avoid the software to configure wrong higher > 32bit address at 32bits addressing mode although it is redundant. > > The change that set 32bits/64bits addressing mode before set ADMA address, > has no side-effect to other host IPs for below reason: > The setting order is reasonable and standard: DMA Mode setting first and > then DMA address setting. It meets all DMA setting sequence. > > Signed-off-by: Chevron Li Applied for next, thanks! Is this material for stable kernels too, as it fixes a real problem, no? Kind regards Uffe > --- > Change in V1: > Set dma mode configure before set dma address > --- > drivers/mmc/host/sdhci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 3241916141d7..ff41aa56564e 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -1167,6 +1167,8 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) > } > } > > + sdhci_config_dma(host); > + > if (host->flags & SDHCI_REQ_USE_DMA) { > int sg_cnt = sdhci_pre_dma_transfer(host, data, COOKIE_MAPPED); > > @@ -1186,8 +1188,6 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) > } > } > > - sdhci_config_dma(host); > - > if (!(host->flags & SDHCI_REQ_USE_DMA)) { > int flags; > > > base-commit: cc3c44c9fda264c6d401be04e95449a57c1231c6 > -- > 2.25.1 >