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 C1CBFC48BC3 for ; Tue, 20 Feb 2024 05:49:12 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ahU0udbtyIjnU/rUDM9JD5mjz9IggbkUCuhoezQ5p9M=; b=YLI2/41jbzXWPJ 2M390I92FVJa0Gcv3PYtB8jKQIkp4y/WDU9PZVjF7GZ1lAfZ5s7UUtDhwoNxudNEYre45FTpVsrBF LSAyWLq6vAbngyWhh0CKvgeA97e9p2z19hI0bDxvA4FdibhU7fGQO37qgKdHaqDiSjb5tF3LhU8jg VbIGCo8gxhpJZ7Xp0NDxVUmsY+PREInQ1+8wqHkOnmhkBybYQP5WXt2+2AAjzD1nTTu2XkOS9Bn0p UyDCpxxDxLY11zTVezkCI2SGi3AHXjuI/vrk5Ablt8loMhUOSDqJ/bZWTF1sO+V3MolaGCsGUr+XX vgVHxI487GEqXlQgeuLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcJ01-0000000DFnz-3Uug; Tue, 20 Feb 2024 05:49:01 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcIzz-0000000DFnY-0zxO for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2024 05:49:01 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41K4SYH6030421; Tue, 20 Feb 2024 05:48:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=6iLzWXnZbSKEXQ4L81Zd+B5q/JwdxAsNq6BxDPHyTPE=; b=ad uYe9JKVV9w9rzk9nBstl6ZyWGxO656xnVgWHx/rTqlPztEhQYfqqoxb9PmqZJKCF OK6P0+wPFSaAeh+gDLfGGncNUSlHCFzYfq1wvwO2Ybw9pVkGj9YvJMY4v0wbfFW9 OO0kXeDso73M5IUTRSQxMtwQYE8uPvtyOGhioCZX8qkXQQrW9beblyQCK4ebbRrR G99kGiMb5HWRnJztEIfLW1++ZFtotBho+3jXnGviGdxop67uRlal7NDajxjEEFqZ N/rLdzoKATmsRlg2UGvimIEcjRLuPyv1xfwj0ykKndjyhgcnjXaQ1HjAaId2b+E8 rPIkGh1+qw/AkJS7gdNA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wckv9g80w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Feb 2024 05:48:46 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41K5mjqF013268 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Feb 2024 05:48:45 GMT Received: from [10.217.198.224] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 19 Feb 2024 21:48:42 -0800 Message-ID: Date: Tue, 20 Feb 2024 11:18:39 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] firmware/psci: Move psci_init_system_suspend() to late_initcall() To: Lorenzo Pieralisi CC: Mark Rutland , , , , , , , , References: <20240219-suspend_ops_late_init-v1-1-6330ca9597fa@quicinc.com> Content-Language: en-US From: "Maulik Shah (mkshah)" In-Reply-To: X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: l7mW_oF9zN_5fAmK4DoZu7ghd3zl5fUE X-Proofpoint-GUID: l7mW_oF9zN_5fAmK4DoZu7ghd3zl5fUE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_04,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 adultscore=0 mlxlogscore=999 impostorscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402200040 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240219_214859_737645_7277BFB3 X-CRM114-Status: GOOD ( 16.60 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/19/2024 10:59 PM, Lorenzo Pieralisi wrote: > On Mon, Feb 19, 2024 at 03:02:04PM +0530, Maulik Shah wrote: >> psci_init_system_suspend() invokes suspend_set_ops() very early during >> bootup even before kernel command line for mem_sleep_default is setup. >> This leads to kernel command line mem_sleep_default=s2idle not working >> as mem_sleep_current gets changed to deep via suspend_set_ops() and never >> changes back to s2idle. >> >> Move psci_init_system_suspend() to late_initcall() to make sure kernel >> command line mem_sleep_default=s2idle sets up s2idle as default suspend >> mode. > > Why can't we fix it the other way around, namely enforce > mem_sleep_current according to the mem_sleep_default command line > even if suspend_set_ops() was already called ? yes, this may be fixed other way also and i did not implement other way since mem_sleep_default_setup() only update mem_sleep_default and to avoid this race, it needs to also need to update mem_sleep_current along with it. Below change also resolves the issue. --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -192,6 +192,7 @@ static int __init mem_sleep_default_setup(char *str) if (mem_sleep_labels[state] && !strcmp(str, mem_sleep_labels[state])) { mem_sleep_default = state; + mem_sleep_current = state; break; } however it may be erasing thin line between mem_sleep_default v/s mem_sleep_current as both gets updated while set up of mem_sleep_default. if this change looks Ok, i can send v2 with it. > > Just asking, I am not super keen on using initcalls ordering, it > looks fragile to me. i agree with above. Thanks, Maulik _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel