From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31B06C433FE for ; Mon, 25 Apr 2022 02:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240314AbiDYCIt (ORCPT ); Sun, 24 Apr 2022 22:08:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240312AbiDYCIp (ORCPT ); Sun, 24 Apr 2022 22:08:45 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DC201583C; Sun, 24 Apr 2022 19:05:35 -0700 (PDT) X-UUID: 0107163202634acd832a8d3d719a9242-20220425 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.4,REQID:779af4f8-4571-4e9a-86cf-b6217c837c50,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:45,FILE:0,RULE:Release_Ham,ACT ION:release,TS:45 X-CID-INFO: VERSION:1.1.4,REQID:779af4f8-4571-4e9a-86cf-b6217c837c50,OB:0,LOB: 0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:45,FILE:0,RULE:Release_Ham,ACTIO N:release,TS:45 X-CID-META: VersionHash:faefae9,CLOUDID:c3b5f3ef-06b0-4305-bfbf-554bfc9d151a,C OID:IGNORED,Recheck:0,SF:13|15|28|17|19|48,TC:nil,Content:0,EDM:-3,File:ni l,QS:0,BEC:nil X-UUID: 0107163202634acd832a8d3d719a9242-20220425 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 680257696; Mon, 25 Apr 2022 10:05:32 +0800 Received: from mtkexhb02.mediatek.inc (172.21.101.103) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 25 Apr 2022 10:05:30 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 25 Apr 2022 10:05:27 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 25 Apr 2022 10:05:27 +0800 Message-ID: <862706781d408669cd80e7e041d96a878178283c.camel@mediatek.com> Subject: Re: [PATCH v3 1/1] pwrap: mediatek: fix FSM timeout issue From: Rex-BC Chen To: Zhiyong Tao , , , , , , , , , CC: , , , , , , , , , , , , Date: Mon, 25 Apr 2022 10:05:27 +0800 In-Reply-To: <20220424025738.32271-2-zhiyong.tao@mediatek.com> References: <20220424025738.32271-1-zhiyong.tao@mediatek.com> <20220424025738.32271-2-zhiyong.tao@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2022-04-24 at 10:57 +0800, Zhiyong Tao wrote: > From: "Zhiyong.Tao" > > Fix pwrap FSM timeout issue which leads the system crash on GFX VSRAM > power on. > Add a usleep delay to avoid busy read for the H/W status. > For avoiding the system behavior(ex. disable interrupt in > suspend/resume > flow, schedule block task)cause if (time_after()) be turn first, > we change it after sleep delay. > Fixes: 1f022d84bd19 ("soc: mediatek: Add PMIC wrapper for MT8135 and > MT8173 SoCs") > > Signed-off-by: Zhiyong.Tao > --- Hello Zhiyong, IMO, commit messages should be Fix pwrap FSM timeout issue.... ...we change it after sleep delay. (=> one blank) Fixes: 1f022d84bd19 ("soc: mediatek: Add PMIC wrapper for MT8135 and MT8173 SoCs") (=> oneline) Signed-off-by: Zhiyong.Tao > drivers/soc/mediatek/mtk-pmic-wrap.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c > b/drivers/soc/mediatek/mtk-pmic-wrap.c > index 952bc554f443..ac7139a67e87 100644 > --- a/drivers/soc/mediatek/mtk-pmic-wrap.c > +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include Sorry, I do not notice this in previous version. It will proper order the header in alphabet. #include #include #include #include BRs, Rex > > #define PWRAP_MT8135_BRIDGE_IORD_ARB_EN 0x4 > #define PWRAP_MT8135_BRIDGE_WACS3_EN 0x10 > @@ -1197,10 +1198,13 @@ static int pwrap_wait_for_state(struct > pmic_wrapper *wrp, > timeout = jiffies + usecs_to_jiffies(10000); > > do { > - if (time_after(jiffies, timeout)) > - return fp(wrp) ? 0 : -ETIMEDOUT; > if (fp(wrp)) > return 0; > + > + usleep_range(10, 11); > + > + if (time_after(jiffies, timeout)) > + return fp(wrp) ? 0 : -ETIMEDOUT; > } while (1); > } >