Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp729118rwb; Thu, 19 Jan 2023 01:44:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXvfdVHoyAdRVOs1aYNMeerT9CawAHpeK6EWHyn7nWxaIRq6bITIn3Bmc21OzYhv7+kw4Hlc X-Received: by 2002:a17:906:1c51:b0:864:8ffe:135b with SMTP id l17-20020a1709061c5100b008648ffe135bmr9948009ejg.22.1674121483085; Thu, 19 Jan 2023 01:44:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674121483; cv=none; d=google.com; s=arc-20160816; b=iyf+viIOu8sKkcizBGNmeFs0uCrAozBVdURwSwGkV7nKKW/MUrUnVC8Tr+7bfQHrqX E39S4oe1ush40I41Bc6WkcHaTqRacr87TIee2EuPdH40lGHviJDKokWy8Vrt3eoKdNtj 7Rt98DKCBxBEvq1MaMa79WtPog1zlc51XMO7l0Ye6bvJUvgdu5uYIQfOv9ZVAdwpu/+3 CKWHJfUG9YqZtw0LidyZ/vx8suUkRpaSykwwJ4HQQdUBRqnSExqLe4DQVaeVEQdCUFzD eZoYTtKsa+0Olo07MKtGfi90qcUbekWHLtaFRObWb+Ny6O3bk0sK++hzV36lMBOPWG2P 7gCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=A8uw9cLSHv+Y0h29P95NjzM0F+WTZEM4kRSqOwv9NGg=; b=Dmdjub+h2bQOESEmsnjUk+DhrBOHFQHHMcuEnLeiboc1E6KULiBPQePHFY5XD0sZPt L2ZC3ULxS/K0uyMwF0BYdSFMagw1iW+tf7qn+6zVHRCemSOwh4v8wGt+P1EsqQbq3Z+X EGuOZv0MKezSHAA+/+epHIOErqqFTUR69tMj+7m+uhENsF6qCCUhclIO8LDNucY7sATj EQhMYEPx0ApR8SpOXQ0Oa519sS0n30EkUOGsveLDkMRLRo//TX5iCKs5T7wpkD59l1CD bttBwNDIpDS2jnk7UPMmhL+6IfdoC7LMivBasBSYkzVg0iB6Flb1eC8I0Ju2aClO4MZB luDA== ARC-Authentication-Results: i=1; mx.google.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 r20-20020aa7d594000000b0046c5b50650esi5982381edq.47.2023.01.19.01.44.30; Thu, 19 Jan 2023 01:44:43 -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; 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 S230092AbjASJfn (ORCPT + 44 others); Thu, 19 Jan 2023 04:35:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjASJfj (ORCPT ); Thu, 19 Jan 2023 04:35:39 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 024115D913 for ; Thu, 19 Jan 2023 01:35:36 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIRJv-0004DY-3L; Thu, 19 Jan 2023 10:34:55 +0100 Received: from pza by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pIRJq-00049f-Qx; Thu, 19 Jan 2023 10:34:50 +0100 Date: Thu, 19 Jan 2023 10:34:50 +0100 From: Philipp Zabel To: Brad Larson Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-spi@vger.kernel.org, adrian.hunter@intel.com, alcooperx@gmail.com, andy.shevchenko@gmail.com, arnd@arndb.de, brad@pensando.io, brendan.higgins@linux.dev, briannorris@chromium.org, brijeshkumar.singh@amd.com, catalin.marinas@arm.com, davidgow@google.com, gsomlo@gmail.com, gerg@linux-m68k.org, krzk@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, lee.jones@linaro.org, broonie@kernel.org, yamada.masahiro@socionext.com, piotrs@cadence.com, p.yadav@ti.com, rdunlap@infradead.org, robh+dt@kernel.org, samuel@sholland.org, fancer.lancer@gmail.com, skhan@linuxfoundation.org, suravee.suthikulpanit@amd.com, thomas.lendacky@amd.com, tonyhuang.sunplus@gmail.com, ulf.hansson@linaro.org, vaishnav.a@ti.com, will@kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v9 14/15] mmc: sdhci-cadence: Support mmc hardware reset Message-ID: <20230119093450.GA14049@pengutronix.de> References: <20230119035136.21603-1-blarson@amd.com> <20230119035136.21603-15-blarson@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230119035136.21603-15-blarson@amd.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: pza@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 Hi Brad, On Wed, Jan 18, 2023 at 07:51:35PM -0800, Brad Larson wrote: > Add support for mmc hardware reset using a reset-controller > that would need to be enabled in the device tree with > a supporting driver. The default is disabled for all > existing designs. > > Signed-off-by: Brad Larson > --- > > Changes since v6: > - Previously patch 17/17 > - Changed delay after reset_control_assert() from 9 to 3 usec > - Renamed sdhci_mmc_hw_reset() to sdhci_cdns_mmc_hw_reset() > > --- > drivers/mmc/host/sdhci-cadence.c | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c > index e92aa79a8be2..62321cef41db 100644 > --- a/drivers/mmc/host/sdhci-cadence.c > +++ b/drivers/mmc/host/sdhci-cadence.c > @@ -12,6 +12,7 @@ [...] > static int sdhci_cdns_probe(struct platform_device *pdev) > { > struct sdhci_host *host; > @@ -521,6 +541,17 @@ static int sdhci_cdns_probe(struct platform_device *pdev) > if (ret) > goto free; > > + if (host->mmc->caps & MMC_CAP_HW_RESET) { > + priv->rst_hw = devm_reset_control_get_optional_exclusive(dev, "hw"); > + if (IS_ERR(priv->rst_hw)) { > + ret = PTR_ERR(priv->rst_hw); > + if (ret == -ENOENT) > + priv->rst_hw = NULL; The optional reset_control_get variants return NULL instead of -ENOENT if no reset is specified. This should return on any error instead. > + } else { > + host->mmc_host_ops.card_hw_reset = sdhci_cdns_mmc_hw_reset; This probably shouldn't be set if reset_control_get_optional returned NULL. > + } > + } > + > ret = sdhci_add_host(host); regards Philipp