Skip to contentSkip to conversation

cxl/core/region_dax.c: fix missing assignment in cxl_dax_region_alloc()

PATCH In review Anisa Su 3 participants 7 messages Apr 11 – Apr 18 CXL

lore
Share & tools
lore

Anisa Su

author
#0 lore raw

PATCH 1/1 cxl/core/region_dax.c: fix missing assignment in cxl_dax_region_alloc()

cxlr->cxlr_dax assignment was dropped during refactor.

Fixes d747cf98f091 cxl/core/region: move dax region device logic into

region_dax.c

---
 drivers/cxl/core/region_dax.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/core/region_dax.c +1 -0
index de04f78f6ad8..068690d02c8c 100644
@@ -62,6 +62,7 @@ static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr)
 
 	dev = &cxlr_dax->dev;
 	cxlr_dax->cxlr = cxlr;
+	cxlr->cxlr_dax = cxlr_dax;
 	device_initialize(dev);
 	lockdep_set_class(&dev->mutex, &cxl_dax_region_key);
 	device_set_pm_not_required(dev);
Signature · 1 line
2.43.0
#1 lore raw
Quoted 4 lines · Anisa Su

cxlr->cxlr_dax assignment was dropped during refactor.

Fixes d747cf98f091 cxl/core/region: move dax region device logic into

region_dax.c

I don't believe this is a valid fixes tag.

Looking only at commit d747cf98f091, this line does not appear in the original function...

-static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr) -{

-       struct cxl_region_params *p = &cxlr->params;
-       struct cxl_dax_region *cxlr_dax;
-       struct device *dev;

-
- guard(rwsem_read)(&cxl_rwsem.region);
- if (p->state != CXL_CONFIG_COMMIT)
- return ERR_PTR(-ENXIO);
-
- cxlr_dax = kzalloc_obj(*cxlr_dax);
- if (!cxlr_dax)
- return ERR_PTR(-ENOMEM);
-
- cxlr_dax->hpa_range.start = p->res->start;
- cxlr_dax->hpa_range.end = p->res->end;
-

-       dev = &cxlr_dax->dev;
-       cxlr_dax->cxlr = cxlr;
-       device_initialize(dev);
-       lockdep_set_class(&dev->mutex, &cxl_dax_region_key);
-       device_set_pm_not_required(dev);
-       dev->parent = &cxlr->dev;
-       dev->bus = &cxl_bus_type;
-       dev->type = &cxl_dax_region_type;

-
- return cxlr_dax;
-}

Furthermore, I don't see where this line ever appeared in cxl_dax_region_alloc() prior to commit d747cf98f091.

So what is the purpose of this change?

Ira

Quoted 20 lines
---
 drivers/cxl/core/region_dax.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/core/region_dax.c +1 -0
index de04f78f6ad8..068690d02c8c 100644
@@ -62,6 +62,7 @@ static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr)
 
 	dev = &cxlr_dax->dev;
 	cxlr_dax->cxlr = cxlr;
+	cxlr->cxlr_dax = cxlr_dax;
 	device_initialize(dev);
 	lockdep_set_class(&dev->mutex, &cxl_dax_region_key);
 	device_set_pm_not_required(dev);
Signature · 1 line
2.43.0
author
#2 lore raw
Quoted 11 lines · Ira Weiny
Quoted 5 lines

Anisa Su wrote:
cxlr->cxlr_dax assignment was dropped during refactor.

Fixes d747cf98f091 cxl/core/region: move dax region device logic into

region_dax.c

I don't believe this is a valid fixes tag.

Looking only at commit d747cf98f091, this line does not appear in the original function...

yeah it's not, sorry :((( the assignment was added in the dcd patches and I dropped it while resolving the conflicts during the rebase cuz I was just in a rush to finish it

I realized the error and said "pls ignore it I was wrong" in the original thread here:
https://lore.kernel.org/linux-cxl/[email protected]/T/#u

but I definitely should have mentioned it here too. anyway sorry, just pretend I never said anything

- Anisa

Quoted 60 lines
(quoted diff) +0 -28
-static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr)
-{
-       struct cxl_region_params *p = &cxlr->params;
-       struct cxl_dax_region *cxlr_dax;
-       struct device *dev;
-
-       guard(rwsem_read)(&cxl_rwsem.region);
-       if (p->state != CXL_CONFIG_COMMIT)
-               return ERR_PTR(-ENXIO);
-
-       cxlr_dax = kzalloc_obj(*cxlr_dax);
-       if (!cxlr_dax)
-               return ERR_PTR(-ENOMEM);
-
-       cxlr_dax->hpa_range.start = p->res->start;
-       cxlr_dax->hpa_range.end = p->res->end;
-
-       dev = &cxlr_dax->dev;
-       cxlr_dax->cxlr = cxlr;
-       device_initialize(dev);
-       lockdep_set_class(&dev->mutex, &cxl_dax_region_key);
-       device_set_pm_not_required(dev);
-       dev->parent = &cxlr->dev;
-       dev->bus = &cxl_bus_type;
-       dev->type = &cxl_dax_region_type;
-
-       return cxlr_dax;
-}

Furthermore, I don't see where this line ever appeared in cxl_dax_region_alloc() prior to commit d747cf98f091.

So what is the purpose of this change?

Ira

Quoted 20 lines
---
 drivers/cxl/core/region_dax.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/core/region_dax.c +1 -0
index de04f78f6ad8..068690d02c8c 100644
@@ -62,6 +62,7 @@ static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr)
 
 	dev = &cxlr_dax->dev;
 	cxlr_dax->cxlr = cxlr;
+	cxlr->cxlr_dax = cxlr_dax;
 	device_initialize(dev);
 	lockdep_set_class(&dev->mutex, &cxl_dax_region_key);
 	device_set_pm_not_required(dev);
Signature · 1 line
2.43.0
#3 lore raw
Quoted 16 lines · Anisa Su
Quoted 11 lines · Ira Weiny
Quoted 5 lines

Anisa Su wrote:
cxlr->cxlr_dax assignment was dropped during refactor.

Fixes d747cf98f091 cxl/core/region: move dax region device logic into

region_dax.c

I don't believe this is a valid fixes tag.

Looking only at commit d747cf98f091, this line does not appear in the original function...

yeah it's not, sorry :((( the assignment was added in the dcd patches and I dropped it while resolving the conflicts during the rebase cuz I was just in a rush to finish it

Quoted 5 lines

I realized the error and said "pls ignore it I was wrong" in the original thread here:
https://lore.kernel.org/linux-cxl/[email protected]/T/#u

but I definitely should have mentioned it here too. anyway sorry, just pretend I never said anything

Got it, no problem.

Thanks,
Ira

#4 lore raw
In reply to Anisa Su
Quoted 16 lines · Anisa Su
Quoted 11 lines · Ira Weiny
Quoted 5 lines

Anisa Su wrote:
cxlr->cxlr_dax assignment was dropped during refactor.

Fixes d747cf98f091 cxl/core/region: move dax region device logic into

region_dax.c

I don't believe this is a valid fixes tag.

Looking only at commit d747cf98f091, this line does not appear in the original function...

yeah it's not, sorry :((( the assignment was added in the dcd patches and I dropped it while resolving the conflicts during the rebase cuz I was just in a rush to finish it

Quoted 5 lines

I realized the error and said "pls ignore it I was wrong" in the original thread here:
https://lore.kernel.org/linux-cxl/[email protected]/T/#u

but I definitely should have mentioned it here too. anyway sorry, just pretend I never said anything

Got it, no problem.

Thanks,
Ira

#5 lore raw
In reply to Anisa Su
kernel test robot noticed the following build errors:

Hi Anisa,

kernel test robot noticed the following build errors:

[auto build test ERROR on cxl/next]
[also build test ERROR on next-20260416]
[cannot apply to linus/master cxl/pending v7.0]
[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/Anisa-Su/cxl-core-region_dax-c-fix-missing-assignment-in-cxl_dax_region_alloc/20260417-104320
base:   https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git next
patch link:    https://lore.kernel.org/r/20260411011137.43545-1-anisa.su%40samsung.com
patch subject: [PATCH] cxl/core/region_dax.c: fix missing assignment in cxl_dax_region_alloc()
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20260418/[email protected]/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260418/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/cxl/core/region_dax.c:65:8: error: no member named 'cxlr_dax' in 'struct cxl_region'
      65 |         cxlr->cxlr_dax = cxlr_dax;
         |         ~~~~  ^

1 error generated.

vim +65 drivers/cxl/core/region_dax.c

    45	
    46	static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr)
    47	{
    48		struct cxl_region_params *p = &cxlr->params;
    49		struct cxl_dax_region *cxlr_dax;
    50		struct device *dev;
    51	
    52		guard(rwsem_read)(&cxl_rwsem.region);
    53		if (p->state != CXL_CONFIG_COMMIT)
    54			return ERR_PTR(-ENXIO);
    55	
    56		cxlr_dax = kzalloc_obj(*cxlr_dax);
    57		if (!cxlr_dax)
    58			return ERR_PTR(-ENOMEM);
    59	
    60		cxlr_dax->hpa_range.start = p->res->start;
    61		cxlr_dax->hpa_range.end = p->res->end;
    62	
    63		dev = &cxlr_dax->dev;
    64		cxlr_dax->cxlr = cxlr;
  > 65		cxlr->cxlr_dax = cxlr_dax;
    66		device_initialize(dev);
    67		lockdep_set_class(&dev->mutex, &cxl_dax_region_key);
    68		device_set_pm_not_required(dev);
    69		dev->parent = &cxlr->dev;
    70		dev->bus = &cxl_bus_type;
    71		dev->type = &cxl_dax_region_type;
    72	
    73		return cxlr_dax;
    74	}
    75	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#6 lore raw
In reply to Anisa Su
kernel test robot noticed the following build errors:

Hi Anisa,

kernel test robot noticed the following build errors:

[auto build test ERROR on cxl/next]
[also build test ERROR on linus/master next-20260417] [cannot apply to cxl/pending v7.0]
[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/Anisa-Su/cxl-core-region_dax-c-fix-missing-assignment-in-cxl_dax_region_alloc/20260417-104320
base:   https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git next
patch link:    https://lore.kernel.org/r/20260411011137.43545-1-anisa.su%40samsung.com
patch subject: [PATCH] cxl/core/region_dax.c: fix missing assignment in cxl_dax_region_alloc()
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20260418/[email protected]/config)
compiler: s390-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260418/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/cxl/core/region_dax.c: In function 'cxl_dax_region_alloc':

>> drivers/cxl/core/region_dax.c:65:15: error: 'struct cxl_region' has no member named 'cxlr_dax'; did you mean 'cxlrd'?
      65 |         cxlr->cxlr_dax = cxlr_dax;
         |               ^~~~~~~~
         |               cxlrd

vim +65 drivers/cxl/core/region_dax.c

    45	
    46	static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr)
    47	{
    48		struct cxl_region_params *p = &cxlr->params;
    49		struct cxl_dax_region *cxlr_dax;
    50		struct device *dev;
    51	
    52		guard(rwsem_read)(&cxl_rwsem.region);
    53		if (p->state != CXL_CONFIG_COMMIT)
    54			return ERR_PTR(-ENXIO);
    55	
    56		cxlr_dax = kzalloc_obj(*cxlr_dax);
    57		if (!cxlr_dax)
    58			return ERR_PTR(-ENOMEM);
    59	
    60		cxlr_dax->hpa_range.start = p->res->start;
    61		cxlr_dax->hpa_range.end = p->res->end;
    62	
    63		dev = &cxlr_dax->dev;
    64		cxlr_dax->cxlr = cxlr;
  > 65		cxlr->cxlr_dax = cxlr_dax;
    66		device_initialize(dev);
    67		lockdep_set_class(&dev->mutex, &cxl_dax_region_key);
    68		device_set_pm_not_required(dev);
    69		dev->parent = &cxlr->dev;
    70		dev->bus = &cxl_bus_type;
    71		dev->type = &cxl_dax_region_type;
    72	
    73		return cxlr_dax;
    74	}
    75	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki