public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: i2c-core-base: fix devicetree alias handling
@ 2026-03-02 17:04 Andreas Kemnade
  2026-03-03  8:46 ` Bartosz Golaszewski
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Andreas Kemnade @ 2026-03-02 17:04 UTC (permalink / raw)
  To: Wolfram Sang, Frank Li, Linus Walleij, Patrice Chotard,
	Florian Fainelli, Dave Stevenson
  Cc: Bartosz Golaszewski, Bartosz Golaszewski, linux-i2c, linux-kernel,
	Kalle Niemi, Andreas Kemnade

Parent device is not set up there, so use the new of_node pointer to
handle aliases.

Fixes: 0ab80451c70f ("i2c: allow setting the parent device and OF node through the adapter struct")
Reported-by: Kalle Niemi <kaleposti@gmail.com>
Closes: https://lore.kernel.org/lkml/EDF3FB58-4747-442E-8463-6F1C6E568962@gmail.com/
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 drivers/i2c/i2c-core-base.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index dd8cec9b04c6..e22d784202b8 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1657,10 +1657,9 @@ static int __i2c_add_numbered_adapter(struct i2c_adapter *adap)
  */
 int i2c_add_adapter(struct i2c_adapter *adapter)
 {
-	struct device *dev = &adapter->dev;
 	int id;
 
-	id = of_alias_get_id(dev->of_node, "i2c");
+	id = of_alias_get_id(adapter->of_node, "i2c");
 	if (id >= 0) {
 		adapter->nr = id;
 		return __i2c_add_numbered_adapter(adapter);

---
base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
change-id: 20260302-i2cfix-56ec3cfedff6

Best regards,
--  
Andreas Kemnade <andreas@kemnade.info>


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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
@ 2026-03-03  8:06 Kalle Niemi
  0 siblings, 0 replies; 11+ messages in thread
From: Kalle Niemi @ 2026-03-03  8:06 UTC (permalink / raw)
  To: Andreas Kemnade, Wolfram Sang, Frank Li, Linus Walleij,
	Patrice Chotard, Florian Fainelli, Dave Stevenson
  Cc: Bartosz Golaszewski, Bartosz Golaszewski, linux-i2c, linux-kernel

On 3/2/26 19:04, Andreas Kemnade wrote:
> Parent device is not set up there, so use the new of_node pointer to
> handle aliases.
> Fixes: 0ab80451c70f ("i2c: allow setting the parent device and OF node through the adapter struct")
> Reported-by: Kalle Niemi <kaleposti@gmail.com>
> Closes: https://lore.kernel.org/lkml/EDF3FB58-4747-442E-8463-6F1C6E568962@gmail.com/
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
>  drivers/i2c/i2c-core-base.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> index dd8cec9b04c6..e22d784202b8 100644
> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c
> @@ -1657,10 +1657,9 @@ static int __i2c_add_numbered_adapter(struct i2c_adapter *adap)
>   */
>  int i2c_add_adapter(struct i2c_adapter *adapter)
>  {
> -    struct device *dev = &adapter->dev;
>      int id;
>  -    id = of_alias_get_id(dev->of_node, "i2c");
> +    id = of_alias_get_id(adapter->of_node, "i2c");
>      if (id >= 0) {
>          adapter->nr = id;
>          return __i2c_add_numbered_adapter(adapter);
> ---
> base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
> change-id: 20260302-i2cfix-56ec3cfedff6
> Best regards,
> --
> Andreas Kemnade <andreas@kemnade.info>

Hello,

With this patch applied all previously failed tests pass now; i2c busses get indexed as described in the devicetree.

Tested-by: Kalle Niemi <kaleposti@gmail.com>

BR
Kalle

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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-02 17:04 [PATCH] i2c: i2c-core-base: fix devicetree alias handling Andreas Kemnade
@ 2026-03-03  8:46 ` Bartosz Golaszewski
  2026-03-04 10:47 ` Wolfram Sang
  2026-03-06 10:18 ` Jon Hunter
  2 siblings, 0 replies; 11+ messages in thread
From: Bartosz Golaszewski @ 2026-03-03  8:46 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Bartosz Golaszewski, Bartosz Golaszewski, linux-i2c, linux-kernel,
	Kalle Niemi, Wolfram Sang, Frank Li, Linus Walleij,
	Patrice Chotard, Florian Fainelli, Dave Stevenson

On Mon, 2 Mar 2026 18:04:42 +0100, Andreas Kemnade <andreas@kemnade.info> said:
> Parent device is not set up there, so use the new of_node pointer to
> handle aliases.
>
> Fixes: 0ab80451c70f ("i2c: allow setting the parent device and OF node through the adapter struct")
> Reported-by: Kalle Niemi <kaleposti@gmail.com>
> Closes: https://lore.kernel.org/lkml/EDF3FB58-4747-442E-8463-6F1C6E568962@gmail.com/
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
>  drivers/i2c/i2c-core-base.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> index dd8cec9b04c6..e22d784202b8 100644
> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c
> @@ -1657,10 +1657,9 @@ static int __i2c_add_numbered_adapter(struct i2c_adapter *adap)
>   */
>  int i2c_add_adapter(struct i2c_adapter *adapter)
>  {
> -	struct device *dev = &adapter->dev;
>  	int id;
>
> -	id = of_alias_get_id(dev->of_node, "i2c");
> +	id = of_alias_get_id(adapter->of_node, "i2c");
>  	if (id >= 0) {
>  		adapter->nr = id;
>  		return __i2c_add_numbered_adapter(adapter);
>
> ---
> base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
> change-id: 20260302-i2cfix-56ec3cfedff6
>
> Best regards,
> --
> Andreas Kemnade <andreas@kemnade.info>
>
>

Thanks for fixing it!

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-02 17:04 [PATCH] i2c: i2c-core-base: fix devicetree alias handling Andreas Kemnade
  2026-03-03  8:46 ` Bartosz Golaszewski
@ 2026-03-04 10:47 ` Wolfram Sang
  2026-03-04 16:42   ` Bartosz Golaszewski
  2026-03-06 10:18 ` Jon Hunter
  2 siblings, 1 reply; 11+ messages in thread
From: Wolfram Sang @ 2026-03-04 10:47 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Frank Li, Linus Walleij, Patrice Chotard, Florian Fainelli,
	Dave Stevenson, Bartosz Golaszewski, Bartosz Golaszewski,
	linux-i2c, linux-kernel, Kalle Niemi

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

Hi Andreas, Bart, all

On Mon, Mar 02, 2026 at 06:04:42PM +0100, Andreas Kemnade wrote:
> Parent device is not set up there, so use the new of_node pointer to
> handle aliases.
> 
> Fixes: 0ab80451c70f ("i2c: allow setting the parent device and OF node through the adapter struct")
> Reported-by: Kalle Niemi <kaleposti@gmail.com>
> Closes: https://lore.kernel.org/lkml/EDF3FB58-4747-442E-8463-6F1C6E568962@gmail.com/
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>

Thank you a lot for this fix! I will apply the patch. Plus, I want to
describe what it also made me do.

Bart's patches are in for-current and were planned to be sent to Linus
as an "after -rc1 cleanup". This patch tells me that we are not there
yet and the patch series should have a full cycle in -next, so we (read:
I) have more trust that we didn't overlook side-effects. As a
conclusion, I will move Bart's patch series to for-mergewindow and apply
your patch on top of it.

Bart, I am sorry for the delay it introduces, but I think the smoother
the transition the better. Maybe we can save some time somewhere else?

Happy hacking,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-04 10:47 ` Wolfram Sang
@ 2026-03-04 16:42   ` Bartosz Golaszewski
  2026-03-04 17:00     ` Wolfram Sang
  0 siblings, 1 reply; 11+ messages in thread
From: Bartosz Golaszewski @ 2026-03-04 16:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Andreas Kemnade, Frank Li, Linus Walleij, Patrice Chotard,
	Florian Fainelli, Dave Stevenson, Bartosz Golaszewski, linux-i2c,
	linux-kernel, Kalle Niemi

On Wed, Mar 4, 2026 at 11:47 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> Hi Andreas, Bart, all
>
> On Mon, Mar 02, 2026 at 06:04:42PM +0100, Andreas Kemnade wrote:
> > Parent device is not set up there, so use the new of_node pointer to
> > handle aliases.
> >
> > Fixes: 0ab80451c70f ("i2c: allow setting the parent device and OF node through the adapter struct")
> > Reported-by: Kalle Niemi <kaleposti@gmail.com>
> > Closes: https://lore.kernel.org/lkml/EDF3FB58-4747-442E-8463-6F1C6E568962@gmail.com/
> > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
>
> Thank you a lot for this fix! I will apply the patch. Plus, I want to
> describe what it also made me do.
>
> Bart's patches are in for-current and were planned to be sent to Linus
> as an "after -rc1 cleanup". This patch tells me that we are not there
> yet and the patch series should have a full cycle in -next, so we (read:
> I) have more trust that we didn't overlook side-effects. As a
> conclusion, I will move Bart's patch series to for-mergewindow and apply
> your patch on top of it.
>
> Bart, I am sorry for the delay it introduces, but I think the smoother
> the transition the better. Maybe we can save some time somewhere else?
>

I think there's been a misunderstanding. I've never suggested this
should go into v7.0. This is definitely v7.1 material and should cook
in linux-next. So yeah, feel free to queue it for the next merge
window.

Bartosz

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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-04 16:42   ` Bartosz Golaszewski
@ 2026-03-04 17:00     ` Wolfram Sang
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2026-03-04 17:00 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Andreas Kemnade, Frank Li, Linus Walleij, Patrice Chotard,
	Florian Fainelli, Dave Stevenson, Bartosz Golaszewski, linux-i2c,
	linux-kernel, Kalle Niemi

[-- Attachment #1: Type: text/plain, Size: 113 bytes --]


> I think there's been a misunderstanding. I've never suggested this
> should go into v7.0.

Even better then!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-02 17:04 [PATCH] i2c: i2c-core-base: fix devicetree alias handling Andreas Kemnade
  2026-03-03  8:46 ` Bartosz Golaszewski
  2026-03-04 10:47 ` Wolfram Sang
@ 2026-03-06 10:18 ` Jon Hunter
  2026-03-06 14:04   ` Jon Hunter
  2026-03-07 17:26   ` Andreas Kemnade
  2 siblings, 2 replies; 11+ messages in thread
From: Jon Hunter @ 2026-03-06 10:18 UTC (permalink / raw)
  To: Andreas Kemnade, Wolfram Sang, Frank Li, Linus Walleij,
	Patrice Chotard, Florian Fainelli, Dave Stevenson
  Cc: Bartosz Golaszewski, Bartosz Golaszewski, linux-i2c, linux-kernel,
	Kalle Niemi, linux-tegra@vger.kernel.org

Hi Andreas,

On 02/03/2026 17:04, Andreas Kemnade wrote:
> Parent device is not set up there, so use the new of_node pointer to
> handle aliases.
> 
> Fixes: 0ab80451c70f ("i2c: allow setting the parent device and OF node through the adapter struct")
> Reported-by: Kalle Niemi <kaleposti@gmail.com>
> Closes: https://lore.kernel.org/lkml/EDF3FB58-4747-442E-8463-6F1C6E568962@gmail.com/
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
>   drivers/i2c/i2c-core-base.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> index dd8cec9b04c6..e22d784202b8 100644
> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c
> @@ -1657,10 +1657,9 @@ static int __i2c_add_numbered_adapter(struct i2c_adapter *adap)
>    */
>   int i2c_add_adapter(struct i2c_adapter *adapter)
>   {
> -	struct device *dev = &adapter->dev;
>   	int id;
>   
> -	id = of_alias_get_id(dev->of_node, "i2c");
> +	id = of_alias_get_id(adapter->of_node, "i2c");
>   	if (id >= 0) {
>   		adapter->nr = id;
>   		return __i2c_add_numbered_adapter(adapter);

This change is breaking a test we run to check that I2C devices are 
populated as expected on a few of our Tegra boards. For example, on the 
Tegra234 board, the I2C aliases are defined in 
arch/arm64/boot/dts/nvidia/tegra234.dtsi. Here we have ...

         aliases {
                 i2c0 = &gen1_i2c;
                 i2c1 = &gen2_i2c;
                 i2c2 = &cam_i2c;
                 i2c3 = &dp_aux_ch1_i2c;
                 i2c4 = &bpmp_i2c;
                 i2c5 = &dp_aux_ch0_i2c;
                 i2c6 = &dp_aux_ch2_i2c;
                 i2c7 = &gen8_i2c;
                 i2c8 = &dp_aux_ch3_i2c;
         };

Before this change, on the Tegra234 Jetson AGX Orin board 
(tegra234-p3737-0000+p3701-0000.dts) the I2C devices were mapped as 
above ...

/sys/class/i2c-dev/i2c-0/name --> 3160000.i2c
/sys/class/i2c-dev/i2c-1/name --> c240000.i2c
/sys/class/i2c-dev/i2c-4/name --> Tegra BPMP I2C adapter
/sys/class/i2c-dev/i2c-8/name --> 31e0000.i2c

After this change I now see ...

/sys/class/i2c-dev/i2c-9/name --> Tegra BPMP I2C adapter
/sys/class/i2c-dev/i2c-10/name --> 3160000.i2c
/sys/class/i2c-dev/i2c-11/name --> 31e0000.i2c
/sys/class/i2c-dev/i2c-12/name --> c240000.i2c

So the subject says that this fixes device-tree aliases, but it appears 
to break it for Tegra. In fact, this patch appears to have the same 
problem that you reported with Bartosz's change. Reverting this change 
fixes the problem. So I am a bit confused why we are seeing different 
behaviour.

Jon

-- 
nvpublic


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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-06 10:18 ` Jon Hunter
@ 2026-03-06 14:04   ` Jon Hunter
  2026-03-07 17:26   ` Andreas Kemnade
  1 sibling, 0 replies; 11+ messages in thread
From: Jon Hunter @ 2026-03-06 14:04 UTC (permalink / raw)
  To: Andreas Kemnade, Wolfram Sang, Frank Li, Linus Walleij,
	Patrice Chotard, Florian Fainelli, Dave Stevenson
  Cc: Bartosz Golaszewski, Bartosz Golaszewski, linux-i2c, linux-kernel,
	Kalle Niemi, linux-tegra@vger.kernel.org


On 06/03/2026 10:18, Jon Hunter wrote:
> Hi Andreas,
> 
> On 02/03/2026 17:04, Andreas Kemnade wrote:
>> Parent device is not set up there, so use the new of_node pointer to
>> handle aliases.
>>
>> Fixes: 0ab80451c70f ("i2c: allow setting the parent device and OF node 
>> through the adapter struct")
>> Reported-by: Kalle Niemi <kaleposti@gmail.com>
>> Closes: https://lore.kernel.org/lkml/ 
>> EDF3FB58-4747-442E-8463-6F1C6E568962@gmail.com/
>> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
>> ---
>>   drivers/i2c/i2c-core-base.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
>> index dd8cec9b04c6..e22d784202b8 100644
>> --- a/drivers/i2c/i2c-core-base.c
>> +++ b/drivers/i2c/i2c-core-base.c
>> @@ -1657,10 +1657,9 @@ static int __i2c_add_numbered_adapter(struct 
>> i2c_adapter *adap)
>>    */
>>   int i2c_add_adapter(struct i2c_adapter *adapter)
>>   {
>> -    struct device *dev = &adapter->dev;
>>       int id;
>> -    id = of_alias_get_id(dev->of_node, "i2c");
>> +    id = of_alias_get_id(adapter->of_node, "i2c");
>>       if (id >= 0) {
>>           adapter->nr = id;
>>           return __i2c_add_numbered_adapter(adapter);
> 
> This change is breaking a test we run to check that I2C devices are 
> populated as expected on a few of our Tegra boards. For example, on the 
> Tegra234 board, the I2C aliases are defined in arch/arm64/boot/dts/ 
> nvidia/tegra234.dtsi. Here we have ...
> 
>          aliases {
>                  i2c0 = &gen1_i2c;
>                  i2c1 = &gen2_i2c;
>                  i2c2 = &cam_i2c;
>                  i2c3 = &dp_aux_ch1_i2c;
>                  i2c4 = &bpmp_i2c;
>                  i2c5 = &dp_aux_ch0_i2c;
>                  i2c6 = &dp_aux_ch2_i2c;
>                  i2c7 = &gen8_i2c;
>                  i2c8 = &dp_aux_ch3_i2c;
>          };

I guess I should add the mapping (from tegra234.dtsi) ...

&gen1_i2c --> i2c@3160000
&gen2_i2c --> i2c@c240000
&bpmp_i2c --> Tegra BPMP I2C adapter
dp_aux_ch3_i2c --> i2c@31e0000

> Before this change, on the Tegra234 Jetson AGX Orin board (tegra234- 
> p3737-0000+p3701-0000.dts) the I2C devices were mapped as above ...
> 
> /sys/class/i2c-dev/i2c-0/name --> 3160000.i2c
> /sys/class/i2c-dev/i2c-1/name --> c240000.i2c
> /sys/class/i2c-dev/i2c-4/name --> Tegra BPMP I2C adapter
> /sys/class/i2c-dev/i2c-8/name --> 31e0000.i2c

Hence this looks correct.

> After this change I now see ...
> 
> /sys/class/i2c-dev/i2c-9/name --> Tegra BPMP I2C adapter
> /sys/class/i2c-dev/i2c-10/name --> 3160000.i2c
> /sys/class/i2c-dev/i2c-11/name --> 31e0000.i2c
> /sys/class/i2c-dev/i2c-12/name --> c240000.i2c

But this does not.

Jon

-- 
nvpublic


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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-06 10:18 ` Jon Hunter
  2026-03-06 14:04   ` Jon Hunter
@ 2026-03-07 17:26   ` Andreas Kemnade
  2026-03-09  9:08     ` Bartosz Golaszewski
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Kemnade @ 2026-03-07 17:26 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Wolfram Sang, Frank Li, Linus Walleij, Patrice Chotard,
	Florian Fainelli, Dave Stevenson, Bartosz Golaszewski,
	Bartosz Golaszewski, linux-i2c, linux-kernel, Kalle Niemi,
	linux-tegra@vger.kernel.org

On Fri, 6 Mar 2026 10:18:09 +0000
Jon Hunter <jonathanh@nvidia.com> wrote:

[...]

> /sys/class/i2c-dev/i2c-0/name --> 3160000.i2c
> /sys/class/i2c-dev/i2c-1/name --> c240000.i2c
> /sys/class/i2c-dev/i2c-4/name --> Tegra BPMP I2C adapter
> /sys/class/i2c-dev/i2c-8/name --> 31e0000.i2c
> 
> After this change I now see ...
> 
> /sys/class/i2c-dev/i2c-9/name --> Tegra BPMP I2C adapter
> /sys/class/i2c-dev/i2c-10/name --> 3160000.i2c
> /sys/class/i2c-dev/i2c-11/name --> 31e0000.i2c
> /sys/class/i2c-dev/i2c-12/name --> c240000.i2c
> 
> So the subject says that this fixes device-tree aliases, but it appears 
> to break it for Tegra. In fact, this patch appears to have the same 
> problem that you reported with Bartosz's change. Reverting this change 
> fixes the problem. So I am a bit confused why we are seeing different 
> behaviour.
> 
Hmm, i2c-tegra.c was forgotten in Bartosz's change because
the code looks a bit different.

There is still
i2c_dev->adapter.dev.of_node = i2c_dev->dev->of_node;
        i2c_dev->adapter.dev.parent = i2c_dev->dev;
there.
compared to 
  adap->parent = &pdev->dev;
        adap->of_node = pdev->dev.of_node;

in omap code. So I think, the easiest to get forward is to
also adapt i2c-tegra.c.

Regards,
Andreas

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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-07 17:26   ` Andreas Kemnade
@ 2026-03-09  9:08     ` Bartosz Golaszewski
  2026-03-09 11:40       ` Wolfram Sang
  0 siblings, 1 reply; 11+ messages in thread
From: Bartosz Golaszewski @ 2026-03-09  9:08 UTC (permalink / raw)
  To: Andreas Kemnade, Wolfram Sang, Johan Hovold
  Cc: Jon Hunter, Frank Li, Linus Walleij, Patrice Chotard,
	Florian Fainelli, Dave Stevenson, Bartosz Golaszewski, linux-i2c,
	linux-kernel, Kalle Niemi, linux-tegra@vger.kernel.org

On Sat, Mar 7, 2026 at 6:27 PM Andreas Kemnade <andreas@kemnade.info> wrote:
>
> On Fri, 6 Mar 2026 10:18:09 +0000
> Jon Hunter <jonathanh@nvidia.com> wrote:
>
> [...]
>
> > /sys/class/i2c-dev/i2c-0/name --> 3160000.i2c
> > /sys/class/i2c-dev/i2c-1/name --> c240000.i2c
> > /sys/class/i2c-dev/i2c-4/name --> Tegra BPMP I2C adapter
> > /sys/class/i2c-dev/i2c-8/name --> 31e0000.i2c
> >
> > After this change I now see ...
> >
> > /sys/class/i2c-dev/i2c-9/name --> Tegra BPMP I2C adapter
> > /sys/class/i2c-dev/i2c-10/name --> 3160000.i2c
> > /sys/class/i2c-dev/i2c-11/name --> 31e0000.i2c
> > /sys/class/i2c-dev/i2c-12/name --> c240000.i2c
> >
> > So the subject says that this fixes device-tree aliases, but it appears
> > to break it for Tegra. In fact, this patch appears to have the same
> > problem that you reported with Bartosz's change. Reverting this change
> > fixes the problem. So I am a bit confused why we are seeing different
> > behaviour.
> >
> Hmm, i2c-tegra.c was forgotten in Bartosz's change because
> the code looks a bit different.
>

It was not forgotten, rather my series only changed a part of the
users and I was planning to continue the work but it seems like Johan
committed to attempting to rework i2c using a different approach[1].

Wolfram: do you want to drop these patches from your v7.1 queue then?

Bartosz

> There is still
> i2c_dev->adapter.dev.of_node = i2c_dev->dev->of_node;
>         i2c_dev->adapter.dev.parent = i2c_dev->dev;
> there.
> compared to
>   adap->parent = &pdev->dev;
>         adap->of_node = pdev->dev.of_node;
>
> in omap code. So I think, the easiest to get forward is to
> also adapt i2c-tegra.c.
>
> Regards,
> Andreas

[1] https://lore.kernel.org/all/aar3rj7Db6NmTVS_@hovoldconsulting.com/

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

* Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
  2026-03-09  9:08     ` Bartosz Golaszewski
@ 2026-03-09 11:40       ` Wolfram Sang
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2026-03-09 11:40 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Andreas Kemnade, Johan Hovold, Jon Hunter, Frank Li,
	Linus Walleij, Patrice Chotard, Florian Fainelli, Dave Stevenson,
	Bartosz Golaszewski, linux-i2c, linux-kernel, Kalle Niemi,
	linux-tegra@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]

Hi Bart,

> Wolfram: do you want to drop these patches from your v7.1 queue then?

Yes, I think this makes sense. Let's see how Johan's approach goes?

Happy hacking,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2026-03-09 11:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 17:04 [PATCH] i2c: i2c-core-base: fix devicetree alias handling Andreas Kemnade
2026-03-03  8:46 ` Bartosz Golaszewski
2026-03-04 10:47 ` Wolfram Sang
2026-03-04 16:42   ` Bartosz Golaszewski
2026-03-04 17:00     ` Wolfram Sang
2026-03-06 10:18 ` Jon Hunter
2026-03-06 14:04   ` Jon Hunter
2026-03-07 17:26   ` Andreas Kemnade
2026-03-09  9:08     ` Bartosz Golaszewski
2026-03-09 11:40       ` Wolfram Sang
  -- strict thread matches above, loose matches on Subject: below --
2026-03-03  8:06 Kalle Niemi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox