From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Frank Li <Frank.Li@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Sasha Levin <sashal@kernel.org>,
linux-i3c@lists.infradead.org
Subject: [PATCH AUTOSEL 6.16-5.4] i3c: don't fail if GETHDRCAP is unsupported
Date: Fri, 8 Aug 2025 11:30:43 -0400 [thread overview]
Message-ID: <20250808153054.1250675-3-sashal@kernel.org> (raw)
In-Reply-To: <20250808153054.1250675-1-sashal@kernel.org>
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
[ Upstream commit 447270cdb41b1c8c3621bb14b93a6749f942556e ]
'I3C_BCR_HDR_CAP' is still spec v1.0 and has been renamed to 'advanced
capabilities' in v1.1 onwards. The ST pressure sensor LPS22DF does not
have HDR, but has the 'advanced cap' bit set. The core still wants to
get additional information using the CCC 'GETHDRCAP' (or GETCAPS in v1.1
onwards). Not all controllers support this CCC and will notify the upper
layers about it. For instantiating the device, we can ignore this
unsupported CCC as standard communication will work. Without this patch,
the device will not be instantiated at all.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250704204524.6124-1-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
Based on my analysis of the commit and the surrounding code, here's my
assessment:
**Backport Status: YES**
This commit should be backported to stable kernel trees for the
following reasons:
1. **Fixes a real bug that prevents device instantiation**: The commit
message clearly states that "Without this patch, the device will not
be instantiated at all." This is a concrete functionality issue where
legitimate I3C devices (like the ST pressure sensor LPS22DF) cannot
be used with controllers that don't support the GETHDRCAP CCC
command.
2. **Small and contained fix**: The change is minimal - only 2 lines
changed:
- Line 1441: Changed from `if (ret)` to `if (ret && ret !=
-ENOTSUPP)`
- This allows the function to continue when GETHDRCAP returns
-ENOTSUPP instead of failing
3. **Clear regression prevention**: The fix prevents device
initialization failure for hardware combinations that should work.
The I3C spec evolved from v1.0 to v1.1, and this handles backward
compatibility gracefully.
4. **No architectural changes**: This is a simple error handling
adjustment that doesn't change any core functionality or introduce
new features.
5. **Fixes interoperability issue**: The commit addresses a real-world
hardware compatibility problem between certain I3C controllers and
devices, which is exactly the type of bug that stable kernels should
fix.
6. **Low risk of regression**: The change only affects the error path
when GETHDRCAP fails with -ENOTSUPP. It doesn't change behavior for
successful cases or other error conditions.
7. **Follows stable rules**:
- It's obviously correct (treats unsupported CCC as non-fatal)
- It's tiny (2-line change)
- Fixes one specific issue
- Fixes a real bug that prevents hardware from working
The commit allows I3C device initialization to proceed even when the
controller doesn't support the GETHDRCAP command, which is reasonable
since HDR capabilities are optional and standard I3C communication will
still work without them.
drivers/i3c/master.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index fd81871609d9..e53c69d24873 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1439,7 +1439,7 @@ static int i3c_master_retrieve_dev_info(struct i3c_dev_desc *dev)
if (dev->info.bcr & I3C_BCR_HDR_CAP) {
ret = i3c_master_gethdrcap_locked(master, &dev->info);
- if (ret)
+ if (ret && ret != -ENOTSUPP)
return ret;
}
--
2.39.5
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next parent reply other threads:[~2025-09-14 20:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250808153054.1250675-1-sashal@kernel.org>
2025-08-08 15:30 ` Sasha Levin [this message]
2025-08-08 15:30 ` [PATCH AUTOSEL 6.16-5.4] i3c: add missing include to internal header Sasha Levin
2025-08-08 15:30 ` [PATCH AUTOSEL 6.16-6.1] i3c: master: Initialize ret in i3c_i2c_notifier_call() Sasha Levin
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=20250808153054.1250675-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-i3c@lists.infradead.org \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--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