Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp334369ybk; Wed, 20 May 2020 00:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuEopmOpLs5zDPUPOkTa+P66ZUcFsIN749lCEh5WyJ/TbPnV92wR7iJdKQWXTp53rCILA1 X-Received: by 2002:a17:906:dc2:: with SMTP id p2mr2606732eji.212.1589959797869; Wed, 20 May 2020 00:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589959797; cv=none; d=google.com; s=arc-20160816; b=CIGF2UGLN0jXqTWBYyjjO3UooxyGj6Ks/uKbqkDvudyZ+iDaS2r4iVJ1x8R6N3UXfD rdqi/LMgp74wc0QOUDo325rCMpbxQw+Ppzhb5YbVG4uW4CA3i+4sUQNuezKotLIQV0BW qg9EJjEVPbcugo5y16gJHeOQIz5OTufvdULRUacFXTU9V9SkkrjaCEYJK0HBov9MKwPW RhBLqiVThIl7HggxadN9Ds69Th6dkjOd93VLu8FdQ9Gqab2hTk+IS8y4TTYxYSGsACGf X6ttc6aj6eJvBgZI4yAkizlGmZmJf8++2p+Dn3orXgucp/EQ364V7pevnbE8v5h5G0yu /XPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=7QnxAPMxYiFYDEhgYWfI0oQ3Qn6LWsicljZhX5L/INw=; b=UpQDL4Jt7LKTOvLF1jZUcoQG0/NC2F+KR6DNxw4/sU4J1nyXQjcofVYpngYHeYw6ky mrAtPlUREYaA2Jo+Z97oRWKd7qvPsuWutxGA3Mn4z2BzOt2PlAbf4A/WwLi7cWi7M87p EhW8fpbAlXLfejL3qKaRiCkSJZWuGBsKnwMAnVTWnph8WQDUpuzqwhLLCsCjAnqxvT8L hSZScNwGFVKoawP81s/ZvZP95KsuYlufyX+KmFz6aMVSdaHx5Hnn1OBRUiFpO95HqxJW q5thM7M42rxS1c2p+v5dkY6d7tw8ZLnsV/KHOyTvBnhRiMYmvMRQglhwk7sRsP/GC8Ck D5Ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v18si1362468ejb.705.2020.05.20.00.29.34; Wed, 20 May 2020 00:29:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726439AbgETH2K (ORCPT + 99 others); Wed, 20 May 2020 03:28:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbgETH2K (ORCPT ); Wed, 20 May 2020 03:28:10 -0400 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 EA0F0C061A0E for ; Wed, 20 May 2020 00:28:09 -0700 (PDT) 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 1jbJ8m-0005fd-1O; Wed, 20 May 2020 09:27:48 +0200 Received: from pza by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1jbJ8l-00021e-8e; Wed, 20 May 2020 09:27:47 +0200 Date: Wed, 20 May 2020 09:27:47 +0200 From: Philipp Zabel To: Jim Quinlan Cc: Nicolas Saenz Julienne , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Florian Fainelli , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS" , open list Subject: Re: [PATCH 07/15] PCI: brcmstb: Add control of rescal reset Message-ID: <20200520072747.GB5213@pengutronix.de> References: <20200519203419.12369-1-james.quinlan@broadcom.com> <20200519203419.12369-8-james.quinlan@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200519203419.12369-8-james.quinlan@broadcom.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:17:38 up 90 days, 14:48, 112 users, load average: 0.07, 0.35, 0.32 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jim, On Tue, May 19, 2020 at 04:34:05PM -0400, Jim Quinlan wrote: > From: Jim Quinlan > > Some STB chips have a special purpose reset controller named > RESCAL (reset calibration). This commit adds the control > of RESCAL as well as the ability to start and stop its > operation for PCIe HW. > > Signed-off-by: Jim Quinlan > --- > drivers/pci/controller/pcie-brcmstb.c | 81 ++++++++++++++++++++++++++- > 1 file changed, 80 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index 2c470104ba38..0787e8f6f7e5 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c [...] > @@ -1100,6 +1164,21 @@ static int brcm_pcie_probe(struct platform_device *pdev) > dev_err(&pdev->dev, "could not enable clock\n"); > return ret; > } > + pcie->rescal = devm_reset_control_get_shared(&pdev->dev, "rescal"); > + if (IS_ERR(pcie->rescal)) { > + if (PTR_ERR(pcie->rescal) == -EPROBE_DEFER) > + return -EPROBE_DEFER; > + pcie->rescal = NULL; This is effectively an optional reset control, so it is better to use: ↵ pcie->rescal = devm_reset_control_get_optional_shared(&pdev->dev, "rescal");↵ if (IS_ERR(pcie->rescal)) return PTR_ERR(pcie->rescal); > + } else { > + ret = reset_control_deassert(pcie->rescal); > + if (ret) > + dev_err(&pdev->dev, "failed to deassert 'rescal'\n"); > + } reset_control_* can handle rstc == NULL parameters for optional reset controls, so this can be done unconditionally: ret = reset_control_deassert(pcie->rescal);↵ if (ret)↵ dev_err(&pdev->dev, "failed to deassert 'rescal'\n");↵ Is rescal handled by the reset-brcmstb-rescal driver? Since that only implements the .reset op, I would expect reset_control_reset() here. Otherwise this looks like it'd be missing a reset_control_assert in remove. regards Philipp