Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp727215iog; Wed, 29 Jun 2022 09:01:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uAPqPRVeHWHVFr4+L5UGhPqqKZYvFv9XM5xTXNERA1h2xFUeRdNzcMpHvTBmPSxyXBdt4c X-Received: by 2002:a17:902:c101:b0:16a:11e9:a485 with SMTP id 1-20020a170902c10100b0016a11e9a485mr11012790pli.29.1656518472012; Wed, 29 Jun 2022 09:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656518472; cv=none; d=google.com; s=arc-20160816; b=vpu6zZCL5Yes/gM+uOZTReQeHvFfQdpOATwdp1T/7eqxZsZMBulm0wQijV7eBhgK3U Ef2Fh2PNyF5eq/irR4GYjnjv7Hq6PK9bIbEGN2cwWr70aWN6Mt+y12j8asTnlvTr1y4q K6C9Sc8UbiA5kKdV8Y5ppKxB55sHio7CokYhdQrjOoqDa0tiEjRXSdXPj/MzOc12OsuZ yW7KmBWsPWhEMVUnRRycxuh5nrUSQf/uG/XdDOJJVPaxILSW4I4QitOleRPnkHGqCTHi JaxwPg4+fAPVLkmuSqUVZglK9DRVlaN7bboFWO6xz/j+NOXaKnbtmUMC0DGWMOs2vPpa fctA== 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=LnIBihELWj1WjNuOXmqQeuUwVd8EyUkwr5np3NlGGGI=; b=sOT5ItSm2+04haGt12FJBQQlFW7i0EBQ26K3h+yCRwYjNjWPCMcHUD+IzaTTi7+2XT Yplme0H82vyf9q+YrGIfYAfqfUolNlteIf0l1TuOzGQ6FduT7OU8JAQTq1rjqZsrhyW8 2UwPy07dBmymFNepV1h0YKKFZLWNFXFCmiulYqbrot0/N0AghzP0jho/MCikYFlP8v0u DnXZ7e/njqGd9ofcAGDpzF242Dx+SiyqAZGi4b976jXUjD9CBTte4+14L3lzAqHqcTHb 2VC+XeyKz3DG/vXxDwncHsGPw3JsR+J0XXd5stmhdByUjZLlR87/GYwShCjR1EEx38hK p9pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="K6TZ27g/"; 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 u124-20020a637982000000b0040d436645f7si20207847pgc.765.2022.06.29.09.00.56; Wed, 29 Jun 2022 09:01:12 -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="K6TZ27g/"; 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 S234043AbiF2PZe (ORCPT + 99 others); Wed, 29 Jun 2022 11:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232012AbiF2PZc (ORCPT ); Wed, 29 Jun 2022 11:25:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D5E2B25D for ; Wed, 29 Jun 2022 08:25:31 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2C7F260F61 for ; Wed, 29 Jun 2022 15:25:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87F54C385A9; Wed, 29 Jun 2022 15:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656516330; bh=ILwnLBcL9ZfmgSD5+XbPsEEk0PHDWrcfV9GaKkubGWc=; h=From:To:Cc:Subject:Date:From; b=K6TZ27g/mbEVpHu5MOTOZ5XGdg62fa3TijkQtP959qyJsjSgYEJAwJe4DQUWdg5Ih 58DQaCM4CqiQhjLjQPzQfMgod1eodllUTurx/CYU6MumGduPEfE+k1lNGd7fa+khYm u9MQ5Z8igz8+FWH+gjEqWDBchSGxndlKYGnbxp1cvfJv0BRq5PKPAILBuMav38EXV8 IImPIku/3iwS7iLOvZZ1XFqER2LBqz7rkXcXfOsq9BTgGMoHqV7YG3XgFxeSwUztXS 27Mi6jKMknJCdn+xhhpq2RUdY1msoLoWFwnvWUiVsJknJiA8I2vQAGvcs78/dwKUO4 inycICzTa55HQ== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1o6ZZH-005hFF-N7; Wed, 29 Jun 2022 16:25:27 +0100 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Andi Shyti , Bruce Chang , Chris Wilson , Daniel Vetter , Daniele Ceraolo Spurio , Dave Airlie , David Airlie , Jani Nikula , Jason Ekstrand , John Harrison , Joonas Lahtinen , Lucas De Marchi , Maarten Lankhorst , Matt Roper , Matthew Auld , Matthew Brost , Oak Zeng , Rodrigo Vivi , Tejas Upadhyay , Tvrtko Ursulin , Umesh Nerlige Ramappa , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] Fix TLB invalidate issues with Broadwell Date: Wed, 29 Jun 2022 16:25:23 +0100 Message-Id: X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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 bot: 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. Bisecting the issue, the patch that introduced the regression is: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Reverting it fix the issues, but introduce other problems, as TLB won't be invalidated anymore. So, instead, let's fix the root cause. It turns that the TLB flush logic ends conflicting with i915 reset, which is called during selftest hangcheck. So, the TLB cache should be serialized, but other TLB fix patches are required for this one to work. Tested on an Intel NUC5i7RYB with an i7-5557U Broadwell CPU. v2: - Reduced to bare minimum fixes, as this shoud be backported deeply into stable. Chris Wilson (3): drm/i915/gt: Ignore TLB invalidations on idle engines drm/i915/gt: Serialize GRDOM access between multiple engine resets drm/i915/gt: Serialize TLB invalidates with GT resets drivers/gpu/drm/i915/gem/i915_gem_pages.c | 10 +++--- drivers/gpu/drm/i915/gt/intel_gt.c | 30 +++++++++++++----- drivers/gpu/drm/i915/gt/intel_gt_pm.h | 3 ++ drivers/gpu/drm/i915/gt/intel_reset.c | 37 +++++++++++++++++------ 4 files changed, 60 insertions(+), 20 deletions(-) -- 2.36.1