From: Cosmin Tanislav <demonsingur@gmail.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Romain Gantois <romain.gantois@bootlin.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org,
Cosmin Tanislav <demonsingur@gmail.com>
Subject: [PATCH v5 0/9] i2c: atr: allow usage of nested ATRs
Date: Wed, 7 May 2025 15:19:06 +0300 [thread overview]
Message-ID: <20250507121917.2364416-1-demonsingur@gmail.com> (raw)
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.
The previous version is at:
https://lore.kernel.org/lkml/20250428102516.933571-1-demonsingur@gmail.com
V5:
* pick up Reviewed-by tags
* expand the I2C_ATR_F_STATIC description
* place i2c_atr_create_mapping_by_addr() before
i2c_atr_replace_mapping_by_addr()
V4:
* rebase on latest merged changes, and latest submitted fixes
V3:
* remove i2c_atr_new_flags(), add flags parameter to i2c_atr_new() in
a new patch
* remove "i2c: atr: unlock mutex after c2a access" patch as it will
be moved into the base series
* remove alias_pairs variable used only once
* remove err_del_c2a label used only once
* add lockdep_assert_held to i2c_atr_create_mapping_by_addr()
* I2C_ATR_STATIC -> I2C_ATR_F_STATIC
* I2C_ATR_PASSTHROUGH -> I2C_ATR_F_PASSTHROUGH
* add passthrough check to i2c_atr_smbus_xfer()
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: 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 flags parameter to i2c_atr_new()
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 | 197 ++++++++++++++++++++++------------
drivers/media/i2c/ds90ub960.c | 2 +-
drivers/misc/ti_fpc202.c | 2 +-
include/linux/i2c-atr.h | 19 +++-
4 files changed, 146 insertions(+), 74 deletions(-)
--
2.49.0
next reply other threads:[~2025-05-07 12:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 12:19 Cosmin Tanislav [this message]
2025-05-07 12:19 ` [PATCH v5 1/9] i2c: atr: Fix lockdep for nested ATRs Cosmin Tanislav
2025-05-22 9:06 ` Wolfram Sang
2025-05-22 9:31 ` Cosmin Tanislav
2025-05-22 10:07 ` Luca Ceresoli
2025-05-22 10:08 ` Luca Ceresoli
2025-05-22 10:11 ` Wolfram Sang
2025-05-07 12:19 ` [PATCH v5 2/9] i2c: atr: find_mapping() -> get_mapping() Cosmin Tanislav
2025-05-07 12:19 ` [PATCH v5 3/9] i2c: atr: split up i2c_atr_get_mapping_by_addr() Cosmin Tanislav
2025-05-21 15:56 ` Luca Ceresoli
2025-05-07 12:19 ` [PATCH v5 4/9] i2c: atr: do not create mapping in detach_addr() Cosmin Tanislav
2025-05-07 12:19 ` [PATCH v5 5/9] i2c: atr: deduplicate logic in attach_addr() Cosmin Tanislav
2025-05-07 12:19 ` [PATCH v5 6/9] i2c: atr: allow replacing mappings " Cosmin Tanislav
2025-05-21 15:56 ` Luca Ceresoli
2025-05-07 12:19 ` [PATCH v5 7/9] i2c: atr: add flags parameter to i2c_atr_new() Cosmin Tanislav
2025-05-22 8:50 ` Wolfram Sang
2025-05-22 10:10 ` Luca Ceresoli
2025-05-07 12:19 ` [PATCH v5 8/9] i2c: atr: add static flag Cosmin Tanislav
2025-05-21 15:56 ` Luca Ceresoli
2025-05-22 8:58 ` Wolfram Sang
2025-05-07 12:19 ` [PATCH v5 9/9] i2c: atr: add passthrough flag Cosmin Tanislav
2025-05-22 10:12 ` [PATCH v5 0/9] i2c: atr: allow usage of nested ATRs Wolfram Sang
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=20250507121917.2364416-1-demonsingur@gmail.com \
--to=demonsingur@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=mchehab@kernel.org \
--cc=romain.gantois@bootlin.com \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=wsa+renesas@sang-engineering.com \
/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