Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3824724rwb; Mon, 5 Sep 2022 20:11:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR4n0pf2l90KslZ3ZzTLNHFVeJgK0m8tJlbULvb6h+U7lH7T3NXjM4DjwB0DiFm0+8mviE3g X-Received: by 2002:a17:907:a058:b0:741:72ed:5606 with SMTP id gz24-20020a170907a05800b0074172ed5606mr28353420ejc.452.1662433875033; Mon, 05 Sep 2022 20:11:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662433875; cv=pass; d=google.com; s=arc-20160816; b=yScilpzUXt2RD1cNJYsvslmlsN/2z40fKAUlTpKg2186ZyW1FF3Edas24d/di+lVwZ xxqVKhA7gyF0TIHzmUlS1hhTXiwOUD5MXYzV+3G4dqZeIiqKgghHQwMahO+cF2D1kwxn 8MPmTxW5fl0FbvBVX8/QmplWftSI0ii/x+gjD3vkultwFB1NV60f5cjwCXK98zQJRRKp vBhoQZs5Byh6m9oa+KOB9tS7xqecuJ+KsgJiuzM+eVZHgd7zxykwZkYnLTFMJSD4zfqD p0dfBC8QXsYeMcj1FE5JmXDdccnHygFpIRSpcXBEr6hfFPrc/X1eQ8E/UxxLCVaTHv8X qSkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TSjVfscx5eAwvDv0ILiVYKmxqhjb1+FZ5X1sB2WTaDk=; b=oWz/NzesUF29ZO2BlH8Gk2LjRnx4PU76Uu14Ts2fDe09kf15HrLS0xJw+YPRSX5bxM messSe7wskUizkIuBfgVt34M879/EZ15D0ZGtQM8EmHKyAdcZ5Nfv7Y3bWFn2VkYRxRl 7tOVMda/1P+nDiXjnaF/SPhwu7x0Yk8YBRPZygWJhNXzkaKebDJzm+DW3XyZc12ZgHUF myeQvC618/Dyg1fS5Y4g4AAaPCzl8SmP+2m4Hxb8Ok229hIF03UZiPYnTR/0BIT4LEXx YOCpANoc/jYg2/htQ9KBucQWzITnPZ9Ppj/ycHPFL0prsy3NI6FyZSbmAI848vivHHdY OJfA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b=CTS7l1dv; arc=pass (i=1 spf=pass spfdomain=analogixsemi.com dkim=pass dkdomain=analogixsemi.com dmarc=pass fromdomain=analogixsemi.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analogixsemi.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020a1709062f1000b0073fc454c591si7980174eji.153.2022.09.05.20.10.50; Mon, 05 Sep 2022 20:11:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b=CTS7l1dv; arc=pass (i=1 spf=pass spfdomain=analogixsemi.com dkim=pass dkdomain=analogixsemi.com dmarc=pass fromdomain=analogixsemi.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analogixsemi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237420AbiIFC6P (ORCPT + 99 others); Mon, 5 Sep 2022 22:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232850AbiIFC6L (ORCPT ); Mon, 5 Sep 2022 22:58:11 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2134.outbound.protection.outlook.com [40.107.101.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 834266BD5B for ; Mon, 5 Sep 2022 19:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WP1xtwEd1RXSToWNvrNhzZeNTdJhuQwHzly5rGKkqqJyCqP0TolJZvl51rGTjypQ/S/L6K+AarY7F6DAriemqvBRMFL1fmNMY7JeQKiPTtH9WdeYoN1Ldy5jftO5xlIIwJvQ8LtTswwqLuGlKhbGbPsexsyPeXvzyOTVPKmJzZIcPrdh9vlPThKYCvF6X8Bmiw6ZLW64WvdXfoNXBj/XtgWeR5HICoW1zzMeCJp9LyO9nVm1hUzsxYNdqQfgBoHkiIXkKtJeHiVeaMS+10FL12DuLESPS8MprmCvYqCY3De3EXVDqbEuHKi1TqIERG7hcs914CYfEI73utcfQ40mpQ== 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=TSjVfscx5eAwvDv0ILiVYKmxqhjb1+FZ5X1sB2WTaDk=; b=Pd4kJQ0pN4QjLja0v2t4v1KKLB39D1FupItsSme3yJmU6yqGIdBpn5plJ3/mJar0Q8ITV7budDm0qzsvS0XZbHErpDVYWSHtESCzspp2ndbBRegTHbapIdunz3nq+rIhSWT2a7bha5PkWxJuABD4Wt1Nz3JA9yMeBS4Ev/7f9drpGvRWGC3/xoeyJAVstBTO1Babmwb02w3g1pN5C6BeobuLwWiTY+v4fSDaxH8pKrGXrTDuQaXOrNjNLtIuViqqevtkUT0tHSWI+NehpJjfjQFUnSClT3K7XcfYA8bXI/7gzFob35zJML6d7snBOGNMwmsdrCVoGp9sXGnDQCmz5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=analogixsemi.com; dmarc=pass action=none header.from=analogixsemi.com; dkim=pass header.d=analogixsemi.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Analogixsemi.onmicrosoft.com; s=selector2-Analogixsemi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TSjVfscx5eAwvDv0ILiVYKmxqhjb1+FZ5X1sB2WTaDk=; b=CTS7l1dv9OdpKz/lTXr2dHAEM3/esN0cOLDGPD97fH9vld0dcnjz51FCRSO6D59TmMM/Up5D13b6n7MaoLulYVaQy0itql7FIqfNq22su1QepBq8FaAQMmwCeYoGethTpDc8md+QXKGOsnFu11gU0U58DibtUW3qoGPvER4s1OQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=analogixsemi.com; Received: from BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) by CO2PR04MB2197.namprd04.prod.outlook.com (2603:10b6:102:c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Tue, 6 Sep 2022 02:58:06 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::1ad:536d:f2aa:8d13]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::1ad:536d:f2aa:8d13%3]) with mapi id 15.20.5588.018; Tue, 6 Sep 2022 02:58:06 +0000 Date: Tue, 6 Sep 2022 10:57:53 +0800 From: Xin Ji To: Robert Foss Cc: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , bliang@analogixsemi.com, qwen@analogixsemi.com, mliu@analogixsemi.com, hsinyi@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/bridge: anx7625: Set HPD irq detect window to 2ms Message-ID: <20220906025753.GA642918@anxtwsw-Precision-3640-Tower> References: <20220903130833.541463-1-xji@analogixsemi.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: TYCP286CA0091.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b4::13) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d913f8ae-0360-4ce9-b9ca-08da8fb39f29 X-MS-TrafficTypeDiagnostic: CO2PR04MB2197:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D0LsfaDA60wEbTCDTqwlrjd430Ncwbwi3VeYlTpd7VyKhIapurYCsYMXiY5/CiHqFiIngpn21BUxk5w8NViI0lLDvVNGbpa/87g870sp2T+QbnzaAF6tvMKTIkNHwV0TY4SrHjXowmluztRE/LJNX/TrZsm3CGmD3/CFySrt/tKGIy+xP8RquwKDbTS7n/a4gxjHhUmdULZWLAnh4u09BK+PhY+vL4to0fnTkaH14Qcxuu7eggx/zGQY3Kw9KyxXC4z4nqOETz+OCdysXdMoUAr0wAjkht5F59rEYWNaWvtdjf6B1GMlIs7q+zjCoN1M0oL88J1lkBjhHPqvuyYyogaPW17gUVoHKDvqBiwg6m7sViPy3aIChQcVTMv8t0RWUocZ1Dwi6ops9N6WOk6ohGU+rBJHuFD2tOKri1PBC+sMT7dm18EcYhnUgp3U7mysgib19BFOPrMW+UqfVrTmNTK3YViSsokCpx7KTv34kEYBOGU027nHJxzCHRT0XA2h3fg0i6Lqau2NEUVALyUwUeUSMQkXZyXrRV1CupH5hNFv+NG915ffG+0CmrH8WvDaiouuWBSB41l9IyOqbG8nWDEm6vdHVxUv+bjdm4rAbekl0iOPyWwBRr47cOZGv9SKVi14+5BV1vgrpWT4NusbSXYixh8WhFpMHI8ZOdv66q6xjR4UUxCM4CBTgTBzR3dHRkhc5spFsU2SuqScrMPMORlxAQgeFZRhM0UVYmr4G1xPE1sX7ouOg6tzvleBOYlShRBmVCzr6EyEY31CtgG27w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR04MB6739.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(366004)(376002)(346002)(136003)(39840400004)(396003)(83380400001)(186003)(1076003)(6486002)(316002)(6916009)(54906003)(66946007)(4326008)(66556008)(66476007)(8676002)(52116002)(6666004)(86362001)(26005)(6506007)(6512007)(2906002)(9686003)(5660300002)(33656002)(41300700001)(478600001)(33716001)(8936002)(7416002)(38100700002)(38350700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6jqr6qqeilE/htiXUXBzL0q0vPWqApvVNKSfKAb27yB0khDYXI/GG9rkenM8?= =?us-ascii?Q?dddFMFBRhS0ER9EY5tuGvSxC3k80VjgmycDS4AtjkqvWEgU5dUwwagRnwFYM?= =?us-ascii?Q?OkqVBHTK7yGDNol6kx1bvgTjw6u+mFJvrmWUkbOKEkD3DdaHv9pXyZM4EhTr?= =?us-ascii?Q?4RZN0zUuSmBAtaIk6Qo54vuY+Mu9D2pqHFYUdnEyEIabSMtNHof9Sx9e0hzp?= =?us-ascii?Q?5a8VKdfFCxWs4baA1f3EYgqRCXLVU7/FfrZGz7W6LfOfmkzQv1a9Q4i0DBKA?= =?us-ascii?Q?I0vqdSbdLQEylvIiyQPhOXqttrk+Ky/krw4AW9wER6I5R3D76k99v2JogVmS?= =?us-ascii?Q?OIEt5y+uViI49xnrOm5EY4Zn5g9vujNbqlvlHGL1BgH/bnydVz16y4v5vFOx?= =?us-ascii?Q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CyYF2DsapiL2Bt4vbMyaX59hw2I?= =?us-ascii?Q?Zu62clm58/N1bZL77s4y/D07o0Wa8CYh3EivDYO/Wmi6nypn1BpqUVI3iCtO?= =?us-ascii?Q?LOzeuuVGC2H08n9tp+Rf3J0OTgLZUynP04Xa+c+dzmUKPhqArfxpMyIV5k45?= =?us-ascii?Q?hR2Yx8VvAnYu/2ZXj/sID3acki31s7ntxv+2vZWTUXGHlYSg7cmyey9LFbVJ?= =?us-ascii?Q?u24Z2Jq9CIklCeXrKzEzrGmOyfJ/ZT/vc3isWi3G11+xAN2Z1Xw1xRBau0ax?= =?us-ascii?Q?9zohOyH/25wF11fgCV/gBRyb64u/Y3ezBCKg4ZSS?= X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: d913f8ae-0360-4ce9-b9ca-08da8fb39f29 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2022 02:58:06.1388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b099b0b4-f26c-4cf5-9a0f-d5be9acab205 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kVkbikW80LW4mu9+J/Nj4NXrFd7H3OmZz/PVWUSPzmYtcVM2qbErMxCcErroXjqq9KSEez7jElcNMfiA6t+blg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR04MB2197 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 05, 2022 at 06:48:06PM +0200, Robert Foss wrote: > Hi Xin, > > On Sat, 3 Sept 2022 at 15:09, Xin Ji wrote: > > > > Some panels trigger HPD irq due to noise, the HPD debounce > > may be 1.8ms, exceeding the default irq detect window, ~1.4ms. > > This patch set HPD irq detection window to 2ms to > > tolerate the HPD noise. > > > > Signed-off-by: Xin Ji > > --- > > drivers/gpu/drm/bridge/analogix/anx7625.c | 14 ++++++++++++++ > > drivers/gpu/drm/bridge/analogix/anx7625.h | 6 ++++++ > > 2 files changed, 20 insertions(+) > > > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > > index c74b5df4cade..0c323b5a1c99 100644 > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > > @@ -1440,6 +1440,20 @@ static void anx7625_start_dp_work(struct anx7625_data *ctx) > > > > static int anx7625_read_hpd_status_p0(struct anx7625_data *ctx) > > { > > + int ret; > > + > > + /* Set irq detect window to 2ms */ > > + ret = anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > > + HPD_DET_TIMER_BIT0_7, HPD_TIME & 0xFF); > > + ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > > + HPD_DET_TIMER_BIT8_15, > > + (HPD_TIME >> 8) & 0xFF); > > + ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > > + HPD_DET_TIMER_BIT16_23, > > + (HPD_TIME >> 16) & 0xFF); > > Does the HPD debounce timer register need to be written for every HPD > status read? Hi Robert Foss, yes, it is better to set it in every HPD status check, because the HPD may be affected by noise, once the chip detect HPD is low, the timer register will be automatically set to 1.4ms, so the driver better set it in each check loop. Thanks, Xin > > > + if (ret < 0) > > + return ret; > > + > > return anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, SYSTEM_STSTUS); > > } > > > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.h b/drivers/gpu/drm/bridge/analogix/anx7625.h > > index e257a84db962..14f33d6be289 100644 > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.h > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.h > > @@ -132,6 +132,12 @@ > > #define I2S_SLAVE_MODE 0x08 > > #define AUDIO_LAYOUT 0x01 > > > > +#define HPD_DET_TIMER_BIT0_7 0xea > > +#define HPD_DET_TIMER_BIT8_15 0xeb > > +#define HPD_DET_TIMER_BIT16_23 0xec > > +/* HPD debounce time 2ms for 27M clock */ > > +#define HPD_TIME 54000 > > + > > #define AUDIO_CONTROL_REGISTER 0xe6 > > #define TDM_TIMING_MODE 0x08 > > > > -- > > 2.25.1 > >