Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3049691rwd; Mon, 29 May 2023 05:11:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JZW+tDtgMulrSypV9AfNNwLXrZdv2UJ6Z1Q5RhNnwKBD4VmLaDo/8pfP9B8CCrX3HbhE5 X-Received: by 2002:a05:6a20:144f:b0:106:5dff:5db5 with SMTP id a15-20020a056a20144f00b001065dff5db5mr8263156pzi.1.1685362263314; Mon, 29 May 2023 05:11:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685362263; cv=pass; d=google.com; s=arc-20160816; b=MBipc8tBq1Y5P/fgr1n81vBoVnRbXdXX6KTNFYtPf6afUtfZSeu+VH13eoR30O1x9R e5XhHsrSW0mlzgvWTlzxd1uUVMmNWGpbxTrM38XePcmp09gVduLRay/esNnQfJokWCT4 F5nSsBHjg35wbDgwEjSXpx7ak9Q4UE7yLwnhg3Fr+pK5uiDJ9tnyCGAEKLrCyxgbtUQE 2iBYtyDo38IwdoR5y11zstWbaYH/Zbhor0oZezbszz1+dPKov8PwfMvRD2RmKK/HNp8T wvnblIWpnoLOYd6Wx3S29p5zG7LutkJctleXmpoytoFDlrXFO6bqBk2Uha0s9MN0cwpv tUbQ== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=61maz6anAFrj4mN/losfDVyafPG+Qi7wn3MMcVBHUQM=; b=sl1gTzDSrGZBhsQbGTP+2nuTZud80OcvTshTD9bK0Taxh8oD5U/EAFtYGZSk+NXmW0 gwAzY59PU9gq8ATLOfdNoS6pZaiC+HVgbBcK0S9R5ROmkaTvCpa22zL65145i7SDat8h 000k2segBjTTjLot8Ix/F0UJ8pkfVcp4hPK4dVZaI96qATixsre3WSuWIuHIi+sZEINr wDZJvcjciXtNtB78jV03MAaoeSbdCGMYe3K3K49YKHkM1zY5r7Mw9tuT/ftDMJv8ZNnz NTKCnkZXaU/Jm61TKuF/rXOhZ2LXhEaBmzCbJwTY9L4gwuLIeqw4e74Qqrc4GkOlDkVX dsMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@towerbridgetechnology.onmicrosoft.com header.s=selector2-towerbridgetechnology-onmicrosoft-com header.b=uTBMgAOD; 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 k7-20020a635607000000b0053028c29b4dsi8248458pgb.92.2023.05.29.05.10.47; Mon, 29 May 2023 05:11:03 -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=@towerbridgetechnology.onmicrosoft.com header.s=selector2-towerbridgetechnology-onmicrosoft-com header.b=uTBMgAOD; 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 S231575AbjE2MID (ORCPT + 99 others); Mon, 29 May 2023 08:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbjE2MIB (ORCPT ); Mon, 29 May 2023 08:08:01 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2093.outbound.protection.outlook.com [40.107.102.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC785A3; Mon, 29 May 2023 05:07:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RIwKNZyoQZ70srf7qL1l4FmLwFomZhrplPFItrnBTRfG87GxYcFtazwABoT7fO1s1UPAxqC7fkq3s6sC0UgyKp1BwC0kS7LhEhNz0qV7+TUMwWpysHnylTYFWsCXEKQOL80QDE1qHRkLBCI5vYy/qs/MCYd2ZOseL3Aovrne6L0Jh/AE4H1R8wjZDf6EgAB5gSR63+g8q+UATeUe7YAhu2b1Hokg8qN86hrdc8/eyNv/bonwmIWDKzdBlf5dn6b8LMda1UxFe4A/Bl6SLKDC3RtOTVzNvzZGaAksH1gdE0LYsSgA0lGXc5u6FNhKiJsta8zwV+tq73Xe4z6E4iIU3A== 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=61maz6anAFrj4mN/losfDVyafPG+Qi7wn3MMcVBHUQM=; b=h5XmST1WFWpOBIiaxa2BBkpoEjt1H4zzjcYdnC1U5+9IxgOY7hX140wcjYIn6qOWkhzN+ibpuQrkupt5W1qdDyyEI1mp9nhs5WLDIUKiP6GAoEzlcfM0hCFkNY2xigmYlV3orm/i5ZR1aitzOqhReSsWDBDQNcyeycpFtC+7w5iAjVLftIuNjch2N6CnDNMednT5czjVzJUAIZmbgD69RPVVkl8Y9jFe/tRG1LBwseMjFPrIzNz7pjgtckHjuQ2lbhqxFt+ne5wtWuGTXYgs98ybkN8+5uNE6zGNvYNsp73RDL1AUhTeZrK3sKB1dtjv5+IAyawsOFp0M94t+XplUQ== 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=61maz6anAFrj4mN/losfDVyafPG+Qi7wn3MMcVBHUQM=; b=uTBMgAOD0c4dn7WZglMQkPHF9JVdeq/StQTBwNX0mj1GpwKxevgH4Q6RM3bATRUl4MeAG8Pbfgu0uXgrtBrJsEqOsSw8D3r8lTucx5/atQbbPiU0TCZ3sjlMnoLcVkQ4Br24JQjpWnG7ZfZL9Rnz0bbhsQbhxXQApAfa40J/sgE= Received: from DM4PR16MB5004.namprd16.prod.outlook.com (2603:10b6:8:43::15) by DM6PR16MB3863.namprd16.prod.outlook.com (2603:10b6:5:2be::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Mon, 29 May 2023 12:07:55 +0000 Received: from DM4PR16MB5004.namprd16.prod.outlook.com ([fe80::a733:90e1:bd47:cf69]) by DM4PR16MB5004.namprd16.prod.outlook.com ([fe80::a733:90e1:bd47:cf69%3]) with mapi id 15.20.6433.022; Mon, 29 May 2023 12:07:55 +0000 From: "Chevron Li (WH)" To: "adrian.hunter@intel.com" , "ulf.hansson@linaro.org" , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "Shirley Her(SC)" , "XiaoGuang Yu (WH)" , "Shaper Liu (WH)" , "Justin Wang (WH)" , Chevron Li Subject: RE: [PATCH V1 1/1] mmc: sdhci: fix DMA configure compatibility issue when 64bit DMA mode is used. Thread-Topic: [PATCH V1 1/1] mmc: sdhci: fix DMA configure compatibility issue when 64bit DMA mode is used. Thread-Index: AQHZjWdihWBVzy0abUm9tKKNGHDpg69xMEgA Date: Mon, 29 May 2023 12:07:55 +0000 Message-ID: References: <20230523111114.18124-1-chevron_li@126.com> In-Reply-To: <20230523111114.18124-1-chevron_li@126.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=bayhubtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR16MB5004:EE_|DM6PR16MB3863:EE_ x-ms-office365-filtering-correlation-id: d252d09a-adf9-467c-15bb-08db603d55e8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Yv1O4hdG3eKM04tj9EHJBUzoKQCTaqjn5u1OCVksU56Y69tMycKIOxy/TqwBEMlOjME7hTeO2obVmr/3wWKPa1btEGrTPziPYdhu4NeOFiuvWlUIxpQkaz9NOlKARLV2n4ZZOAtB3EgYE3UHuLkFJc1ddvsAfavVU/H1huY+2qR1zES7rwA7h6pxyJMkQ/JkWkTqiZGlb27vbXIN1PKra5D4A97LEgLD8L+IUYQGaDT1LdEk/kqx/HQMFcWP8DhwD2OvD0OIHx73Oygiyjlv/eedmSftgdpP4mmCiK+3yjG2NGrXGmbqyF7s4lQ6JsWdlt2wuCcxxWcry1lYHP8KZEmmdhX8bfvliDI1ZbMKGusqSgZttjx20O4G81pwhjoimyD38YG1q/5o35ly1CoG0j6gAdIDyFJUDIWcSzdakDhE/VFzyMbQnABOZw9oDmPY7/Ht4ItYl2Cb3ppke/VT1rhFc9TZx9dklM8co7JT2ifKQ/tv7sdebhO6n6/Gf1NAQs9qMPtz+XuHAZouh2PtsSN/tYrlABSoSwEtGir7vJx/Sugjm64x3TDd6Xuv7ZefjCTsOXtst4Pe5ahByNtrGbqH8fwWHARRfAMMe9jUEeI03Sx5NefRUOWbL8BdLE9F x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR16MB5004.namprd16.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(396003)(136003)(39830400003)(451199021)(41300700001)(86362001)(7696005)(38070700005)(55016003)(64756008)(66446008)(4326008)(316002)(33656002)(71200400001)(76116006)(66476007)(66556008)(66946007)(52536014)(5660300002)(9686003)(6506007)(26005)(83380400001)(53546011)(186003)(2906002)(478600001)(8676002)(8936002)(122000001)(110136005)(54906003)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WTuDpktcXIViarhbHKaXcEHcU5VJNIE+3HORFbj6Vc1T9hXm950MsX7kXDwb?= =?us-ascii?Q?QCv6RynTDgyL2iB1ev5BtUBrLW7btCmpBPQ2565nTxB1zZfZosIRk3yKBEY3?= =?us-ascii?Q?L2athOuBCLh2b48vzuFyCvpyQ2wOHv0fym7iNVIdu+sGds0ypnHqntpALmzp?= =?us-ascii?Q?4g9BDWzQBeYAXBJgJuBe03IknUJJt0Z1CzAloiWDn3BhNx7LlrUikqwCAP53?= =?us-ascii?Q?vNuOKs7bgfKbqqw/aZB7abRDrF3p1Nb3MJKLiokeLKxFlar8Ri1dhMDZAj+r?= =?us-ascii?Q?jGNNxAyUEHGID5/dOc6O64DD3pfjm4B8UAkfDGnBdd7PO8YY0E+p4JA2rU3p?= =?us-ascii?Q?CRaZIIgLAy8tyusDBWN9887Dql+OAAhdu9Uidr7mwSuL+3Z3a1DeLz1o0tL4?= =?us-ascii?Q?uWVTYee8oexWOYCwefXC2vCM4iSoVXedMvgXRGIRrw+AolDeeYH74jdW+qDX?= =?us-ascii?Q?oRwxJSZ3jqEHktdJyMHEiaHp88q3n/Q+82Ckv/TD6RQsVCMnjmaEXGfGFVMe?= =?us-ascii?Q?nseCUJzeozDAol0luAfX2z3X+rG6rGQxA2hUfDi3tv8ohbSdBLlbAr+JqkOY?= =?us-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bBxruScI+Yf/8VdJHM010GdpAFMR1YojF?= =?us-ascii?Q?FqQ5mawDvlHI4kISU/2HcEXs58Jd+AVPfxW11OEjpHAowabFhArdq8XB7v4w?= =?us-ascii?Q?d/TfNwCj6Y8Zs9dY+VhsNk/sbPS/e2L0VhSwGp/z?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: bayhubtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR16MB5004.namprd16.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d252d09a-adf9-467c-15bb-08db603d55e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2023 12:07:55.3447 (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: ZuJ5P8X05NG+yZ70V8HfcO/IPtUjeubw1rMM/7iDIbggBIV1ICsb+EYV7c/vw9TjR2EM9eE9gz3YkEAzcsjDXILsuy/9aObP6mRf0k8B5ho= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR16MB3863 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, 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 Hi, Adrian/Ulf, May I know the patch progress? Look forward your response. BR, Chevron -----Original Message----- From: Chevron Li =20 Sent: Tuesday, May 23, 2023 19:11 To: adrian.hunter@intel.com; ulf.hansson@linaro.org; linux-mmc@vger.kernel.= org; linux-kernel@vger.kernel.org Cc: Shirley Her(SC) ; XiaoGuang Yu (WH) ; Shaper Liu (WH) ; Justin= Wang (WH) ; Chevron Li (WH) Subject: [PATCH V1 1/1] mmc: sdhci: fix DMA configure compatibility issue w= hen 64bit DMA mode is used. 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]=3D0 (32bits addressing) mode, is admitted to be written only at SD Host Register [03E][13]=3D1 (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 --- 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 3241= 916141d7..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 *hos= t, struct mmc_command *cmd) } } =20 + sdhci_config_dma(host); + if (host->flags & SDHCI_REQ_USE_DMA) { int sg_cnt =3D sdhci_pre_dma_transfer(host, data, COOKIE_MAPPED); =20 @@ -1186,8 +1188,6 @@ static void sdhci_prepare_data(struct sdhci_host *hos= t, struct mmc_command *cmd) } } =20 - sdhci_config_dma(host); - if (!(host->flags & SDHCI_REQ_USE_DMA)) { int flags; =20 base-commit: cc3c44c9fda264c6d401be04e95449a57c1231c6 -- 2.25.1