Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7345376imu; Mon, 3 Dec 2018 11:20:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/VGQEwDBGDFPoxuU8h9jDKaM2gclgOllKW3sWuOCKksb4wgfLruC9p/53ZVFdLFypiahpwq X-Received: by 2002:a63:7a5b:: with SMTP id j27mr14323241pgn.112.1543864818114; Mon, 03 Dec 2018 11:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543864818; cv=none; d=google.com; s=arc-20160816; b=P28up7Z6GRUpRPYOa+EWq2z9vEMlvrqNhB0i9Ws/oZqZ+ANOTcH/KnbhPt2+CPstNG r4oFbc1QryFKVMqv2yIk1XjIdqHot4r5ydS9hSw8P0J2crj/ng+gH9CL9M5orvZhjflb QKKvIsb/easJkL9l053GB51InIEWDAQqvB7ZPq4jxrF2EDEY8EteEE9YFvYD8qGSvbpe lIVmsLfp10vouaAaNDm+nFQv68hTjoMKaS/s46bNvMbjhi4OAPL94xCXnGh1p2j+TmVq Y4H18f0BiQam3YXxLvG9NqHOlPGPZri+BYnFh7DiBS+T88VYvwTw3mqe5G4aZRMjPvSP m43A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature; bh=4jy+4deCS4HEF4ZKlugFyBPqi40hdZaTGvEKeC7dA4E=; b=sDItsQgps1/1v5Zybnv8ryFtZzXx9JSjVf424tJ71OEOqpAgrS6NLcyqn4UCUkG/3g RYFy2H34WtZdZ+MCAG+aC+MqSBazTFJIQPVCprTQ+jx/Ik4ukWZkUxh7nFJH11DnaHgp CqSm3IsWZTlaRY1OfGnHZws9rDFj/XQYCbdGyNwE730oYHex2aiKEwsGimRJ6Dv5h9Kq kdRYE0t6rwe5B7LD5f87JJNsw3gx9kp/nz22Q3JbcD9LY7fUYhVtC2RQw5YsHLxd4hvY 7WQiHL9/f0b0krdR6zjaiaZ0Z3ABfK12KrToi3K8UdysBTjQ+j+MrlJXPmO+BsGz0k3p qggA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0QI9psdX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si13999641pgt.464.2018.12.03.11.20.02; Mon, 03 Dec 2018 11:20:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0QI9psdX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726087AbeLCTT2 (ORCPT + 99 others); Mon, 3 Dec 2018 14:19:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:42972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbeLCTT2 (ORCPT ); Mon, 3 Dec 2018 14:19:28 -0500 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7453D20848; Mon, 3 Dec 2018 19:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543864763; bh=loEs24ZyMoNpy+gMXQJBM7jI49KannDP3YHy75Z7URI=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=0QI9psdXLbnDJstfNoLdBl4aGNAlhaStszy0pkD/ATX/7QarrlIKH4bPG9feQ7FJx BwQFn1UbmF7ajle++cjD4jET4lFnc2kQ9dY7JGf4XAKHgGH9cddMRjVkpV69trptoG BeF6feuT7a+qYYIzZfpJjDSr+oaUpI1mW5HiryRE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Lorenzo Pieralisi , Miquel Raynal From: Stephen Boyd In-Reply-To: <20181203171859.GA12792@e107981-ln.cambridge.arm.com> Cc: "Rafael J. Wysocki" , sudeep.holla@arm.com, Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Thomas Petazzoni , Bjorn Helgaas , devicetree@vger.kernel.org, Rob Herring , Mark Rutland , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Antoine Tenart , Maxime Chevallier , Nadav Haklai , Michael Turquette References: <20181123141831.8214-1-miquel.raynal@bootlin.com> <20181123141831.8214-6-miquel.raynal@bootlin.com> <20181203102708.GA6090@e107981-ln.cambridge.arm.com> <20181203163846.494904f9@xps13> <20181203171859.GA12792@e107981-ln.cambridge.arm.com> Message-ID: <154386476279.88331.4767594304261181833@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH 05/12] PCI: aardvark: add suspend to RAM support Date: Mon, 03 Dec 2018 11:19:22 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Lorenzo Pieralisi (2018-12-03 09:18:59) > [+Stephen, Mike] > = > On Mon, Dec 03, 2018 at 04:38:46PM +0100, Miquel Raynal wrote: > > Hi Lorenzo, > > = > > Lorenzo Pieralisi wrote on Mon, 3 Dec 2018 > > 10:27:08 +0000: > > = > > > [+Rafael, Sudeep] > > > = > > > On Fri, Nov 23, 2018 at 03:18:24PM +0100, Miquel Raynal wrote: > > > > Add suspend and resume callbacks. The priority of these are > > > > "_noirq()", to workaround early access to the registers done by the > > > > PCI core through the ->read()/->write() callbacks at resume time. > > > > = > > > > Signed-off-by: Miquel Raynal > > > > --- > > > > drivers/pci/controller/pci-aardvark.c | 52 +++++++++++++++++++++++= ++++ > > > > 1 file changed, 52 insertions(+) > > > > = > > > > diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/co= ntroller/pci-aardvark.c > > > > index 108b3f15c410..7ecf1ac4036b 100644 > > > > --- a/drivers/pci/controller/pci-aardvark.c > > > > +++ b/drivers/pci/controller/pci-aardvark.c > > > > @@ -1108,6 +1108,55 @@ static int advk_pcie_setup_clk(struct advk_p= cie *pcie) > > > > return ret; > > > > } > > > > = > > > > +static int __maybe_unused advk_pcie_suspend(struct device *dev) > > > > +{ > > > > + struct advk_pcie *pcie =3D dev_get_drvdata(dev); > > > > + > > > > + advk_pcie_disable_phy(pcie); > > > > + > > > > + clk_disable_unprepare(pcie->clk); = > > > = > > > I have noticed it is common practice, still, I would like to check wh= ether > > > it is allowed to call functions that may sleep in a NOIRQ suspend/res= ume > > > callback ? > > = > > You are right this is weird. I double checked and for instance, > > pcie-mediatek.c, pci-tegra.c and pci-imx6.c do the exact same thing. > > There are probably other cases where drivers call functions that may > > sleep from a NOIRQ context. I am interested to know if this is valid > > and if not, what is the alternative? > = > I added Stephen and Mike, who along with Rafael can help us shed some > light into this, I do not have the necessary bits of info myself, I just > noticed. > = Is the noirq phase of system suspend run with irqs disabled? Or just run with the device irqs disabled? I thought it was the latter, which is fine for this scenario because it's still running in a schedulable context.