Message ID | 20240819-i3c_fix-v3-4-7d69f7b0a05e@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 CD640C52D7C for <linux-i3c@archiver.kernel.org>; Mon, 19 Aug 2024 16:03:20 +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=7AI6/H7SBpYEXJZDstCYiDrkAz7aOHj8mZS6LynlF9g=; b=OUKx5QX8CioOuV3RtC34UViK4y /VyYM7tbrpK4muWtD8bTZXvw8e08O46ntV62kwj1lze9Q+t2/te9LkaVf9qvHLimcyQtaFD+m+cXR PKbvVSJZ9TmBaYPlFxfd6QXFdM/3CWize0VA/SO706dwr684TTKmwfZPRDCcvEZW8Yg/79h2/74bQ eGAAhih8wNI7JflItaagR2BzFGQ2p8otQ0qdGT/wLJaPzrJTkpOfX03qVunKdoqz+jGw8aCwKEpo9 c5Z1IHGWFEH6tqvRh0IbW5pX/CGZzQ3icVZFn266drNxuJO+606s+wmXtESZxXGRT+aJZw7H0/0tg 18uN1+SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg4qm-000000024hy-2L98; Mon, 19 Aug 2024 16:03:20 +0000 Received: from mail-westeuropeazlp170100000.outbound.protection.outlook.com ([2a01:111:f403:c201::] helo=AM0PR83CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg4q0-000000024DK-32c2 for linux-i3c@lists.infradead.org; Mon, 19 Aug 2024 16:02:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jSMUQs/raDWipPcsG5zENM1+XzHEOPakEVYgvVkjWb8g5OWUMfPZFUxodW2aBecBYYqZ+OiPJJl2WS5BGRGnosdyAmwAM+oSBAPOTxpM3sURDGEgUAnivGQCGW6/x1EBqkWOH9PIXoL4ggUEepNKCOB4Bk/4I+xsmrsl8woo/5+VEBFSfSfpCSKdNaefQgMzIA1W/JAoyVjjapj5P1gdkMjTXMJoPQed4NNDPYQvDXqhSWDBI5wdJWdUovLNn2itQHEOkYTEPxB5Em9qmup8BydV0+yhhs+l7mNtz71MlLbayy2JehxQ+ZY47WwGV/bsF43NJB//tTIiQ6rKzuXANg== 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=khB9K849nl/MU67dxO7G2LRxt5J+Bs0EnkTKFa+J0gI=; b=YXcsPCgaDbznlWHD/b642IHS0YFq4IgGhYPg/l/3k6Fpo7++sST45juLRFfpSSh9IaGPWIS58SM4zBHq9IdSSB9QXXZEH/WrD+W4NKWf4T3jka5x7zgF3rpSS6K9QUOlIVuzREVQml6YTHE7LpcM22FKseRrXniHYwU9yuhCQz+oDOrBg4C8VzKU7uLuy6fpyeRgbEtHOTapBujRDAE60EN5tIObTu0BN80kLKb+vb6IQS8jOlwxIIT2QE5IUncjruWE5kIqTGGYj2Bh2fj3cjAB2SgcnBpZgj3UNmrvisuFznGGg1129BWdYx9vZWg62fP5vod5rJRXJ/sCJbyxKw== 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=khB9K849nl/MU67dxO7G2LRxt5J+Bs0EnkTKFa+J0gI=; b=VT9wjUSVSwuWc92TMteATOOB4zdN/JK0idyf70hN4GoAdV/wKdVUMiagZnmKhNB10NHM5v8O5PvWfIOYmQgf3JsoKaBlWafL2EMZ+FM3AbFYqI1mG0+/ckCl+geiyGyuh2qqMEt/0pd95P+gqZ+6N/nvLyLR7PpR+D5P0XxbBJf6qIADmj0m/VvniutllUlCjfStAeQSuxmKq8pWmj6ZxDGCSNMxxBbz8/idCDG1mQ1Dz9Q+hIao/hOT4RQFrzajRkFx2ZWmncI8l8R/tdN8ikxRKuf/lIxhrgYQH7DJ+Lgv4X0iBW3olUcsYmdVGf9YSoFC8hDrpXjnBfqYdjtCpw== 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 DU0PR04MB9659.eurprd04.prod.outlook.com (2603:10a6:10:320::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Mon, 19 Aug 2024 16:02:18 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%3]) with mapi id 15.20.7875.019; Mon, 19 Aug 2024 16:02:18 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Mon, 19 Aug 2024 12:01:58 -0400 Subject: [PATCH v3 04/11] i3c: master: Fix dynamic address leak when 'assigned-address' is present Message-Id: <20240819-i3c_fix-v3-4-7d69f7b0a05e@nxp.com> References: <20240819-i3c_fix-v3-0-7d69f7b0a05e@nxp.com> In-Reply-To: <20240819-i3c_fix-v3-0-7d69f7b0a05e@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=1724083326; l=3637; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=phlwJ/9jw9NpeTB7NJPyHYpdTuYWHApnsz953oBcxmA=; b=T8jmLDD61caEY6FKsJk9EB1yCOsJ6DQjBeSuejdIN9NGKNUu4DuLwCya/eUH2pM8Fz4PvP1+b 9TelFo7AohdCHMr3Q+/jHeOrNCacVcwb71VLPm6CtHpsZobZIT8kRX2 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SA9PR03CA0005.namprd03.prod.outlook.com (2603:10b6:806:20::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU0PR04MB9659:EE_ X-MS-Office365-Filtering-Correlation-Id: 01371e4f-ba54-4565-f2c1-08dcc0684ce0 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|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?g4E68uKNBnm7DwMoMPtbi9dADNPXQiV?= =?utf-8?q?WeahxJPxiSmFd6w9IZHlDTFEfnbv3oBoO+1jtH3e+X9VR+P8jQkGuzmtFIWbcL4Ry?= =?utf-8?q?jYQF4oxIecOWquQy+lraj4Gct4xPhJ4hrahb9jzeo/ihFD3SjaUpqUUkfCS3x9unv?= =?utf-8?q?K8EJCTz0TYA7Bjpt7XK91R4Gtzo9pyGHkLHakWPg9BQsJuI07fUGMnJFM+z7T1dtT?= =?utf-8?q?HHlTIe2f0WMPI5/+h46qlCi5VZCS9XFmbrMXkRdxYCnQBRhrGPFT40gRSGlMLDLwM?= =?utf-8?q?nwxM6KzeAqH5QCoPvGcIYmCBy+K8t73DoOoTh0UpO6n3UUJLXd+hl8AWMP8tEmvIa?= =?utf-8?q?3pJr9cdz8jFp9uLJ3iipwS8memFTIadzufBH/OJQD1B9+sViXplKUnclo0flYyaxJ?= =?utf-8?q?FuOZhdLZSsAI9Kyga6ONsPXnJ0Wp8OdMHvv5GJ6raEgRCD0vqTbQrkNyDu3/5m2xx?= =?utf-8?q?kFjJcrJD2pL6foeF+no6fAkz/DKbII8KEGFtlxU0fH+GrGc3uytOBaX7n8/YEKi23?= =?utf-8?q?aw1IAnPK85tsMTh1fRBdqcRFR1eb2vZHtLLh1bzPcWMo/PP8TcPTLYT/yXbBXgefO?= =?utf-8?q?26NWZM9gjDFiVvH0SN5f8ZOnN3VSFxSkwehNn3nhqNXoDmItaeX5jRlOulYT59Avw?= =?utf-8?q?wQtQHv2bd10TzZVRrO1hztVWlLJf+/xRfklCQtUU/JwWgi773v5DuAx8iQzBmmOj/?= =?utf-8?q?JktXNADUvtrkYmEE/N6vNPJtm+OZb11o3pYWLSrMqGXZ0NCq/T4y34916/JoDyyPT?= =?utf-8?q?6196jIpzHlCC/hQ+c3Q7LqM136ldMsRP2uGqiIhfLI1lCiyzSURAYcxHjMNT4jrXk?= =?utf-8?q?p2L4WbeVeDG0nN3TpB1AANTPJOUfsorBrOEcBuhow35czkB0UPBys4e4uZXBY2Eoq?= =?utf-8?q?SkJwpWgIBJgePV6Xwy0gxV9BT/Asl4y8HF8y5Sk//b8oZU02jTzk/QAEzxXvH3TZO?= =?utf-8?q?ZIRsk8PJQeQ3vDHkuJn984I18teSR/Ae9pYkax0ij5dZLa3H1uHLGP8yWx7FS6LGa?= =?utf-8?q?I75IcPIY8ObZ5O/7QWtfsLxJyEOb2BZQSpkI6nZ6BuxRIyuMAqWtTm+OcQ/5zaOSe?= =?utf-8?q?NtKYbPxHz87+Nx2N3kDKDrisy/3U+OLGN/mRU2hoflKN7n9TOdOb0gHkRBib/sNpd?= =?utf-8?q?hvX9v0x3VL7jc7vPwPdrEsAPy+clPQHV4S+8L8vvGw5KkLHR1wiXe+fcDxfwnfOCV?= =?utf-8?q?wbHn1aQfdTYhsZzXfwsbuBlCQrs0B0lkr8447HDaynArP/MznObBhtcWGqgC+l5T9?= =?utf-8?q?vI0INTQS4+pX9Go2LUReshZBt/NHefyx3STZ+VzPGBViCDyAZSmyZD/ZpAUa/2UIS?= =?utf-8?q?2k3e2z2fjA+WuAxi7gmX0tg08PAeqrSOiw=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)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?009Q05ja+0YMvuHImAYggrqUglvi?= =?utf-8?q?x+LQhCNYT+GvtWV81WnLTk7yRrD7a+dbx4tA86xNKuVPt5QmpRu9eW0Jqe60gWiYq?= =?utf-8?q?cxGasb5jKR6sm6q/s669VFK+zcoGokLBKTXvlfYPN+UFR0UptgPkhQGaSLgYMJmzc?= =?utf-8?q?GkPDCH5VJ78wgzS9mhT82P8D7tSIMY8bVX8jPhcBOMO7b9N292ibxQzIPGxgiySGa?= =?utf-8?q?MoRCwY3j1Yd4WYtltgIBK3M+p6LGBusPVRmoYNI4ZOlMMR0r26R8JuGdLICiv19GC?= =?utf-8?q?dO6MVMUKEp7xdeJVeztVI/MdZwHbUDFIAVDhRhFrSfNKUCegNPVGXLJnKj04BJOk5?= =?utf-8?q?OiB8BgPDz/s88oVS0x8pONm/bFTrvP474GFuYYeILKQ/nNpW6GVHxZen6KwNvZq+X?= =?utf-8?q?PKNjF0tU4gR0WR+NgyZyKg5hoPMYtCda/RSXoOtrervqffjKs5RbqwV5H2pQ2rEUB?= =?utf-8?q?vwkz+F3oIpDEwh/aCycP7J5ZpMzG0xyu7PvFUK5pAeuwbikIh6u54vTyYIxTYPkHS?= =?utf-8?q?ta6h02NoFqFX7fnQDbhj3UV5JBOuptwGNgxByY+orI+Mr8VYCmrkoRDU2Mq4VsVSS?= =?utf-8?q?wOqoxVIJEJjVfle3EJZv8Gh9khiY01YY5VZqFyBYpekg2ym5Ca9ZyDEqhFvvrsQ/K?= =?utf-8?q?cHdjAYq/lHtd39Q5FvsITw2oUS/Z0COWXBCszq3SrBfcMq0tSZyeomYtKXQItIip1?= =?utf-8?q?uwlQ8gDPCNPq6VNuqjzkPg5aR2MTNLF9EaORwBsR1DixU8+Xrb9yFz3nq08NMrzO9?= =?utf-8?q?6/zlRhaM54i4UaO1SazABuzC06xzUWyxodQD6DY5dQieqQn4P69rF/GNGwsC2UFPL?= =?utf-8?q?HhH6phqTkTeXvc3203noUH1y0Cd0YCniDKjE+CDstGetAxLmeT6fZc+TNfq31+vsE?= =?utf-8?q?koqFRziM7vnIqMbgijkPWRkBBzDX1HwHVA6+mivg7x+C21UxGlhKdOmSebzX0c1WU?= =?utf-8?q?YhU8CG8tFeDbbzMrB460Q8RD3wQulOTJ9AauhwN8KEsINqxEg+H8baOgI9hrTFBif?= =?utf-8?q?QYG2nIlr+BSjaUeyG3ByWNESvTmlek33r77+KF+W/vkzDhH/0CtmPB6r0Nzg71lkh?= =?utf-8?q?eovYoWuQKneJW+fVXgcFWF9hdvD5+Qy1hSw7KoOZvO/Kje1/UONB/2vySurBPMpka?= =?utf-8?q?9OuYjRxfEO1hU+3ZCYhoONQql2ho685b+IU75PJ9hUrD6Prboywzwn8qxKQ97WbS1?= =?utf-8?q?wht+IOsbJTYWjKnmzND1pdAVqFAt2+ZwTimJLRw+xGxWzMngQj5q61a7V29ko8NoF?= =?utf-8?q?X2DyQbCE39rduwUzIav+H/d+BUJuZIz9E/ZSc0UK8eQWzUkQoyiwfhVXy4Xtau+p/?= =?utf-8?q?lIodEdz5bIYRIVBEe16XtDMaTJuZKM0H7+PsqLbIv5Wt8Tyb9Md5LqfHtBExcTne+?= =?utf-8?q?WFy2wDmxrKlkav3666R/POVgqFtwc2bi/scEtKbSQgdqrmYFk+lrAe3gj9LUsEkBd?= =?utf-8?q?6+03g+lTTXQK9dWdWZnzk0Mf4LDGxS0bFTuml6Ec4t2KqHFSUdIPhuu7jf+p8tbMz?= =?utf-8?q?TGxr+qya5DGB?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01371e4f-ba54-4565-f2c1-08dcc0684ce0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2024 16:02:17.9822 (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: Yr/4+yAui4egw8RTGa3zsIEFZoc5FVL0Uda6w1/x6LgXxcwCGD9JWVDi6uW7hdWyt1N8O/3FR2T8BS05jCSmjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9659 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240819_090232_812785_61F75C46 X-CRM114-Status: GOOD ( 13.14 ) 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.c b/drivers/i3c/master.c index 4281f673e08d8..c8eaeada54781 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -1531,16 +1531,9 @@ static int i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev, u8 old_dyn_addr) { struct i3c_master_controller *master = i3c_dev_get_master(dev); - enum i3c_addr_slot_status status; int ret; - if (dev->info.dyn_addr != old_dyn_addr && - (!dev->boardinfo || - dev->info.dyn_addr != dev->boardinfo->init_dyn_addr)) { - status = i3c_bus_get_addr_slot_status(&master->bus, - dev->info.dyn_addr); - if (status != I3C_ADDR_SLOT_FREE) - return -EBUSY; + if (dev->info.dyn_addr != old_dyn_addr) { i3c_bus_set_addr_slot_status(&master->bus, dev->info.dyn_addr, I3C_ADDR_SLOT_I3C_DEV); @@ -1931,9 +1924,10 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) goto err_rstdaa; } + /* Not mark as occupied until real device exist in bus */ i3c_bus_set_addr_slot_status_ext(&master->bus, i3cboardinfo->init_dyn_addr, - I3C_ADDR_SLOT_I3C_DEV | I3C_ADDR_SLOT_EXT_INIT); + I3C_ADDR_SLOT_EXT_INIT); /* * Only try to create/attach devices that have a static @@ -2094,7 +2088,8 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master, else expected_dyn_addr = newdev->info.dyn_addr; - if (newdev->info.dyn_addr != expected_dyn_addr) { + if (newdev->info.dyn_addr != expected_dyn_addr && + i3c_bus_get_addr_slot_status(&master->bus, expected_dyn_addr) == I3C_ADDR_SLOT_FREE) { /* * Try to apply the expected dynamic address. If it fails, keep * the address assigned by the master.
If the DTS contains 'assigned-address', a dynamic address leak occurs during hotjoin events. Assume a device have assigned-address 0xb. - Device issue Hotjoin - Call i3c_master_do_daa() - Call driver xxx_do_daa() - Call i3c_master_get_free_addr() to get dynamic address 0x9 - i3c_master_add_i3c_dev_locked(0x9) - expected_dyn_addr = newdev->boardinfo->init_dyn_addr (0xb); - i3c_master_reattach_i3c_dev(newdev(0xb), old_dyn_addr(0x9)); - if (dev->info.dyn_addr != old_dyn_addr && ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 0xb != 0x9 -> TRUE (!dev->boardinfo || ^^^^^^^^^^^^^^^ -> FALSE dev->info.dyn_addr != dev->boardinfo->init_dyn_addr)) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 0xb != 0xb -> FALSE ... i3c_bus_set_addr_slot_status(&master->bus, old_dyn_addr, I3C_ADDR_SLOT_FREE); ^^^ This will be skipped. So old_dyn_addr never free } - i3c_master_get_free_addr() will return increased sequence number. Remove dev->info.dyn_addr != dev->boardinfo->init_dyn_addr condition check. dev->info.dyn_addr should be checked before calling this function because i3c_master_setnewda_locked() has already been called and the target device has already accepted dyn_addr. It is too late to check if dyn_addr is free in i3c_master_reattach_i3c_dev(). Add check to ensure expected_dyn_addr is free before i3c_master_setnewda_locked(). Fixes: cc3a392d69b6 ("i3c: master: fix for SETDASA and DAA process") Cc: stable@kernel.org Signed-off-by: Frank Li <Frank.Li@nxp.com> --- drivers/i3c/master.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)