Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9974937imu; Wed, 5 Dec 2018 13:40:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/XvARFkpfrzVTKCextIrO+IJMKIhze41rA9btuJP/bBC1wy7arZqgR1HDOGNTvh9aAm9GLl X-Received: by 2002:a63:cd17:: with SMTP id i23mr21663035pgg.13.1544046005490; Wed, 05 Dec 2018 13:40:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544046005; cv=none; d=google.com; s=arc-20160816; b=HxorUgEzW6yYd7BEo0qFKI4X6uzXALJ97ltegUHKqY9bKV89QQVKRYBQHLyYe3zKXv x3ndp3+t5AP31aEjglw1qqlnWdwWnbInQ8aY5FqPi6vfgL5CMbgnhFfeEHCU/bvN3Aed K43S1hSg8ZLpFuKnv1mVSEaTRSJP0wgZr+F14Ojw1Q0LrQUYrQ21FgD8NfYohpYVp/ig rodh/5a1TJ46de+XpoFjnLIB5hcWh3rHup5kfxli2G53cDNrLpwCx3LYP5hc3etkRdRm 6dFAwWwCNZhTgGL6OkYNukvyluVMV39//lb/6fqhbCOQTRJid7fgx6zwNdhAvIFOIsXL cdpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=uLgVmppR9Qg/dnbfMidHvTPEN4rmCpRa8bqUEPwZGCY=; b=m2eDSkZwd4mFc0iOQhsH1Eg/MpgElDQlDj5BLkL0+Vnl0+sHtlDZr7oiJOetssqSxZ Vug2Ek804CvrratmBEkT6TAPVMsfXIMMJx6T70xmCbRJ6vcSl8U7gst3NBWOpk6C65Ez sGOThuAltga4tVm1TnZuXiF+x7zQYu3JRPCBCeOOKJkBf23vLzgOI/89+VCm8wkU2Yfq 9UdOmf1jUoWr7Ca3K1r4NFfB2/1iCcVBoJZ/L7v0Y06q2NPhK/txHYDlTEdXl8J9YodX bxx2Cz7ovcI7SBMxMdr2MqpPZxjEzgD4ezash32S4Pfslsy/W1cI4g/87KmXkBf3vTJe FGpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id z13si18373728pgi.438.2018.12.05.13.39.49; Wed, 05 Dec 2018 13:40:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728260AbeLEVjJ (ORCPT + 99 others); Wed, 5 Dec 2018 16:39:09 -0500 Received: from mga05.intel.com ([192.55.52.43]:42545 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727337AbeLEVjJ (ORCPT ); Wed, 5 Dec 2018 16:39:09 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2018 13:39:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,319,1539673200"; d="scan'208";a="127447741" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 05 Dec 2018 13:39:06 -0800 Received: by stinkbox (sSMTP sendmail emulation); Wed, 05 Dec 2018 23:39:05 +0200 Date: Wed, 5 Dec 2018 23:39:05 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Chris Wilson , Joonas Lahtinen Subject: Re: [PATCH 4.19 044/110] drm/i915: Disable LP3 watermarks on all SNB machines Message-ID: <20181205213905.GW9144@intel.com> References: <20181129135921.231283053@linuxfoundation.org> <20181129135923.048859299@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181129135923.048859299@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 03:12:15PM +0100, Greg Kroah-Hartman wrote: > 4.19-stable review patch. If anyone has any objections, please let me know. This one apparently introduces some annoying dmesg errors: [ 3.487895] [drm:intel_print_wm_latency [i915]] *ERROR* Primary WM3 latency not provided [ 3.487926] [drm:intel_print_wm_latency [i915]] *ERROR* Sprite WM3 latency not provided [ 3.487955] [drm:intel_print_wm_latency [i915]] *ERROR* Cursor WM3 latency not provided To silence those please also backport commit 274dba1ae8ff ("drm/i915: Downgrade Gen9 Plane WM latency error") > > ------------------ > > From: Ville Syrj?l? > > commit 21556350ade3cb5d7afecc8b3544e56431d21695 upstream. > > I have a Thinkpad X220 Tablet in my hands that is losing vblank > interrupts whenever LP3 watermarks are used. > > If I nudge the latency value written to the WM3 register just > by one in either direction the problem disappears. That to me > suggests that the punit will not enter the corrsponding > powersave mode (MPLL shutdown IIRC) unless the latency value > in the register matches exactly what we read from SSKPD. Ie. > it's not really a latency value but rather just a cookie > by which the punit can identify the desired power saving state. > On HSW/BDW this was changed such that we actually just write > the WM level number into those bits, which makes much more > sense given the observed behaviour. > > We could try to handle this by disallowing LP3 watermarks > only when vblank interrupts are enabled but we'd first have > to prove that only vblank interrupts are affected, which > seems unlikely. Also we can't grab the wm mutex from the > vblank enable/disable hooks because those are called with > various spinlocks held. Thus we'd have to redesigne the > watermark locking. So to play it safe and keep the code > simple we simply disable LP3 watermarks on all SNB machines. > > To do that we simply zero out the latency values for > watermark level 3, and we adjust the watermark computation > to check for that. The behaviour now matches that of the > g4x/vlv/skl wm code in the presence of a zeroed latency > value. > > v2: s/USHRT_MAX/U32_MAX/ for consistency with the types (Chris) > > Cc: stable@vger.kernel.org > Cc: Chris Wilson > Acked-by: Chris Wilson > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101269 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103713 > Signed-off-by: Ville Syrj?l? > Link: https://patchwork.freedesktop.org/patch/msgid/20181114173440.6730-1-ville.syrjala@linux.intel.com > (cherry picked from commit 03981c6ebec4fc7056b9b45f847393aeac90d060) > Signed-off-by: Joonas Lahtinen > Signed-off-by: Greg Kroah-Hartman > > --- > drivers/gpu/drm/i915/intel_pm.c | 41 +++++++++++++++++++++++++++++++++++++++- > 1 file changed, 40 insertions(+), 1 deletion(-) > > --- a/drivers/gpu/drm/i915/intel_pm.c > +++ b/drivers/gpu/drm/i915/intel_pm.c > @@ -2492,6 +2492,9 @@ static uint32_t ilk_compute_pri_wm(const > uint32_t method1, method2; > int cpp; > > + if (mem_value == 0) > + return U32_MAX; > + > if (!intel_wm_plane_visible(cstate, pstate)) > return 0; > > @@ -2521,6 +2524,9 @@ static uint32_t ilk_compute_spr_wm(const > uint32_t method1, method2; > int cpp; > > + if (mem_value == 0) > + return U32_MAX; > + > if (!intel_wm_plane_visible(cstate, pstate)) > return 0; > > @@ -2544,6 +2550,9 @@ static uint32_t ilk_compute_cur_wm(const > { > int cpp; > > + if (mem_value == 0) > + return U32_MAX; > + > if (!intel_wm_plane_visible(cstate, pstate)) > return 0; > > @@ -2998,6 +3007,34 @@ static void snb_wm_latency_quirk(struct > intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); > } > > +static void snb_wm_lp3_irq_quirk(struct drm_i915_private *dev_priv) > +{ > + /* > + * On some SNB machines (Thinkpad X220 Tablet at least) > + * LP3 usage can cause vblank interrupts to be lost. > + * The DEIIR bit will go high but it looks like the CPU > + * never gets interrupted. > + * > + * It's not clear whether other interrupt source could > + * be affected or if this is somehow limited to vblank > + * interrupts only. To play it safe we disable LP3 > + * watermarks entirely. > + */ > + if (dev_priv->wm.pri_latency[3] == 0 && > + dev_priv->wm.spr_latency[3] == 0 && > + dev_priv->wm.cur_latency[3] == 0) > + return; > + > + dev_priv->wm.pri_latency[3] = 0; > + dev_priv->wm.spr_latency[3] = 0; > + dev_priv->wm.cur_latency[3] = 0; > + > + DRM_DEBUG_KMS("LP3 watermarks disabled due to potential for lost interrupts\n"); > + intel_print_wm_latency(dev_priv, "Primary", dev_priv->wm.pri_latency); > + intel_print_wm_latency(dev_priv, "Sprite", dev_priv->wm.spr_latency); > + intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); > +} > + > static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv) > { > intel_read_wm_latency(dev_priv, dev_priv->wm.pri_latency); > @@ -3014,8 +3051,10 @@ static void ilk_setup_wm_latency(struct > intel_print_wm_latency(dev_priv, "Sprite", dev_priv->wm.spr_latency); > intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); > > - if (IS_GEN6(dev_priv)) > + if (IS_GEN6(dev_priv)) { > snb_wm_latency_quirk(dev_priv); > + snb_wm_lp3_irq_quirk(dev_priv); > + } > } > > static void skl_setup_wm_latency(struct drm_i915_private *dev_priv) > -- Ville Syrj?l? Intel