Message ID | 20240724-i3c_fix-v1-2-bfa500b023d6@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 202ADC3DA61 for <linux-i3c@archiver.kernel.org>; Wed, 24 Jul 2024 15:46: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=NwHj60ALX45bPWmNU8oS4bDmMVteWjZQD32eVuJ5iPw=; b=DaxkWqm3RWqzPOUgDX1rvQm2At okxXnhYbS2LXar5WWiECgffpTgookV18rWTLbHvNLl4QcJsi+lmnhJbmXXHnOgz9PLD00d43VclrC GXMqu83ecUFJybOjnS/JmFOkf9fIMurPvte0A+1YYVFW2bBX1lviWSaRSqdPXcFVPh57qrPSAJptu lCFVmr/Ij988Hl0kqWPrQHdgNuUYnw2nwaCdJyW2I44TMLzPSMx7WIldgoDw8e+CD7WIS9DRRVhFB TX5uvNWTQnPf7zUkdx5Zstu+gMYHTCU2U7VxWaiudmoapFHFB1QUk/W1EgfZE/xj4NuUaGKjVfGC4 Hn7Lr+Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWeC3-0000000Fouj-2pZl; Wed, 24 Jul 2024 15:46:19 +0000 Received: from mail-db8eur05on20601.outbound.protection.outlook.com ([2a01:111:f400:7e1a::601] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWeBz-0000000FosN-0RAK for linux-i3c@lists.infradead.org; Wed, 24 Jul 2024 15:46:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A0hKXhIP09WxodGn6dj/F/2R7F/tPyOq+aFChGYKTdnmgQAD/z9+K/bt7W7fliVSEBekpKnsLX8dlSfet/MGHj5CGGvbuvx7R1Rc8zS1cEcHtmCGPGba2+LmmMX8qu5YqMiUuzI5mQ7PdQCi3qwCYoQxj57nNZKyYfjdMDqbCpaZiENY872WayDD2vTUsDPduLQdtNNBKPvauEqK9ME0TzMLNToOtoMjo1+Hve2N924cUPNgL068ZWu+ZIOMFh9gg+PXuqHStsFGCAzCVZ8SsHLfJBA8yALxUMihVonKI5OReEMlhj2dpJ5nHRjwyBVVrObQTvnYDN7hlkMgu0EI4A== 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=/H5YFp3nwDhvmKVPeBWxGQWI1IbbbTbtrRrxup0oAxQ=; b=qewuBOKZP4RwYXwcnEPATi8Fd20Hl0DoONQDXPQwHSJAQv2FOpBiIvL5H64RKRX7Dm+3yeRiPynKcaGS4OZj2i0GETyspxkNURVnU3ZfsErHQYOXVTTmzVOvv/i8AlD3m+Kw+5WW30XZPGOKbuUh3opcZdO6UCdT8L6wmxC6qKGnTFGGPjnHDBv5AWC4DB8+iehXbLzvJgMaXiA7DpxWhTcMmNeMXuf/LxrbPBwrW6OikhhVVq7Vs1yFlhHtR1O7ljd4ZDtR8ee6qxLQ9E4dAONslMmB/Jugbv0RDDnBEDuVZBo2xWe0R1SUbEPyrg8gAIc5Hq/PJj4l/sNhra02XA== 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=/H5YFp3nwDhvmKVPeBWxGQWI1IbbbTbtrRrxup0oAxQ=; b=WXS+PVjcKeqRF4jjgO7iLt8go+BMayzwf66w2IzcZOH/ExyldavC95D+dYBbybfiNtEBFDDIXOowTLOF4lv/awJtouyi/+5CjLzvLQkXgypCk3j35jyA4x0tLlat7nZ1ajz70gHu3zcAQ64iudMH4JJThDzm785h7z8Lcd+N93JCgexehoqDziPn9Es5wwpnBoKt/ug+klbb2F4zl7RdKP+POdset6eF2OaTh2oh0Yybugkq4QhPqZUQId53pAAgsL9X4/zL1GMFf1BBMWZ8PBHn43osGn0YcCSC3KNaHrcqxLdUkZvTQrE/THkTgqxXIgwYvZ3TshzBACEUi9tYLA== 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 DU2PR04MB8599.eurprd04.prod.outlook.com (2603:10a6:10:2da::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Wed, 24 Jul 2024 15:46:11 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.7784.017; Wed, 24 Jul 2024 15:46:11 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Wed, 24 Jul 2024 11:45:47 -0400 Subject: [PATCH 2/7] i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_BITS Message-Id: <20240724-i3c_fix-v1-2-bfa500b023d6@nxp.com> References: <20240724-i3c_fix-v1-0-bfa500b023d6@nxp.com> In-Reply-To: <20240724-i3c_fix-v1-0-bfa500b023d6@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, Frank Li <Frank.Li@nxp.com> X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1721835962; l=1901; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=/8gjfrLEbeqdvh2UWIsUOXSQLlEPInExNiw2wP5o2A0=; b=o3K+zGhp85Eo5QVg5L9biEGZcoVSDJXgyOoSG1pJZaeva+eIH2wEx1039sM8ZAULgIcYz9q/n zWlMN0WXdfhBxRe9XBnrX4yMFMzy578s75fzlZ2Vo22QPmPZngeO1Qn X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY5PR17CA0008.namprd17.prod.outlook.com (2603:10b6:a03:1b8::21) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU2PR04MB8599:EE_ X-MS-Office365-Filtering-Correlation-Id: 5af0900b-d7da-4119-c89e-08dcabf7be49 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|7416014|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?bOdEOMc1r/4UwpVfrqvsdFtTA/JTDHk?= =?utf-8?q?I65SkSK/wAb1k9Gm4z+nDrwbn32GJ/Fz9w0WHygWMkOSaI+pz5xN5nf9MnOhGhF2w?= =?utf-8?q?mcE+IWbEUVr+7U4MNGFA0gUKhEFYxJBZWRM33gAZEJrlo6/OWYmigzWjlmeVxMN+g?= =?utf-8?q?1Y/DttKFFSVUk/0Wbm97ln8Wl+Ja6ox1SThyKTbb6AgqxUCDXNmbG/b0SP+CwPjuT?= =?utf-8?q?kmSByoLb36j4gW9169JluGiAD2bMp4ovpnC3dKik1Rp2ocI4okjtosU15bqq2QkdR?= =?utf-8?q?5vS/1SXcl5r7tEwy1LO8eGe/LepTpgE/C3Gkkk/8wX1/X2vYWpAwDEC8ztjh+K9ci?= =?utf-8?q?zdzNm0Kub2X4bpPj8heJwR+fa4rABr6jpsPnSZqV8GeH1ULRz47q7J8QW5TbTOlbj?= =?utf-8?q?QgBt1fvLH/Mla2+1uH6NAXwhD/38u4R8LJFLNK4O3geWGyPJt8qbwsLBB0bNQoU6K?= =?utf-8?q?VTuriXBeCkgV/XVIQfnaEkoQJ9IVVuMZNqFxS4GpHsf51LsK3PPIRMhwsP/U8aJwJ?= =?utf-8?q?oxb4XQMB66aXxEd5hTx2UcBNnh2SyEEDvaOd0OQeh+3dujDcrq5KCpm+oldJ9Ji0u?= =?utf-8?q?3xr4pO1idP6iHxV5+PGUmtdg5b4Am+R92iq18ULFB0kd1njGlzQFeKGcBueoXQMhO?= =?utf-8?q?loFuUzuf2u7wY2B+hZ4rweim0EJBpwpwLyqi9XOzWGAh5cPo6zEVPnxudtcxNZK0l?= =?utf-8?q?fgkIfuA3umuUFvEHmQalu8lGAN3fvERG7J4P2hX1KvsYslL0gLrP+GX7KA4097HVg?= =?utf-8?q?sBOnRSbeq6P/a3tCZ99o/nVElw8kfHJ4lEnJEgTPjVLFwChc0R0PV93p6er59XZkL?= =?utf-8?q?Vw3E4C5b6AaYCeMjuGp+ss3P4L1h/Q2eo7ZeV/9qU0Tmtak+hlYm//mOg5Fhtcx+0?= =?utf-8?q?ehQjB76SpAcfuwx5NO4rF3QojazZNR2z+7nDTxdJnp9v8bMkZ8eQB7Ul6KLivxfZK?= =?utf-8?q?ERpxmO+vQCSqEmDRKZk1/YyTQhlbQpt2ZbZ4mOwWZsW6bejV8Sg/GbPOlQVaKTtQt?= =?utf-8?q?qjQ/xjHEHBBvLrxhdbvz/U/WErDxZIt/L3dlC6ejQfTykxzJCnwJqCmlV7ksSBVHg?= =?utf-8?q?EFbmlNpbfQgSjxiLa7D8csB6VxlwT4WWOpguhG0V2umj84ApoltB6MnDmqlpPsVOT?= =?utf-8?q?TcgBUkYJVJ+UNhgHmCNvmsu5qtEWk2MYAqZmlvHcJhAYLFeg4g0N1pvbt7JniJcJJ?= =?utf-8?q?7PIN2InVXe9+W8Z2HyK2jiMPVf2JnS7aw7jI04b3pdDzTkaHSY1FQStmGH01Ge66P?= =?utf-8?q?1Tnonea5bfzqNOR0T00CxOI9TZfs65w8jLLSP99ML4XnsImLCvmQkZ1HZiiPPtqSa?= =?utf-8?q?6W2CHZhY4A7mCOwAfi/aBd6iobpBREpMYg=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)(7416014)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?8zx/mhREo7a23aNTwCBCKI373ymd?= =?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Em6rDvzd/wcE+hqeWaRlyWyZ8jDngN9k4UmiK9ahBihcgw1bKn1/q2Qbqr?= =?utf-8?q?RbAqg1ehszXKx1C1RRn4OSJTsgQXc5MHZyxg9eaXQWX9JsGHNXwflPXRqvvVWWzVG?= =?utf-8?q?CfLvWAR+uxiS/N5aHjJfs/GeYVwzuwEnMgUEQ/OPPaZq1e3IWwIc2cDE6soQJk3fX?= =?utf-8?q?arLZPaIESXzWio+inXkE+g1V6n4rEmGcLTkWqqOgln1Zy1OAXftEcYpZZTOBdO71C?= =?utf-8?q?98t68sRfVuvY2k51AB8SQFF6kR65evT9tjt2HU+hnchFf7oP2Hfjlql4nF2OtZcuP?= =?utf-8?q?BqFtCN1DlrwdPJ56lyRyHHCaNuIJjLVJCNZsVh5pebXL0ggaQ7KLf2CwsjWu0yIE3?= =?utf-8?q?M7eWYyseEtktUAFEVGikCI2UUKIyl0pnSXKaImWJjrnqvGLBymtWh+S5bWl1alzll?= =?utf-8?q?6A97ZIusQAHSc++qNYdK3cI7ee1iWlMSSipw3w+KKP3PVc7SFz2QIwbUqNkgqOrG1?= =?utf-8?q?1+OihqzLdrkZOehAO8uJEKLnyTZ03fYTyHLY98+K3ygpUGK5cnpLHhFo4e3gfgQ+W?= =?utf-8?q?8goC/E0DVVeN9Av6542Vy3Db+0RZqo/GOOKVxbsyd4UVN5yl9gF/xIHRAVgs7h03E?= =?utf-8?q?zxXHG4ean3/L?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5af0900b-d7da-4119-c89e-08dcabf7be49 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 15:46:11.8621 (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: Qt1hYMUyq/SuY+qoVFOVUPtmeSrXen+RLaOTzmEoXxLE0T6ONukBxNMLMb0/jWcB4DggwNwUPjr5pnikcaTZEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8599 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240724_084615_198262_BF035B41 X-CRM114-Status: GOOD ( 12.72 ) 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 852b32178b722..85c737554c940 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_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_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..4601b6957f799 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_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_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_BITS. Improve maintainability and extensibility of the code. Signed-off-by: Frank Li <Frank.Li@nxp.com> --- drivers/i3c/master.c | 4 ++-- include/linux/i3c/master.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-)