From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EBA528AB03; Tue, 10 Jun 2025 09:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749548289; cv=none; b=PbL1udtNqnad21mcWINg2Zw/xOKuMhdjZrJtBToRAKWD+DGSggXY2oPP0bbs2r2lp/sNYJSVEFBJv5iltPb+vLIISRvc2ggu4sock+dliw1cYcP3pYR+TsDxDgBVrrRuO0gzWl+zyXrzZWXLcrKnpX/h0QWOhSzUW/CsaxnmpJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749548289; c=relaxed/simple; bh=7VUpOKqstykfHqwFcxqAxihgk8EigUO4kuTzgEAooz4=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CCF+DgXF3MlSPlXCTCMxT/J5gkVvdv1zdhcTrF0qhZYv/JBNAqyH2lIch+49T4uFOeiMDiLdPVJ4TtIUahKE0+pgSP23WZsw7NygB50B6pg9mbZDUb4Hsq+R42aauSoi92IZBPTIgITOoVst3asEuTVRNn/4qABSZAIiOU6vxO8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4bGkBP30cjz67KX2; Tue, 10 Jun 2025 17:33:49 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 273A01402FE; Tue, 10 Jun 2025 17:38:04 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 10 Jun 2025 11:38:03 +0200 Date: Tue, 10 Jun 2025 10:38:01 +0100 From: Jonathan Cameron To: "Koralahalli Channabasappa, Smita" CC: , , , , , Davidlohr Bueso , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Matthew Wilcox , Jan Kara , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Li Ming , Jeff Johnson , Ying Huang , Yao Xingtao , Peter Zijlstra , Greg KH , "Nathan Fontenot" , Terry Bowman , Robert Richter , Benjamin Cheatham , PradeepVineshReddy Kodamati , Zhijian Li Subject: Re: [PATCH v4 2/7] cxl/core: Remove CONFIG_CXL_SUSPEND and always build suspend.o Message-ID: <20250610103801.0000121b@huawei.com> In-Reply-To: <8e445a49-7209-402f-96ab-5285560a08a1@amd.com> References: <20250603221949.53272-1-Smita.KoralahalliChannabasappa@amd.com> <20250603221949.53272-3-Smita.KoralahalliChannabasappa@amd.com> <20250609120237.00002eef@huawei.com> <8e445a49-7209-402f-96ab-5285560a08a1@amd.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To frapeml500008.china.huawei.com (7.182.85.71) On Mon, 9 Jun 2025 16:25:49 -0700 "Koralahalli Channabasappa, Smita" wrote: > On 6/9/2025 4:02 AM, Jonathan Cameron wrote: > > On Tue, 3 Jun 2025 22:19:44 +0000 > > Smita Koralahalli wrote: > > > >> In preparation for soft-reserved resource handling, make the suspend > >> infrastructure always available by removing the CONFIG_CXL_SUSPEND > >> Kconfig option. > >> > >> This ensures cxl_mem_active_inc()/dec() and cxl_mem_active() are > >> unconditionally available, enabling coordination between cxl_pci and > >> cxl_mem drivers during region setup and hotplug operations. > > > > If these are no longer just being used for suspend, given there > > is nothing else in the file, maybe move them to somewhere else? > > There was recommendation to move the wait queue declaration and its > related changes to acpi.c. I was considering that. Let me know if there > is any other best place for this. > I wasn't sure on the best location (which is why I was lazy an didn't suggest one ;) Dan, Dave etc anyone have strong mental model for where this should be? > Thanks > Smita > > > > > >> > >> Co-developed-by: Nathan Fontenot > >> Signed-off-by: Nathan Fontenot > >> Co-developed-by: Terry Bowman > >> Signed-off-by: Terry Bowman > >> Signed-off-by: Smita Koralahalli > >> --- > >> drivers/cxl/Kconfig | 4 ---- > >> drivers/cxl/core/Makefile | 2 +- > >> drivers/cxl/core/suspend.c | 5 ++++- > >> drivers/cxl/cxlmem.h | 9 --------- > >> include/linux/pm.h | 7 ------- > >> 5 files changed, 5 insertions(+), 22 deletions(-) > >> > >> diff --git a/drivers/cxl/Kconfig b/drivers/cxl/Kconfig > >> index cf1ba673b8c2..d09144c2002e 100644 > >> --- a/drivers/cxl/Kconfig > >> +++ b/drivers/cxl/Kconfig > >> @@ -118,10 +118,6 @@ config CXL_PORT > >> default CXL_BUS > >> tristate > >> > >> -config CXL_SUSPEND > >> - def_bool y > >> - depends on SUSPEND && CXL_MEM > >> - > >> config CXL_REGION > >> bool "CXL: Region Support" > >> default CXL_BUS > >> diff --git a/drivers/cxl/core/Makefile b/drivers/cxl/core/Makefile > >> index 086df97a0fcf..035864db8a32 100644 > >> --- a/drivers/cxl/core/Makefile > >> +++ b/drivers/cxl/core/Makefile > >> @@ -1,6 +1,6 @@ > >> # SPDX-License-Identifier: GPL-2.0 > >> obj-$(CONFIG_CXL_BUS) += cxl_core.o > >> -obj-$(CONFIG_CXL_SUSPEND) += suspend.o > >> +obj-y += suspend.o > >> > >> ccflags-y += -I$(srctree)/drivers/cxl > >> CFLAGS_trace.o = -DTRACE_INCLUDE_PATH=. -I$(src) > >> diff --git a/drivers/cxl/core/suspend.c b/drivers/cxl/core/suspend.c > >> index 29aa5cc5e565..5ba4b4de0e33 100644 > >> --- a/drivers/cxl/core/suspend.c > >> +++ b/drivers/cxl/core/suspend.c > >> @@ -8,7 +8,10 @@ static atomic_t mem_active; > >> > >> bool cxl_mem_active(void) > >> { > >> - return atomic_read(&mem_active) != 0; > >> + if (IS_ENABLED(CONFIG_CXL_MEM)) > >> + return atomic_read(&mem_active) != 0; > >> + > >> + return false; > >> } > >> > >> void cxl_mem_active_inc(void) > >> diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h > >> index 3ec6b906371b..1bd1e88c4cc0 100644 > >> --- a/drivers/cxl/cxlmem.h > >> +++ b/drivers/cxl/cxlmem.h > >> @@ -853,17 +853,8 @@ int cxl_trigger_poison_list(struct cxl_memdev *cxlmd); > >> int cxl_inject_poison(struct cxl_memdev *cxlmd, u64 dpa); > >> int cxl_clear_poison(struct cxl_memdev *cxlmd, u64 dpa); > >> > >> -#ifdef CONFIG_CXL_SUSPEND > >> void cxl_mem_active_inc(void); > >> void cxl_mem_active_dec(void); > >> -#else > >> -static inline void cxl_mem_active_inc(void) > >> -{ > >> -} > >> -static inline void cxl_mem_active_dec(void) > >> -{ > >> -} > >> -#endif > >> > >> int cxl_mem_sanitize(struct cxl_memdev *cxlmd, u16 cmd); > >> > >> diff --git a/include/linux/pm.h b/include/linux/pm.h > >> index f0bd8fbae4f2..415928e0b6ca 100644 > >> --- a/include/linux/pm.h > >> +++ b/include/linux/pm.h > >> @@ -35,14 +35,7 @@ static inline void pm_vt_switch_unregister(struct device *dev) > >> } > >> #endif /* CONFIG_VT_CONSOLE_SLEEP */ > >> > >> -#ifdef CONFIG_CXL_SUSPEND > >> bool cxl_mem_active(void); > >> -#else > >> -static inline bool cxl_mem_active(void) > >> -{ > >> - return false; > >> -} > >> -#endif > >> > >> /* > >> * Device power management > > >