Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v2] dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region()
@ 2026-05-19 10:18 Tomasz Wolski
  2026-05-19 11:31 ` Jonathan Cameron
  2026-05-20  0:14 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Tomasz Wolski @ 2026-05-19 10:18 UTC (permalink / raw)
  To: smita.koralahallichannabasappa, alison.schofield, dan.j.williams
  Cc: icheng, linux-cxl, linux-fsdevel, linux-kernel, linux-pm, nvdimm,
	ardb, benjamin.cheatham, dave.jiang, jonathan.cameron,
	Tomasz Wolski

The dax_region resource conflict in alloc_dax_region() indicates a
serious configuration problem — two subsystems (e.g. dax_hmem and
dax_cxl) are attempting to register overlapping address ranges. This is
not a transient or debug-level condition; it represents a genuine
resource conflict that an administrator needs to be aware of.

Switch from request_resource() + dev_dbg() to
request_resource_conflict() + dev_err() so that the conflict is visible
by default and the colliding resource is identified in the message.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/linux-cxl/69c1a8d1c0fa9_7ee3100a1@dwillia2-mobl4.notmuch/
Signed-off-by: Tomasz Wolski <tomasz.wolski@fujitsu.com>
---
 drivers/dax/bus.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 68437c05e21d..66413c6c2ba0 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -637,7 +637,7 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
 		unsigned long flags)
 {
 	struct dax_region *dax_region;
-	int rc;
+	struct resource *conflict;
 
 	/*
 	 * The DAX core assumes that it can store its private data in
@@ -670,10 +670,11 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
 		.flags = IORESOURCE_MEM | flags,
 	};
 
-	rc = request_resource(&dax_regions, &dax_region->res);
-	if (rc) {
-		dev_dbg(parent, "dax_region resource conflict for %pR\n",
-			&dax_region->res);
+	conflict = request_resource_conflict(&dax_regions, &dax_region->res);
+	if (conflict) {
+		dev_err(parent,
+			"dax_region: can't claim %pR: address conflict with %s %pR\n",
+			&dax_region->res, conflict->name, conflict);
 		goto err_res;
 	}
 
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region()
  2026-05-19 10:18 [PATCH v2] dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region() Tomasz Wolski
@ 2026-05-19 11:31 ` Jonathan Cameron
  2026-05-19 23:27   ` Richard Cheng
  2026-05-20  0:14 ` kernel test robot
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2026-05-19 11:31 UTC (permalink / raw)
  To: Tomasz Wolski
  Cc: smita.koralahallichannabasappa, alison.schofield, dan.j.williams,
	icheng, linux-cxl, linux-fsdevel, linux-kernel, linux-pm, nvdimm,
	ardb, benjamin.cheatham, dave.jiang, jonathan.cameron

On Tue, 19 May 2026 12:18:32 +0200
Tomasz Wolski <tomasz.wolski@fujitsu.com> wrote:

> The dax_region resource conflict in alloc_dax_region() indicates a
> serious configuration problem — two subsystems (e.g. dax_hmem and
> dax_cxl) are attempting to register overlapping address ranges. This is
> not a transient or debug-level condition; it represents a genuine
> resource conflict that an administrator needs to be aware of.
> 
> Switch from request_resource() + dev_dbg() to
> request_resource_conflict() + dev_err() so that the conflict is visible
> by default and the colliding resource is identified in the message.
> 
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Link: https://lore.kernel.org/linux-cxl/69c1a8d1c0fa9_7ee3100a1@dwillia2-mobl4.notmuch/
> Signed-off-by: Tomasz Wolski <tomasz.wolski@fujitsu.com>
Seems reasonable to me
Reviewed-by: Jonathan Cameron <jic23@kernel.org>
> ---
>  drivers/dax/bus.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
> index 68437c05e21d..66413c6c2ba0 100644
> --- a/drivers/dax/bus.c
> +++ b/drivers/dax/bus.c
> @@ -637,7 +637,7 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
>  		unsigned long flags)
>  {
>  	struct dax_region *dax_region;
> -	int rc;
> +	struct resource *conflict;
>  
>  	/*
>  	 * The DAX core assumes that it can store its private data in
> @@ -670,10 +670,11 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
>  		.flags = IORESOURCE_MEM | flags,
>  	};
>  
> -	rc = request_resource(&dax_regions, &dax_region->res);
> -	if (rc) {
> -		dev_dbg(parent, "dax_region resource conflict for %pR\n",
> -			&dax_region->res);
> +	conflict = request_resource_conflict(&dax_regions, &dax_region->res);
> +	if (conflict) {
> +		dev_err(parent,
> +			"dax_region: can't claim %pR: address conflict with %s %pR\n",
> +			&dax_region->res, conflict->name, conflict);
>  		goto err_res;
>  	}
>  


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region()
  2026-05-19 11:31 ` Jonathan Cameron
@ 2026-05-19 23:27   ` Richard Cheng
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Cheng @ 2026-05-19 23:27 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Tomasz Wolski, smita.koralahallichannabasappa, alison.schofield,
	dan.j.williams, linux-cxl, linux-fsdevel, linux-kernel, linux-pm,
	nvdimm, ardb, benjamin.cheatham, dave.jiang, jonathan.cameron

On Tue, May 19, 2026 at 12:31:12PM +0800, Jonathan Cameron wrote:
> On Tue, 19 May 2026 12:18:32 +0200
> Tomasz Wolski <tomasz.wolski@fujitsu.com> wrote:
> 
> > The dax_region resource conflict in alloc_dax_region() indicates a
> > serious configuration problem — two subsystems (e.g. dax_hmem and
> > dax_cxl) are attempting to register overlapping address ranges. This is
> > not a transient or debug-level condition; it represents a genuine
> > resource conflict that an administrator needs to be aware of.
> > 
> > Switch from request_resource() + dev_dbg() to
> > request_resource_conflict() + dev_err() so that the conflict is visible
> > by default and the colliding resource is identified in the message.
> > 
> > Suggested-by: Dan Williams <dan.j.williams@intel.com>
> > Link: https://lore.kernel.org/linux-cxl/69c1a8d1c0fa9_7ee3100a1@dwillia2-mobl4.notmuch/
> > Signed-off-by: Tomasz Wolski <tomasz.wolski@fujitsu.com>
> Seems reasonable to me
> Reviewed-by: Jonathan Cameron <jic23@kernel.org>

Reviewed-by: Richard Cheng <icheng@nvidia.com>

Best regards,
Richard Cheng.

> > ---
> >  drivers/dax/bus.c | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
> > index 68437c05e21d..66413c6c2ba0 100644
> > --- a/drivers/dax/bus.c
> > +++ b/drivers/dax/bus.c
> > @@ -637,7 +637,7 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
> >  		unsigned long flags)
> >  {
> >  	struct dax_region *dax_region;
> > -	int rc;
> > +	struct resource *conflict;
> >  
> >  	/*
> >  	 * The DAX core assumes that it can store its private data in
> > @@ -670,10 +670,11 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
> >  		.flags = IORESOURCE_MEM | flags,
> >  	};
> >  
> > -	rc = request_resource(&dax_regions, &dax_region->res);
> > -	if (rc) {
> > -		dev_dbg(parent, "dax_region resource conflict for %pR\n",
> > -			&dax_region->res);
> > +	conflict = request_resource_conflict(&dax_regions, &dax_region->res);
> > +	if (conflict) {
> > +		dev_err(parent,
> > +			"dax_region: can't claim %pR: address conflict with %s %pR\n",
> > +			&dax_region->res, conflict->name, conflict);
> >  		goto err_res;
> >  	}
> >  
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region()
  2026-05-19 10:18 [PATCH v2] dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region() Tomasz Wolski
  2026-05-19 11:31 ` Jonathan Cameron
@ 2026-05-20  0:14 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-05-20  0:14 UTC (permalink / raw)
  To: Tomasz Wolski, smita.koralahallichannabasappa, alison.schofield
  Cc: oe-kbuild-all, icheng, linux-cxl, linux-fsdevel, linux-kernel,
	linux-pm, nvdimm, ardb, benjamin.cheatham, dave.jiang,
	jonathan.cameron, Tomasz Wolski

Hi Tomasz,

kernel test robot noticed the following build errors:

[auto build test ERROR on cxl/next]
[also build test ERROR on linus/master v7.1-rc4 next-20260519]
[cannot apply to cxl/pending]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Tomasz-Wolski/dax-bus-Upgrade-resource-conflict-message-to-dev_err-in-alloc_dax_region/20260519-182401
base:   https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git next
patch link:    https://lore.kernel.org/r/20260519101832.31988-1-tomasz.wolski%40fujitsu.com
patch subject: [PATCH v2] dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region()
config: s390-randconfig-r072-20260520 (https://download.01.org/0day-ci/archive/20260520/202605200842.i0s39151-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 9.5.0
smatch: v0.5.0-9185-gbcc58b9c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260520/202605200842.i0s39151-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605200842.i0s39151-lkp@intel.com/

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> ERROR: modpost: "request_resource_conflict" [drivers/dax/dax.ko] undefined!

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-20  0:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 10:18 [PATCH v2] dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region() Tomasz Wolski
2026-05-19 11:31 ` Jonathan Cameron
2026-05-19 23:27   ` Richard Cheng
2026-05-20  0:14 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox