From patchwork Mon Oct 23 16:16:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 156972 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1405428vqx; Mon, 23 Oct 2023 09:18:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBSgtK2gpPBfxT6bnr22bTcTUZMg0BgECBTQnguWoNOcFh5dx81zTJwc+N3efceRk+7xfd X-Received: by 2002:a17:903:22c5:b0:1ca:8541:e1e7 with SMTP id y5-20020a17090322c500b001ca8541e1e7mr11908940plg.22.1698077898861; Mon, 23 Oct 2023 09:18:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698077898; cv=pass; d=google.com; s=arc-20160816; b=J+zxsmU2G653FsE/27WTrPjsKMrJJbykjAfxLk5k9g62V0Mx7gOTpfIG6dsifnq7xR SOrBQ9OdGVWipvd2KTeqFvtqjVy08ajoIU+6sato3HMHH2M4Mj8CTLcVlgtCiGHhVJE7 yuSndmTWy8nRfnDw6yXCs4rdQxDvdpxcj1FUwpFKK7Oz0Riw/H8RjLHgi5O/MPql1o6i To0tyTtnEhqv36ox3n6ElOCS9Z+NpxuporRNR1S+9MrpuQS5Tyf3YL9+UiTGN1Nqforf dMZDiFBXx7WMUEs+q+gNdhd3/dQiV8Y/t8ibAZx02SJWDl/bVYiKesunroKfXdI9RVf+ y9cA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nxBwTfviefvCF4FZJghiatpkh63SM3ZApfysbHSxGKY=; fh=E7JNjAJdSu5PUjZ4Tphj2KJeWxfDCW7LpfLC+N7cHJ0=; b=mILkagB+rmzSB46PRo5V7i+SPUbxclU2i87+JpcsQcEsOXjDSXSqlwH6Q3gSUYpgsi CcK9+ik3na9ery2I75TCUgk9fplExqgn2u6u5PibIB++nUEahyfgh/xQb+M9jOgWKreC 7iDNDXiaK5CDrtPcK7BdX8T+ycugilj2ayB3WJh1PuQA6YdOIljXs3XadUBpW2rqPZhA URQYFHwBidon5vh9geHaSfMjnQHgOr+UrbYJt7Da3zGh9icLQAYcYJLkBeXyQ+POTqAF /oACDskku6oZBcs/2DpzPT1pLbPrz/ND5EawPASFNnXNyPW3kxulps1Lkxys1HdO3oVj AFQQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=pbOcV8Av; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j13-20020a170903024d00b001c9ad75c067si6983196plh.149.2023.10.23.09.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 09:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=pbOcV8Av; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B132880AF3EB; Mon, 23 Oct 2023 09:18:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233692AbjJWQRy (ORCPT + 27 others); Mon, 23 Oct 2023 12:17:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233641AbjJWQRb (ORCPT ); Mon, 23 Oct 2023 12:17:31 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2056.outbound.protection.outlook.com [40.107.6.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B77610EA for ; Mon, 23 Oct 2023 09:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BRLI6FkfM/TdaI18u///YcnF0M0g1tIz0GvzM0xejITvTwaYIhkh/+mwTEOBeU0gvTiWJQSTt0jnelZEaLCcaZ9Q2VPV4oGKoyhvE4KqVyuh498Jl19lut+7cQyRawOyUR8Wx9Iu+DT50gXy2eIPKOM9kZQfAKWVH0JgrS1hwkBIzNAxQGDY37y/Omc7DnqDf46DyUgEpWXJTKC5dEmjduMBvtc4LaUTk4ILjtJfSge7u/bmUwYN10pb/9dK5/f+mGs/xap3KyIbwitgojhygMpVG+NOOBf+uJZfuAm5E9B5WMKA+aJdchc9L5IHzCC7TaChicD0G2twYbOVEVo3ow== 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=nxBwTfviefvCF4FZJghiatpkh63SM3ZApfysbHSxGKY=; b=SNnX29DqPMWWJ9x1Ds5XY/6Y5ps95vOjaahe6vSPe0wGM7Zlmbcql3s5IW8TEgkXJu42Ry+7iAl2uZtUbuVbxF6RAuuYVmmHr6AHZsDEwrPgKsAxQ4rBff0z6i59qZQf0TfhlE8t53ua+RiWURRKEPNY259vuGItGsJrW4/SwfYNX8CwbI3F33hkZfkyXbDTG9IRG5aCXGFK3FY6saxSCkeIecVyrFZHSSk/0JqP2a2meOrANJ2z4anAe2h3Xsnc7OdiEPhLv4B642QxppnLnjT4xOYjbo3v+2XUZ5yjyQojNA6DcyDyJbS2JWmzAGYcc9zhvENs7omtW5s5ZfV7oQ== 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=nxBwTfviefvCF4FZJghiatpkh63SM3ZApfysbHSxGKY=; b=pbOcV8Av0KqKjZ5l+K+zgQjOsDMsYc4Vq1aB2o3MjVX2avT3yaZCu/SBJiXZIGGWNl/zF8JDHQFr8wHpctq69Yaz7vPQ5ww9INCPjHnMMv/spEugLKLdDpcOLw32T2Rw5VfnFTVCE1ogd2buW5liSZTdMYJ1GucalyYlSvl0w4s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by PAXPR04MB8655.eurprd04.prod.outlook.com (2603:10a6:102:21e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.16; Mon, 23 Oct 2023 16:17:26 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::97ca:a905:8e64:c098]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::97ca:a905:8e64:c098%6]) with mapi id 15.20.6933.011; Mon, 23 Oct 2023 16:17: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, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 6/6] i3c: master: svc: fix random hot join failure since timeout error Date: Mon, 23 Oct 2023 12:16:58 -0400 Message-Id: <20231023161658.3890811-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231023161658.3890811-1-Frank.Li@nxp.com> References: <20231023161658.3890811-1-Frank.Li@nxp.com> X-ClientProxiedBy: BY5PR20CA0002.namprd20.prod.outlook.com (2603:10b6:a03:1f4::15) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB8655:EE_ X-MS-Office365-Filtering-Correlation-Id: b6aa3968-6fb1-4441-0e8e-08dbd3e38bc9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8zCVGeih/1XImRLE1hl3BcOTxLhQr7KRepfcuRX6ha/BJfmXPe6bw94yaVdNh/u58eVxmV4gO2G7rKDVqAMvxFpUKBj3eSgcoLeiEfUb9PHpDPX/IRpktinvigrtFPYRTtV2pNLnJ4DpIJm8jT/75kSVYyNg+G0uBU8SDYSx9pjaufZB3NDDimrQl0UE4sz5bahXtmzhUssUsK2KUuNqV+lgP4qb4EQJikJYuOqWf09CMo4tyEv9/eEZXX9KAlGi9faKO6je22yyUbMUCfQF9huuuliR/C+bvuUqc1xTgJa6t5nr1pGEyn0Qh1/uuNHFl5TnaXVjM5OGgadqH46Z5pxDHB6py35jhv+4QfTiowwJOGp9NCNhZXHWOKlnJO6Vsoyc0mXOH31DtIZeTH+IigJB0UlYdirJuPu+wXcMP6axN5DzHA8CvWfOfqo2X1cCGhCro5XfuQbbckm61zZf/WecHG8cGPPyZAP4CGhnxTOBZYQ5Yhh8xPCGKd7AWBg0ohTxfYUCOS7rD54Rm5yyAwOcxJMu0v0JRjWX5mDNBdRPVj56v1zy2dQWHQFJ6C68dRHx5jQ9tnDAy84qlCJgseWS1pP3jm6bz9/+16q6BoED0Y2vxAD3uBd6YyyuEMJW X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(39860400002)(366004)(396003)(376002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(478600001)(6506007)(6512007)(6666004)(86362001)(316002)(41300700001)(6916009)(2906002)(6486002)(5660300002)(52116002)(36756003)(8676002)(2616005)(1076003)(26005)(38100700002)(8936002)(4326008)(66946007)(38350700005)(83380400001)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?PT1brGKV4OG8gqr6IIyZmMI+uNPU?= =?utf-8?q?VHvhy0J0lN1toYdiQCbNblKFGHrFAl/HZRLC5UiqZqGlJ54u6shusthfNVhDVzFI0?= =?utf-8?q?9/tcMLEY9f4GPrrULr2u0hBt5xHEIkQCfGR0B0Iv6Fx/u3lGwbMOm7x+CRQGA82PA?= =?utf-8?q?K3p+rxXwBFZV5ZM7cyifuAkemZNLuY2mPljBr7A6bH5snSY1YyL1EBFkfNI2YPLsX?= =?utf-8?q?l5Q0uKiFVHFGFc56iGG+xJWLaWm8nmeYfdGofxXYWcthmHXlEJWOiIzqmcWAuBY+e?= =?utf-8?q?vaOfeXICNB4VcaxMqQ73/H5ClGHYeSdd3sub3Hbh4BWnQkndIqJsHgtaSPq+G/wdc?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091pwhmSQM+7?= =?utf-8?q?yqdgsX7FwhnB7o50MFZ0IUuqjtQE68zVpSz6tx01pUBqyXMGSrH6HpQqlsprOfKCu?= =?utf-8?q?aWKy2riyVHBeLm3Hk62Ym6DSk91JXM25UVrhKfzzumGZYEiVGLe7IL26wgZpbazDF?= =?utf-8?q?5m+E30ukTeulWkNuSz4pUtx13N8pvbqGV708nrcD+gCRWoN3X7yklRBra9tlVI13m?= =?utf-8?q?pxC6flc/FQL5gunO0H/ZLKhr7/KgqxYUZUW9YK559b+Ou40MdmERwN2Yblieqmd8F?= =?utf-8?q?4tyGm6GxxNlkoWh+imqplF3Pj18x7VQf+bRCr2ac500w2njWaLLaq5F6x5hc2oylm?= =?utf-8?q?xOXC/lq8NzQ7?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6aa3968-6fb1-4441-0e8e-08dbd3e38bc9 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 16:17:26.0587 (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: Fv2aAifx1F2hnB4a9mY7Ky225TgNnfdoQNvWE8DzyfWWSXdNQy2obMMT08ujlHnYmFcBAsyMQlKzPObKwtOM2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8655 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 09:18:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780563730979103967 X-GMAIL-MSGID: 1780563730979103967 master side report: silvaco-i3c-master 44330000.i3c-master: Error condition: MSTATUS 0x020090c7, MERRWARN 0x00100000 BIT 20: TIMEOUT error The module has stalled too long in a frame. This happens when: - The TX FIFO or RX FIFO is not handled and the bus is stuck in the middle of a message, - No STOP was issued and between messages, - IBI manual is used and no decision was made. The maximum stall period is 100 μs. This can be considered as being just a warning as the system IRQ latency can easily be greater than 100us. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- Notes: Change from v3 to v4 - fixed missed update commit message Add dev_dbg for TIMEOUT case This can be considered as being just a warning as the system IRQ latency can easily be greater than 100us. Change from v2 to v3 - remove 10k at commit message Change from v1 to v2 -none Change from v1 to v2 -none Change from v2 to v3 - remove 10k at commit message Change from v1 to v2 -none Change from v1 to v2 -none drivers/i3c/master/svc-i3c-master.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 1a57fdebaa26d..6b6bdd163af4f 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -93,6 +93,7 @@ #define SVC_I3C_MINTMASKED 0x098 #define SVC_I3C_MERRWARN 0x09C #define SVC_I3C_MERRWARN_NACK BIT(2) +#define SVC_I3C_MERRWARN_TIMEOUT BIT(20) #define SVC_I3C_MDMACTRL 0x0A0 #define SVC_I3C_MDATACTRL 0x0AC #define SVC_I3C_MDATACTRL_FLUSHTB BIT(0) @@ -226,6 +227,14 @@ static bool svc_i3c_master_error(struct svc_i3c_master *master) if (SVC_I3C_MSTATUS_ERRWARN(mstatus)) { merrwarn = readl(master->regs + SVC_I3C_MERRWARN); writel(merrwarn, master->regs + SVC_I3C_MERRWARN); + + /* Ignore timeout error */ + if (merrwarn & SVC_I3C_MERRWARN_TIMEOUT) { + dev_dbg(master->dev, "Warning condition: MSTATUS 0x%08x, MERRWARN 0x%08x\n", + mstatus, merrwarn); + return false; + } + dev_err(master->dev, "Error condition: MSTATUS 0x%08x, MERRWARN 0x%08x\n", mstatus, merrwarn);