From: Heiner Kallweit <hkallweit1@gmail.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
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: Fri, 16 Aug 2024 08:17:00 +0200 [thread overview]
Message-ID: <dfbe5afa-daf6-4366-8f53-c8f7434b0748@gmail.com> (raw)
In-Reply-To: <ZryRqVexisiS-SGp@shikoro>
On 14.08.2024 13:14, Wolfram Sang wrote:
> 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?
>
Wrt 10 bit addresses:
I didn't find a single dts(i) with a 10bit i2c device. Because you said
that you're tempted to remove 10 bit support: Could the device tree part
be a starting point?
> Happy hacking,
>
> Wolfram
>
Heiner
next prev parent reply other threads:[~2024-08-16 6:17 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
2024-08-14 20:07 ` Heiner Kallweit
2024-08-14 20:25 ` Wolfram Sang
2024-08-16 6:17 ` Heiner Kallweit [this message]
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=dfbe5afa-daf6-4366-8f53-c8f7434b0748@gmail.com \
--to=hkallweit1@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=ole@ans.pl \
--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