From patchwork Wed Oct 2 14:50:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13819875 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 8A684CF6D28 for ; Wed, 2 Oct 2024 14:51:58 +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=KcplNt/0eHO6haLmy9+4goYbAN3FupVLz/URzN8U6sk=; b=HxG1pfXNPm2nqhqJQd/WOtNVix sNzzjfw7YiGBU2CLwRCCBCvgwtyY4SAuLOrI7xonEj6wY0zSRfm7DkJ18cAZhue6wVLQ74hoZdnLs 3ElN4r72IOJsgVbxqMikIQAJ4FdPo2LHmkZuwSK3ckJ5Zm9hmbknlCwFoDaxHRsFmljFwjpfqrKU5 2egcoDGdCMQxhsz2KsA9m2AW9CH7er3BPlVaXi/1u+SyKQxxV6K8uctV71FXQ2aTo8D3/rL4a49/E U0Crn29Vy8S2S6wLfcJUaMmufykCM/7YsLtrULeo7QRFgD074qeUuknY8gMrr68xwZ0+4/XkyuFzs K76krWdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sw0hq-00000006SwD-0Xyr; Wed, 02 Oct 2024 14:51:58 +0000 Received: from mail-am6eur05on20610.outbound.protection.outlook.com ([2a01:111:f403:2612::610] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sw0gw-00000006Sin-0b4S for linux-i3c@lists.infradead.org; Wed, 02 Oct 2024 14:51:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KkYZ+zE2rMHlnc70VSAQ100789i18tAaO8SQTNbW4kg5CWGN+r4Cp1ETZG5/L0hjL6H698ejpvxYORdf4ouqDoAEidFXkvSEolcOoP2k1MNvNtrvsEF4eBp9qXNHDUqgc0R8GbVGeOWteNRhTfkHdqBmsXslG8CYevugKWB6Ym5ITHvL+G1ML5Js60SJHIR7X7lEl/YK46L0p2mK+DKpIpLA+fDLgD7tqhSFFXtKJf8v23MFQOBYWUV22wGN5CqnmbH2oKoTGnexE3WIMJgw0i2XpOmIq2Mh/Fq8ppYSodws+dmteD6QFp4ES93tCQW9JU8lbU+RqMpgq0GmemYm8w== 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=X3g4JdrXttj+9kVg/nPdSIQfctPvNkrRl+XAcULKDEM=; b=S9pdwUc1dRVSoCrkEhdsicNH+Hg1hivnE+JDuV8sOsXdT0uJ2hzHRSzFuR+JSUEW6z15qdYM0J5XsCaV+wQayL7WjWrtbYitcuNcqUNN2H8cps8vCOH2qONTIqW5FLu3Jkiank8iMerZPXo9rJM0lX91alPCsQxWTv1E31cyCqby3uOQM3ay/pXw7lcVnMHZdLJssmxYzqG19su0ZOKWtH4ustrYiLAk/IEwk0XRy/Af7hvaNNGxcn3201ilSFjdkyS5PZMKjxPzWyAn2ih8llcEp2PsBwRCXc7JPiOwtSLzINYfVAY5rmkDdqDjqr9N3WjHMxyluipIzlbeaXdZlg== 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=X3g4JdrXttj+9kVg/nPdSIQfctPvNkrRl+XAcULKDEM=; b=e7iwHWOW942zd9e1aU+MKBpxV6Krlc+S+tkBT0jQKHO+LM3Sz0qlQKeu+mW0XREBFhTxGvANa0xsv690yhgGb3rdDm6RQuK9fSOSFWNLcwpevJYwwEKEcJlXaE7kiK8KumBDfV/uDJEOV8ZbNtucVzyJ2xZH8XJdC29+7G4j8f3pEdMkCzQBlGKbhv7zxZ5SWh/TdC1h2yflwhscszxNxfNQ0uV/NC816BUyEwr8d76CSsJLm5qHE/KOfICS6ulIkIUpSV2C6dpCFvCJZ4fJ1gNS6qyO9qUfsTOVTe8grBBKq5jO/S25rEwyQDdQNmurwKpHBy5qGDaOa/3hbmZM+A== 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 AS1PR04MB9699.eurprd04.prod.outlook.com (2603:10a6:20b:482::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Wed, 2 Oct 2024 14:50:56 +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.8005.024; Wed, 2 Oct 2024 14:50:56 +0000 From: Frank Li Date: Wed, 02 Oct 2024 10:50:34 -0400 Subject: [PATCH v6 2/6] i3c: master: svc: manually emit NACK/ACK for hotjoin Message-Id: <20241002-svc-i3c-hj-v6-2-7e6e1d3569ae@nxp.com> References: <20241002-svc-i3c-hj-v6-0-7e6e1d3569ae@nxp.com> In-Reply-To: <20241002-svc-i3c-hj-v6-0-7e6e1d3569ae@nxp.com> To: Miquel Raynal , Conor Culhane , Alexandre Belloni 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=1727880649; l=1900; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Gqd0wCYgtoBFMpBxtk0AaOasL9R8L0WjBcTL6xq2nd0=; b=yTdOKTPn+Hk4AHdfqpLCafDEvmCl2BrJJxQOVbedY6RqaFUBlJ0BGf+gflgCusCn1PCsnkUsn f8OQ7scY4pHAVImiva3L8kVM/j/nVX33oQCoyxzyx9Gom48JoOQtYYI X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0177.namprd13.prod.outlook.com (2603:10b6:a03:2c7::32) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AS1PR04MB9699:EE_ X-MS-Office365-Filtering-Correlation-Id: 48628745-f4cb-472f-994f-08dce2f19f01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?RAXKm7raruJPlahhfrbiNGRIomxExaH?= =?utf-8?q?pIt0g04XnQValLf/rt8jjxypQKyshG88wGjgxFi8Vh0FVP6CvLvACT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X2tFk6kPX?= =?utf-8?q?ySEEoedF4LjdXtEDLMMCulejLKiGgKWN8OuS+DFo0s3JsvtP3ivOPKdfNmU2LkL6K?= =?utf-8?q?wY9qkgNgt1xxjMhwcdFdfmOIyGkH/4gn8sadvPFqBX7x93mkvSLyi2MV7SBeUf1zM?= =?utf-8?q?a3GqF1jGCY5eTljJ24pCklxPMnc4QdIxrAX+yIrsBOjd1xVrU1JSr3bAF4mTbO2YX?= =?utf-8?q?x5xaRUhWRURyWGA0jE/2J3popSh8hnnWBrb6U7DlQXL1zmbCKs5PHhCLFVa+/DjDn?= =?utf-8?q?E/+/VxckybCYfumGqNRuhKLAWQ6/n2eGSh2teyL4PdDyGD1r0s/ALx3C8b1JMLXiq?= =?utf-8?q?gVl/9D2e/OsBI+1oCslcQBoqFjnYs5e05gA=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)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?QOaeM/6qBKhXImNdykHBLIgF6Qq8?= =?utf-8?q?4SG3VVA7nxeqZSjPUtkauUussLeXWLeQYykEwPWWOp+4jzKxqtU6l4mXxHWIkJV9f?= =?utf-8?q?nvW3yaXSmtaP8zJ1IECkqbLaKD+c2z6QGOd6mUADN8d1Lqqpyc+TDp0GcgfmMMxm1?= =?utf-8?q?u0gYqDoXdFkl77jYylShBmUk/NidDSGhv3jKV5NGdjUiU67DDgBF0g9xporWzvfXx?= =?utf-8?q?bdYRDZ2GNIqEacB+IzG8OhmVgN6QkV5QNz3KfxfVFtxagLhm6ldoID0r+KC0wusti?= =?utf-8?q?N4NUYYK3F+TQSpd46Gb5f1s76KzZR//d4VJ26C+kECZczXC8RPu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?= =?utf-8?q?4GHhgWBeupadoTcWxQ0FavJeyshLvmnm+MSVWC6eUA4R+wq2zSy0prpTsHsEJnqZU?= =?utf-8?q?fwI/sc3ezVnV8yjKGHCHpk5Bfcrmys50B6PobT6pfSwxQgenZGuP4QFU4BviKuriW?= =?utf-8?q?j0I9+J7bew/GUmKNce/2uh5mcGG+4kqy/LbYHZBTEX8gwPep9V6qdK5E4MwLg0MhD?= =?utf-8?q?j/fYCa6tBVGIH9sn/WBp2Q/5zRCkinHZ7/K4xXl2HxSxfOLRACD5pN2w0a7+k5gQJ?= =?utf-8?q?tk/JS1GJq8tNaN8En9o3NHjR9Aav2LJi0+lZQ7Eb5jljVmfygVtLDsp9m9ASoon3X?= =?utf-8?q?0ZeW2srdWYDl?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48628745-f4cb-472f-994f-08dce2f19f01 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2024 14:50:56.3360 (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: 1xd52IG72cRUZpMsDz/QlwkyrX7bmWjP/Z3fgFCd74g2Z8DugpepE4TYdLBAoSNp6M49Le+7PR5fBnqzQqx5zA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9699 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_075102_221109_A1884E9E X-CRM114-Status: GOOD ( 13.48 ) 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 the address is arbitrated at send address, the hardware can auto-send NACK if it is an IBI. However, manual emission of NACK/ACK is needed for hot join or controller request events. Add help function svc_i3c_master_handle_ibi_won() to check event type and send out NACK if the event is not an IBI. Reviewed-by: Miquel Raynal Signed-off-by: Frank Li --- Change form v4 to v6 - none change from v3 to v4 - add Miquel review tag --- drivers/i3c/master/svc-i3c-master.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 7cd3ce2643f1a..c35a228f0c2f4 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -409,6 +409,24 @@ static void svc_i3c_master_nack_ibi(struct svc_i3c_master *master) master->regs + SVC_I3C_MCTRL); } +static int svc_i3c_master_handle_ibi_won(struct svc_i3c_master *master, u32 mstatus) +{ + u32 ibitype; + + ibitype = SVC_I3C_MSTATUS_IBITYPE(mstatus); + + writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); + + /* Hardware can't auto emit NACK for hot join and master request */ + switch (ibitype) { + case SVC_I3C_MSTATUS_IBITYPE_HOT_JOIN: + case SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST: + svc_i3c_master_nack_ibi(master); + } + + return 0; +} + static void svc_i3c_master_ibi_work(struct work_struct *work) { struct svc_i3c_master *master = container_of(work, struct svc_i3c_master, ibi_work); @@ -1177,7 +1195,7 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, * start. */ if (SVC_I3C_MSTATUS_IBIWON(reg)) { - writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); + svc_i3c_master_handle_ibi_won(master, reg); continue; }