mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Koralahalli Channabasappa, Smita" <Smita.KoralahalliChannabasappa@amd.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org,
	nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org,
	linux-pm@vger.kernel.org, Davidlohr Bueso <dave@stgolabs.net>,
	Dave Jiang <dave.jiang@intel.com>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@kernel.org>,
	Li Ming <ming.li@zohomail.com>,
	Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
	Ying Huang <huang.ying.caritas@gmail.com>,
	Yao Xingtao <yaoxt.fnst@fujitsu.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Nathan Fontenot <nathan.fontenot@amd.com>,
	Terry Bowman <terry.bowman@amd.com>,
	Robert Richter <rrichter@amd.com>,
	Benjamin Cheatham <benjamin.cheatham@amd.com>,
	PradeepVineshReddy Kodamati <PradeepVineshReddy.Kodamati@amd.com>,
	Zhijian Li <lizhijian@fujitsu.com>
Subject: Re: [PATCH v4 2/7] cxl/core: Remove CONFIG_CXL_SUSPEND and always build suspend.o
Date: Mon, 9 Jun 2025 16:25:49 -0700	[thread overview]
Message-ID: <8e445a49-7209-402f-96ab-5285560a08a1@amd.com> (raw)
In-Reply-To: <20250609120237.00002eef@huawei.com>


On 6/9/2025 4:02 AM, Jonathan Cameron wrote:
> On Tue, 3 Jun 2025 22:19:44 +0000
> Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com> 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.

Thanks
Smita
> 
> 
>>
>> Co-developed-by: Nathan Fontenot <Nathan.Fontenot@amd.com>
>> Signed-off-by: Nathan Fontenot <Nathan.Fontenot@amd.com>
>> Co-developed-by: Terry Bowman <terry.bowman@amd.com>
>> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
>> Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
>> ---
>>   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
> 


  reply	other threads:[~2025-06-09 23:25 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 22:19 [PATCH v4 0/7] Add managed SOFT RESERVE resource handling Smita Koralahalli
2025-06-03 22:19 ` [PATCH v4 1/7] cxl/region: Avoid null pointer dereference in is_cxl_region() Smita Koralahalli
2025-06-03 23:49   ` Dave Jiang
2025-06-04 19:56     ` Nathan Fontenot
2025-06-25 15:23       ` Robert Richter
2025-06-03 22:19 ` [PATCH v4 2/7] cxl/core: Remove CONFIG_CXL_SUSPEND and always build suspend.o Smita Koralahalli
2025-06-09 11:02   ` Jonathan Cameron
2025-06-09 23:25     ` Koralahalli Channabasappa, Smita [this message]
2025-06-10  9:38       ` Jonathan Cameron
2025-06-03 22:19 ` [PATCH v4 3/7] cxl/pci: Add pci_loaded tracking to mark PCI driver readiness Smita Koralahalli
2025-06-04  9:29   ` Zhijian Li (Fujitsu)
2025-06-03 22:19 ` [PATCH v4 4/7] cxl/acpi: Add background worker to wait for cxl_pci and cxl_mem probe Smita Koralahalli
2025-06-03 23:45   ` Dave Jiang
2025-06-04 18:31     ` Koralahalli Channabasappa, Smita
2025-06-04  9:40   ` Zhijian Li (Fujitsu)
2025-06-04 14:35     ` Dave Jiang
2025-06-05  2:18       ` Zhijian Li (Fujitsu)
2025-06-03 22:19 ` [PATCH v4 5/7] cxl/region: Introduce SOFT RESERVED resource removal on region teardown Smita Koralahalli
2025-06-06  4:16   ` Zhijian Li (Fujitsu)
2025-06-06 17:53     ` Koralahalli Channabasappa, Smita
2025-06-09 12:54   ` Jonathan Cameron
2025-06-10  1:25     ` Koralahalli Channabasappa, Smita
2025-06-10  9:37       ` Jonathan Cameron
2025-06-25 15:20       ` Robert Richter
2025-07-09  1:14   ` Alison Schofield
2025-06-03 22:19 ` [PATCH v4 6/7] dax/hmem: Save the DAX HMEM platform device pointer Smita Koralahalli
2025-06-05 16:54   ` Dave Jiang
2025-06-06  8:11     ` Zhijian Li (Fujitsu)
2025-06-06 20:09       ` Nathan Fontenot
2025-06-03 22:19 ` [PATCH v4 7/7] cxl/dax: Defer DAX consumption of SOFT RESERVED resources until after CXL region creation Smita Koralahalli
2025-06-09 13:01   ` Jonathan Cameron
2025-06-13  2:12   ` Zhijian Li (Fujitsu)
2025-07-10  4:22     ` Koralahalli Channabasappa, Smita
2025-07-10  8:18       ` Zhijian Li (Fujitsu)
2025-07-15 16:27   ` Alison Schofield
2025-07-15 18:19     ` Koralahalli Channabasappa, Smita
2025-07-15 18:45       ` Alison Schofield
2025-06-04  8:43 ` [PATCH v4 0/7] Add managed SOFT RESERVE resource handling Zhijian Li (Fujitsu)
2025-06-04 18:59   ` Koralahalli Channabasappa, Smita
2025-06-16  1:00     ` Zhijian Li (Fujitsu)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e445a49-7209-402f-96ab-5285560a08a1@amd.com \
    --to=smita.koralahallichannabasappa@amd.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=PradeepVineshReddy.Kodamati@amd.com \
    --cc=alison.schofield@intel.com \
    --cc=benjamin.cheatham@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=huang.ying.caritas@gmail.com \
    --cc=ira.weiny@intel.com \
    --cc=jack@suse.cz \
    --cc=jeff.johnson@oss.qualcomm.com \
    --cc=len.brown@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lizhijian@fujitsu.com \
    --cc=ming.li@zohomail.com \
    --cc=nathan.fontenot@amd.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=pavel@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=rrichter@amd.com \
    --cc=terry.bowman@amd.com \
    --cc=vishal.l.verma@intel.com \
    --cc=willy@infradead.org \
    --cc=yaoxt.fnst@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®