Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6788556pxb; Wed, 17 Feb 2021 13:32:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz8TYTdwT2d56+acjSqjmSJqlHOI1dH7lxun94BeheKFPU03S/+cr0KFwqP+M5/a6K/vyV X-Received: by 2002:a05:6402:617:: with SMTP id n23mr777928edv.257.1613597526147; Wed, 17 Feb 2021 13:32:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613597526; cv=none; d=google.com; s=arc-20160816; b=kpd82kEl8kTpbKAvWD7afX6fh9/dOETBUgL+uEOtwvovNloijjkFwcWRMXTx5aRwcE iNsZdasB9tG9WO0VoPia1DaWBASPJ02aS7uTGgK/vpSxMC4xRZuGA24K45/glEUvAgcK frtujwrWnMycfFhjFi9XjVafEr4AqdwBzu7faATBs7Kp2qyfJLIAVmgKuA6u3fJ/TWOk kXOoJFe8gAZgZ0Ga0qmUphw86INYx4xgXMqL4S8dmlHRFSPZ38+q7izHKBgqR3wqyghb tIk4lwUhtqlCB/4KGQcrLH35A8QWr4eG+2ilvJMtn8Bmr0gsHsc9ysJbaE8bC0vi7KVf PXcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:reply-to :from:subject:message-id:dkim-signature; bh=xBMyArAKf4mpgQyvFkqw/42F48Y7NN6P7Dp+VCh0VH4=; b=g+L2arZpMLbJs0WINGoa3zCSa8b3OIaj5a0M6Dy7Hv4okhx3RpvxfG2o1NIfFMh0+U X3c3k63pRnbL7NSZM6HregE6lqPs756lta00oQBVdkxph3qvd49D9JeYtOyy6368hYT1 q6yRXvgS0cPkoNcDw3ezX++qFz/2XOWOJ4Ic+U/d5FWglPkijgVksMp5TDb83lzvyolE 8tU1jyRRZfX5xEINvf/Z1gEUNu4pB7A4WdtTZ7BeL2Cv6z9uVj+vYJlyl7b7WVMUaCGq Qid81+dVp4sIQbbAAtjas/MzmYao9R+9PVUsHlIuSghPSp82hM81t/flMMx1s2tfb9Ps 9PGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GEDavZ8M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si2264658ejj.217.2021.02.17.13.31.38; Wed, 17 Feb 2021 13:32:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GEDavZ8M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233492AbhBQVV2 (ORCPT + 99 others); Wed, 17 Feb 2021 16:21:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38885 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232371AbhBQVVD (ORCPT ); Wed, 17 Feb 2021 16:21:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613596775; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xBMyArAKf4mpgQyvFkqw/42F48Y7NN6P7Dp+VCh0VH4=; b=GEDavZ8MnseRs0HNbGx+z2G59P5nQ0v/ix2ewZhM7O2WBUuy3k2qdmQM8lLcq8pTI5lzpD kG5/rP0vKMSHt+PVfi7UiEybDYpvfk3d4eA08EK0HCErGcYSyjrFF424ezF3uP7ooJq3zt TYCrffq2gsUeNAiS2fF6JhZJojKnIgo= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-368-cUcreWDIO2OuAIH2axwRlQ-1; Wed, 17 Feb 2021 16:19:31 -0500 X-MC-Unique: cUcreWDIO2OuAIH2axwRlQ-1 Received: by mail-qt1-f197.google.com with SMTP id f5so11007509qtf.15 for ; Wed, 17 Feb 2021 13:19:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:reply-to:to:cc:date :in-reply-to:references:organization:user-agent:mime-version :content-transfer-encoding; bh=xBMyArAKf4mpgQyvFkqw/42F48Y7NN6P7Dp+VCh0VH4=; b=qJQAPoBvlBIgg3hpB7Rp3C4ufPYNpee+v7+BGyP57H1yKLSe4WUfC1R6aLKOOXAFZ0 UpjLt0Dpirmi6PiphHf2GXuVfozMKZu0Oj5YAl4iOg9/MPQE3WiCRx9bc0TlPhMUpUSg K40tgm2SUU2tLkJCQoVk9dg1TsrdwDNcNfDz1RXECWZuTryS1UamF+eJ8IzmXSmPdkGt rSXEQQaPFhmgLDBBF16tCJCve9Kq1LZTS147+moo4F9m/Zvqt4PEJZaiUPy7Hx89S1sd RvscszEglan2njGeWG25PUncLvLyxzVzB3mT5O2/MoATYJoGvdHX75DzoZs/QNpziU/G oLFw== X-Gm-Message-State: AOAM533NSuZPGuEPyeHXknKhcIg1dPepXSuqOZv/+26j/VTEahKx0zO1 5obEzGCCicc1u5MaYMlLt8pF8EFufanJPNP5hvU2A3MCoRyjKAgnaux9Op3CenalSZXh7+vdD+G wUAijV29F8mashb72B9GwLD7F X-Received: by 2002:a05:620a:5e3:: with SMTP id z3mr1298127qkg.82.1613596771221; Wed, 17 Feb 2021 13:19:31 -0800 (PST) X-Received: by 2002:a05:620a:5e3:: with SMTP id z3mr1298100qkg.82.1613596770966; Wed, 17 Feb 2021 13:19:30 -0800 (PST) Received: from Whitewolf.lyude.net (pool-108-49-102-102.bstnma.fios.verizon.net. [108.49.102.102]) by smtp.gmail.com with ESMTPSA id 18sm1938054qtw.70.2021.02.17.13.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 13:19:30 -0800 (PST) Message-ID: Subject: Re: [PATCH v4] drm/i915/gen9bc: Handle TGP PCH during suspend/resume From: Lyude Paul Reply-To: lyude@redhat.com To: imre.deak@intel.com Cc: intel-gfx@lists.freedesktop.org, Tejas Upadhyay , Matt Roper , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , "open list:DRM DRIVERS" , open list Date: Wed, 17 Feb 2021 16:19:29 -0500 In-Reply-To: <20210217211802.GC558393@ideak-desk.fi.intel.com> References: <20210217025337.1929015-1-lyude@redhat.com> <20210217180016.1937401-1-lyude@redhat.com> <20210217211802.GC558393@ideak-desk.fi.intel.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3 (3.38.3-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-02-17 at 23:18 +0200, Imre Deak wrote: > On Wed, Feb 17, 2021 at 01:00:16PM -0500, Lyude Paul wrote: > > From: Tejas Upadhyay > > > > For Legacy S3 suspend/resume GEN9 BC needs to enable and > > setup TGP PCH. > > > > v2: > > * Move Wa_14010685332 into it's own function - vsyrjala > > * Add TODO comment about figuring out if we can move this workaround - imre > > v3: > > * Rename cnp_irq_post_reset() to cnp_display_clock_wa() > > * Add TODO item mentioning we need to clarify which platforms this > >   workaround applies to > > * Just use ibx_irq_reset() in gen8_irq_reset(). This code should be > >   functionally equivalent on gen9 bc to the code v2 added > > * Drop icp_hpd_irq_setup() call in spt_hpd_irq_setup(), this looks to be > >   more or less identical to spt_hpd_irq_setup() minus additionally enabling > >   one port. Will update i915 to use icp_hpd_irq_setup() for ICP in a > >   separate patch. > > v4: > > * Revert Wa_14010685332 system list in comments to how it was before > > * Add back HAS_PCH_SPLIT() check before calling ibx_irq_reset() > > > > Cc: Matt Roper > > Signed-off-by: Tejas Upadhyay > > Signed-off-by: Lyude Paul > > Thanks, looks ok to me: > Reviewed-by: Imre Deak > > nit: cnp_display_clock_gating_wa() would be an even better name, could > be renamed while applying. Sure thing. JFYI - I'm going to hold off on pushing this patch until I've got confirmation from the OEMs this is for that these patches still fix their issues (since I unfortunately don't have any access to this hardware). > > > --- > >  drivers/gpu/drm/i915/i915_irq.c | 49 +++++++++++++++++++++------------ > >  1 file changed, 32 insertions(+), 17 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_irq.c > > b/drivers/gpu/drm/i915/i915_irq.c > > index 98145a7f28a4..9b56a8f81e1a 100644 > > --- a/drivers/gpu/drm/i915/i915_irq.c > > +++ b/drivers/gpu/drm/i915/i915_irq.c > > @@ -3040,6 +3040,24 @@ static void valleyview_irq_reset(struct > > drm_i915_private *dev_priv) > >         spin_unlock_irq(&dev_priv->irq_lock); > >  } > >   > > +static void cnp_display_clock_wa(struct drm_i915_private *dev_priv) > > +{ > > +       struct intel_uncore *uncore = &dev_priv->uncore; > > + > > +       /* > > +        * Wa_14010685332:cnp/cmp,tgp,adp > > +        * TODO: Clarify which platforms this applies to > > +        * TODO: Figure out if this workaround can be applied in the s0ix > > suspend/resume handlers as > > +        * on earlier platforms and whether the workaround is also needed > > for runtime suspend/resume > > +        */ > > +       if (INTEL_PCH_TYPE(dev_priv) == PCH_CNP || > > +           (INTEL_PCH_TYPE(dev_priv) >= PCH_TGP && INTEL_PCH_TYPE(dev_priv) > > < PCH_DG1)) { > > +               intel_uncore_rmw(uncore, SOUTH_CHICKEN1, > > SBCLK_RUN_REFCLK_DIS, > > +                                SBCLK_RUN_REFCLK_DIS); > > +               intel_uncore_rmw(uncore, SOUTH_CHICKEN1, > > SBCLK_RUN_REFCLK_DIS, 0); > > +       } > > +} > > + > >  static void gen8_irq_reset(struct drm_i915_private *dev_priv) > >  { > >         struct intel_uncore *uncore = &dev_priv->uncore; > > @@ -3063,6 +3081,8 @@ static void gen8_irq_reset(struct drm_i915_private > > *dev_priv) > >   > >         if (HAS_PCH_SPLIT(dev_priv)) > >                 ibx_irq_reset(dev_priv); > > + > > +       cnp_display_clock_wa(dev_priv); > >  } > >   > >  static void gen11_display_irq_reset(struct drm_i915_private *dev_priv) > > @@ -3104,15 +3124,7 @@ static void gen11_display_irq_reset(struct > > drm_i915_private *dev_priv) > >         if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP) > >                 GEN3_IRQ_RESET(uncore, SDE); > >   > > -       /* Wa_14010685332:cnp/cmp,tgp,adp */ > > -       if (INTEL_PCH_TYPE(dev_priv) == PCH_CNP || > > -           (INTEL_PCH_TYPE(dev_priv) >= PCH_TGP && > > -            INTEL_PCH_TYPE(dev_priv) < PCH_DG1)) { > > -               intel_uncore_rmw(uncore, SOUTH_CHICKEN1, > > -                                SBCLK_RUN_REFCLK_DIS, > > SBCLK_RUN_REFCLK_DIS); > > -               intel_uncore_rmw(uncore, SOUTH_CHICKEN1, > > -                                SBCLK_RUN_REFCLK_DIS, 0); > > -       } > > +       cnp_display_clock_wa(dev_priv); > >  } > >   > >  static void gen11_irq_reset(struct drm_i915_private *dev_priv) > > @@ -3764,9 +3776,19 @@ static void gen8_de_irq_postinstall(struct > > drm_i915_private *dev_priv) > >         } > >  } > >   > > +static void icp_irq_postinstall(struct drm_i915_private *dev_priv) > > +{ > > +       struct intel_uncore *uncore = &dev_priv->uncore; > > +       u32 mask = SDE_GMBUS_ICP; > > + > > +       GEN3_IRQ_INIT(uncore, SDE, ~mask, 0xffffffff); > > +} > > + > >  static void gen8_irq_postinstall(struct drm_i915_private *dev_priv) > >  { > > -       if (HAS_PCH_SPLIT(dev_priv)) > > +       if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP) > > +               icp_irq_postinstall(dev_priv); > > +       else if (HAS_PCH_SPLIT(dev_priv)) > >                 ibx_irq_postinstall(dev_priv); > >   > >         gen8_gt_irq_postinstall(&dev_priv->gt); > > @@ -3775,13 +3797,6 @@ static void gen8_irq_postinstall(struct > > drm_i915_private *dev_priv) > >         gen8_master_intr_enable(dev_priv->uncore.regs); > >  } > >   > > -static void icp_irq_postinstall(struct drm_i915_private *dev_priv) > > -{ > > -       struct intel_uncore *uncore = &dev_priv->uncore; > > -       u32 mask = SDE_GMBUS_ICP; > > - > > -       GEN3_IRQ_INIT(uncore, SDE, ~mask, 0xffffffff); > > -} > >   > >  static void gen11_irq_postinstall(struct drm_i915_private *dev_priv) > >  { > > -- > > 2.29.2 > > > -- Sincerely, Lyude Paul (she/her) Software Engineer at Red Hat Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've asked me a question, are waiting for a review/merge on a patch, etc. and I haven't responded in a while, please feel free to send me another email to check on my status. I don't bite!