From patchwork Mon Aug 19 16:01:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13768527 Return-Path: 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 624C1C52D6F for ; Mon, 19 Aug 2024 16:02:36 +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=3RN4WrYZZ/5gnhfzgisHCv9OXUxSXCz6XRA09a3moec=; b=gFRDqi2lk8PdN/gAqQonXNB7q3 YIioeiddax+wm1b+nfz3oVT7EYUxzpUqHrHbdmfHVpnLV0FlWjwyYOKtlebHgRfx8jb85NaPxSihe MAKLGxQTil/VaQYs4QNdulLWftjB/SV8azrvwuVOpDBVh/nRYY9ix7Y9JlEYu4ydyO64+yEQXrbVo Joj2kBJ96saYxRtPx3qwQt87Ss0NDDK1yV3q3uq7mDU5Fuo1XkZAW1+d13IjV4N05+QPXPqp/6vh2 P2NLfgFcU7w/k/8E+g5M06mZzckAO09ysN2Uqqig8tGkei1cbcvAiroa6Pb60plsE2ruUz7Tvpc+Y Z4XgI63Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg4q4-000000024LI-0WOK; Mon, 19 Aug 2024 16:02:36 +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 1sg4pt-000000024DK-2hPk for linux-i3c@lists.infradead.org; Mon, 19 Aug 2024 16:02:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t1ecW37Gb3zLMvvEW1YQfRJ9VEOaKwpnQS0NKrvOBHCerOII16NaKMYsaymDDP6xaZgfJgiuuLpzGnGeaLjt1j0beDqckVrYmVtCByO4TlfrUEKPjK+Hm15KeqmenFfee2g7lgRN2xiH4LeNPt8KVReU+7k/mAcy4yxe4WP2+fMSLuMnCwCIcnlucdqR8lD/gNj6dG/LXnrG3/xiKQ59LsNTi4Wr2JNTEPTn8rcR1p6LylK5dxaYeU6EgLuTMSk3otj8epdEGVTHgdPgXtk9u0dku+eAtHYk4yFkHI6TMoOfJ+Z+ctVPDCzgbxkcp7P2x46aXHLHRKIBAMxMu1BkKQ== 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=iEH3AqOKfHzxwLjQgVs3Ok5rqhSw+ALKLhi5IuDAIjI=; b=yrlT80qdOWzL50NlKeWPjZC+U49vraok5/5hjrkzdkw5qIWHOV1ddWYTGPV3UDkSTX9d8osey5VwdzDPKJXJRQV57yyhnSljp5w3bH+tNwGoAFcum2leBojdizH3D76GFMhbZDMODrdhokytcZMayiJNsFImiQCBea1smfpIdsYZYqWaaqoFjixcfJdvRD9njYGqEUrkTG4qmsjzJ5VFf151ejv4b7Ed3CFCG8BU7AWBWYgeU5VSmcaGPdQUpImxGEEIA7q3d+uHJt/aCmqSsPHgCVbrnBLZUe/88AHmzdL2zFbosOBMOVEZtB9vQpWhyYooLe25juKGDpks3unlzg== 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=iEH3AqOKfHzxwLjQgVs3Ok5rqhSw+ALKLhi5IuDAIjI=; b=OIKaA0YLZ3HpleVMFLgmvKJuzsvMEgHyubtKSSl6Kpm22127WlO2xx+O6z341s+orU0kpSnUEIHsjbAZEMTWhKYactUK2yX4hV3hdXpJnZbd5C+nT5kwEpCqnQgup5PR4LMSNzK334uNCZTbZ/zzPqwV74jF3PnqNJ79XleMFOXhlsMfa+MLXfQ+GrkmBu1YhmsRzcmH0IcTyMHIEe64rKa+ZbMidIIpAVBdp/m8bgyCZEbtUWPLKDjEcje3Bn/RbIM3cG0p5zKvtLH4DOz5a9gj5wMkXDauZ/L/JKEjfcxjfpjMEQSIorxzax+D5/hRzX78ywijtrl6WxOEVmynsw== 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:10 +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:10 +0000 From: Frank Li Date: Mon, 19 Aug 2024 12:01:55 -0400 Subject: [PATCH v3 01/11] i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin Message-Id: <20240819-i3c_fix-v3-1-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 , Boris Brezillon , Parshuram Thombare , Greg Kroah-Hartman , Boris Brezillon , Arnd Bergmann , Miquel Raynal , Conor Culhane Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1724083326; l=1374; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=/JI8s94ok2z+hT6L0BfTNT5ICOc99IOP4jbZmyhmqiE=; b=U8JWV56QJWMg7tHj0mH5hBVpJ2WB54ZuW2LJPI+LWtGmYzVgSThVRW0Ibp8hZnHCAQ6mK1Xu2 41vCFO3ye3PDMzTam1jgN1r0x5OOy6pKWMrOhZRXtoUyeEm4aPZLUNJ 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: db33ad1e-d352-4141-acfa-08dcc0684885 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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bVvl9wshWs4b5BfErDNAWbznEvRzSUpfIJ771hXztY2ZEoVli?= =?utf-8?q?K4kU+boTcChJLF/Scc974VB50fkoDAgrKF0OwvO+VFAC927xNjf5cFKkeR9ybjeJv?= =?utf-8?q?oxNrzeGPvB3OA6O5LTBIrWuYZqSy/Nleio9QAitN/Ia+nK+1RwsTW76Lp0yJZkV9H?= =?utf-8?q?GElrDgk0dg38FAFHBwNKgvsZ8aqTSDfLzjo1i5ZLV3DnejaBAosBOS4I8uIm11r70?= =?utf-8?q?eK4mmnEhOoN/jnvekvhjTe0ycBORZ4ohFSpdTrd0XQUn0PYWjZyZ4wSBmaM8VHsoP?= =?utf-8?q?y/j/8Mbmz1Igi7ggnDWMlouEfIPyWQ1FmZhg4pD7YCgb4mDnHK3Bo3XyER18Z1mRx?= =?utf-8?q?gXVVcX7/XJQGH3S1QdrMZJeCNt6VlHvthQWiz9/1hwo8pX7peHHXU+tZR3dJWRRPP?= =?utf-8?q?xziT36osIIHP0Y0mGSTaX2KsGP9SAaWAyjhzYUM6SMGBMW1IgKuvN8sj4VF4XSJj6?= =?utf-8?q?6ErAEVR5cWZbX5V+INMTk7ntHT+tbPtdCg=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?Ysu+u4xapKD0xdfSVtaSDoaD8sao?= =?utf-8?q?9r7ZYKC5e7B2k1RTj7CMoDrVOm4C1ekv2mrZEFfkoSPyl6J4O0stkYXk+u8APDXfk?= =?utf-8?q?GVOfXvyDQs8VTUNdyN7GnlE6JiGJkH2kZiPjT/Mlcp6zQ7HCZGVDfz5PFF/MB+U1h?= =?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-8?q?xAwybjgxW4PL4m1ldh+BszneAVPg6gSUpvzGNmDsWHBojDMIYeYZ8uaJ52cWgVZPK?= =?utf-8?q?Rs4ickOckNj2n3KZvlcczZpK/tiaPURc1582GgrrCiPLAox8LGyMX4jPBkMIALAic?= =?utf-8?q?bK74CJKu/8jsjNPF+I9TOlEZT42RIQ+QCGarisqVk+yGwyBC8ccJdr84kZtQ7bZ2O?= =?utf-8?q?0Vz4+L2fYPYGXP7FbrM4B9x38ei1BV9fFQsv4lShQw7h7H0wX16F4l83G1Sha/n81?= =?utf-8?q?+mdGeLSDkTm3SRDLv51I9tc/GDlwnMiX7asyg4gLwi2mzPWWJ54+rm4f4QaDvrQe5?= =?utf-8?q?mDH3gliV5n38RB+q9J4Ft4Hpx/Cm2AVAudTKbSeUipyfyC5VhTK4TQqmrVCDJBtm1?= =?utf-8?q?1z7LdwYe8k1Yri9djktTfNizgi3TlhVKv1YhCJik8k+/HigC+z3dJjn9fTneTcx+Q?= =?utf-8?q?wC600acuwV+2SDJsJBg6tq3e+7J6I4MOdKQOWZcyTQL7tofUHDq1Hia0QxbPhWV58?= =?utf-8?q?sRF6k5k2Eggj?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: db33ad1e-d352-4141-acfa-08dcc0684885 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:10.6829 (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: GSsGBVJ1w5UfjCUM7gC2LzZGAmn9k8dSZca0T1HiSHLN9ypXhk5O8eVfP0jSPJumy/iDAH0z9udelZnL3lpP6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9659 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240819_090225_708979_70A4204A X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org When a new device hotjoins, a new dynamic address is assigned. i3c_master_add_i3c_dev_locked() identifies that the device was previously attached to the bus and locates the olddev. i3c_master_add_i3c_dev_locked() { ... olddev = i3c_master_search_i3c_dev_duplicate(newdev); ... if (olddev) { ... i3c_dev_disable_ibi_locked(olddev); ^^^^^^ The olddev should not receive any commands on the i3c bus as it does not exist and has been assigned a new address. This will result in NACK or timeout. So remove it. } } Fixes: 317bacf960a4 ("i3c: master: add enable(disable) hot join in sys entry") Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- drivers/i3c/master.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 7028f03c2c42e..852b32178b722 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2039,10 +2039,8 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master, ibireq.max_payload_len = olddev->ibi->max_payload_len; ibireq.num_slots = olddev->ibi->num_slots; - if (olddev->ibi->enabled) { + if (olddev->ibi->enabled) enable_ibi = true; - i3c_dev_disable_ibi_locked(olddev); - } i3c_dev_free_ibi_locked(olddev); }