Re: [PATCH 20/46] cxl/mem: Add a debugfs version of 'iomem' for DPA, 'dpamem'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Cameron wrote:
> On Thu, 23 Jun 2022 19:47:33 -0700
> Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
> 
> > Dump the device-physial-address map for a CXL expander in /proc/iomem
> > style format. E.g.:
> > 
> >   cat /sys/kernel/debug/cxl/mem1/dpamem
> >   00000000-0fffffff : ram
> >   10000000-1fffffff : pmem
> 
> Nice in general, but...
> 
> When I just checked what this looked like on my test setup. I'm 
> seeing
> 00000000-0ffffff : pmem
>   00000000-0fffff : endpoint3
> 
> Seems odd to see an endpoint nested below a pmem.  Wrong name somewhere
> in a later patch. I'd expect that to be a decoder rather than the endpoint...
> If I spot where that comes from whilst reviewing I'll call it out, but
> didn't want to forget to raise it.

Ah, yes, agree should be the decoder name not the port name for the
allocation.

The bug was actually back in the introduction of cxl_dpa_reserve().
Folded in the following to "[PATCH 14/46] cxl/hdm: Enumerate allocated
DPA":

diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index 1b902966db78..8a677f5f3942 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -180,7 +180,7 @@ static int __cxl_dpa_reserve(struct cxl_endpoint_decoder *cxled,
 
        if (skipped) {
                res = __request_region(&cxlds->dpa_res, base - skipped, skipped,
-                                      dev_name(dev), 0);
+                                      dev_name(&cxled->cxld.dev), 0);
                if (!res) {
                        dev_dbg(dev,
                                "decoder%d.%d: failed to reserve skipped space\n",
@@ -188,7 +188,8 @@ static int __cxl_dpa_reserve(struct cxl_endpoint_decoder *cxled,
                        return -EBUSY;
                }
        }
-       res = __request_region(&cxlds->dpa_res, base, len, dev_name(dev), 0);
+       res = __request_region(&cxlds->dpa_res, base, len,
+                              dev_name(&cxled->cxld.dev), 0);
        if (!res) {
                dev_dbg(dev, "decoder%d.%d: failed to reserve allocation\n",
                        port->id, cxled->cxld.id);



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux