[PATCH v2 0/9] i2c: atr: allow usage of nested ATRs

Cosmin Tanislav
2025-02-25T11:39:45Z

For upcoming GMSL drivers, we need to be able to use nested ATRs.
The deserializer changes the address of the serializers, and can only
do that for the serializers, while the serializers have proper address
translation hardware, and can translate the address of its children.

To achieve this, add a static flag and a passthrough flag.
The static flag prevents usage of dynamic remapping by disallowing
creation of new mappings outside of the attach_addr() function.
The passthrough flag prevents messages coming from non-direct children
(which don't have a local mapping) to be treated as erroneous.

This series also contains various fixes to the logic observed during
development.

This series depends on:
https://lore.kernel.org/lkml/20250204-fpc202-v7-0-78b4b8a35cf1@bootlin.com

The previous version is at:
https://lore.kernel.org/all/20250203121629.2027871-1-demonsingur@gmail.com

V2:
* rename and split up i2c_atr_find_mapping_by_addr() to allow for
usage of parts of its logic where applicable

Cosmin Tanislav (8):
i2c: atr: unlock mutex after c2a access
i2c: atr: find_mapping() -> get_mapping()
i2c: atr: split up i2c_atr_get_mapping_by_addr()
i2c: atr: do not create mapping in detach_addr()
i2c: atr: deduplicate logic in attach_addr()
i2c: atr: allow replacing mappings in attach_addr()
i2c: atr: add static flag
i2c: atr: add passthrough flag

Tomi Valkeinen (1):
i2c: atr: Fix lockdep for nested ATRs

drivers/i2c/i2c-atr.c | 187 ++++++++++++++++++++++++++--------------
include/linux/i2c-atr.h | 22 ++++-
2 files changed, 142 insertions(+), 67 deletions(-)

--
2.48.1