public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Romain Gantois <romain.gantois@bootlin.com>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wolfram Sang <wsa@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Cosmin Tanislav <demonsingur@gmail.com>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Subject: Re: [PATCH v2 2/3] i2c: atr: Allow unmapped addresses from nested ATRs
Date: Tue, 26 Nov 2024 09:34:56 +0100	[thread overview]
Message-ID: <7074006.bC9N32Mljn@fw-rgant> (raw)
In-Reply-To: <20241122-i2c-atr-fixes-v2-2-0acd325b6916@ideasonboard.com>

Hello Tomi,

On vendredi 22 novembre 2024 13:26:19 heure normale d’Europe centrale Tomi Valkeinen wrote:
> From: Cosmin Tanislav <demonsingur@gmail.com>
> 
> i2c-atr translates the i2c transactions and forwards them to its parent
> i2c bus. Any transaction to an i2c address that has not been mapped on
> the i2c-atr will be rejected with an error.
> 
> However, if the parent i2c bus is another i2c-atr, the parent i2c-atr
> gets a transaction to an i2c address that is not mapped in the parent
> i2c-atr, and thus fails.
> 
> Relax the checks, and allow non-mapped transactions to fix this issue.

I have a series in the review pipeline which adds optional support for dynamic 
I2C ATR address translation. If this option is enabled, then transactions on any
unmapped address are assigned an alias on-the-fly. This feature is required to
handle alias shortages on some hardware setups:

https://lore.kernel.org/all/20241125-fpc202-v3-0-34e86bcb5b56@bootlin.com/

Letting all non-mapped transactions through would conflict with my series, since
these two scenarios would be indistinguishable:

case 1:
transaction with 3 messages is requested, msg1 -> 0x50; msg2 -> 0x51; msg3 -> 0x56
alias pool can only hold 2 mappings at a time, so transaction cannot go through

case 2:
transaction with 3 messages is requested, msg1 -> 0x50; msg2 -> 0x51; msg3 -> 0x50
alias pool can hold 2 mappings at a time, so transaction can go through

Could you perhaps introduce an ATR flag which would enable/disable letting all unmapped
messages through? I have something similar in patch 8 of my FPC202 series:

https://lore.kernel.org/all/20241125-fpc202-v3-8-34e86bcb5b56@bootlin.com/

There could be a flag named "I2C_ATR_FLAG_NESTED_ATR", which would be enabled in i2c_atr_new():

```
@@ i2c_atr_new()

if (is_an_atr(parent))
	atr->flags |= I2C_ATR_FLAG_NESTED_ATR;
```

Please let me know what you think.

Best Regards,

-- 
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




  parent reply	other threads:[~2024-11-26  8:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 12:26 [PATCH v2 0/3] i2c: atr: A few i2c-atr fixes Tomi Valkeinen
2024-11-22 12:26 ` [PATCH v2 1/3] i2c: atr: Fix client detach Tomi Valkeinen
2024-11-22 14:07   ` Andy Shevchenko
2024-12-10  8:01     ` Tomi Valkeinen
2024-11-26  8:14   ` Luca Ceresoli
2024-11-29 12:44     ` Tomi Valkeinen
2024-12-02 16:21   ` Romain Gantois
2024-12-10  8:04   ` Tomi Valkeinen
2025-01-09 10:09   ` Wolfram Sang
2024-11-22 12:26 ` [PATCH v2 2/3] i2c: atr: Allow unmapped addresses from nested ATRs Tomi Valkeinen
2024-11-22 14:09   ` Andy Shevchenko
2024-11-26  8:16   ` Luca Ceresoli
2024-11-26  8:35     ` Tomi Valkeinen
2024-11-27 12:19       ` Luca Ceresoli
2024-11-28 17:50         ` Tomi Valkeinen
2024-11-29 11:53           ` Luca Ceresoli
2024-11-29 13:31             ` Tomi Valkeinen
2024-12-03  9:39               ` Luca Ceresoli
2024-12-03 10:35                 ` Cosmin Tanislav
2024-12-04 17:20                   ` Luca Ceresoli
2024-11-26  8:34   ` Romain Gantois [this message]
2024-11-29 11:53     ` Luca Ceresoli
2024-11-22 12:26 ` [PATCH v2 3/3] i2c: atr: Fix lockdep for " Tomi Valkeinen
2024-11-22 14:13 ` [PATCH v2 0/3] i2c: atr: A few i2c-atr fixes Andy Shevchenko
2024-12-03  8:06   ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7074006.bC9N32Mljn@fw-rgant \
    --to=romain.gantois@bootlin.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=demonsingur@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen+renesas@ideasonboard.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox