Message ID | 20241001-i3c_dts_assign-v1-0-6ba83dc15eb8@nxp.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95E32CEACEC for <linux-i3c@archiver.kernel.org>; Tue, 1 Oct 2024 17:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qJDrwpKtKei0tXp+1uHxIb01VowY+PqxI6y8N7vvS5U=; b=Z6wg6QNnU3AYXB N7TaSLoNp7WGamEzy+Ocn9Vs5kUehCkhkPcFTqhmERlH0gBuRCAKH4W5o7m7MtLn9e83wa7BNpiFI OIRcAVp0UviWqkhKmVb71DqpBEykQVy3O+n3JznPEf5W3ynbQnJ9p4q2ddZvngI/X/0syz8Po24m9 t3p8di6oJuP6wkVAGgdiJpLz3+imYmYGU0xFAbQLKHiTOFPIC9rqJtFwzXOq+E4tSinFQOnMdXFYA jhmNsqUvXOD0FnT63YAEMa6/88JyIj4rE35qR/i25QnhWzhjSTGAx8jQl3k7zv94YjZI89ZryMNaj l4ttdMCx8zoc1LhHTfgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svgMt-00000003d5W-3pSw; Tue, 01 Oct 2024 17:08:59 +0000 Received: from mail-db8eur05on20600.outbound.protection.outlook.com ([2a01:111:f403:2614::600] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svgMr-00000003d3R-0WF8 for linux-i3c@lists.infradead.org; Tue, 01 Oct 2024 17:08:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QBR+tZFozV2Wr2Qd9SjuvQjyXxdrTzhbT4IeiL/CRAhL2DdB27roFeMSvnxzoTioA5DlcUms62VXbycBaE/wSM3b/T125xMH4xFP2UJZrY5/yQbjQh8BfTl6Cn/oiKz3cE3/zT8vnd51YMp+jVBnKhbAd0Sb00/9baZxA7De3zr7EPd2yyht7Ldn9HjtBPpI/2uTWqeWwY+71AyAqB9qbCMVnnU7QVm6lWgkyHExCnFqejclTP1gCIRCdx3EM5sy/IGnUw8q7Tp/ojknZt0U0eP1cHxAMDB5jo4dsRU0AbYvAyDH3RxkuT0ASItklZGjMM9az4uzUghtym6/LV0AEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Aay5jINYC5iI7kAZW+VAYpy5xHGg1bMv8Z8UFYY/6GY=; b=OkVeeaAq4p6W4ABmnAAFqCyS57hVykAK+NXUbEHn4LtibZrAKXfBb2SaLimgInojppkx45Alt+sN6w5R2c3CCThH8yumMspn05eY0MDNeOXHJAZgjHTvg7josn0e7qrhnDyUTUZ1jsRj2dq7mOCEAXRJfC3KNl7fYmrUplRFT7O6JKiYVzLg331Jr62Czi1QOb1KXZRFUk2oFnhF6HsyFKEKVfKWxpS7iALaNsuPJHrBks88hKIZ5QeM/jzSZ0sfK7IEbDPq3JNbK3QHt6yay5z3fwE5K7WCrqjRnEjOsn+oA+jU7SDrES4TSy+ORdSYPEN2XhMT4DDgw2S3EwAqTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Aay5jINYC5iI7kAZW+VAYpy5xHGg1bMv8Z8UFYY/6GY=; b=F0x3G7UaB/EKgOPXwx5tiiaqQWqlExCZxeOGbbfUDUYmDZ94O3u71FnmrD1ui4Q6/sYdeoh6eMQgy8FZ0+YW7BeKXmMhN6q4USJuNqDnE8OQYiPLLCYFKTxyXsbK6jNP+zOVvTHp8ouwLpQmU/sguylMcQ9HB/MOkvhf0a3494cfTjMT1fcvLss1yndT9poksjxbISbw/CQVWjM2cXLZjVl7hWHaHcqGoRKskVK+sSLwDqb+5yn/gnKOfwF1aFrYndLHRPmZ4JRvV7UBAx7WvrSBlptd04LwzBqdpopR71I2fbrjnAJbCsD92frGrmWDo7y+jrcf4TZSzVaNQHzspQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PA4PR04MB9710.eurprd04.prod.outlook.com (2603:10a6:102:268::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15; Tue, 1 Oct 2024 17:08:49 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8005.024; Tue, 1 Oct 2024 17:08:49 +0000 From: Frank Li <Frank.Li@nxp.com> Subject: [PATCH 0/3] I3C: master: fix the address assign issue if assign-address is exist in dts Date: Tue, 01 Oct 2024 13:08:19 -0400 Message-Id: <20241001-i3c_dts_assign-v1-0-6ba83dc15eb8@nxp.com> X-B4-Tracking: v=1; b=H4sIAIMs/GYC/x3MMQqAMAxA0atIZguNVQevIiIljZqlSiMilN7d4 viG/zMoJ2GFqcmQ+BGVM1Zg2wAdPu5sJFRDZ7serUUjjtZw6+pVZY8mjDhs5BwRBqjRlXiT9x/ OSykfdnHfX2AAAAA= 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 X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1727802526; l=2712; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=LTE5ego0SeLYowWBP7tV0c5GAHBDraD1MgZKK4UYgJg=; b=codmkhwH0jS5jJVcDN0BerUYEf0uSm4Guowl22bRKPicXqpnF5Wso1Ry4Veg07yOwy4UFO512 6cIsaagZL+KCayGv/GWyeGA1pfMipWlNsM43SL+Eag5G+JdggVg1N8c X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0007.namprd03.prod.outlook.com (2603:10b6:a03:33a::12) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PA4PR04MB9710:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ea9a791-60c7-4cad-c77b-08dce23bb7ce X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?MNIrvVdoX464Uw5fqEn8V5+qWtlYfPz?= =?utf-8?q?W3rXWfDwmSNz2wzQs5+1UdPEdiLtycuT1ijdbEXvo2TZ3uedjX6I23IUzYP0dGI9Y?= =?utf-8?q?mV7Q40AiPgq+YgBdAqQdZ1jWvxfShWIkPPyhyjR3t5hWghmFLSsMcCjSjHD3kD6SQ?= =?utf-8?q?mBoh+g8lPL7Q2RIwQFaYYidLY5ug206vZwMhid98coi1xv+JklF34EN184N4sUAqm?= =?utf-8?q?nS5Y/tSbIheprjl6f9OqHpz0Skt4WGp4YYe1m9EgnX3pLm1h8QAM+F/SbjJ7Lwh4S?= =?utf-8?q?PZKZnv0Wlc7VbNBez1HvB9cFSy9KoRSTA9vaq0sl7oxSuxnDWAsNX6tgc3zdENG6H?= =?utf-8?q?+6tRZXrH7cDvvt+Bd09GkYTF05dzXxy9eq0yi2g5jv8VtFwZ5yQPnPg5d+wz54S3D?= =?utf-8?q?7DYYQMKDmNNjZy7jZOkPtnvoPxYBNsyDDGYU9w2bYE8tPqZ0Ace+Oaura0eRTK52U?= =?utf-8?q?DocfwhS/AA5e2fmnFS3ViXFkQDYxOaLz5zcz1y9rvs6x0uQ1zCeF+rEOs0AMBVQcg?= =?utf-8?q?LrRR4fseLrXKi6Zm7yxftDrwJaRiQG99a2Z8MqRoCYSWAj47N7pby3ZOjKr5WCrld?= =?utf-8?q?208/KVYwxtFCUmUjpzqn+HE62JdYbnTGVmQIuMNT8CyQlA29+DVISgmEYrUJEN8bW?= =?utf-8?q?mi8LEqa2iNFCA6IJ3rAVqNgnSp9wA247E8tTdU4neisseg8nelMTqWXFWp6MtS2x8?= =?utf-8?q?ctPEMh7M8NIVehtOyFqR8JPpFsD2HE6NLQUo8GJlwGWy4LJLFhvup/ViIlWKnIgnu?= =?utf-8?q?9WEcKaR4ota6R6vyM5CJ+NGEBwgwzJnmqkiNNolosXAM3+L51HxqaHDOXR7917j8g?= =?utf-8?q?HfxPWc1A1JzAoZY/37D5v5kfTEaNbOw+LpggUuLMAMzXEhZ0gfeQzjKdT+bvBioxI?= =?utf-8?q?Wx+v9hklW/9XoPFR/Hwk1C5ZWgVH5NXxcuNcChMyndHoHjYsMUa57i1pt5W6YxOeT?= =?utf-8?q?5a73FqCZhYsaL2LZJL+48QhLUBKWkHtaT5xtBzWsx3oXFdfaZEc2Ekci3nlzcEfwa?= =?utf-8?q?Gauy/uCbL0oSthHL+YXj0EqWbk/OCYrlSqktoTilOxkjtNt3qAZI8wvIAJxC5kXLk?= =?utf-8?q?LA+gkxGf+J61z7wszM7qO6BUYVrnyKt+FQX+BbmATHC9Q5TpRsIHMw42k2yDJZD+H?= =?utf-8?q?YtuwqjaCPdfDCgLYCdGziMBWQlzx6SEZ7wUjBwp7QwJFM3FonUPDN3RbpWJHDN7Hj?= =?utf-8?q?HmDHs1XsEixyGQAyzv1Gbee7BtMjRXESzrCQpyc7hOV7bwvoNp4ZNMFzRWmymdqFj?= =?utf-8?q?YP8NrGAwj+VjtsgLfz0A47vFny8/qibsBEW6078E0ZJAKJ5tuSxG3/489eWlhgn52?= =?utf-8?q?5oOdRsINEuTMwvap/eHpQGcFiYK0lMveng=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?68SVqVD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C4T3arfigo0c5cXtmSlE?= =?utf-8?q?i9I540kAn9IOEMOHHcTdf/qVEnfdNJdESKVntzsbU6xEZ4TIGeGM0d23wlKdeL7OW?= =?utf-8?q?xNbq5UWg0MXAVvrjaiH6gT54dBKjCUo4Fg0+HVLqR5fn1AsxzLB1MJ2TWXyjgv2wD?= =?utf-8?q?Wz2s1kgJJA32+Okt2Omy57oUBkvWYDsrhfwvauKTJ0BevzxpVI3Vz/i4wYUuqOYhl?= =?utf-8?q?VqN8i/n+abS0TPqs1KqP+uKNzJZjtxCVzHwfvm2G8yApmubAeY9+7MWu3yuOhsYHM?= =?utf-8?q?ix1YwTn3smhQtbUfpbAXT7h+PU/ABllxzbeklyPxgHRipUoE5eI8hRH9X0zKItz/r?= =?utf-8?q?R1R77ZT2g/WEVxnN85GLZrdDkTvjc+SmhinV+jUBLlet2RQ4idAP4NDENmYjLgzjO?= =?utf-8?q?PIjDYEJ2lpc2bMst215oGPKgcbr5FzGysKWAh+RMLYz3YbLIL+5PAnL7BdcVpfoOM?= =?utf-8?q?/YpbMaUYk/K9ynPJLgjeUHMhlmfr03MGwfkpEX4/V64j2M6vGt1rawx2T6C+T5eja?= =?utf-8?q?+1TuhTaLjZha5e4q5rPPl8u0xO/BmtS7YM37qr5VzLuwTnh+RLshCI73BSpUTYN2C?= =?utf-8?q?mbkRz+heR3/atfMKhTgKEel1h607EpWjN7jnGm7m+JTN+zfFHGCZjPmKi97ppNoAi?= =?utf-8?q?wPJFfRBEdd+p?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ea9a791-60c7-4cad-c77b-08dce23bb7ce X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2024 17:08:49.5302 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mkAeZaOqZfiqf+wnwDv9OIGhlKmYnY3ImxRPJKD90OmNy7ND96KTfYctj3sZII1DDIw1IdcRN3JRWMjJU5IVJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9710 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241001_100857_334240_9D610F04 X-CRM114-Status: GOOD ( 11.10 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-i3c.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-i3c>, <mailto:linux-i3c-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-i3c/> List-Post: <mailto:linux-i3c@lists.infradead.org> List-Help: <mailto:linux-i3c-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-i3c>, <mailto:linux-i3c-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-i3c" <linux-i3c-bounces@lists.infradead.org> Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org |
Series |
I3C: master: fix the address assign issue if assign-address is exist in dts
|
expand
|
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> --- 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_INIT i3c: master: Fix dynamic address leak when 'assigned-address' is present drivers/i3c/master.c | 85 +++++++++++++++++++++++++++++++++++----------- include/linux/i3c/master.h | 9 +++-- 2 files changed, 72 insertions(+), 22 deletions(-) --- base-commit: 77df9e4bb2224d8ffbddec04c333a9d7965dad6c change-id: 20241001-i3c_dts_assign-d615fc33cc1d Best regards, --- Frank Li <Frank.Li@nxp.com>