diff mbox series

[RFC,04/13] cxl: allow devices without mailbox capability

Message ID 20240516081202.27023-5-alucerop@amd.com
State New, archived
Headers show
Series RFC: add Type2 device support | expand

Commit Message

Alejandro Lucero Palau May 16, 2024, 8:11 a.m. UTC
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>
---
 drivers/cxl/core/regs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Jonathan Cameron May 17, 2024, 2:33 p.m. UTC | #1
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;
>  		}
Alejandro Lucero Palau May 20, 2024, 3:49 p.m. UTC | #2
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 mbox series

Patch

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;
 		}