linux-i3c.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i3c: don't fail if GETHDRCAP is unsupported
@ 2025-06-25  7:34 Wolfram Sang
  2025-06-25 15:24 ` Frank Li
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2025-06-25  7:34 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang, Alexandre Belloni, Frank Li, linux-i3c

If a target has the HDR_CAP bit set in BCR, the core wants to get
additional information using the CCC 'GETHDRCAP'. Not all controllers
support this CCC, though. This is not fatal. We can just skip it. The
information is not needed if the controller won't support HDR anyhow.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Found during the I3C plugfest in Warsaw.

 drivers/i3c/master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 204b96e6be1e..b6b96cf9e4e0 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1440,7 +1440,7 @@ static int i3c_master_retrieve_dev_info(struct i3c_dev_desc *dev)
 
 	if (dev->info.bcr & I3C_BCR_HDR_CAP) {
 		ret = i3c_master_gethdrcap_locked(master, &dev->info);
-		if (ret)
+		if (ret && ret != -ENOTSUPP)
 			return ret;
 	}
 
-- 
2.47.2


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c: don't fail if GETHDRCAP is unsupported
  2025-06-25  7:34 [PATCH] i3c: don't fail if GETHDRCAP is unsupported Wolfram Sang
@ 2025-06-25 15:24 ` Frank Li
  2025-06-25 16:41   ` Wolfram Sang
  2025-06-26  2:46   ` Joshua Yeong
  0 siblings, 2 replies; 5+ messages in thread
From: Frank Li @ 2025-06-25 15:24 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-renesas-soc, Alexandre Belloni, linux-i3c

On Wed, Jun 25, 2025 at 09:34:52AM +0200, Wolfram Sang wrote:
> If a target has the HDR_CAP bit set in BCR, the core wants to get
> additional information using the CCC 'GETHDRCAP'. Not all controllers
> support this CCC, though.

Do you know which target device support HDR? I3C master API don't HDR yet.

>This is not fatal. We can just skip it. The
> information is not needed if the controller won't support HDR anyhow.

This is not fatal and can be safely skipped, as the information is not
necessary if HDR is unsupported by the controller anyway.

Frank
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Found during the I3C plugfest in Warsaw.
>
>  drivers/i3c/master.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 204b96e6be1e..b6b96cf9e4e0 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -1440,7 +1440,7 @@ static int i3c_master_retrieve_dev_info(struct i3c_dev_desc *dev)
>
>  	if (dev->info.bcr & I3C_BCR_HDR_CAP) {
>  		ret = i3c_master_gethdrcap_locked(master, &dev->info);
> -		if (ret)
> +		if (ret && ret != -ENOTSUPP)
>  			return ret;
>  	}
>
> --
> 2.47.2
>
>
> --
> linux-i3c mailing list
> linux-i3c@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-i3c

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c: don't fail if GETHDRCAP is unsupported
  2025-06-25 15:24 ` Frank Li
@ 2025-06-25 16:41   ` Wolfram Sang
  2025-06-26  2:46   ` Joshua Yeong
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2025-06-25 16:41 UTC (permalink / raw)
  To: Frank Li; +Cc: linux-renesas-soc, Alexandre Belloni, linux-i3c


> > If a target has the HDR_CAP bit set in BCR, the core wants to get
> > additional information using the CCC 'GETHDRCAP'. Not all controllers
> > support this CCC, though.
> 
> Do you know which target device support HDR? I3C master API don't HDR yet.

The problem is bigger but I didn't want to tackle all of it right now.
'I3C_BCR_HDR_CAP' is still spec v1.0 and has been renamed to 'advanced
capabilities' in v1.1 onwards. That means the CCC was also modified to
get the advanced caps (while it is backwards compatible if you only read
the first byte I have been told, didn't check). So, if you get the ST
pressure sensor LPS22DF, it will not have HDR, but it will have the
'advanced cap' bit set.

Because my controller neither supports old GETHDRCAP nor new GETCAPS
CCC, it will bail out and not instantiate the device. Which is wrong,
because we can deal with it good enough without the extended
capabilities.

Maybe I should update the commit message a bit?

> This is not fatal and can be safely skipped, as the information is not
> necessary if HDR is unsupported by the controller anyway.

It is fatal because the target device is not instantiated while it
could be. I tested it.


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c: don't fail if GETHDRCAP is unsupported
  2025-06-25 15:24 ` Frank Li
  2025-06-25 16:41   ` Wolfram Sang
@ 2025-06-26  2:46   ` Joshua Yeong
  2025-07-03  6:41     ` Wolfram Sang
  1 sibling, 1 reply; 5+ messages in thread
From: Joshua Yeong @ 2025-06-26  2:46 UTC (permalink / raw)
  To: Frank Li, Wolfram Sang
  Cc: linux-renesas-soc@vger.kernel.org, Alexandre Belloni,
	linux-i3c@lists.infradead.org

On 25-Jun-2025 11:24 PM, Frank Li wrote:
> On Wed, Jun 25, 2025 at 09:34:52AM +0200, Wolfram Sang wrote:
>> If a target has the HDR_CAP bit set in BCR, the core wants to get
>> additional information using the CCC 'GETHDRCAP'. Not all controllers
>> support this CCC, though.
> 
> Do you know which target device support HDR? I3C master API don't HDR yet.
> 
>> This is not fatal. We can just skip it. The
>> information is not needed if the controller won't support HDR anyhow.
> 
> This is not fatal and can be safely skipped, as the information is not
> necessary if HDR is unsupported by the controller anyway.
> 
> Frank

Hi Frank

I'm use `MMC5633` to test out the HDR-DDR functionality master functionality.
The patch can be accepted as some controller might not support HDR.


>>
>> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>> ---
>>
>> Found during the I3C plugfest in Warsaw.
>>
>>  drivers/i3c/master.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
>> index 204b96e6be1e..b6b96cf9e4e0 100644
>> --- a/drivers/i3c/master.c
>> +++ b/drivers/i3c/master.c
>> @@ -1440,7 +1440,7 @@ static int i3c_master_retrieve_dev_info(struct i3c_dev_desc *dev)
>>
>>  	if (dev->info.bcr & I3C_BCR_HDR_CAP) {
>>  		ret = i3c_master_gethdrcap_locked(master, &dev->info);
>> -		if (ret)
>> +		if (ret && ret != -ENOTSUPP)
>>  			return ret;
>>  	}
>>
>> --
>> 2.47.2
>>
>>
>> --
>> linux-i3c mailing list
>> linux-i3c@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-i3c
> 

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c: don't fail if GETHDRCAP is unsupported
  2025-06-26  2:46   ` Joshua Yeong
@ 2025-07-03  6:41     ` Wolfram Sang
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2025-07-03  6:41 UTC (permalink / raw)
  To: Joshua Yeong
  Cc: Frank Li, linux-renesas-soc@vger.kernel.org, Alexandre Belloni,
	linux-i3c@lists.infradead.org

Hi Joshua,

> I'm use `MMC5633` to test out the HDR-DDR functionality master functionality.
> The patch can be accepted as some controller might not support HDR.

May I read this as an Acked-by? Then, I would add it when sending v2.

Happy hacking,

   Wolfram


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

end of thread, other threads:[~2025-07-03  6:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25  7:34 [PATCH] i3c: don't fail if GETHDRCAP is unsupported Wolfram Sang
2025-06-25 15:24 ` Frank Li
2025-06-25 16:41   ` Wolfram Sang
2025-06-26  2:46   ` Joshua Yeong
2025-07-03  6:41     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).