From: Heiner Kallweit <hkallweit1@gmail.com>
To: "Pali Rohár" <pali@kernel.org>, Dell.Client.Kernel@dell.com
Cc: "Jean Delvare" <jdelvare@suse.com>,
"Andi Shyti" <andi.shyti@kernel.org>,
"Wolfram Sang" <wsa@the-dreams.de>,
"Patrick Höhn" <hoehnp@gmx.de>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH RFT] i2c: i801: Scan for Dell accelerometer i2c address
Date: Fri, 3 May 2024 22:43:03 +0200 [thread overview]
Message-ID: <3e16b1a9-4697-4325-87ce-6d1f57ecac2b@gmail.com> (raw)
In-Reply-To: <20240503143939.xfsxwrcmiflty5fl@pali>
On 03.05.2024 16:39, Pali Rohár wrote:
> On Friday 03 May 2024 16:09:03 Heiner Kallweit wrote:
>> So far each new Dell device with an accelerometer requires a patch.
>> All devices, with one older system as an exception, use address 0x29.
>> So I think we can safely scan for the correct address
>
> This is too risky. Poking random smbus address can lead to the lockup or
> crash of the whole system. I really dislike such change which is going
> to unconditionally on every system to scan or access fixed smbus address.
> Crashing kernel on some new model in future or on some older models is
> the worst user experience which can happen.
>
The scan is protected by is_dell_system_with_lis3lv02d().
So we know it's a Dell system with an accelerometer.
The only potentially problematic scenario would be:
- It's a Dell system with an accelerometer and
- Accelerometer is at an address different from 0x29 and
- System has some other device at address 0x29
If there ever should be such a case, we still would have the option to
provide a more specific probe function to i2c_new_scanned_device().
At least for now I don't really see a risk.
> The hardcoded table with model name and address is the safest option to
> prevent crashes or other unexpected behavior.
>
> Instead, I would suggest to contact Dell if they can provide a way to
> read accelerometer's i2c/smbus address from ACPI/WMI/DMI. And if there
See comment in the driver:
"Accelerometer's I2C address is not specified in DMI nor ACPI"
> is not any way right now then ask Dell to include it for new products.
> So we can avoid having hardcoded table for new products released in
> future.
This is a good point. Not sure whether anybody tried this yet.
Therefore +Dell.Client.Kernel@dell.com
prev parent reply other threads:[~2024-05-03 20:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 14:09 [PATCH RFT] i2c: i801: Scan for Dell accelerometer i2c address Heiner Kallweit
2024-05-03 14:39 ` Pali Rohár
2024-05-03 20:43 ` Heiner Kallweit [this message]
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=3e16b1a9-4697-4325-87ce-6d1f57ecac2b@gmail.com \
--to=hkallweit1@gmail.com \
--cc=Dell.Client.Kernel@dell.com \
--cc=andi.shyti@kernel.org \
--cc=hoehnp@gmx.de \
--cc=jdelvare@suse.com \
--cc=linux-i2c@vger.kernel.org \
--cc=pali@kernel.org \
--cc=wsa@the-dreams.de \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).