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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7872EC433F5 for ; Thu, 5 May 2022 15:38:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381364AbiEEPmM (ORCPT ); Thu, 5 May 2022 11:42:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380759AbiEEPmK (ORCPT ); Thu, 5 May 2022 11:42:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0377957B15; Thu, 5 May 2022 08:38:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1FAD861D1B; Thu, 5 May 2022 15:38:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7350AC385A8; Thu, 5 May 2022 15:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651765109; bh=Np8qjfuZd4T5JqzN9vyOqdbCko5iAGfOJsY1a9k7kjs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B8KjwH+SmG/PA/TUMcocOHV9fNtRi0ICkxpNV46AhiQydGNzI1H5qFWbJigWgWU7s eu4icqtQoKuz+mrholtDw/AyUJQA9SY6LS+5IXo6rwX/dlnbPjBin4VRiWQozICOjg F38lHR2u/ipv5Onk4CB4BDZEyZAN7T4B7lgLdk//pjVVtrxzk+hInbVPXrhsTuFIWz kK19N6UX1SNckP2hhsP/Pe8iyYrcHTMUb7ppKJXM+gzO96XJyKny9/6wEGPCDQNGOm QkTuf5+d6Lj2HZ1bm+j3LpLHO658M27z9i+njUMTKHzInNTLEDLWPDe/sqkHrPRFNV I45j/PzN5Ny5g== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nmdYg-009FLc-QL; Thu, 05 May 2022 16:38:26 +0100 Date: Thu, 05 May 2022 16:38:26 +0100 Message-ID: <87wnf06lcd.wl-maz@kernel.org> From: Marc Zyngier To: Hector Martin Cc: Rob Herring , Lorenzo Pieralisi , Krzysztof =?UTF-8?B?V2lsY3p5xYRza2k=?= , Bjorn Helgaas , Alyssa Rosenzweig , Sven Peter , PCI , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 3/3] PCI: apple: Add support for optional PWREN GPIO In-Reply-To: <57e47786-0b99-646e-9e73-694e47d14cf5@marcan.st> References: <20220502093832.32778-1-marcan@marcan.st> <20220502093832.32778-4-marcan@marcan.st> <0ccc44cd-21aa-3670-24b3-4ee051dd3c12@marcan.st> <2615501d-7569-41cb-7039-46e690689f1f@marcan.st> <57e47786-0b99-646e-9e73-694e47d14cf5@marcan.st> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: marcan@marcan.st, robh@kernel.org, lorenzo.pieralisi@arm.com, kw@linux.com, bhelgaas@google.com, alyssa@rosenzweig.io, sven@svenpeter.dev, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 04 May 2022 04:36:02 +0100, Hector Martin wrote: [...] > > So it'd go something like this: > > - apcie driver, on slot activation, sees a pwren gpio/reg and powers it > on prior to bringing up the link (and marks that port as d3cold supported) > - sdhci-pci driver, on probe, sees an external card detect GPIO declared > and considers that license to call pci_d3cold_enable and enable > runtime-pm (since it won't need the internal card detect IRQ/GPIO) > - No SD card is inserted, so SD driver goes into runtime suspend and > saves whatever controller state it needs > - PCI core saves whatever config space stuff it needs to save, SD > controller is powered down via GPIO I haven't quite found yet how this goes, but I can't say I tried in anger. I guess that the root port device has to provide some standard PM callbacks that would further tickle the regulator? > - SD card is inserted, SMC GPIO IRQ notifies SD driver > - SD driver goes out of runtime suspend > - PCI core powers on controller, re-establishes link, restores config space > - SD driver restores host controller registers and discovers the new card > > No new APIs, this is all existing kernel stuff. PCI manages slot power > same as it does on ACPI systems (that support it), driver interacts with > it via runtime-pm and the d3cold control stuff. > > I'm tempted to prototype this today and see how it goes... Well, let us know how that goes. Thanks, M. -- Without deviation from the norm, progress is not possible.