Message ID | 20240516081202.27023-5-alucerop@amd.com |
---|---|
State | New, archived |
Headers | show |
Series | RFC: add Type2 device support | expand |
On Thu, 16 May 2024 09:11:53 +0100 <alucerop@amd.com> wrote: > From: Alejandro Lucero <alucerop@amd.com> > > A device not implementing the CXL memory-device class code, aka Type2 > devices, has mailbox capability as optional. If the device registers > mapping does not show such capability, do not treat that as an error. > > Signed-off-by: Alejandro Lucero <alucerop@amd.com> If you are removing this check from the shared code, it needs to be in the more specific code, or you need to state why that isn't a problem (i.e. it is caught later anyway) Jonathan > --- > drivers/cxl/core/regs.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c > index fd165e718cf2..5434a7c899fd 100644 > --- a/drivers/cxl/core/regs.c > +++ b/drivers/cxl/core/regs.c > @@ -437,11 +437,10 @@ static int cxl_probe_regs(struct cxl_register_map *map) > case CXL_REGLOC_RBI_MEMDEV: > dev_map = &map->device_map; > cxl_probe_device_regs(host, base, dev_map); > - if (!dev_map->status.valid || !dev_map->mbox.valid || > + if (!dev_map->status.valid || > !dev_map->memdev.valid) { > - dev_err(host, "registers not found: %s%s%s\n", > + dev_err(host, "registers not found: %s%s\n", > !dev_map->status.valid ? "status " : "", > - !dev_map->mbox.valid ? "mbox " : "", > !dev_map->memdev.valid ? "memdev " : ""); > return -ENXIO; > }
On 5/17/24 15:33, Jonathan Cameron wrote: > On Thu, 16 May 2024 09:11:53 +0100 > <alucerop@amd.com> wrote: > >> From: Alejandro Lucero <alucerop@amd.com> >> >> A device not implementing the CXL memory-device class code, aka Type2 >> devices, has mailbox capability as optional. If the device registers >> mapping does not show such capability, do not treat that as an error. >> >> Signed-off-by: Alejandro Lucero <alucerop@amd.com> > If you are removing this check from the shared code, it needs to be > in the more specific code, or you need to state why that isn't > a problem (i.e. it is caught later anyway) Yes, I realize this is solving the Type2 problem but impacting on current behavior for Type3. I'll change it for doing it without such impact. Thanks. > > Jonathan > >> --- >> drivers/cxl/core/regs.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c >> index fd165e718cf2..5434a7c899fd 100644 >> --- a/drivers/cxl/core/regs.c >> +++ b/drivers/cxl/core/regs.c >> @@ -437,11 +437,10 @@ static int cxl_probe_regs(struct cxl_register_map *map) >> case CXL_REGLOC_RBI_MEMDEV: >> dev_map = &map->device_map; >> cxl_probe_device_regs(host, base, dev_map); >> - if (!dev_map->status.valid || !dev_map->mbox.valid || >> + if (!dev_map->status.valid || >> !dev_map->memdev.valid) { >> - dev_err(host, "registers not found: %s%s%s\n", >> + dev_err(host, "registers not found: %s%s\n", >> !dev_map->status.valid ? "status " : "", >> - !dev_map->mbox.valid ? "mbox " : "", >> !dev_map->memdev.valid ? "memdev " : ""); >> return -ENXIO; >> }
diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c index fd165e718cf2..5434a7c899fd 100644 --- a/drivers/cxl/core/regs.c +++ b/drivers/cxl/core/regs.c @@ -437,11 +437,10 @@ static int cxl_probe_regs(struct cxl_register_map *map) case CXL_REGLOC_RBI_MEMDEV: dev_map = &map->device_map; cxl_probe_device_regs(host, base, dev_map); - if (!dev_map->status.valid || !dev_map->mbox.valid || + if (!dev_map->status.valid || !dev_map->memdev.valid) { - dev_err(host, "registers not found: %s%s%s\n", + dev_err(host, "registers not found: %s%s\n", !dev_map->status.valid ? "status " : "", - !dev_map->mbox.valid ? "mbox " : "", !dev_map->memdev.valid ? "memdev " : ""); return -ENXIO; }