Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp894074pxb; Fri, 15 Apr 2022 14:33:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8IbHgH0W2dMv53HSP+63fjDINV5w6gF4ypo4d+B7/p5/KAC64Fuc3VYE4vETMSO8vvpk0 X-Received: by 2002:a17:907:7b83:b0:6e8:c2c8:1f14 with SMTP id ne3-20020a1709077b8300b006e8c2c81f14mr720690ejc.356.1650058431111; Fri, 15 Apr 2022 14:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650058431; cv=none; d=google.com; s=arc-20160816; b=Y/uLFlTikIsezxBfjki8LW4Kmk4g+VsKjmWhVqZZna1+sVrZ+orCMJutmOoWModhM0 lwbpiaxupo3BinwpFs0nNORDM077j4pqX+s68jdkFAXuBCi0oG9zkjA2N99uk2Q5x4p2 mZK3m4putH9zErb1558SMLNaUgh1MAn3tIVzpNQQlZimF7kbq1HHwV0Ci8pLt+DV5Ylu 7/kF6sArNQOX4saHs4yjjAtLbOsAULWCaA1gMmIjpfJL9wC93ifcQ7li160VCZ2bGXFx kISd9TFKZjnMISi8fJckBvxEvCaI7y2ArNg6S3KuH2tHoQqwkYEkYfuqpUV2kdUux7Jp DKug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nYg934FepxhPHJYVYrZutxuJmtuv3DcX7+LrwvmwUiI=; b=gQvS5N08ysYnX35hfB3x9ccvtHpp7niNQPId8NgThsToEX+/kaqPuG9gHIgPQDVBvz NN/U7sDfRKIUkLvKuGeK1JNdHKFAeR4w1IXdPg8nXeMfFwPLdw4JJ52Z4xhDk5ZpLnLp E5c1z58X0wvE0ba9cQzU+dD2gxLLMZjLZhVVuH6yIDb3QrZTbgwOUcLqIxBuLIf+eFWi 6c4FbSOnSoDZdyBjZVdaa7ADsuK4wmVFGuAuMRZrthlRTdS1gOMADJTBQ52Ah0OKPC97 Oh+Gdyi5qvHiTC4TXksNsmCvDiSCp77Uu2trh+7fcWIM6zOxRkudbEZu9uFZqfRP752+ ZiWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eGFM3ztM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a170906805400b006e881d564d3si1613615ejw.812.2022.04.15.14.33.25; Fri, 15 Apr 2022 14:33:51 -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=@chromium.org header.s=google header.b=eGFM3ztM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243142AbiDNRD6 (ORCPT + 99 others); Thu, 14 Apr 2022 13:03:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243675AbiDNRDU (ORCPT ); Thu, 14 Apr 2022 13:03:20 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9773A49F99 for ; Thu, 14 Apr 2022 09:39:52 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 21so7125637edv.1 for ; Thu, 14 Apr 2022 09:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nYg934FepxhPHJYVYrZutxuJmtuv3DcX7+LrwvmwUiI=; b=eGFM3ztMn9Emo9AjWCLBFf6FEEMtubNIu4UVefX1GeJ26mF6dhm/kQWOM5JylyVuYl AHn+lsZ0Yi4quPDxF8v/hLAKDCzF3fDmkLwshBHfrSsZIyCpo3q5P97DH5qN01gnoVSV 2s/CAcL2joy6KFQjXDYCrSGLKApreqzCGzpJc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nYg934FepxhPHJYVYrZutxuJmtuv3DcX7+LrwvmwUiI=; b=43lHCE7vKusTm/XsEK4HZo4anLK+8bnJXeM0eqxvxPYvmLk04Kj7/TECvZvClWtr4U 2846OSqeV8uHPnEcLDuUjtz/ASDniHKZd7fSxBsUoes3IBTkhG65GQTvK0V6oUO254bT 4khY9XkwA/fRJSVXow2+M3V9kO0FU59EWvddsYzWjUq+mTVQignCMXbeyIJmZHLNQ/Ay A+FMYx/ssoSRUVsyixh92wQVhTx6QGjtzbnEP0+rh17OPhbx0CZ/fTk3VuSZnma1RKR/ ETXBRg9mjAfOx21UkOOlCEBZL5NWYqbg3Nvw6OiQbjxd5ruj3NcEz8u6hcfSNpHb3MoK o8Mg== X-Gm-Message-State: AOAM531e5pThMXKC1OF7fIHWGZP+/LGKRoIDTZPS7gYh0x+l+APFHRUX ZJM4EA3dRSNmq/3iHs5kPcU8A4DZ5kK9ZpPL X-Received: by 2002:a05:6402:1707:b0:41d:9794:6421 with SMTP id y7-20020a056402170700b0041d97946421mr3883033edu.212.1649954390887; Thu, 14 Apr 2022 09:39:50 -0700 (PDT) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com. [209.85.128.45]) by smtp.gmail.com with ESMTPSA id f2-20020a50e082000000b0041df731649asm1240677edl.60.2022.04.14.09.39.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Apr 2022 09:39:49 -0700 (PDT) Received: by mail-wm1-f45.google.com with SMTP id ay11-20020a05600c1e0b00b0038eb92fa965so6329059wmb.4 for ; Thu, 14 Apr 2022 09:39:49 -0700 (PDT) X-Received: by 2002:a05:600c:502b:b0:38f:f7c6:3609 with SMTP id n43-20020a05600c502b00b0038ff7c63609mr3225672wmr.15.1649954388394; Thu, 14 Apr 2022 09:39:48 -0700 (PDT) MIME-Version: 1.0 References: <1649938766-6768-1-git-send-email-quic_sbillaka@quicinc.com> <1649938766-6768-3-git-send-email-quic_sbillaka@quicinc.com> In-Reply-To: <1649938766-6768-3-git-send-email-quic_sbillaka@quicinc.com> From: Doug Anderson Date: Thu, 14 Apr 2022 09:39:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 2/4] drm/msm/dp: Support only IRQ_HPD and REPLUG interrupts for eDP To: Sankeerth Billakanti Cc: dri-devel , linux-arm-msm , freedreno , LKML , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Clark , Sean Paul , Stephen Boyd , quic_kalyant , "Abhinav Kumar (QUIC)" , "Kuogee Hsieh (QUIC)" , Bjorn Andersson , Sean Paul , David Airlie , Daniel Vetter , Dmitry Baryshkov , quic_vproddut , "Aravind Venkateswaran (QUIC)" , Steev Klimaszewski Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hi, On Thu, Apr 14, 2022 at 5:20 AM Sankeerth Billakanti wrote: > > The panel-edp enables the eDP panel power during probe, get_modes > and enable. Technically the panel-edp powers on the panel in pre_enable() > The eDP connect and disconnect interrupts for the eDP/DP > controller are directly dependent on panel power. As eDP display can be > assumed as always connected, the controller driver can skip the eDP > connect and disconnect interrupts. Any disruption in the link status > will be indicated via the IRQ_HPD interrupts. > > So, the eDP controller driver can just enable the IRQ_HPD and replug > interrupts. The DP controller driver still needs to enable all the > interrupts. > > Signed-off-by: Sankeerth Billakanti > --- > > Changes in v7: > - reordered the patch in the series > - modified the return statement for isr > - connector check modified to just check for eDP > > drivers/gpu/drm/msm/dp/dp_catalog.c | 9 +++------ > drivers/gpu/drm/msm/dp/dp_display.c | 22 +++++++++++++++++++++- > 2 files changed, 24 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c > index fac815f..07f2389 100644 > --- a/drivers/gpu/drm/msm/dp/dp_catalog.c > +++ b/drivers/gpu/drm/msm/dp/dp_catalog.c > @@ -569,10 +569,6 @@ void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog) > > u32 reftimer = dp_read_aux(catalog, REG_DP_DP_HPD_REFTIMER); > > - /* enable HPD plug and unplug interrupts */ > - dp_catalog_hpd_config_intr(dp_catalog, > - DP_DP_HPD_PLUG_INT_MASK | DP_DP_HPD_UNPLUG_INT_MASK, true); > - > /* Configure REFTIMER and enable it */ > reftimer |= DP_DP_HPD_REFTIMER_ENABLE; > dp_write_aux(catalog, REG_DP_DP_HPD_REFTIMER, reftimer); > @@ -599,13 +595,14 @@ u32 dp_catalog_hpd_get_intr_status(struct dp_catalog *dp_catalog) > { > struct dp_catalog_private *catalog = container_of(dp_catalog, > struct dp_catalog_private, dp_catalog); > - int isr = 0; > + int isr, mask; > > isr = dp_read_aux(catalog, REG_DP_DP_HPD_INT_STATUS); > dp_write_aux(catalog, REG_DP_DP_HPD_INT_ACK, > (isr & DP_DP_HPD_INT_MASK)); > + mask = dp_read_aux(catalog, REG_DP_DP_HPD_INT_MASK); > > - return isr; > + return isr & (mask | ~DP_DP_HPD_INT_MASK); Please add a comment above this explaining what the goal of the above statement is. I guess it's something like this, though you might want to modify it to remove snark and insert the real reason unless you like being snarky: /* * Report the raw status of all interrupts (AKA we still report the * interrupt as asserted even if it's masked) _except_ for HPD-related. * interrupts. We only report HPD-related interrupts if they're * unmasked. We do it this way because we thought it would be extra * confusing for readers of this code and we were bribed by Mordac to * confuse you. OK, maybe that's not true. We actually do it this way * because of . */ Along the same lines as my comments in patch #1, I don't have a great feel for exactly when the various HPD bits are enabled / disabled and it feels like it need to be made super obvious / well documented. That being said, I'd be OK w/ that happening in the proposed cleanup. -Doug