Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2654553rda; Wed, 25 Oct 2023 08:41:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaqgGftzCig57Ztgpo3pjZqvkKlbd4rPa6bMfyE27YfxoJDppTZpECG4Y6zrlCwvXd6a74 X-Received: by 2002:a17:907:86a0:b0:9bd:fc4a:c70b with SMTP id qa32-20020a17090786a000b009bdfc4ac70bmr13432968ejc.70.1698248517231; Wed, 25 Oct 2023 08:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698248517; cv=none; d=google.com; s=arc-20160816; b=rePUuRF/yxBOmsLJ9J+U7V88kZf8rwi4gTDSdLyaLbQgNhqbBLg4zjoF9yY+eZOPKz +NK2P8IMHglQBNCPLhihvHf7J4y0+EQ5RTScmkxpLX+hMM2p5/2s2I6llHfOWH6yGX0H Vk78ZJS6vD0S0YM1sUkpJnwytQ0ZpC0k2smjOhq1zjv4de2NC4IfrGAyolwwI/nyYPq6 /aU2KjDwuUi7M69+XpmAKDoUsFGi0HNIV5/YlrBtly480jLF9OK3t83sZGJMyQ2mw6As wEan/Vv+MMGfxgcX2LODO+PNQaVmtctAm5ntIeEpN9A00oHyLo/31zdJgLzpepU8irS6 fKKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=catQkGGoy4Efzat+lKyP1a3mAz2iIP2zibMS1iYe5YQ=; fh=ljkMGdtR/rk/PuCVL7iOpt7rL9ABqSVItWt3kGzivlM=; b=ODY6R293BVz2dgPSKwW5bbpEAB+Z8ioHyKAxGedJgfN3mSUaxQhh91hwV7C+0j6ZeJ M+sQ3Snn51/3G0d1g9GJd7K95677GM/Ia/mhkHydJ3uHqjRnFIIzkXgKW5J52t4JxdAr TzC828WbfCkOJQTpOu1Zn+PVedEr8h5H3OnfPkBdGAXYJW2engmS0yBuPgwtbwSjR/Kd wFJsz9f/TOoQQv+hqTFQfn3wLs9Cbzjk0SV97UkcBreeA1OHO236WkmQk47TGr/TMZzG wHg5Ws6SOE9c1QYNR3h9vz3nJBDpR8GQGT9B5x6gB7c+WRrgXTRZzAvk7CK5fFcNbbNf YY+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lI4Q9Gwo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id he39-20020a1709073da700b0099db0004d5asi5842672ejc.213.2023.10.25.08.41.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 08:41:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lI4Q9Gwo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A1B958088A50; Wed, 25 Oct 2023 08:41:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233778AbjJYPlr (ORCPT + 99 others); Wed, 25 Oct 2023 11:41:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbjJYPlp (ORCPT ); Wed, 25 Oct 2023 11:41:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E968612A; Wed, 25 Oct 2023 08:41:43 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C50CC433C8; Wed, 25 Oct 2023 15:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698248503; bh=PzjgKpSa57giPfmrowGoMAs62Cov+6nezTmGkieIMeQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lI4Q9GwoRePYdEq52N3c61EeIRpMkDTqi5iRFrMExTJTacyDIyN9YPfehym+0288I QYIJ6qIdPhPbIp3fNIKVMoZf7yx8kdD6htozlwjc0THS4jEU3HFGUivXVYCuRRBmz7 5lcLSeXaK9Jrfz9JBYeXauXCbAgNO9kq9obW3jJdOBtxOH2GJ+Q6PxsUxMtF8NinKT PjojuRheRm6QfWUoTeUtl8wFLWHfvEIFhe/XISifpZfKoTsuf0FTBvplwLdSCE/fMs N97EJD4KeRscOI/Em55RnBO+fPYO+KFd58sQ/W+Zt8az7zQHWfYR/RUY5gpruGryMf BxZTSRD41fw+g== Date: Wed, 25 Oct 2023 23:29:25 +0800 From: Jisheng Zhang To: Drew Fustini Cc: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Guo Ren , Fu Wei , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Robert Nelson , Jason Kridner , Xi Ruoyao , Han Gao , Icenowy Zheng , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v3 2/7] mmc: sdhci: add __sdhci_execute_tuning() to header Message-ID: References: <20231023-th1520-mmc-v3-0-abc5e7491166@baylibre.com> <20231023-th1520-mmc-v3-2-abc5e7491166@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231023-th1520-mmc-v3-2-abc5e7491166@baylibre.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 08:41:53 -0700 (PDT) On Mon, Oct 23, 2023 at 02:07:03PM -0700, Drew Fustini wrote: > Expose __sdhci_execute_tuning() so that it can be called from the > mmc host controller drivers. > > In the sdhci-of-dwcmshc driver, sdhci_dwcmshc_th1520_ops sets > platform_execute_tuning to th1520_execute_tuning(). That function has Hi Drew, Just FYI, my th1520 version patch in my local repo overrides the mmc_host_ops.execute_tuning as the following: host->mmc_host_ops.execute_tuning = dwcmshc_execute_tuning; In dwcmshc_execute_tuning(), I will do some necessary setting then call sdhci_execute_tuning(); So I don't need to export __sdhci_execute_tuning(). The main reason is that the __abc symbol is expected to be used internally. However, I have no big preference. I would leave the decision be made by mmc maintainers @Ulf @Adrian, can you please comment? Thanks > to manipulate phy registers before tuning can be performed. To avoid > copying the code verbatim from __sdhci_execute_tuning() into > th1520_execute_tuning(), make it possible for __sdhci_execute_tuning() > to be called from sdhci-of-dwcmshc. > > Signed-off-by: Drew Fustini > --- > drivers/mmc/host/sdhci.c | 3 ++- > drivers/mmc/host/sdhci.h | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index ff41aa56564e..c79f73459915 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -2841,7 +2841,7 @@ void sdhci_send_tuning(struct sdhci_host *host, u32 opcode) > } > EXPORT_SYMBOL_GPL(sdhci_send_tuning); > > -static int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode) > +int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode) > { > int i; > > @@ -2879,6 +2879,7 @@ static int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode) > sdhci_reset_tuning(host); > return -EAGAIN; > } > +EXPORT_SYMBOL_GPL(__sdhci_execute_tuning); > > int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) > { > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index f219bdea8f28..a20864fc0641 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -793,6 +793,7 @@ void sdhci_set_bus_width(struct sdhci_host *host, int width); > void sdhci_reset(struct sdhci_host *host, u8 mask); > void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); > int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode); > +int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode); > void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios); > int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, > struct mmc_ios *ios); > > -- > 2.34.1 >