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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C37DAC001DE for ; Mon, 7 Aug 2023 21:57:42 +0000 (UTC) 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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FVLPrNHb5JlajEu76WBhY56CnDZcPE9TP4nZm37BSHU=; b=qOeZzzrAOZbe3i 6APflVGxHvSKUiFnMVSDCGkWHcFQC1i5OsQbul/CvtYSgR3aFpA7/MhnTep+ViqLAt2r6OVqXAjlN POmQIM3weI3RQMpp8vjr7//An8Rmqcy3UnOVTIDUiMeKJlFP+lqUgqIR7knOiFoJYieHAvHvm/H0W jbiK07gHz+qiCLjxzfeon4F8ivC5msQ9GgSEtpZ9KlQ3wKD9QkwdtP9M52PCd7RZueEIH2grBLwsc JGXpnuWS0NZYIT8NMUrNfNt0bHlaE29wxObF5VMblTAqVjIIErUgug3La4tonPdrDk+N8hBQcHXbk 0NY2GnwyD9tyru/XChEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qT8E1-000p1s-2T; Mon, 07 Aug 2023 21:57:17 +0000 Received: from mail-pg1-f175.google.com ([209.85.215.175]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qT8Du-000ozi-1n for linux-arm-kernel@lists.infradead.org; Mon, 07 Aug 2023 21:57:15 +0000 Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-54290603887so2915744a12.1 for ; Mon, 07 Aug 2023 14:57:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691445427; x=1692050227; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WvIEaTGboMwJuS/k2b6YBv94pmgX2U83ceP6WGTpdkM=; b=XYHaSEZE7hN0Stlm/TzXpwi4Lv0gGic/oY/VttOxTPgziKnx3GXF3vV1FTR81g9srx zSfsNqQPJM+2IrE8t2UAYrajY48mY7uPU64DJrM4PFbUnmIxS03fjDqj4w0b42Aa+lkN 9SgwnbuNJZ84tkIIIO+Aao5ISUx+S3vcHG3PUv7KbqFjzbrskY52AV0SbGWyKI150MJz IQuRpvYqfnTQot/aogAjY4LLuXoTF7IUKTqT3vlduSPgVDsHLtUVbFOc1vp4wsFjVPD5 pe99Em/XpfN1r/teXnrrAaOJeYZvpgK1CBS63SnHbNEuQ78Sps0JjZyf+RDpQJ/w7vgI 2PZg== X-Gm-Message-State: AOJu0YxzUywZ6f7MRgChmOXv75XwFdAcsmQcGT6IrE4LUFyG5EipX+d7 gC8cGU+wzHwqW5WBvMdgL8XThA== X-Google-Smtp-Source: AGHT+IEdiUMcXmPMcKTJnHdeH59gwbfl+t+l+pkmpPSb1V346uMtAeM99tfVQPHhldq22o7KUFssAw== X-Received: by 2002:a17:90b:38c3:b0:262:f09c:e73d with SMTP id nn3-20020a17090b38c300b00262f09ce73dmr8289917pjb.34.1691445426934; Mon, 07 Aug 2023 14:57:06 -0700 (PDT) Received: from localhost ([75.172.135.98]) by smtp.gmail.com with ESMTPSA id u19-20020a17090a891300b00267fbd521dbsm9237293pjn.5.2023.08.07.14.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 14:57:06 -0700 (PDT) From: Kevin Hilman To: Dhruva Gole , Andrew Davis Cc: Nishanth Menon , Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Viresh Kumar , Praneeth Bajjuri , Tony Lindgren , Dave Gerlach , Vibhore Vardhan , Georgi Vlaev Subject: Re: [PATCH V6 4/4] firmware: ti_sci: Introduce system suspend resume support In-Reply-To: <20230803160815.yfpkdfssv75d4inf@dhruva> References: <20230803064247.503036-1-d-gole@ti.com> <20230803064247.503036-5-d-gole@ti.com> <3882f0ac-b74c-6eb2-197c-34ca233cd7a3@ti.com> <20230803155541.nwsfwobfkbpefoyw@dhruva> <8c330bd9-5f4e-8cd0-ed02-c3a696d7473a@ti.com> <20230803160815.yfpkdfssv75d4inf@dhruva> Date: Mon, 07 Aug 2023 14:57:05 -0700 Message-ID: <7ho7jifrda.fsf@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230807_145710_621281_3E3A43B5 X-CRM114-Status: GOOD ( 32.20 ) 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 Dhruva Gole writes: > On Aug 03, 2023 at 11:00:11 -0500, Andrew Davis wrote: >> On 8/3/23 10:55 AM, Dhruva Gole wrote: >> > On Aug 03, 2023 at 10:26:32 -0500, Andrew Davis wrote: >> > > On 8/3/23 1:42 AM, Dhruva Gole wrote: >> > > > Introduce system suspend resume calls that will allow the ti_sci >> > > > driver to support deep sleep low power mode when the user space issues a >> > > > suspend to mem. >> > > > >> > > > Also, write a ti_sci_prepare_system_suspend call to be used in the driver >> > > > suspend handler to allow the system to identify the low power mode being >> > > > entered and if necessary, send TISCI_MSG_PREPARE_SLEEP with information >> > > > about the mode is being entered and the address for allocated memory for >> > > > storing the context during Deep Sleep. >> > > > >> > > > We're using "pm_suspend_target_state" to map the kernel's target suspend >> > > > state to SysFW low power mode. Make sure this is available only when >> > > > CONFIG_SUSPEND is enabled. >> > > > >> > > > Co-developed-by: Dave Gerlach >> > > > Signed-off-by: Dave Gerlach >> > > > Signed-off-by: Vibhore Vardhan >> > > > Signed-off-by: Georgi Vlaev >> > > > Signed-off-by: Dhruva Gole >> > > > --- >> > > > drivers/firmware/ti_sci.c | 63 +++++++++++++++++++++++++++++++++++++++ >> > > > 1 file changed, 63 insertions(+) >> > > > >> > [..snip..] >> > > > +static int ti_sci_suspend(struct device *dev) >> > > > +{ >> > > > + struct ti_sci_info *info = dev_get_drvdata(dev); >> > > > + int ret; >> > > > + >> > > > + ret = ti_sci_cmd_set_io_isolation(&info->handle, TISCI_MSG_VALUE_IO_ENABLE); >> > > >> > > After this the will the IOs be in isolation? Or does the firmware wait >> > > until power down begins later? >> > >> > From what I understand, >> > IOs will be in isolation immediately >> > >> >> That is what I understand too, so then any device that may need to do some >> external communication for its suspend will not function, this must be the >> last driver _suspend() the system calls, how do you enforce that? > > I will make use of .suspend_noirq callbacks in that case. Does that > sound better, or is there anything else I may not be aware of? Using _noirq just moves the problem. What if other drivers are also using _noirq callbacks and run after the SCI driver? You still cannot guarantee ordering. It seems to me that the IO isolation stuff is a system-wide operation, and should probably be handled at the platform suspend_ops level (e.g. suspend_ops->prepare_late()). This would ensure that it runs *after* all the driver hooks (even driver _noirq hooks.) and right before the full suspend (or s2idle.) Now, all that being said, I noticed that in v7, you didn't move this to _noirq, but instead suggested that this be handled by TF-A. I suppose that's an option also, but my suggestion above should work also. Kevin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel