Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp825575ybg; Sun, 26 Jul 2020 23:59:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxanK6KxWlhWx0sXBaMV7cBxKQqjpFDmi8xHzw4Khh1OUbSY10gjmz0ptTheh8T5wdhoSl X-Received: by 2002:a17:906:3050:: with SMTP id d16mr5669402ejd.12.1595833149558; Sun, 26 Jul 2020 23:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595833149; cv=none; d=google.com; s=arc-20160816; b=0xffh1v2bLTlbTUs5U8+LyTom/+YsktnjpOHfWoAA5yyPqTX343+Jm9IBHlIrS6NA1 KA3qieJolJK6fjl1GbeliEFX6u9k0NIawT5NXEbXSRYWhQ9VmtZhV4B6VqgWqlKiHdTK 91DPwGtmASK4v5pUVws6rC/GcZ0s3JUFQpADPUINxlJ88EJuUufiYLSVVenWFv+zDb1e fhKGDSp/Y8i+maScyQ5Mto6JPCHw+mrpKus0ptUahhFSlWKuDxMMQIZa7mczhfUqKd24 HsGgxYotNh+7C1V4wzDasflC16Sko8HIhJEj7dd3nAKAsrudiWxRwuS4EdUV8CyuUZUF AzAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=RCjJnUHy2+jdSUCT/TFHHS0JowC0yTai05+Nz2MA4ZY=; b=Ked8dDFRLUwyAIlMgToKRc6x5iEczbzu5P58KDYjYk9I79PmYPLgeNfGcIMWeP1jh5 TngkBWAHT8qqykHxuIyA+lghm/R4kdxoGGgvsqOsqkXt+Qx7LuXWFzFDltoQqkrH7Kaa pOol9Sm+jt/BMhpVtJ/TlCqWm39aMZg8WloVRUb6tyJ7yi0Fx4a8lKtTanHp5k4qi73e 5jpZO/lKzAzLvGSJJWtHAKoopUDPnWyDC3PYnwry7BxQPRxzNlH6mOzAGJMutRI9Lcvh YiUwzMfUq7rMqx0R/wHcd2Wy8nfU+vYBOMF0WNHnFl81LEnNM7iAfWbUWhRczKPkG8iJ 6pMQ== 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 z16si4842484eju.554.2020.07.26.23.58.46; Sun, 26 Jul 2020 23:59:09 -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 S1726835AbgG0G60 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 27 Jul 2020 02:58:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726662AbgG0G6Z (ORCPT ); Mon, 27 Jul 2020 02:58:25 -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 B7037C0619D2 for ; Sun, 26 Jul 2020 23:58:25 -0700 (PDT) Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jzx5W-0006HG-KR; Mon, 27 Jul 2020 08:58:18 +0200 Received: from pza by lupine with local (Exim 4.92) (envelope-from ) id 1jzx5U-0004Sa-7O; Mon, 27 Jul 2020 08:58:16 +0200 Message-ID: <00892cf87c3da679d76c4632109ebcf21059d556.camel@pengutronix.de> Subject: Re: [PATCH v9 02/12] ata: ahci_brcm: Fix use of BCM7216 reset controller From: Philipp Zabel To: Jim Quinlan , linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Christoph Hellwig , Robin Murphy , bcm-kernel-feedback-list@broadcom.com Cc: Jens Axboe , Florian Fainelli , Hans de Goede , "open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)" , open list Date: Mon, 27 Jul 2020 08:58:16 +0200 In-Reply-To: <20200724203407.16972-3-james.quinlan@broadcom.com> References: <20200724203407.16972-1-james.quinlan@broadcom.com> <20200724203407.16972-3-james.quinlan@broadcom.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@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 Fri, 2020-07-24 at 16:33 -0400, Jim Quinlan wrote: > From: Jim Quinlan > > A reset controller "rescal" is shared between the AHCI driver and the PCIe > driver for the BrcmSTB 7216 chip. Use > devm_reset_control_get_optional_shared() to handle this sharing. > > Signed-off-by: Jim Quinlan > > Fixes: 272ecd60a636 ("ata: ahci_brcm: BCM7216 reset is self de-asserting") > Fixes: c345ec6a50e9 ("ata: ahci_brcm: Support BCM7216 reset controller name") > --- > drivers/ata/ahci_brcm.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c > index 6853dbb4131d..d6115bc04b09 100644 > --- a/drivers/ata/ahci_brcm.c > +++ b/drivers/ata/ahci_brcm.c > @@ -428,7 +428,6 @@ static int brcm_ahci_probe(struct platform_device *pdev) > { > const struct of_device_id *of_id; > struct device *dev = &pdev->dev; > - const char *reset_name = NULL; > struct brcm_ahci_priv *priv; > struct ahci_host_priv *hpriv; > struct resource *res; > @@ -452,11 +451,10 @@ static int brcm_ahci_probe(struct platform_device *pdev) > > /* Reset is optional depending on platform and named differently */ > if (priv->version == BRCM_SATA_BCM7216) > - reset_name = "rescal"; > + priv->rcdev = devm_reset_control_get_optional_shared(&pdev->dev, "rescal"); > else > - reset_name = "ahci"; > + priv->rcdev = devm_reset_control_get_optional(&pdev->dev, "ahci"); Please use devm_reset_control_get_optional_exclusive() here. > > - priv->rcdev = devm_reset_control_get_optional(&pdev->dev, reset_name); > if (IS_ERR(priv->rcdev)) > return PTR_ERR(priv->rcdev); > > @@ -479,10 +477,7 @@ static int brcm_ahci_probe(struct platform_device *pdev) > break; > } > > - if (priv->version == BRCM_SATA_BCM7216) > - ret = reset_control_reset(priv->rcdev); > - else > - ret = reset_control_deassert(priv->rcdev); > + ret = reset_control_deassert(priv->rcdev); > if (ret) > return ret; > Since you switch from _reset to _deassert/_assert here, I suspect you should also change the out_reset error path, and the suspend/resume functions accordingly. regards Philipp