Message ID | 20240829-i3c_fix-v4-2-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 96F82CA0EC4 for <linux-i3c@archiver.kernel.org>; Thu, 29 Aug 2024 21:15:04 +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=WO6dqY44nXeL/TunNPHaetdKta8SFIf5GyfxO/6arQ4=; b=IP5sZpFWhO8WDcF/z5I8ELpGIJ pxiYR7qC+9DXvUMERkh4+EESE6MfDYl8JJvCpwrpGX15T1CMV4TWb8gIiRpiIrcLUtGXS80/wfRV1 qmOtRbOi+P4xl56/V1O8LQHao8KHN5ziOlPaZYVnJ/jozBZcN816oGb7ZuMaliM1wiPv1NZintmmI tH0nj8tAp1/pnj01JFdTEmdOPoq+JLDbaRW1d9b7AhxCMcVk5PZYZ2JstsoHvwjR/gLME79HJZTGn wVDCKqqvNWXdo3ckwKV3RLBca0BqgZ5piIE6uhdaCCkorvn7PmJmf4uulszc+LL1RbGOjLMge7NH1 6US2alNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjmTw-00000003epz-1Mfm; Thu, 29 Aug 2024 21:15:04 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjmTt-00000003en9-11fF for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 21:15:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cEHkyLbY/3nU3aDDyL5/obOg3c9XcoFzyIKR8YiFsLVGxqsQ2PVCOz4wcHTvCtDad7uqWuSCoS4/lrBjed9oergCtTxzl5ZgoDD7iNBa4D0RnUEhfgO2JoQkFaQmKEQ+qmQ7YEjE9R8D3xoY+2BoXvZhJQ+B6zP/pn5es7Nr5eCFdDbar5nqSFR7Z9NY4qsTJqI9fBveh9WHSb7S0uvOYlCzpCOFIywRq1tRQIFKvuG+KwIONaG3c2iZ9PJk+jb/LAyCL3VQ1H+vRNyrb0dKJUpnbfhSUKgjnMdd8Wsyu3RsHQqlZT7HUbw1qWJh/GS0wqOUpHPgr3k0S/RRYkm5kw== 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=+Zw+7Tpjz7a4IHNLJ2t5tmfYoXfsEZBhOfeYqgtMXJE=; b=Gl3BOi84aq8S6WpmTUdLl6UYNYu3fBcy9ujRfzqnSFpzz1YK7TUcOqD49fJre/ZGa0pO7nwWEv+qzC6xNejfn3pbvsmSykYfg950nCwZEfnAK3nDYpMyp9WDF/qKuj+P9FSupiCUQ/sbpIF57rIqnSju0QQFiOJBeNU//S3MpUReyBScWdNH2VfNFzpg8IsvUNqzS3jhTTJBMfg8yFw2F6ee3mAgFGAyHwe5VjuOc2yEU/nbZJPuO/tfhm8WUIUvvV1bYwLVjzlAftIMbY5tX0G/GjsTpNxuPhkW7/9ny4qY9Cd9f/43mqKmwM8ELV5t1DGJUFZfZ17GYWJafvF9Lw== 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=+Zw+7Tpjz7a4IHNLJ2t5tmfYoXfsEZBhOfeYqgtMXJE=; b=SN41fT1vny71FylgoVJLMnQC9NrYL/MK4hwwhIiIBTAQrB58vJ3iriuTBvhAKgNiMIXWMaCEMCejLl13NsYzC2wemPz97oa39E693bcFEnmGIWVCB5P3Jub3bocn3DYJWoyLqe4wZxTUoFeXLUZJ3rHSAyFeGNiGQQZq7HsdvCHXR3kic6B01CbISzbehe2MKP2ezsV8CGjCFc/YvHWxFbTyRGc1AmNh0ifDcAj1GwNGx3MxCIoYHEGeGtkLPDUCgeqd+tp+v0+ee9S5f39NBdMCCI7i1nz2QsK1LwlCFbCs3/3rLEi6vjgMoldGiQySHfIl5ZcxEMKIQ2+EdvC1LQ== 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 AS8PR04MB7560.eurprd04.prod.outlook.com (2603:10a6:20b:29d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 21:14:52 +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:14:52 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Thu, 29 Aug 2024 17:13:59 -0400 Subject: [PATCH v4 02/11] i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS Message-Id: <20240829-i3c_fix-v4-2-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> X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1724966082; l=2002; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=ZFRph0b9X+/CcyKerJ3YnFLz9ZtABnOTIX6HgBcQtls=; b=JJwat71EjT2Efb5wn7NQ5FjXv7ISFVknI5FLH3pYCOP8kFCQbd9CHHn9qBGDeb3q9VlV1tvex fy9BLeYfXPVARU389gVJolvkRZkVnoI7Nle08lVPAhIbJmbDSHftc0D 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_|AS8PR04MB7560:EE_ X-MS-Office365-Filtering-Correlation-Id: 1420fe84-6d9e-40e4-330f-08dcc86f9fc9 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|366016|376014|52116014|7416014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?fLrHNsQDUzxuCX7eqHCoEBuWnA0Ihb+?= =?utf-8?q?188yvYzatMzmDVkWk3Q4CYFaeg3IYsqHIIbwjsEgTxRqVm3jsHcQG0WgYGKUhlm9P?= =?utf-8?q?GA+41PRM8fQEVVSghedJ651hZy5zP4VvfB7ayUlu1ZyzqbwWd/K+JzIbukzIp1Lz1?= =?utf-8?q?Sl6XqNq9gRgTUEzpmdMYs/MJ0IjPwh7GZSkB3fXJGJV0fCaiufnJJUpnXzziDq2Gx?= =?utf-8?q?A5xWAXSPhy6ZgNfrEV9Z+DTT0wz45vkF0A+TKKSQpFhFMw2Vklo8UVI7ZK/JnWs3h?= =?utf-8?q?4T4NG9V3ZWlYX9pblQcJ+zJjE8ifI9YB8ZVFroVn1qwpLlgKqMwvSXPF+kiyOU3gZ?= =?utf-8?q?H8PGIyYoEFhhfPHVXvNARvFIDgRh1jG5K7s0ViQFfNaPAT374QPsJgxf0Ck5V3cZp?= =?utf-8?q?wZmc0rEDLNa/tYIORsLb+u3rsPt4+M4wsAGkOhSWPaV2kIAspLLv9D8EBp2jRBcBf?= =?utf-8?q?/Hcoq1rRlaDt36UkBI17FuCHVbp3TUE9/MuHxYSFV64Bc4eEdum+JLxgxN1K2zOjj?= =?utf-8?q?b3k1xu2vGYiGWLs9Ed35UhGWfwBM3xnN0Jk7NS/pgIVyIWcjqMulG4+l7+7AQTLV+?= =?utf-8?q?6Zm3m+sKk8dF2QTMphS2WN8OW2n4tCtIRETXqDrd8EbSx1BFNDOHlhZQRgKmGi43m?= =?utf-8?q?NaISB21jN0X7qNnlDkYyfRfCSxU0QB+A1ONJ+nLHF1Tue0HqDX3tqsvz0E+jazvJ+?= =?utf-8?q?UtJ/EAaIBzJQ6IKgX98tLCrKr+8BgRd4y8OXBMJryYJUhhnhJ7lZrl3t3uSeRxXKH?= =?utf-8?q?GYe4Apu7ufUioi8XhWzOPg14PmpqpPwVbxNIKXx30cPleov1zasZh8FOyXCo+0xnw?= =?utf-8?q?arhWAVBk0eUo8/LdHNuAAKUdXW+v5XnftsiQuS90XHm5IcUYpXqSUo/DlFSXISLV6?= =?utf-8?q?QohXSf8f2SuchRRLNJk1IPJKSdVjoN/MYvZahaI6HfXD5bfKbJP1v89gYG/JsIhkV?= =?utf-8?q?rBq4WxpVTmIwEvg7BRrj5oaUknR/3Qvhum+59Fkyfdxx4IpAwq+FT+qavW5DfAqk7?= =?utf-8?q?Aemg8aUyqCkYi3uVtA8or0XnlwCvVLKrQhZDQ7vCbv/sPpOf3NlBrCwOxex2Emqin?= =?utf-8?q?9KDwwBNUn/3rstoJ0pLmEC0OGNkxFpWz9OXHbQBTKHgD+6lqPMLFbdU+eVTp2lL8s?= =?utf-8?q?yEWvRN9XDwhXKCWjsljfa1M2CgDj7ojB3BOtvo6BNQ+jCSMRmK54VmKyEjMZgqA3v?= =?utf-8?q?j2DkxfLEVaby9KD2MM1LyiLvixVn3caq6ZwXyuS2BIEgaVaV8UmuspsdgGWFmOwGK?= =?utf-8?q?YTOQLYSvZ7Tw3OU0MKpbbUJCkqbeUol2ajJlVixEne1peI1a/ww4dayL6EmwZsZEk?= =?utf-8?q?2YnM5VsUI9iYJZjY+gIa8S4zVB4xRG1Qyw=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)(1800799024)(366016)(376014)(52116014)(7416014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?EjI9cHcZ9Y1g56HUMtgasNjm3nWm?= =?utf-8?q?a9FgZraxfgofAzmMSJxr7TfNlkaZnXFocvCI/vb1B7F18dqfB/99pDI74QoJrXGMI?= =?utf-8?q?HULHb+UxQMfwAC6rkkEZK+AggSkhwdzmh+kA6G0xPK+amrtXai4/PpXmxPmGQ/LU/?= =?utf-8?q?0icy5aoYe66o47DoeqteD6uR+AK1tWnYkAL1FM07/ETNAeZqRNPIK57cL6kXKgJbt?= =?utf-8?q?eZdrn7YZCqjMjaRd1Nr1c1gryHDi/aQiuA0Req3ewEuxH/LEYQa0kl3OxgzQIXIQe?= =?utf-8?q?porgtXwRDMd7px49wfC6NJc6SxhhJA84i2wSqYPH+A7lxznFN9618qCi/YPHDX/k1?= =?utf-8?q?evoC3ucJvZ8BheWwFf610Q0OewfmuqV5/KEYZXESpQiY7xWMF4MpjVe8ON6Sx/oIV?= =?utf-8?q?RER6vTCxb46C5mqGUyNTBqOp6EcQiTVLXSA5ttSFRZ+9s3euRNtU5mWelxzmpKfo3?= =?utf-8?q?W3WdS+kWmDttn2dXXUHe9k3U8OwGOGjpKrw/EAFHhBJKYI6GBcBeDdYlY49/nc5fp?= =?utf-8?q?Nb2CEqqbSvG1ISnx3HawcAXClGeYd5dsHtK46p+2+8i8Mxh7ashHdx5/cnUy5yHH5?= =?utf-8?q?6bffcu+LWOrlae4RPHf3aQNa3MychJydd7eNxILaSjVH6Y9ZAMJ0ueMDBmMurllSt?= =?utf-8?q?OC6j+WpsJaqbk6xVQsiqdBQ64h6+saln5h2y7PkibsTiEOSZ070SlEvqZxmtLaNhL?= =?utf-8?q?Sa8uYr2vS9HaKGldV4DZZCaMHnx7gnkSaN0hrpeCkzg4AjMp3to46yiV13I1tiANa?= =?utf-8?q?NkL3xUpfjUG7c9ialyemDiuOuxjPZLUBMbFfo4mvxYQErtOCzbup/4Jjpf62upeF1?= =?utf-8?q?/TpZVTnnn3ILnnBiHyEb0W4ZzscGI5dJy9RxXqkqEGmIzTEJ22htaqDYlYZYt2bsE?= =?utf-8?q?sKZo3k5DHO7g6ZB6eJ7YTU+UWAh4WIe/roN1VRAORnCmufLPOtcfUSo+ovIBE2sPo?= =?utf-8?q?Pwx3yLtvlXCz0q+xZb8n/T+ABaeKXZsYaMpyvzAh0L/np0UWmcSY3gmnrbW/a7Z6j?= =?utf-8?q?g6UtxLefTx4Gaci2oP9I2m2s4gF8j9JUOtq+i3Rv6Jj1AMpcO8P9Ckl+IOj3hBWX4?= =?utf-8?q?fyl63UdGUFCp2zl8cUR5K6AiIjXEEaGhGouTOm6mxWuaWtRl0wEvKSXS4ZsUAvEZg?= =?utf-8?q?a+Y/0deR7gaGgd4qVDLRxMDBKeLN9mGf5wm2o3JuhGBGBrmCAhtU7ue5rRpWmkwwi?= =?utf-8?q?EQOKUy753GlP+AtJWkwoKn/0v5Rx2CRvcJ/2uQlMJOQEDy7Go261d5DB77vAq8Ems?= =?utf-8?q?P0qyg1tks633US9GH4EIddWYncbbHnFWCLll86tDoKxaqwGFYAXEungQ0IFcl3TrE?= =?utf-8?q?uFOC3iGfw0oxCqffGvmjVahZOsdFe9BKRRq5K959DmQypXToIQB0rN2pIEG8A/OIe?= =?utf-8?q?cPZFs31AFpn5YUKBQn+QhiHIcbzF02O3wYBiNhI+xpZg1eJrwJVrmwQTpctQi7+ZB?= =?utf-8?q?KFVEDIPrq6Jc0KyeMoaV9V1y0So1MV1qW0E5C7VQZBXwxxLwusMYPX8a4/6DCCNfH?= =?utf-8?q?V6nG8JfqN3xG?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1420fe84-6d9e-40e4-330f-08dcc86f9fc9 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:14:52.8626 (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: FUhNNkO4u6hgs6jcyKx++fFnWvmDg7RU60dqIDg2GRlIoBPrPmtF/EyqcISpJwp/NAwZ3/iBI/hYr6Saq9bjsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7560 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_141501_328404_F69BE163 X-CRM114-Status: GOOD ( 13.05 ) 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 82f031928e413..2c9d45486ed8b 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -348,7 +348,7 @@ static enum i3c_addr_slot_status i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr) { unsigned long status; - int bitpos = addr * 2; + int bitpos = addr * I3C_ADDR_SLOT_STATUS_BITS; if (addr > I2C_MAX_ADDR) return I3C_ADDR_SLOT_RSVD; @@ -362,7 +362,7 @@ i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr) static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr, enum i3c_addr_slot_status status) { - int bitpos = addr * 2; + int bitpos = addr * I3C_ADDR_SLOT_STATUS_BITS; unsigned long *ptr; if (addr > I2C_MAX_ADDR) diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index 074f632868d98..2fac4a45ec600 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -299,6 +299,8 @@ enum i3c_addr_slot_status { I3C_ADDR_SLOT_STATUS_MASK = 3, }; +#define I3C_ADDR_SLOT_STATUS_BITS 2 + /** * struct i3c_bus - I3C bus object * @cur_master: I3C master currently driving the bus. Since I3C is multi-master @@ -340,7 +342,7 @@ enum i3c_addr_slot_status { struct i3c_bus { struct i3c_dev_desc *cur_master; int id; - unsigned long addrslots[((I2C_MAX_ADDR + 1) * 2) / BITS_PER_LONG]; + unsigned long addrslots[((I2C_MAX_ADDR + 1) * I3C_ADDR_SLOT_STATUS_BITS) / BITS_PER_LONG]; enum i3c_bus_mode mode; struct { unsigned long i3c;
Replace the hardcoded value 2, which indicates 2 bits for I3C address status, with the predefined macro I3C_ADDR_SLOT_STATUS_BITS. Improve maintainability and extensibility of the code. Signed-off-by: Frank Li <Frank.Li@nxp.com> --- Change from v3 to v4 - rename to I3C_ADDR_SLOT_STATUS_BITS --- drivers/i3c/master.c | 4 ++-- include/linux/i3c/master.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-)