Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6788292pxb; Wed, 17 Feb 2021 13:31:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhG9n50zzPEvI+t8sZpQBVzEvWc12slQlsmlajhvcUxKRnX5+PHP9V7EAEB50P2gEMmlB1 X-Received: by 2002:aa7:c78e:: with SMTP id n14mr787985eds.31.1613597496128; Wed, 17 Feb 2021 13:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613597496; cv=none; d=google.com; s=arc-20160816; b=sqaPh41BZAL/WueBKMbPBWLZ8515a0200HNrvtA2nrYUXgmE5UllAvkWTgFogQb0o+ d+p6eq5a9k/Vg4hrWS1UNBE3WTCreVuM9pRkpcoNYxYifsdISy6YxiztjOMf4OUCF40y zXARW0fouAfu+ExFWpxXvu8WaSWBqiXLC2vl/n6fkNM6095HgaBm2Oc7qRPoHuLHDAP6 XzFx/Aa62DDEOJfCMRvHdGf/4NqMZyB5JadwbXITwFeBC9pOcvk/4SM4oii2XdmtLigw 15+x2A6Jpw/NyNNEa3oSO4LIhozZlDzo6QPpmrkOLqom4RIZeEIbiIqnji3ACrbRy/wj kFog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=GO6QyScfr4JxBGdov/U9ddFHfMysw4apJOo/SY66XvM=; b=r+RSFvKBv5uQgfPw8RpgFtB0q2F1LMHoVDJuVJXf23+ENJBC9uXk2cmp3Hn+5HzGUu o7BAfzZtJGzgADW6Oy0g1N8AtHM3BL7eTiZt0pzYCS4yP9zxvP3SL4iLisWT5sl6shja TrKdHZxp5FhrEwyl2vdb0N0K16k5iR7G4Ci3pLq2EZiwRMiJAk0QVttv1+bV1khIPQcb otNW7RcpfmznTPOYBQeHsugy2hgujv75a4aLsup+B4RyqJUBMRLg97J5c8tyD9LqvgK/ ycYFrnS+MSHqlZk3ZrcIaydhvp7HfrJQapW+z1zfGPVDCexpGn8wjP7ksM4pi8EwC6A+ zrzA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl11si2831615ejb.688.2021.02.17.13.31.12; Wed, 17 Feb 2021 13:31:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229796AbhBQVTF (ORCPT + 99 others); Wed, 17 Feb 2021 16:19:05 -0500 Received: from mga01.intel.com ([192.55.52.88]:41333 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232648AbhBQVSt (ORCPT ); Wed, 17 Feb 2021 16:18:49 -0500 IronPort-SDR: Jojm18NKVttbZtuh19S+j7ulfbFizNjvd8cDSUuHR1nSkGtoKioNzRmSdo63Q952jnT9ucywzp a6MHP5nDPsEA== X-IronPort-AV: E=McAfee;i="6000,8403,9898"; a="202552896" X-IronPort-AV: E=Sophos;i="5.81,185,1610438400"; d="scan'208";a="202552896" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2021 13:18:08 -0800 IronPort-SDR: 6Ub+DP3lNmpif5ozsQYhhvDtBAGT0G3RCtKhn99MYdT2niEzd4eqFF11dIwVg8x7Omzw09npj/ iv9QKiUDnaNQ== X-IronPort-AV: E=Sophos;i="5.81,185,1610438400"; d="scan'208";a="494426430" Received: from ideak-desk.fi.intel.com ([10.237.68.141]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2021 13:18:05 -0800 Date: Wed, 17 Feb 2021 23:18:02 +0200 From: Imre Deak To: Lyude Paul 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 Subject: Re: [PATCH v4] drm/i915/gen9bc: Handle TGP PCH during suspend/resume Message-ID: <20210217211802.GC558393@ideak-desk.fi.intel.com> Reply-To: imre.deak@intel.com References: <20210217025337.1929015-1-lyude@redhat.com> <20210217180016.1937401-1-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210217180016.1937401-1-lyude@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > --- > 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 >