From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0A65C433F5 for ; Tue, 16 Nov 2021 20:41:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C0EEC615E2 for ; Tue, 16 Nov 2021 20:41:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C0EEC615E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=kp0LEvgMRS1BsBClF5q3h6vCGfRxh8GQMJdtL5KX78E=; b=y41pTwoZA5iqHc KYog7CccTajwtaGNzufvLQ9HzvuMAlixcdkVjGM2EWMwbGZk4KlFPM7BeRbBkgAUtcyku785RyFgv MtOqCgTTbzkcrDYFwjRTV+RfCoQxaHjdbb6O5VQHIdqlRd5dqfPrfmVhC8j9W41aSQmfNnFP2C00N Boh4l+EUmVZ8V1lO1dblB43hI5jzxR48wIOPfJNaqJBD8qPiZvtaTdWSIL7oGjbrsDR/jOq0W1XBi IjBODpHtVgGLoOmAzHZ87CAj35/jXmp6cA9uucIvHjeRsChFy6swDxYS1yJt5GTprznXKwDKbIgZg I+36Ztr7Wkc8/QN94UxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mn5FS-002jkB-9J; Tue, 16 Nov 2021 20:40:10 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mn5FN-002jiz-MQ; Tue, 16 Nov 2021 20:40:07 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F67761B30; Tue, 16 Nov 2021 20:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637095204; bh=SqgvuUNAsCwRWZsRjJoxgM4Yn5y7VGBMt/yUh10/rfI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=SfFx9GSLSUML4INXVyC7DPCQxaMYlGsCUp9HvQIQgFgSWvzpILZVVV8jBeT5SdTnA SjCrCbAArtgB68wX0ASQkYvRprf/fosaHLfFQgVrI6XzuhigwaSXeJJhs40HFtZxOK f3fdzeHv5WszP5I9+EHsI4PRebT0P2nzr1DEG2MZuM6mCrilIMMW22+H3ocsFSXlhu EWUHGYuBtWnZvC7mB0pFq51L0wDO8IG4CBpSpG619rjjXmYwTiMmMqcOOr3WW51AAd 56L4Yc//N85VcN0oKSdpXJ+0IZ9rjRBNgNF3TNteY1d3jOXBscXn5bDldvHE/ilpIx 4Q31o9MsggdEw== Date: Tue, 16 Nov 2021 14:40:03 -0600 From: Bjorn Helgaas To: Jim Quinlan Cc: Jim Quinlan , "open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS" , Bjorn Helgaas , Nicolas Saenz Julienne , Rob Herring , Mark Brown , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , Florian Fainelli , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v8 1/8] PCI: brcmstb: Change brcm_phy_stop() to return void Message-ID: <20211116204003.GA1678373@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211116_124005_812846_5D76B564 X-CRM114-Status: GOOD ( 30.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 15, 2021 at 03:56:14PM -0500, Jim Quinlan wrote: > On Thu, Nov 11, 2021 at 4:57 PM Bjorn Helgaas wrote: > > On Wed, Nov 10, 2021 at 05:14:41PM -0500, Jim Quinlan wrote: > > > We do not use the result of this function so make it void. > > > > I don't get it. Can you expand on this? > > > > brcm_phy_cntl() can return -EIO, which means brcm_phy_stop() can > > return -EIO, which means brcm_pcie_suspend can return -EIO. > > brcm_pcie_suspend() is the dev_pm_ops.suspend() method. > > > > So are you saying we never use the result of dev_pm_ops.suspend()? > > In this situation we are going into suspend. In doing so, any > problems with the brcm phy may be erased/forgiven upon resume, since > clocks are turned off and most power removed/reduced. An error from > brcm_phy_stop() that becomes the return value of brcm_pcie_suspend() > will bring a halt to the entire suspend IIRC. In fact, I forced a > -EIO in this code and it panic'd on suspend. This is not really the > behavior I want for what is most likely a recoverable error. > > Perhaps a dev_err(...) will suffice while still returning 0? Maybe we just need a note about why we want to intentionally ignore any errors here. > I noticed that reset_control_rearm() also returns a value, and if that > is in error it will not be erease/forgiven by suspend sleep. I will > fix this. > > Regards, > Jim Quinlan > Broadcom STB > > > > > > > Signed-off-by: Jim Quinlan > > > --- > > > drivers/pci/controller/pcie-brcmstb.c | 10 +++++----- > > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > > > index cc30215f5a43..ff7d0d291531 100644 > > > --- a/drivers/pci/controller/pcie-brcmstb.c > > > +++ b/drivers/pci/controller/pcie-brcmstb.c > > > @@ -1111,9 +1111,10 @@ static inline int brcm_phy_start(struct brcm_pcie *pcie) > > > return pcie->rescal ? brcm_phy_cntl(pcie, 1) : 0; > > > } > > > > > > -static inline int brcm_phy_stop(struct brcm_pcie *pcie) > > > +static inline void brcm_phy_stop(struct brcm_pcie *pcie) > > > { > > > - return pcie->rescal ? brcm_phy_cntl(pcie, 0) : 0; > > > + if (pcie->rescal) > > > + brcm_phy_cntl(pcie, 0); > > > } > > > > > > static void brcm_pcie_turn_off(struct brcm_pcie *pcie) > > > @@ -1143,14 +1144,13 @@ static void brcm_pcie_turn_off(struct brcm_pcie *pcie) > > > static int brcm_pcie_suspend(struct device *dev) > > > { > > > struct brcm_pcie *pcie = dev_get_drvdata(dev); > > > - int ret; > > > > > > brcm_pcie_turn_off(pcie); > > > - ret = brcm_phy_stop(pcie); > > > + brcm_phy_stop(pcie); > > > reset_control_rearm(pcie->rescal); > > > clk_disable_unprepare(pcie->clk); > > > > > > - return ret; > > > + return 0; > > > } > > > > > > static int brcm_pcie_resume(struct device *dev) > > > -- > > > 2.17.1 > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel