From: Frank Li <Frank.Li@nxp.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org,
arnd@arndb.de, bbrezillon@kernel.org,
boris.brezillon@collabora.com, conor.culhane@silvaco.com,
gregkh@linuxfoundation.org, imx@lists.linux.dev,
miquel.raynal@bootlin.com, pthombar@cadence.com,
ravindra.yashvant.shinde@nxp.com, Frank Li <Frank.Li@nxp.com>,
stable@kernel.org
Subject: [PATCH v7 0/3] I3C: master: fix the address assign issue if assign-address is exist in dts
Date: Tue, 08 Oct 2024 11:18:23 -0400 [thread overview]
Message-ID: <20241008-i3c_dts_assign-v7-0-96ec93d1f34c@nxp.com> (raw)
These patches are split from
https://lore.kernel.org/linux-i3c/ZvrAuOBLgi+HtrPD@lizhi-Precision-Tower-5810/#R
There are discussion on
https://lore.kernel.org/linux-i3c/20240819-i3c_fix-v3-0-7d69f7b0a05e@nxp.com/T/#m16fa9bb875b0ae9d37c5f6e91f90e375551c6366
Basic back ground is
The current framework is
1. get free i3c dynamic address
2. if found dt have assign-address for such device (identify by PID),
change to such address.
There are problem in current implement.
If device A have assign-address 0xa, device B have assign-address 0xB,
which described at dts file.
If device A is not ready during i3c probe, and device B hotjoin happen,
0xA will assign to device B, so if device A hotjoin later, address 0xA
Can't assign to A because B already use it.
Mirquel's opinion is return address B when B hotjoin by scan dts by PID.
The issue is the controller HCI (i3C standard),
I3C HCI Spec 1.2, sec 6.4.1, when do DAA, "DAA CMD and dynmatic address"
queue to cmd together. We don't know PID before DAA CMD. So dynamic
address can NOT get based on PID.
When do DAA in HCI, it needs a dynamtic address firstly before get PID
information.
Consider this need more time to discuss, so split from previous big serial
to avoid prevent other fix patches can't be merged into i3c tree.
This patches's overall design:
1. keep current frame's work flow
2. reserver all address, which assigned in dts.
3. the device with assigned address have high priorioty to get such
address.
4. if all address without assigned by dt are used, use offline devices's
assigned address.
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-i3c@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: arnd@arndb.de
Cc: bbrezillon@kernel.org
Cc: boris.brezillon@collabora.com
Cc: conor.culhane@silvaco.com
Cc: gregkh@linuxfoundation.org
Cc: imx@lists.linux.dev
Cc: linux-i3c@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: miquel.raynal@bootlin.com
Cc: pthombar@cadence.com
Cc: ravindra.yashvant.shinde@nxp.com
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Changes in v7:
- see each patch
- Link to v6: https://lore.kernel.org/r/20241003-i3c_dts_assign-v6-0-eae2569c92ca@nxp.com
Changes in v2:
- see each patch
- Link to v1: https://lore.kernel.org/r/20241001-i3c_dts_assign-v1-0-6ba83dc15eb8@nxp.com
---
Frank Li (3):
i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS
i3c: master: Extend address status bit to 4 and add I3C_ADDR_SLOT_EXT_DESIRED
i3c: master: Fix dynamic address leak when 'assigned-address' is present
drivers/i3c/master.c | 82 +++++++++++++++++++++++++++++++++-------------
include/linux/i3c/master.h | 9 +++--
2 files changed, 67 insertions(+), 24 deletions(-)
---
base-commit: 77df9e4bb2224d8ffbddec04c333a9d7965dad6c
change-id: 20241001-i3c_dts_assign-d615fc33cc1d
Best regards,
---
Frank Li <Frank.Li@nxp.com>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next reply other threads:[~2024-10-08 15:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 15:18 Frank Li [this message]
2024-10-08 15:18 ` [PATCH v7 1/3] i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS Frank Li
2024-10-08 15:18 ` [PATCH v7 2/3] i3c: master: Extend address status bit to 4 and add I3C_ADDR_SLOT_EXT_DESIRED Frank Li
2024-10-16 16:09 ` Frank Li
2024-10-17 7:40 ` Miquel Raynal
2024-10-21 10:02 ` Miquel Raynal
2024-10-08 15:18 ` [PATCH v7 3/3] i3c: master: Fix dynamic address leak when 'assigned-address' is present Frank Li
2024-10-21 10:04 ` Miquel Raynal
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=20241008-i3c_dts_assign-v7-0-96ec93d1f34c@nxp.com \
--to=frank.li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=arnd@arndb.de \
--cc=bbrezillon@kernel.org \
--cc=boris.brezillon@collabora.com \
--cc=conor.culhane@silvaco.com \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=pthombar@cadence.com \
--cc=ravindra.yashvant.shinde@nxp.com \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).