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 F0351C46CD2 for ; Tue, 9 Jan 2024 09:49:40 +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:In-Reply-To:MIME-Version:References: 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: List-Owner; bh=NCPQgjcWqVIBZ0Gvgp5dTtadpNofa7zjnqFqmQS5WyM=; b=NwI5lJymvji96s 61JZ45FS0L2+hxO9In3wu5LaGdFWaCSdpiTdV1z4LxeW+UZIMsWVgLaMSe/xkVgxDztCR9l2ygH3+ 9/3qCsqcptj2STubj7rrPtxEBk3B9DaPYnqahwgGdnicnJm69V10toDlFrIZYrm8k+q6DxZeXV3H0 mD7DhWFUlX0p10koxOUlJjKdUhm/TbDOaVPK2jCUuzIneuxMxLQ9f/+CzpWW1NPZdE/C0Oz1OeyhF hMUMiOzwMTOec903FcSgAyTyJlkomM/n3knadPYoHEKnXosn0LIuVMJHH0/aCZu9mCmYnx7LNgBS2 GM7+a7vagPd8jLwxoiAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rN8jS-007Yr5-2n; Tue, 09 Jan 2024 09:49:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rN8jP-007Yqg-0z for linux-arm-kernel@lists.infradead.org; Tue, 09 Jan 2024 09:49:12 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3CA0BC15; Tue, 9 Jan 2024 01:49:48 -0800 (PST) Received: from FVFF77S0Q05N (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B92333F73F; Tue, 9 Jan 2024 01:49:01 -0800 (PST) Date: Tue, 9 Jan 2024 09:48:56 +0000 From: Mark Rutland To: Sudeep Holla , arnd@arndb.de Cc: linux-arm-kernel@lists.infradead.org, Lorenzo Pieralisi Subject: Re: [PATCH] firmware: psci: Fix return value from psci_system_suspend() Message-ID: References: <20231113153446.82684-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231113153446.82684-1-sudeep.holla@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240109_014911_389465_C127840D X-CRM114-Status: GOOD ( 22.49 ) 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 13, 2023 at 03:34:46PM +0000, Sudeep Holla wrote: > Currently we return the value from invoke_psci_fn() directly as return > value from psci_system_suspend(). It is wrong to send the PSCI interface > return value directly. psci_to_linux_errno() provide the mapping from > PSCI return value to the one that can be returned to the callers within > the kernel. > > Use psci_to_linux_errno() to convert and return the correct value from > psci_system_suspend(). > > Fixes: faf7ec4a92c0 ("drivers: firmware: psci: add system suspend support") > Signed-off-by: Sudeep Holla Sorry for the delay; this looks good to me: Acked-by: Mark Rutland Arnd, are you happy to pick this up for v6.8? Mark. > --- > drivers/firmware/psci/psci.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > Hi, > > For some reason, this has gone unnoticed for years. I bumped into this when > I was trying to test suspend on FVP which claims to support but returns error > when called. The error was getting not communicated properly(incorrect > error code) before this patch. > > Regards, > Sudeep > > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c > index d9629ff87861..2328ca58bba6 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -497,10 +497,12 @@ int psci_cpu_suspend_enter(u32 state) > > static int psci_system_suspend(unsigned long unused) > { > + int err; > phys_addr_t pa_cpu_resume = __pa_symbol(cpu_resume); > > - return invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND), > + err = invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND), > pa_cpu_resume, 0, 0); > + return psci_to_linux_errno(err); > } > > static int psci_system_suspend_enter(suspend_state_t state) > -- > 2.42.0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel