Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1405085ioo; Fri, 27 May 2022 08:03:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJy9C5WWkTDU1UqyTjKj0vJVP7lK3v1lbxiQ0K7Y4T239HDUwbU2zgWx3PVo0JdWrmeEpe X-Received: by 2002:a17:907:8689:b0:6fe:e525:ea9c with SMTP id qa9-20020a170907868900b006fee525ea9cmr22957307ejc.720.1653663823302; Fri, 27 May 2022 08:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653663823; cv=none; d=google.com; s=arc-20160816; b=zfselAELu1zx9/k/q1euyuqleO9LESJRqTkx7bDoQZsx5YJz3iYinA+2Qn5ZFp4q/z fdkRkiDtSI4L24KQMlBaOgRKrdSkb8lNRPyoBiphOQD1FJTyv+ZRfP1KJLuIQgM45xls LLzrTL01kBTr6gax0GGpkELgJaqLI5mWiK5xX/Sxjow22CP0wYX6rmhY46Pw/aEJMqmx AWgqOdpH7IyF/hX9a9+TB7nAQnZCprK6by8pqTEBgVOk5T4LfNen+p5fTTYObwK0kt9M sqqgrVVEI4jYX2GMLtdXVpSUfrLTTK7WkSx9Km9mIMSvlNPe1ug46qifAyjoB0reqB67 Xg5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=05HUf2VuQO2/ddA/41uYw76BKZpVo6SdoskLQrfSVaA=; b=fi/Ove3LRambCi3YXhyT2vBgOmVDOQvFJ0MYlcUv41lAKnP5slqg8nr/5WfXaFQYDX HUxk4fGpfLTm9q+mNkT0zSt8Ws7fW4QYQrpXASmk8ywnLjoAX7QEkXd/DXoOmFBDJSnM hSsi72npzkjkLLauN1tUZ3dmkvCEX4n/2RNxIgFAU8KAXs1iDEBa4TY7CoKjxcqtK8oZ Wb9KFn1VprKXDQNNF2nNYJFa6+MlJnI1QnwyellRjEBgAIbDg39jReBBb3Xw/h4zH6pO W9tjUko/2CnKWhARP+OzkzEQL4eBXybhrUMlGM3PwvJKEAkTxqI8ziWmc0+iJMlmwQ4K 2N4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="VbS1JMH/"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a50e68b000000b00426305c7d2csi4366605edm.608.2022.05.27.08.03.14; Fri, 27 May 2022 08:03:43 -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=fail header.i=@kernel.org header.s=k20201202 header.b="VbS1JMH/"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350518AbiE0JNP (ORCPT + 99 others); Fri, 27 May 2022 05:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350538AbiE0JMS (ORCPT ); Fri, 27 May 2022 05:12:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BF8B1356BA; Fri, 27 May 2022 02:09:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D6054B823FD; Fri, 27 May 2022 09:09:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A761C385B8; Fri, 27 May 2022 09:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653642573; bh=bES5tOhJ++GeKlJcRtlWQOd/879zYMEsJsfOCJP4Bgs=; h=From:To:Cc:Subject:Date:From; b=VbS1JMH/Wlp7ysFxnOoANd9rG3VsFEAbhYnbg5CLGGdbSrVHuuztfdEmzQJfmcAK6 Js/ZGD+gBvq34X4WCURQ5mZGTJT0ZWBrcgUzJDeR4nVPQLSXcc/pX7Flwni2MqfF03 UHl7/msvaZ+/rK/67ti/ZHPa3yFEuzJn0dkgpJA/IFc9rKlTLbbOrwTQ1qDKIw9ZN3 W0jjMn4AFYFxKpR+JEy5jFW8TUE71cLiDUR0PdTw5sgIKnSD9/eXPp5Yi5ma0Rc7q+ n3K7DFRnYibsCiddsToPHvxKh5r/JyTvNQbYggBlBW8DTWnZde8LgqkIQHKbnXA8hP 3YopCQsW4TVqw== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1nuVyM-008KD3-TZ; Fri, 27 May 2022 11:09:30 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Andi Shyti , Daniel Vetter , Daniele Ceraolo Spurio , David Airlie , Jani Nikula , John Harrison , Joonas Lahtinen , Lucas De Marchi , Matt Roper , Matthew Auld , Rodrigo Vivi , Tvrtko Ursulin , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, mauro.chehab@linux.intel.com, Tvrtko Ursulin , Sushma Venkatesh Reddy , Daniel Vetter , Dave Airlie , Jon Bloomfield , Jani Nikula , stable@vger.kernel.org Subject: [PATCH] drm/i915: don't flush TLB on GEN8 Date: Fri, 27 May 2022 11:09:29 +0200 Message-Id: X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org i915 selftest hangcheck is causing the i915 driver timeouts, as reported by Intel CI: http://gfx-ci.fi.intel.com/cibuglog-ng/issuefilterassoc/24297?query_key=42a999f48fa6ecce068bc8126c069be7c31153b4 When such test runs, the only output is: [ 68.811639] i915: Performing live selftests with st_random_seed=0xe138eac7 st_timeout=500 [ 68.811792] i915: Running hangcheck [ 68.811859] i915: Running intel_hangcheck_live_selftests/igt_hang_sanitycheck [ 68.816910] i915 0000:00:02.0: [drm] Cannot find any crtc or sizes [ 68.841597] i915: Running intel_hangcheck_live_selftests/igt_reset_nop [ 69.346347] igt_reset_nop: 80 resets [ 69.362695] i915: Running intel_hangcheck_live_selftests/igt_reset_nop_engine [ 69.863559] igt_reset_nop_engine(rcs0): 709 resets [ 70.364924] igt_reset_nop_engine(bcs0): 903 resets [ 70.866005] igt_reset_nop_engine(vcs0): 659 resets [ 71.367934] igt_reset_nop_engine(vcs1): 549 resets [ 71.869259] igt_reset_nop_engine(vecs0): 553 resets [ 71.882592] i915: Running intel_hangcheck_live_selftests/igt_reset_idle_engine [ 72.383554] rcs0: Completed 16605 idle resets [ 72.884599] bcs0: Completed 18641 idle resets [ 73.385592] vcs0: Completed 17517 idle resets [ 73.886658] vcs1: Completed 15474 idle resets [ 74.387600] vecs0: Completed 17983 idle resets [ 74.387667] i915: Running intel_hangcheck_live_selftests/igt_reset_active_engine [ 74.889017] rcs0: Completed 747 active resets [ 75.174240] intel_engine_reset(bcs0) failed, err:-110 [ 75.174301] bcs0: Completed 525 active resets After that, the machine just silently hangs. The root cause is that the flush TLB logic is not working as expected on GEN8. Tested on an Intel NUC5i7RYB with an i7-5557U Broadwell CPU. This patch partially reverts the logic by skipping GEN8 from the TLB cache flush. Cc: Tvrtko Ursulin Cc: Sushma Venkatesh Reddy Cc: Daniel Vetter Cc: Dave Airlie Cc: Jon Bloomfield Cc: Joonas Lahtinen Cc: Jani Nikula Cc: stable@vger.kernel.org # Kernel 5.17 and upper Fixes: 494c2c9b630e ("drm/i915: Flush TLBs before releasing backing store") Signed-off-by: Mauro Carvalho Chehab --- Patch resent, as the first version was using an old email. That's what happens when writing patches on old test machines ;-) drivers/gpu/drm/i915/gt/intel_gt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c index 034182f85501..7965a77e5046 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.c +++ b/drivers/gpu/drm/i915/gt/intel_gt.c @@ -1191,10 +1191,10 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt) if (GRAPHICS_VER(i915) == 12) { regs = gen12_regs; num = ARRAY_SIZE(gen12_regs); - } else if (GRAPHICS_VER(i915) >= 8 && GRAPHICS_VER(i915) <= 11) { + } else if (GRAPHICS_VER(i915) > 8 && GRAPHICS_VER(i915) <= 11) { regs = gen8_regs; num = ARRAY_SIZE(gen8_regs); - } else if (GRAPHICS_VER(i915) < 8) { + } else if (GRAPHICS_VER(i915) <= 8) { return; } -- 2.36.1