Message ID | 20241008-i3c_dts_assign-v7-0-96ec93d1f34c@nxp.com (mailing list archive) |
---|---|
Headers | show
Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013046.outbound.protection.outlook.com [52.101.67.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A99A1E00B9 for <imx@lists.linux.dev>; Tue, 8 Oct 2024 15:18:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728400732; cv=fail; b=kuSllYnvXCsQKmCZvJBb2UmO3SxDLBwXQ4etFtB5t6haItrnva1Y/ooxRMsRBY3qyQz2BNOoUGL66OVQEKUNuAbW8e/qE4MT14ITq1j7J3HOgb8IeEjG0o0B4ft/IdJv4+Bva49mrj5+b8MHSm32hAkVmp53hha5eWXLzZjU8LY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728400732; c=relaxed/simple; bh=+7QPBxnwt2V1GG1U4yxNLheJGHw+eSP4zpbWKxI6V/s=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=fO8N+n407r1NLkNGIsAr20pvicR+Ri2vKrThC3E2jH2Y/7Ij3yNNh5ynLot/BlfAgdGg/Z6A5+gPYRs9KcHr6eUf7GUQ4GrLBH6PVdJARpy/PeaPS4jxtL1G65p5di/1tGMEGnMb6S/o6LPP3PbUhTzYrLQjv8x5Ft6mFY+1WBg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=OxIr73tJ; arc=fail smtp.client-ip=52.101.67.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="OxIr73tJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l59dPJYO4wcJ/RehDy/7mGd+9FhyXAkZjpzagxtxgtGL2Fc/h4eW/ACwuktz6SDwEMfpCrNPaS6Yeh2i2n4fJwlwqLWakTaqSPcXwyHzTK+APQMIluC+SncSAZE+lgdtkjGlm1mDOwRYdYdM0k+zHiUw9olebvQ5iaJUB8JtnjJzhDN83pUn0y48pjXM/Sh0wDCf4dA+Y8uQ5NpihDTpmIIQTeYmiliTqFAOyptY4V7DcQuwYb4xzcOUIDrb9BSRIkk/dGs0E2rKhITHayKuuacSWgHwPkVSRUqtlMeUt81qaPWhr+kOpjrsNecTrKYdjt8XCNHis4luHL84Mzxo1Q== 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=7fAfl3zyO+Nj+cRlreqeSBYK06jwDw1fGqD5/PIkPSE=; b=wsLy41OJx14hzMU4zyuqWZ9wsrBAoxuPdvBSKiCI57z/6yo/cq46ji8Kaw1LYfA5SNxVpdFTc0JsjJQhWIHqJRil1T44WA2qcgppVwl0WgF5Sxc0rSKXIDvo2II1MBzwfEXAn+oNsCo3uDPJg3LwZMVcm6xg++FGi8SKNmZmYHL7fwEkhc18SDL7gb1aNMM/BoWgbJh9w8Ziutu3oCCmNmWGrXSreECzy9oHTwtSdEYJ6ryKnRLFBt9YQ97Mv3CT9GX43+XRhJVF0KD35GWl4nrXgIMiL/Rd3nkl8CNZNsAoY55ekD82va+M9twG8fBxVNoJSsWC1q31c84cGA7S9g== 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=7fAfl3zyO+Nj+cRlreqeSBYK06jwDw1fGqD5/PIkPSE=; b=OxIr73tJikAyD9i944SZhHCF9mlRLpaXGZsdvRF5ttGckeevfWxGRFkarKXxJ8MrjWCDtxw5n7CTLwcmQ8qhxyAYK7w9m4XUzQSs+a5sGF1nVQMCLW3Q86ya1hmQSwX89pjrHFzr6w/p4YcXNx/Nz136yF5I472MmsJytbUDbER2Q9AhWFxFDp5v7F1xqioF8wFekbu4MtrtY9p3dhUHNWvWXi8xHszyhUe4WHv1f2Oij+rRwA22GU01nGga2tn8Mc0tOEDuux6uaxswyQZ8vg1J7CNy83piZQIkbFJNqPyx1Ub1ICEYaIG/Nq0CNrD5/ZgINEO+ohRbgKfZGvJchg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) by DB8PR04MB7194.eurprd04.prod.outlook.com (2603:10a6:10:127::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 15:18:44 +0000 Received: from DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d]) by DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d%3]) with mapi id 15.20.8026.019; Tue, 8 Oct 2024 15:18:43 +0000 From: Frank Li <Frank.Li@nxp.com> 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 Message-Id: <20241008-i3c_dts_assign-v7-0-96ec93d1f34c@nxp.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAD9NBWcC/3XMSw6CMBSF4a2Yjq3pQyo4ch/GkHJ7gTuwkJY0G MLeLUw0MQ7PSb5/YREDYWTXw8ICJoo0+DwuxwOD3voOObm8mRLqLIWQnDTUboq1jZE6z52RRQt aA0jHMhoDtjTvwfsj757iNITX3k9ye/+mkuSCm8aW2oEssClvfh5PMDzZFkrmG+sfbDJGi6owF VQK7Aev6/oGpO4kKucAAAA= 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=1728400720; l=2974; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=+7QPBxnwt2V1GG1U4yxNLheJGHw+eSP4zpbWKxI6V/s=; b=eoYRNB1Esyjox7DTHyU0EI632GB0WoN/RnXDofnGr9T5O3q6X8ew1NdpHwoOfiqpoSco48xlC ZkhCi4i1rYdBLC5NkCUYO3Dc+NpF3mqIBvCbtQmQ4XSfn3TJjfRg0Bj X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR11CA0101.namprd11.prod.outlook.com (2603:10b6:a03:f4::42) To DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: <imx.lists.linux.dev> List-Subscribe: <mailto:imx+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:imx+unsubscribe@lists.linux.dev> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9626:EE_|DB8PR04MB7194:EE_ X-MS-Office365-Filtering-Correlation-Id: 59aa9827-6555-4764-273f-08dce7ac7f64 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|1800799024|52116014|376014|7416014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?GOdU4fbr3AkZ14HS56Tyuk/zSZA4CIm?= =?utf-8?q?PzHKAxrkPwqJcf7ZXP4/m8eHFFSdWw/MHYYEeqfe1tAk/YeJcMie4JLE+A4C6jkhp?= =?utf-8?q?l8d7aHhgvFkpb9oy/qtLJyNc/8SstTzg/dBFULSddPRRiH1weUXu8bVXLOJ1hR247?= =?utf-8?q?Hw9JwYme0u39Gy/YrPuOhagOcc3W27XHg1uCw9K0lytXqDvMZLVJEujY3Pf21F2qL?= =?utf-8?q?lzSSazY+qUqEk123sAnLi8r046ZyLS3Kb3R5C6ouOlUwtG02Dc6nqllpORDBHBNpc?= =?utf-8?q?qcA6/MDTLF7Rnn7s0btNAQV+cpZmDHavvgvjPQRdFZji8TkaT4IReFrWbrvWP01Ge?= =?utf-8?q?pYW1pX+wDqy+LexZPCEX2bBY7nkTwfuStqZeFmcrVLp9OCrgy6wR1g0YT9/de2GjM?= =?utf-8?q?ObFdaAFYzDeCQuWlt9cDvcDsjATGneU+PWRRhnyNEQXJ5frHUiBV/AkBB0GP1Do14?= =?utf-8?q?llA10bMX3ALCQ7YfWSOv1q035KrT0CoRuPfl7SPiZdHGyzaT8c7ujmkWH/w8jZA6n?= =?utf-8?q?pYoJxYBV4NyVdGb9cErfHBL+YZzEoHlNDrHluNuBzJjke3+IU/nI2raUXzwlyiZTw?= =?utf-8?q?vg9GxTKbNViyuf/EZ3RrWlJ0v8rXXuy/Sbkxd+6L1mw9GsXwbf0gENaFrOr535Qm9?= =?utf-8?q?JLg3qLM/oP9WYlvp1ShyJ2LzIIVWVr0n2b/rtjsV7oozMsekLCPRdQrPqnPk0B2nY?= =?utf-8?q?W9aNiOlebv3eSCpNWxvSUQde93UfxhwxAO1NIwdfiBzV14KqsEVmKHDsC0kf6vty7?= =?utf-8?q?5uGiSDfAfpfrtdmTnNK6OCCIEWB0nD49+746+9CBQab7PIqE/hV4JmTyzktPlvPG3?= =?utf-8?q?Ni+747Z76D1r3cryzABn2PlC7TdO9K6VLZuf3kdfb1uxjVUvkSa2EXSwTB4DRYWZu?= =?utf-8?q?iSusSl6hzRBO7NpKudBLn9U9XvYj5YugaujdJi4xj4g/G4gHSMwuwjgNTrx3/1jjs?= =?utf-8?q?BejQGZjYVBLj+FNW10prkPc9BnITYOg9dzn1/klpBg6QDe+9erLx5hWRVF7UL9xGc?= =?utf-8?q?pTyBqtoBBa1+7V78JeWhnYinpnnlBfY4p938unyCirZv6IAYvrzhxoFO6Ns2j/3ID?= =?utf-8?q?oDdo7Z46Uj75lV7twzKXsxvB5DLkLbcNU1sqVZyNrT2o3QwynpMHxnGunHwWfgzvi?= =?utf-8?q?c9cCI/xqF+X3SpnAXq4Rs6YZapAqG6XBG0Jwe/GRRt2TZd4nZraQ3FZARlWEAO2fg?= =?utf-8?q?MyHxF82wzYAqBqSfV0tKl8mKXQNGJv+6kQ3wL2LFRaZrEAPhUlL/Yqit4dyJEZlQl?= =?utf-8?q?vZz5FhpQxdnnmCF9SrPbfabs4U2ilTV47MQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9626.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(7416014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-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MwbsE7/n7unQgG?= =?utf-8?q?XD6QNNMr4zK0A+eh71+ekR0Mfg2eXTlWXs3taMs1/l6g9ROMzWSQq50uiyaZiNEod?= =?utf-8?q?Jj2XG3Q3KBbsHjYMbCarXvTKQBWn0kj7baiV13wmnMTG0OgMgTfXp3Q+IrjKY6DXO?= =?utf-8?q?krwtM9M/kTWOB3/V0ZTpxcRjADYio5b7gVGHvBQvw/AvTaDylmL7BHUJGZ3/sw38k?= =?utf-8?q?JKCPUuvZK6bsps4FfJ9DL0um/lR0JINWV/uuezIt9BAMtmg0S4Ye0EpQ5Tkjqjism?= =?utf-8?q?fJ4kMTTG+nWBdj2xbZnGw8gXwMdJmaTKr35dPArMZ4GgJFTDnEfzZVcDtnFuDGsk8?= =?utf-8?q?P7ahwdxYg9LtUmmHgC9Dj4isZ4magmC/XtcuaGsa0HcBmxLjW5IQ83OZ7P2onxDrx?= =?utf-8?q?gLobCRIdtfdYKxfZbCP3n1SOJ7mPpuMnbDquC6MB3gkwS+PohRGbjIzPqYq+8n/Gj?= =?utf-8?q?T4I0Ql2xMvGR9aNzUndhwiMue3ALhpbp/QCEe8400cqjdUzWreld4B7WDQewlswdY?= =?utf-8?q?gZ6PZXsRLBTdlTJ3dHWEVtccL3y0csi63T/6+ug7cNZuZZR1SI/g9Wij7Lxq+C3cv?= =?utf-8?q?55ipnE4tAD2aHHxQtTfihMpWmoZHxbanReqHxhpfimqqkhtU29RyAPH53VZYkzd+m?= =?utf-8?q?X//mBrI8uTG9KrpwPjIMBNCs38vj/ukCOO9mIx11f4JgETXaVbGUVZ3g=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59aa9827-6555-4764-273f-08dce7ac7f64 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9626.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 15:18:43.8663 (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: //83gv1Nn3sNC2jbEIw6SOWxFfTOc/G71adzeDPXeqC2QuGHnfOmEePKi1GPOimaaQcsiXCsvlSizlbcccX+dQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7194 |
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> --- 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>