From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Wolfram Sang <wsa@kernel.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
Krzysztof Piotr Oledzki <ole@ans.pl>
Subject: Re: [PATCH] i2c: core: Lock address during client device instantiation
Date: Wed, 14 Aug 2024 13:14:49 +0200 [thread overview]
Message-ID: <ZryRqVexisiS-SGp@shikoro> (raw)
In-Reply-To: <3b1964fa-56fd-464f-93d3-98d46c70b872@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]
Hi Heiner,
thanks for tackling this!
> +static int i2c_lock_addr(struct i2c_adapter *adap, unsigned short addr,
> + unsigned short flags)
What about just using 'struct i2c_client *client' here as an argument.
It has all we need and it currently seems unlikely that we need to call
it from somewhere else where we need this seperation.
> + if (!(flags & I2C_CLIENT_TEN) && !(flags & I2C_CLIENT_SLAVE) &&
From a pedantic point of view, I don't see a reason for not handling
those two cases above. I hate to be pedantic because 10-bit mode is
practically unused (and I am tempted to remove support for it once in a
while because it makes other solutions clumsy). And the other one is
super unlikely to happen because the backends do not autoload. However,
it is theoretically possible if someone loads a devicetree overlay and
initiates via sysfs at the same time. I liked the solution with the
bitfield and atomic access, but maybe a linked list is better?
Happy hacking,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-08-14 11:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 21:39 [PATCH] i2c: core: Lock address during client device instantiation Heiner Kallweit
2024-08-14 11:14 ` Wolfram Sang [this message]
2024-08-14 20:07 ` Heiner Kallweit
2024-08-14 20:25 ` Wolfram Sang
2024-08-16 6:17 ` Heiner Kallweit
2024-08-16 9:23 ` Wolfram Sang
2024-08-16 11:33 ` Heiner Kallweit
2024-08-16 14:49 ` Wolfram Sang
2024-08-15 11:29 ` kernel test robot
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=ZryRqVexisiS-SGp@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=hkallweit1@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=ole@ans.pl \
--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