From patchwork Mon May 6 16:40:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13655759 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 B90D6C25B5F for ; Mon, 6 May 2024 16:40:44 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dd0VTHpy2bVFgvcWfKTOhW89P7+IXWUyI7gm237UHuw=; b=Pkhv7WLaOy6DaZ w9XtO4jGri8ETRyGd0x1gXI+tnZyjNT9SRF6zhkH/Qa3CHnQ/YFkNiUKNRzveckGAfNEgS5w5jj86 zrZ8Z0qnlS1E6i5mYHozsYscMk3SdjGPmKNxZwUMQjd4nRqU6ZFGpgqDSS4Gh2yfbVIRtp3O123YY jbvEgfnzcK+VIdb+mYg3Tzq5FMrlOIs6EXgByfqUzjUA6MSNRN+3I+BLt1hJYA23oN+oTiar1h9Mn 4Z2ZjCwE3ADvXESvAam7FbGtF7I7CY1m0RXnYWt4vOfoNY88ryXyHLp7pSFWRUheFPdRyPcNyRSXr BveTDuY/vub7vE//2vOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s41ON-0000000872z-35Wb; Mon, 06 May 2024 16:40:43 +0000 Received: from mail-he1eur01on0617.outbound.protection.outlook.com ([2a01:111:f400:fe1e::617] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s41OK-000000086xK-2Se0 for linux-i3c@lists.infradead.org; Mon, 06 May 2024 16:40:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I4EdCr+TAD39jUdCty/h+cP1qlHHtAXpqEIqi3h+YZanGvNN2MhDWwYcxNHeHgpp8CplxLvIuPdEP4mC0UfOOAAACWRXCVaB/z2nSNu/rnm8tm3tUgY2/odGRq0IHRDpk6Z1gEM+NuowY1YTqBhm58s8NCyBw00eLuay16x7IOvgkAnbw61u4xsGIGG/UFYRCfoUHV2DVAeh+h0J/nULHS11hU9I9yV3UprKYfU3GA7acjMtBh6GhDrZMGwY9cmrEhrr4jOmlg4SQfeiy+OnKcc+6mLG0B7EHrtqcsxf1VbPOA0QUpXE+BHrxEH5ANiimsHoiX1F9+zOJX3FUpRpqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=tE3RPDL6QL2unNktTbkb+AOZpVlVxRBdqM05c+svhD0=; b=k7OB0+PWzwi7p3kEUahK6QMNE/HqrvwujMMeMZXsLUjaQcK4djXz9NG3gV0wMjFyhynoUhlleu9Mhi3WW0M2Ws2jLuE+sVHrhei5O1Mvbo829QEuFyxbjmRfpvb4ydM4iJKscsCXmc5/kEQYCuvUTzz7yt7OvTCZSOecJeyT0QW5Iokz3kEKveT3h5+klFxxNL0Wyl0EG0R1xkjeSxoaIR5vIM0EsvUv+r1t1Y7vPTucUtdlU/rhao3RKDZgOxWw0fR1NKiWHE0whXED9iT1hbiawNSOfifTKwjq4Vdw0GmGzDjn8M/mAC8pOPl7Foq3/Y1OarHgLs08+xFpRdn2ew== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tE3RPDL6QL2unNktTbkb+AOZpVlVxRBdqM05c+svhD0=; b=eQL9eTNMr0ovvKr+mYfRmWJnzMCKAPFuQlHCobqa/4b8YL5AkwQRMeBR/bA7JeFmlBemNBr/gmbs219tg+hwUgSmn6ZCaJNFkQobzOoNhagrE518w9s2gtp62LIvmZ6uO8g41EicQD//liYJI+6fXTkfnIlujXlUfd8pW7WwWlk= 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 AS1PR04MB9429.eurprd04.prod.outlook.com (2603:10a6:20b:4db::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 16:40:26 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58%7]) with mapi id 15.20.7544.039; Mon, 6 May 2024 16:40:26 +0000 From: Frank Li To: miquel.raynal@bootlin.com Cc: Frank.Li@nxp.com, alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, imx@lists.linux.dev, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] i3c: Add comment for -EAGAIN in i3c_device_do_priv_xfers() Date: Mon, 6 May 2024 12:40:07 -0400 Message-Id: <20240506164009.21375-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SJ0PR03CA0296.namprd03.prod.outlook.com (2603:10b6:a03:39e::31) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AS1PR04MB9429:EE_ X-MS-Office365-Filtering-Correlation-Id: 8929be52-c684-45ee-e55a-08dc6deb3b58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|52116005|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: a7LdjT8+niJkRId1MHRLZ1ayoPhH/6HMvPvHkUektx+Qppe+poRRbIogzFEZOsSt8WSzWQeVBfvkbyjZyP6v3LomlITIGwAftimPEEzPupJ2gw8XFbz9EfNnFrRRliTWTs/il+UJk4Et2CvymWqbJNpNF01OHAl9sReRBAdk+wMNBwn6bcqmm1A6e6ZMuP9b/fht/hzWT7qzsOGRaAUAfK3qb9GedleH9QoOH8zdnoi58tA35UdgF1PJF7++sG9HkcCch+/JbSfiTNoZpbdlae28l1ZKg9vt1DruwDIwtl926zxZ7LGNMg6Ubqp2/Rf3Ey1m4Gi8p/00Qd4mHif15htHcnI1e5g3o7sDeIvw8ACVL0DAiYgYfob0SUmBN21LO9hc+rD4JKq8Rbv81/JzJWhb/nHGM5KwmoYnp8RgP7+H/vckkhvQKT3xb0z+R5iQsIX9F/qW0pPeHHwXoxHYauae0N30RfHesimHYdEU+kdzteojDny1jv5bXvIbbX4Isk/MbEvDLSjeE4vDSANYcbmXunB6kp7WHKdIxiVt/J/pdAaq1RBjSMy8/fdOdrqKvHN/U2kzXOdWDQHF/dazhQ8ykNq9T6cQUJz6jnbGaYuE+UBBqtD6nLn0Nsgap022O9PLYYziqZNQWEWlg73x/NCJl/EQZHaFhQ2sWqh5avlS0AZRtJbAjlhd638PCI6cAN/zTCbGhYPubOok9j8GSRvtqplmr/8lGPC1akVRxmaLLQONEpyyAX4RdPh2iHOdnKinVWkmneingcCNioyfxhtbXWDIfgPuovV4oegMDaOqbT0XeWrkKFEcWtb3aZ450iUokoTRD08FY34Dj0x3txcV1/O3Zy7mc9uNTIdvlbw7N/LuFKBPVM3E9KpNO7zXx6dN1gxgHyQIYUWWtVChseSzV5nUe5y8bROrrMxcY4hsp6VTpdE6d2e+zWfMd4gyuH+IvtBwafhKN7SroZ3R8Yf20MArm6fqD8MZ8x2ggF5kv0ltpkqgUahizKPkypfjp2uFxnMDecjcGWbB7Z9PLOwmD95uGXKX+VDYyJxYh4kkAslhBM+LjUrVWelTATTgJpPQrhZFHkf/OiL6sX/o5G0WQBOnNYSdPCu7yaSzvpsfKQGzni9zcTTdcvPJyXcUgXyzLa/sbI8b2OGUJieBS1nG2HU3Zz2x0/w2pFhrJTnRmKsRkAkgv0jtagUgQBPALWzMjO8NlSUk2+DTASRILUqUvqiPMbcpsjNTN4CDkAvmq25UjZekSytpv2kNbElSKLapEsEh5W+AIZQBP6xtO7B5Muj9cvV/iy6MlcSp/pO1L+frKDS7VcASkDaafl6Wumfe8ES5f9NJzZg6Ubo3Vw== 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:(13230031)(1800799015)(52116005)(376005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1EXiCe1j6onSzht7fWx7L8975QyOtm5hQ7ofbnKQcH9bZNQodLAKtQRVsCBxJzj2a7Wwdcmgc1DLwpKfhfgGO4z/lBwCFBpmuSr8MZyK8dyFF8w5oR77dE5uaNsLMYY/aTGh/7Um6eZCOmyhuv23dmmPEG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vH4TK2rJNZMRDCXyaD2thY8gOtrnkW49Oq535AOzTBUyTvBEMylgQE0oejl8r8F4bH6/3ufxisEz4DB9EYAVBEiT8DD91mP+yRgwm/0cHr2irSAwDJ7oBieASrb7ZM7Ai/F97OOq/cm6pDWh2YApfTSkEshknu+QEx1pvDo2f9X61F0Bfto1T6tRif1KWQsQ2+iNEMAYmhq734BeJd/BNtiElo0HLvv3EmUWvOO2S9Qsjlqz1hS+tQEXmSUOs0gUpNNmIbMG2UpnlpIZ63EuYrjhdA9k4DKhzKcCHqQP44Fv0oEpBLf5EVXMrDWA685XXfKa9NRyq0ipehQBXmlCJBbtz8FFDNA= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8929be52-c684-45ee-e55a-08dc6deb3b58 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 16:40:26.3023 (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: 0Spy4mvgeojPZiI6VK1EJ0ClhgcFUUKBFSmmUxCpArIomt0jDm34uLy8EugTmTo34SbmKrlAr9dZXyRDmc82Mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9429 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_094040_637951_CB210B87 X-CRM114-Status: UNSURE ( 7.91 ) X-CRM114-Notice: Please train this message. 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 In accordance with I3C spec ver 1.1.1 09-Jun-2021, section: 5.1.2.2.3, if a target requests hot join (HJ), In-Band Interrupt (IBI), or controller role request (CRR) during the emission of an I3C address in i3c_device_do_priv_xfers(), the target may win bus arbitration. In such cases, it is imperative to notify the I3C client driver and retry i3c_device_do_priv_xfers() after some delay. Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- Notes: Change from v1 to v2 - new patch drivers/i3c/device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c index 1a6a8703dbc3a..b04a55a1337d4 100644 --- a/drivers/i3c/device.c +++ b/drivers/i3c/device.c @@ -27,6 +27,10 @@ * This function can sleep and thus cannot be called in atomic context. * * Return: 0 in case of success, a negative error core otherwise. + * -EAGAIN: controller lost address arbitration. Target + * (IBI, HJ or controller role request) win the bus. Client + * driver need resend this 'xfers' some time later. + * See I3C spec ver 1.1.1 09-Jun-2021. Section: 5.1.2.2.3. */ int i3c_device_do_priv_xfers(struct i3c_device *dev, struct i3c_priv_xfer *xfers, From patchwork Mon May 6 16:40:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13655758 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 A30DDC25B4F for ; Mon, 6 May 2024 16:40:44 +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:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=To8uj0MvQ/cRmPNmuEEmCuZoRBF2WtG3jLLPflxTPeI=; b=M5quIrCnbEB84B /N0Y2ke9ITGWOZ3wS0/F0TY7zouiSkmiPcgM6Ef4DkM/wGB9S1L+d1Hq/FqKGDCp/NIfxASqg9Aki XesjrKFRvsFRPp8xgFnD4+7l4UlA623VhTLHOEDF7A5DRp6DAXPsPjIb3FFbmFvMSs+SZcHs0FSwA pP/LCBFaGQZXOAa8rfe7oYCgAdSoAQxOZvCzYatukns+4kFKspAQ3P7+bLNHUTEacrmk3JZjj/fC1 jPtPHygE2gk55j6bm5Nr+csMG2Y8mRH6O3qv+emoXnZqqcxy5BDldTce2KUd4+Ggk7AScXq+1JDPx kK45UFCr90J+zkXqRuag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s41OO-0000000873e-1Cyb; Mon, 06 May 2024 16:40:44 +0000 Received: from mail-db3eur04on0618.outbound.protection.outlook.com ([2a01:111:f400:fe0c::618] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s41OK-000000086xi-3LYa for linux-i3c@lists.infradead.org; Mon, 06 May 2024 16:40:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KPRbGu+2PLXIbo+b+afT92opVe0JhYE7dsM8ZxVfo9e9NlDxusWpM/3lLw/PTTSrEgatQGUdDklaK7RWE+AdoBaA4lL4vswAlrcdKmajKO9RXKjj5D2XG/aWwm0r7D2QpcEXtYmhCQqnAqyN8oZ8+8guQvZ6J6fhgvHAwpD8laPdnvbJOa3YNwdq+AHpiLjXhXHHxiXZLBlfF/MnHGmZkVBn6ozkYmWX0Yz8mnxJuRJ1px5ZDbgdhlLslBEaXz10o52XLtuUPtQuQdQnkTNJIPm/oxwBUpYz+F3SeU22HSocS53kUhMZ0d1eYq0kBj7ZphuXdTF90qD5ZR5zFV71xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=RZa3Ui22bl0O+Rohjhbh5GVtdNA8CI3VASFPs59f3Xs=; b=DMcBMOt7T9AwXerGTR+yQekyOdXGehLgYFKyQBtxYiiEIffUfrV9+aaiyFpB7fHK25MTnx6itOoyQXzqoY78o/40bHZPqQ4pIhpzc78aAhp2ILjZRhA6STXK07N4HSDkxB2c9bgCc8ZFP1IA5E9POaLve6+g0S4Nq0f5VOVjbU++4EbR+Ze8kvDV088BwQMl3t0rcuFhLn6h08ATwiOVeVeL03MOalMtY0k1cfO4XxSSFdrWZL2gnX1M6wOgz5RGJnkijk4gnwWnm3XFQAY3NZeeEQPp+KThuyNavOUMe5VIzqfxnZMUDSavwrp1hgF/aubgdiEYwmKkHUfvyV8RTA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RZa3Ui22bl0O+Rohjhbh5GVtdNA8CI3VASFPs59f3Xs=; b=aMOuE3eLtkFy6iRLqP6IHrpoYILrz3mV5ff66uK1V1ertfaf0HZ+v+iPlv5KkJaqe7TGEKz3mh0Gr1pjesfVK+GmYiyY7FAc8lWq520oj/L7RrkKcBubsiuvvBMDkC7yuV+nOHT2IUpqMPLLS25e+Lm/QjAoDxD2vpnRx9tVT2I= 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 DU2PR04MB9049.eurprd04.prod.outlook.com (2603:10a6:10:2e4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 16:40:28 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58%7]) with mapi id 15.20.7544.039; Mon, 6 May 2024 16:40:28 +0000 From: Frank Li To: miquel.raynal@bootlin.com Cc: Frank.Li@nxp.com, alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, imx@lists.linux.dev, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] i3c: master: svc: change ENXIO to EAGAIN when IBI occurs during start frame Date: Mon, 6 May 2024 12:40:08 -0400 Message-Id: <20240506164009.21375-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506164009.21375-1-Frank.Li@nxp.com> References: <20240506164009.21375-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0296.namprd03.prod.outlook.com (2603:10b6:a03:39e::31) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU2PR04MB9049:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ca8e3ef-70fb-45ca-4c32-08dc6deb3cbe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|52116005|376005|366007|38350700005; X-Microsoft-Antispam-Message-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iWTYNti95wKXvc/fuh8xFwFyO75cUMlFLQoGjKTE/1sSFw2zadecH7I8+D5CPgiJDjsxm9Fp0m0Y8qIq31GMQma9XUc8a/qmz6rL97x4f+ajmtzlWmmG9uWgKQKpYeSgSuz3Qfhq/GMPMJnkLE2s/P51c65WmNpyaUETLEwEHH0wgHMqCm0B7tDqCTLGqKOJsQNkl/jZG5oBvnxX9/sILd5G9nAwE9Xo8/mvGD5lMDYSl7w7Yy1k4VCkuf6qDqSyXNakPF645SCsfob8kyok5LM+EsUToapQ== 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:(13230031)(1800799015)(52116005)(376005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +5w89qb59irigpgcgafwVjYHSsS1CMp6BayCPQumfBt5Dc1crZsUj0oS15ujfKKxLHL1J+RoydlcP7PiDzEghi7Up1kMKQTPrn2lxrpMkO9kCciMmIu/YujMaR4ZLHG6xiZXKKPKCDBgDV0zdbXivCOmpblK1X441hipX/w71pCnob44a3naWcGLMnVeTIOQmQJnaAGuDCAk8gGKldlD8FhP6vBsFbMq32Wd8NhgGdc+ky0Fa2Zvn/DAV4evKYJGIVVkMIyXaErbz5P65L+I3tpt7GJ3iQElL+0PCFNc02bkH26VITQdm2pIV0zlLlDBPZ4DkUUWE688aDL+MJX/9UCbt1jFoCipePJZp7grmnA8VR2Y84LQ2yaPIOnLZyy50KmmmjnUcPg4Oze3MwDArYT1NEamCrYFSzTRZ6aGZ6vXtVgnTpeZTOhdRbUM6jtpIftHIXBFdLKtokYKH2EfuQgVMD2ShMpo0umEXaqO2SeKETQqs4GDrfVa+IqZyHEHAPcp3T5yEp9kdTphvkRhi41f0TK2YCaDNqJUwKh68JisPb/DeA/pdP5ecREIJ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-4c32-08dc6deb3cbe X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 16:40:28.6499 (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: ONRGNs81xPviuHXw2IOpy3vjszL1+nsQAHD0kErRpCAskRE0FasWl9RGM/VU5ed8NHp0C/5TMAKoT9szWoGyww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9049 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_094040_886583_C39A6C5A X-CRM114-Status: GOOD ( 11.40 ) 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 svc_i3c_master_xfer() returns error ENXIO if an In-Band Interrupt (IBI) occurs when the host starts the frame. Change error code to EAGAIN to inform the client driver that this situation has occurred and to try again sometime later. Fixes: 5e5e3c92e748 ("i3c: master: svc: fix wrong data return when IBI happen during start frame") Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- Notes: change from v1 to v2 - none drivers/i3c/master/svc-i3c-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index fd8de54b13667..94e4954509558 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -1080,7 +1080,7 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, * and yield the above events handler. */ if (SVC_I3C_MSTATUS_IBIWON(reg)) { - ret = -ENXIO; + ret = -EAGAIN; *actual_len = 0; goto emit_stop; } From patchwork Mon May 6 16:40:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13655760 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 68F69C25B74 for ; Mon, 6 May 2024 16:40:46 +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:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ANOextUdEkly0CsrTTuC6MwAV+MBwZatqmbAiJ8JeMs=; b=CrUal283Ry2fnJ QStoRi+HK8pr/Oagb1WVzViC4Chct0a+rzsKfWp4C7tyVNDdnQF572veM5M6HRB5iztzu9Tp5v9Bc cPoqfgf4Wyb7m1ODjbSIoo/7UCGfGOMOsESAWU+bznwFgStIhRoFZRoWU//F6FGF9N7PpxaEaIRm8 rE60nDUjL22F1HmCzHZ9DeFpM95b5XbNR+SqwmidPoEjCjN39mIJ3pRZGjjWc7RickEWt44QSnLFC ClIVYGDPehWVVhc/bGl6hNUnnqHm3nM0puge4HpIr4W3/rdwjzrjjrRBFPWrBNZW96PlZMGI+Zpyn T85TdCqX/eqzNQFLBBVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s41OQ-0000000874u-0TzW; Mon, 06 May 2024 16:40:46 +0000 Received: from mail-db3eur04on0618.outbound.protection.outlook.com ([2a01:111:f400:fe0c::618] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s41OM-000000086xi-3BKe for linux-i3c@lists.infradead.org; Mon, 06 May 2024 16:40:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gwVUGCCC3t0KsPFijnDflNxBgLPfKq0zz6KCkYH4T6JQZi3jdA/RVGY8PRej4ZZMIlUS5lHomYjfEPQoE2PvgtdOAWcagKjKyaZLTkkEI4Rc1R9G1pjEmjnIQXvH5lIdWlTPXSerCoi93khj71epUxRpmStA1vZmLSW3aessGA1U54wJ41kihVMIm6niqxbMQbRSKOK1FL+IV7JlDrc5Kh2l4WWH1+ItTWJWdWaX+73INdNtItvcX52W+DfJr9bNlWqgVKjbl9Qdg2DsHBOkLpleHoAFkdNN5GQ1jyVJt/EAdTFK21AvGUvHHVDc893aZYWJ0p4x8jeWXQls5ZdNmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=BbvQuI+RZS4jJsJ68lAJ22P2VWHR5xpSScaRT/EAudg=; b=RnyJjj61NuzfWFjnSiW2mSLRIGG9sXf8+gEtk9c+xUC4ztL7CSSqYGO6Qu7aF0oGeExa7RLtra9RUh1X4zOa32MGiLyLz1xtuTag1e/WbzjMSj4gWovcOc+2mFroWO/QZYDlrs2yU5WRvfZG0TPtrX+JHcZz08BYe/h5V1kXY8/nJXgmj4C2MHwndpRiEucK9wo4nMMLUMFJ0/dsch3dRFl7/WvOSJ2AwgjwRKTIh0cn+jT44lIHDpObxpxGTlUQKD7abXLHQwc6vO+VKCtufQFRxMcFVmOHMdkUmdM0Y97R5KvTaXFcW/+YMo27CeC1uUOlp+oTLVrImKeOPq/dXA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BbvQuI+RZS4jJsJ68lAJ22P2VWHR5xpSScaRT/EAudg=; b=jLpsBhWQ3QIV30M2iKKrBb6SN+wMTf9JjzeAUrZvIbG139ihkUL993dtbC+Q1A60BoEuu10fNCQhmmHwl6ckAy1/mxrHqxk2VDtkvFEoJV9ZpEgM2cDLlZLxXfUQ2b6o9o1bYt+mmhrvtM4AZxhBuORr9MVAnvonJYDLRPQPjJk= 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 DU2PR04MB9049.eurprd04.prod.outlook.com (2603:10a6:10:2e4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 16:40:30 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::1e67:dfc9:d0c1:fe58%7]) with mapi id 15.20.7544.039; Mon, 6 May 2024 16:40:30 +0000 From: Frank Li To: miquel.raynal@bootlin.com Cc: Frank.Li@nxp.com, alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, imx@lists.linux.dev, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] i3c: master: svc: fix invalidate IBI type and miss call client IBI handler Date: Mon, 6 May 2024 12:40:09 -0400 Message-Id: <20240506164009.21375-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506164009.21375-1-Frank.Li@nxp.com> References: <20240506164009.21375-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0296.namprd03.prod.outlook.com (2603:10b6:a03:39e::31) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU2PR04MB9049:EE_ X-MS-Office365-Filtering-Correlation-Id: 8dcc8de6-610e-4adf-8555-08dc6deb3e24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|52116005|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: QIQdGs/fhdrvuxoLLcYgHHoSVoEID3uUucIGDYLkh1aRq3S2ZWiHPbVf5DDNzsU+08jZGEUkGitGVdWBSOWADU6atV1UnNRf9Y74boX/PGy3BUNkf1d0KxU5fIe6CKCGNKjwmRLRWp+dYwRkYn93XiX/5lUhfrGAkh5dNsnhaSnw37bn9jUkNmcb856o0g3qYtb4qI60PfUCCR+zjDVzRuiQra6s2MDouYRAsaOxV5PgJHTav+82NtrbAcCn2+lI8WFHweIotuqpmf7/zA2wqNaIpuUjXYrVx02I6+rids9CTX9urn/s8z3XfHzFpgYd2ux8B8Nl4fjENXXNprU5aZTiAYJgXe7qIkx0MYyDDrYr6VRd19O9u03uJyUr9R4HzcxcUc5WQ63EaSRiHItQusYb9TvItlbxtY/SfLgg5lRQvHwmy/BO2fPob9OIyBLJr3U4fhvMmD3dvfx6Q3+jCCf5AMV88Bzh1lgbLi5zuktE+kFPcCCDoFSTJmLeQwMFcdEcyh5CJMS78/s4Eeiq/in/gROv4IUPhKg9FFBiZQkPO/dMRsLRomTAr7skzPvdf5bwQryy2WjVo7Xwp4prsXo+Fk4Z+3pHWdNjrN6fFcyL7bpdg2qJeT+/lmUO5UgDVvwYMg+2WeHR7z0D+vrP7W3S2EM1th/94+AZboTctyROnA642n2kWKCXDht99QPkXd26Cd2phi8SDket6AQSz9coRVzF8TkPxm0FW4NTvq/Bwfagp35FwGstgfDpMfMsB9UucEe9/PPdw6XUsUOdUwZ72WW9G/0KLnCFLT5se3QhrWUn6gC87iGDhFALe9gM4RbRdfS038NoaPSe1Z26IW9L/9mWEqn8ozGtrEx7MuaMSu2ZlcsvrM94wTl6RclVxsUT5WngGhXbm4CQpQ3j8tO0JyBRE6KdmF7xPbcqPfd+TXXVYjW4GtAUNle5k50otZYs/a/wx+6rwYs2sAWCDJGVksdJJNJbwHQla7mswxqnPccAgdlur9ie7VOjMZF2iYBpwCFP3NbtMrOMcPGipFYBFc1wfJmETHYBaK8WaczjEzQq3D/1oAgW+lm/XEw9n0BnRNTNYC+PWWQuCn6iuhttCWENT+VcJO/E7CaMrbRuheVUjkG1ifhak8GMg1gtub+/tp1V7ovj2T0WfBwtoh16/xrXcwaA5TPU1E6o0ZQj2rY4OD3UnfA1Wel5X16W6UIQUf5pSt6UlFcGoszYrw5oKxMOYoZPQwMDlxBYnk5DNWcQaz8wzBefgyEB1sK6yuwKRRQk/W3SYzyR9o/g18B6k21o7PEBhbnTjtL0QKjMPEvt4zPiDSLBVo/I2ZJ18agmU/nb9fSUfHLSStNLbw== 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:(13230031)(1800799015)(52116005)(376005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kqzO3sLF9Ga6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kKfbf4bVJxrk7UZ4AWkU5X4UjRw2Pml649Jv5FgFEabGd5yp+XsxnuIm04085x7XR9oYC8v71MFHtSXJzhpj9dwDoyHDL/sNfwq4dayVYJMuODH1QHFdrWTHFq6OwMmMeIQieGvgSNQLpB1sz3BTtyyCyYkJz09g4Hm47UqOKQoIELBA6oc/u1MIFP1EYuO2M6D8XUCtX+MFpDDNyFp5wDZW6mvEISzirspgM85SkWdCK1Zo+cnjJSPNKZd7tJikRA2JehyILfHcbtmA1t04IZcKI5h5iqD3mB4MuV71i1v8ehGYTmPWrjz3Zgh8kkNJCDqsOEfIEBrpBuKc8LXUCMM3l61XVjRKsuVZhG32tzWG0qjHSLHi6bRdsp60hWkXzHeLsd+h41yyXtjJ65eajZpe+sBBcCGjjtgBa47tBxGFSYCWTl56NE8u3fhu7cujfi9TpUY0uoSYQ5LLg5mG1987dg6gnr+FyzqGZGlmY877K4= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8dcc8de6-610e-4adf-8555-08dc6deb3e24 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 16:40:30.8384 (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: U23bqU1BIpZ0WIQDYK5bwhEH++OLpwlLD045WtK4EgkOcqU5vqVvPb0W0scYClNdPttYGKBkCI83BXNTu6tMWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9049 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_094043_335758_C7D71D84 X-CRM114-Status: GOOD ( 12.58 ) 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 In an In-Band Interrupt (IBI) handle, the code logic is as follows: 1: writel(SVC_I3C_MCTRL_REQUEST_AUTO_IBI | SVC_I3C_MCTRL_IBIRESP_AUTO, master->regs + SVC_I3C_MCTRL); 2: ret = readl_relaxed_poll_timeout(master->regs + SVC_I3C_MSTATUS, val, SVC_I3C_MSTATUS_IBIWON(val), 0, 1000); ... 3: ibitype = SVC_I3C_MSTATUS_IBITYPE(status); ibiaddr = SVC_I3C_MSTATUS_IBIADDR(status); SVC_I3C_MSTATUS_IBIWON may be set before step 1. Thus, step 2 will return immediately, and the I3C controller has not sent out the 9th SCL yet. Consequently, ibitype and ibiaddr are 0, resulting in an unknown IBI type occurrence and missing call I3C client driver's IBI handler. A typical case is that SVC_I3C_MSTATUS_IBIWON is set when an IBI occurs during the controller send start frame in svc_i3c_master_xfer(). Clear SVC_I3C_MSTATUS_IBIWON before issue SVC_I3C_MCTRL_REQUEST_AUTO_IBI to fix this issue. Cc: stable@vger.kernel.org Fixes: 5e5e3c92e748 ("i3c: master: svc: fix wrong data return when IBI happen during start frame") Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- Notes: Change from v1 to v2 - improve comments. drivers/i3c/master/svc-i3c-master.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 94e4954509558..032fe032ec433 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -415,6 +415,19 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) int ret; mutex_lock(&master->lock); + /* + * IBIWON may be set before SVC_I3C_MCTRL_REQUEST_AUTO_IBI, causing + * readl_relaxed_poll_timeout() to return immediately. Consequently, + * ibitype will be 0 since it was last updated only after the 8th SCL + * cycle, leading to missed client IBI handlers. + * + * A typical scenario is when IBIWON occurs and bus arbitration is lost + * at svc_i3c_master_priv_xfers(). + * + * Clear SVC_I3C_MINT_IBIWON before sending SVC_I3C_MCTRL_REQUEST_AUTO_IBI. + */ + writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); + /* Acknowledge the incoming interrupt with the AUTOIBI mechanism */ writel(SVC_I3C_MCTRL_REQUEST_AUTO_IBI | SVC_I3C_MCTRL_IBIRESP_AUTO, @@ -429,9 +442,6 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) goto reenable_ibis; } - /* Clear the interrupt status */ - writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); - status = readl(master->regs + SVC_I3C_MSTATUS); ibitype = SVC_I3C_MSTATUS_IBITYPE(status); ibiaddr = SVC_I3C_MSTATUS_IBIADDR(status);