Message ID | 20240829-i3c_fix-v4-11-ebcbd5efceba@nxp.com (mailing list archive) |
---|---|
State | Superseded |
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 40AD1CA0EC3 for <linux-i3c@archiver.kernel.org>; Thu, 29 Aug 2024 21:15:33 +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:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=S1bauCkCsy2z0AP0N3wc5zm+U9Kl/JCiIge+V5PJNlA=; b=Ij1XqaPzISS34XwrhR+4Xh+Zme CIc4g6HU5upPJy8CATl033Ev0mOhgyRAUaE/yjaLf/kh3wkQ8mnYZvsqrzW24f8eNvDl/6vEd819j soHMVU7D+GW8eS9414ljYvJwzW04F3ZV4NWqyXiITVkp+0C3/lmE5wSu8f3ZYwzQIh5cx1BKFb2gi rBCdAhTwerDqKBBROeX800KE3uujTi5b3nFw6RSvZg5B6o7q8vJIYIo9/knM+5D3+/H81vCKvCGVX 8oN17PKdDnJGSq2Mf4PsF9PzV3IhDxWaJIKxUPp+HeBdcjOuexP/fv3Cx10AJLjaDoj+HU1/3gdlC YAXHv8Og==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjmUO-00000003f4T-3ez6; Thu, 29 Aug 2024 21:15:32 +0000 Received: from mail-northeuropeazlp170120003.outbound.protection.outlook.com ([2a01:111:f403:c200::3] helo=DU2PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjmUL-00000003f2f-2oAY for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 21:15:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZwxaHeP3MN9BaWjLwO61fPQMynQEQKOlRf8rRmHosmxtWF2oudyvDE+WcOEbjjDpQ7PGi4AZrDiGrAxiC0PZc2vwDkdolFhR09f0KbcUBSNIuih8yK4f4x2ssarA0w9v57oHM3SPZLDIcEvr56apXMyW3OwUOcxFLGHpQ2j7fWQUl4IA9sQ7ux4DOtDhbk5lXabMOMV35Tk7nvOE6Z21pia0WFbZy8hF9Vh8Y2wWi4Tqzsr+B5EsVBjMsZ4GhnN6Cc4Mq43BiEHql5AhA6iHDByFbb6QOAkM48vzqUiqtpXRpFQs4hyIFbr4lTx4IHAKC2rmIEAqh3W81hKx24jDtg== 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=l+wM5XFFRbRdoH83tWAzH9EHEDGwXzNFWdNBvKh93EY=; b=sAxTnOIR0/Tc0Abp/IDfQI4nYm4eVEZl+oHhkQAUCB5xQ2BFBuI0osMScw90ppBigPtDb0doav1bYchbsxO2KI90zTn5RgPEdVhrtMAX9K0SN9czlGJiDESSc7zby7kBb34Ojhb6XszdQZbGsZdxupdGvwWAfdr3wYDZmSkG5ye8L5+4fzux9e8P1XvXqYVlOFt7Wnzw/i/2+QzHCzD48FdlJ2hT4gUUEjWq2gOtESio68NIJqX7IC9K293D88UyS4Qo9mg5EzixDWbjxsiOzusEuJGsBXOwovJyAPtU1pCNOc8EHjYxbqlHbg14qO4Tnjf2VGmO1hHk2j0ZWdHc9A== 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=l+wM5XFFRbRdoH83tWAzH9EHEDGwXzNFWdNBvKh93EY=; b=Eyn0RUq59+ydzykMiopNsweBdpst1oMq5T/MQKL46/pDnEcfx7w2MR0I/9NHu+bhkDc0iruNTwRyZZ5+QGq8qcVh19fRqxfA84Sjq7jxdyD7JPkD/eLrIJvTWuKPjvEicy+dy3KlEbJ+1AtJ0OULS7dTbzLtWhHpRVI6pBdITrHsMDGqc2eIADfDpmRHNMgDC1S7lA6JaZ9eCCUUBZqxOD48le7B8u20i09cu7EZCLLFerpGBZM+CYdMBmP95GY/Qr+Ff4x9cHtJDmvcClA9UCBHlzBKWBxrmgRCA2prWM6W1tmFnoUXOOzVkmNwqcHKdfEvTxcJ6CkK0bJFfGTw0Q== 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 AM9PR04MB8971.eurprd04.prod.outlook.com (2603:10a6:20b:40a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Thu, 29 Aug 2024 21:15:21 +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.7897.027; Thu, 29 Aug 2024 21:15:21 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Thu, 29 Aug 2024 17:14:08 -0400 Subject: [PATCH v4 11/11] i3c: master: svc: fix possible assignment of the same address to two devices Message-Id: <20240829-i3c_fix-v4-11-ebcbd5efceba@nxp.com> References: <20240829-i3c_fix-v4-0-ebcbd5efceba@nxp.com> In-Reply-To: <20240829-i3c_fix-v4-0-ebcbd5efceba@nxp.com> To: Alexandre Belloni <alexandre.belloni@bootlin.com>, Boris Brezillon <boris.brezillon@collabora.com>, Parshuram Thombare <pthombar@cadence.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Boris Brezillon <bbrezillon@kernel.org>, Arnd Bergmann <arnd@arndb.de>, Miquel Raynal <miquel.raynal@bootlin.com>, Conor Culhane <conor.culhane@silvaco.com> Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, 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=1724966083; l=3184; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=AHcqgly/vmoU+jJ+4HNr0fpgvCz9aPVFw5NId2LgYsM=; b=0VnkJGxAJrsl06sm4Q7m0MJStVDIHL9X8VwXMfWEyiHZdMs19KXgj9cBZzvu/mZoO7o/agbna XxpkRjLB24PBzgJjoLbfBoLT7OIc77CR44IMpbqnnM3g7Vectva8HmV X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0219.namprd13.prod.outlook.com (2603:10b6:a03:2c1::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AM9PR04MB8971:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a6b77b2-82e0-44f9-a876-08dcc86fb119 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|1800799024|52116014|7416014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?CzncPul0yZP67tcmXqiDSkGZ4q4HPRY?= =?utf-8?q?mEwtYTFt9+J1krLHsSKQpQXs3GnvTmBaC+kkAGWXAiYWPXUZaNCsj76u3pKEKbJ3Z?= =?utf-8?q?3aLo4nhvJh/2zUU5TA145Lu1ffeBGhpgUzT67ewhOLD5npcbYP5vIKHN4ObCaw9Oo?= =?utf-8?q?AUkv6CdUVQGvhypjyza6bjdQgMMH0fOOW2zMfVL271hpOdDlgRoA5tR2yp1NhZ85j?= =?utf-8?q?LyXYBFfc1bb3SKDZuvvx5Ly+ODujidI7mlhiWj7KznjBt5xVZqYhQqV3YJGAvNo+4?= =?utf-8?q?NDLo8d4FFzU2aK3HSsHvevC1zILix3US1BYvy1knsbcszeZQLdQx7kVFIqmhFw5NQ?= =?utf-8?q?GvXX0pBS1KoNRxRtO6KylvZyTMDhoalDfRchZ+KwDorZ7i792DX8rXLJi7AaLVFXU?= =?utf-8?q?Ww5xT5oorrU84H0Ar9fkCLmnRxjg7Fd93jeOTdU9hhoFUTv1ISG8s8x/R0egScONl?= =?utf-8?q?cNKhMgD4WnxLPrcxjvcwtmTxwGMNEKbiueEDdQfLGD/po5BGLoQIzvLeoNVGMTMYL?= =?utf-8?q?YqtSsnW1EetRKHnHMNYzI0vJAgrLtvD5/+Tb6FFSmJ7MA0+wKThZGMdj5tdYWMtgG?= =?utf-8?q?Hgsi2/bcaYmFNy8+F2bm16mJ+kqfGL9TF8lfeOiMn+n/NwU/O3C/V6r2znmiFfCcz?= =?utf-8?q?ODNEHrjYeypm/1daiozCKh/RPNduW76K5pHuQ97C+QFFnw8FB67KQhWWeIgkPZiE+?= =?utf-8?q?JBfBRsNCtNNyYmQ9+6dvpVj9ffLn660/GhNqD3OQEeiIzOUsO2x+Bz3+D3UQ0jm4s?= =?utf-8?q?O0znm0pLfUHeyr92VNCWEkG7sV94La2NZyg/msY+fZN7HeyA8XgTRLtrb490ydxai?= =?utf-8?q?EA/uic3RTxXc7IdgG6MBZ84XELsQyXXu71uLiF9dQfPIhWohVpeU2UIvWzc1qKPzC?= =?utf-8?q?VGJF5UZUqdbfvQiJJl9UHpb0YuqoJ0CgsOO5MDzoqJX2tx6BOKPhexquw1X4YJS40?= =?utf-8?q?mzg28MScne2H9QBHVgxrmTZfHmGhEpNlSs3j8k6OjD4bSp5FI1UvyD6CHatGPw8o5?= =?utf-8?q?Rr2sdS0KOyM4S+FVLRKbWLifAtLpwglNrDBvb/NF7CpD0rIsYzVTlZsAqmQgWO1KZ?= =?utf-8?q?TISe44NgrDF+OixPy67yLAd41A9YNUR5bPykJUR9xT4/yOYSCfVWMEfWGxQ17Hnuw?= =?utf-8?q?gsHSyr0nrT76r5fnzkwF1cAihv5Jcoymp6YSdoyYREF47QRzU7/x4NE17CNtsFm25?= =?utf-8?q?f5I8aoUV7Dtst1fr+xMukk0WGtevdN1n3IY3c4etnXq6WqlwcDwZPx8zXOIc40QYK?= =?utf-8?q?rtlHK/hAhRrXGE3T4k4eefk78gVYIuG1dGsBYoATQmTp0QZj0X+7lTwmDVjyxiTGE?= =?utf-8?q?I/xyFttxIYscDbFSwdGw0VTRBH7O6tsKeg=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)(1800799024)(52116014)(7416014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?e5Mi46ZuIVg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8kknjV4c9LoNVI/sBRYpgRW2YQ?= =?utf-8?q?07ig5bg5ZEC8jbXz7sg+TlknHshBitV6aAXR2XE5IUBRleun1MJ6fF+d0cX62i9Qx?= =?utf-8?q?9JS3kP3JpK/g7wiwadOFYzeehbyVTqmDmOdpbcTjtxJBvcLlC/UKhy10NKLZx7b2p?= =?utf-8?q?vgsQ5qMYNM1nGLLq6Em1jiYSDXPyhdXgzs0xt729l2yJ6/NT593Gpe6JKY0f4Siim?= =?utf-8?q?oxESaSlbX/mv/OU/Q75rG84NFI81B+7Jh7xKnz9WUX5HL2auixSn2JAemFEYRiP0y?= =?utf-8?q?PlVfYrNo//i2n45j4jOrPeHyud3LK4ksB0YfYiCdXNbm9UuSkGnUlBm75QbhQAZAC?= =?utf-8?q?mk2cfFCRkurTkZ4shzrPtybnS8McNkqTee4k+rVD3+zZOfzS6/IRfDwmSdbaXXydj?= =?utf-8?q?yQfUMwZBOZ69jB9YmuLDfITFN/FbK+zbzYjovT3Dvat3E8tbH+40k2ZQuUec5i6Q7?= =?utf-8?q?7HhJPIyZBIs4a767z2/yOeJRtMJlkTUHTxtBMQynWdeXFRcac6nIelftsA7N/cxZ9?= =?utf-8?q?iEQG//XrGcZV1LyoybYHIGHHsZ7dGpZvmoL1Gimhb3NYBIu/czvw4uZRD9YAxlEsK?= =?utf-8?q?6yNKI3IbgXLgRvoSybk6chKgTRseEgoD/czce69rd8pwlx3qSB5/a50oUXWiriox5?= =?utf-8?q?AQStUOhCk1OY?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a6b77b2-82e0-44f9-a876-08dcc86fb119 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 21:15:21.9011 (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: dQk4Ej28I1weAx7kZza93Ulc0FGfZTaPPfh+f2m/0wC64762D/vT5la70piuHZ9hNO/hcsJSet30MpGBDitU6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8971 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_141529_753476_E10EE6B9 X-CRM114-Status: GOOD ( 16.22 ) 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: some fix and improvemnt for hotjoin
|
expand
|
diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 83b2943074866..a520f5482b592 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -1039,12 +1039,27 @@ static int svc_i3c_master_do_daa(struct i3c_master_controller *m) if (ret) goto rpm_out; - /* Register all devices who participated to the core */ - for (i = 0; i < dev_nb; i++) { - ret = i3c_master_add_i3c_dev_locked(m, addrs[i]); - if (ret) - goto rpm_out; - } + /* + * Register all devices who participated to the core + * + * If two devices (A and B) are detected in DAA and address 0xa is assigned to + * device A and 0xb to device B, a failure in i3c_master_add_i3c_dev_locked() + * for device A (addr: 0xa) could prevent device B (addr: 0xb) from being + * registered on the bus. The I3C stack might still consider 0xb a free + * address. If a subsequent Hotjoin occurs, 0xb might be assigned to Device A, + * causing both devices A and B to use the same address 0xb, violating the I3C + * specification. + * + * The return value for i3c_master_add_i3c_dev_locked() should not be checked + * because subsequent steps will scan the entire I3C bus, independent of + * whether i3c_master_add_i3c_dev_locked() returns success. + * + * If device A registration fails, there is still a chance to register device + * B. i3c_master_add_i3c_dev_locked() can reset DAA if a failure occurs while + * retrieving device information. + */ + for (i = 0; i < dev_nb; i++) + i3c_master_add_i3c_dev_locked(m, addrs[i]); /* Configure IBI auto-rules */ ret = svc_i3c_update_ibirules(master);