Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1053182rwb; Wed, 9 Nov 2022 12:06:07 -0800 (PST) X-Google-Smtp-Source: AMsMyM5jCak7LfCxOnfvLCz6wBh7HfZD0dPk3DnLzcWPoUCnI4IpUVsbHWwG6GB1Am+0fGSglBMC X-Received: by 2002:aa7:d553:0:b0:463:18d3:195c with SMTP id u19-20020aa7d553000000b0046318d3195cmr56545826edr.235.1668024367240; Wed, 09 Nov 2022 12:06:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668024367; cv=none; d=google.com; s=arc-20160816; b=Z7/RaK/NSmmSzfQ67BVo95mx7pGZiYxP1LicHAV/hLncFFBb5W6PaDQNvfEXtRMbkx 8k8gc3a+5XrqYNla0y5oaNoZeZI6lG04x+XQVnaoodZTZ5dNnOOE3lzoYc45EPMB7Enc VbuOBirqIk/uOURdyfdmMyI2JRxNbsCXkC/hZE1tURj4+96uORYI7nnPVrLqstjtJXa6 nakYe7lTzzmSNEsOAeS7gcfarSB7dOjIg/vEbsO0OaEYlKCYTNAm7jwe5LRI4c5DZuGf ri+Z89N6QsazyNUrGzykND/U3cHoGx+DDzU9ZSgtR7u1rNrAadtlK1G0kGL+2d6D+TXo l/vg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=otCxyHkeQiNGgHxH79E0q1fOib+sGVkSLOCGGEZ86FM=; b=pE1md5Pr4mmndAUzpkgYHjsRqSl6mLX0emP+YkmpIOPcjhGIjqFmyZA6WSK37LSYOw M+vc05QMYieQ5soEr5f54g1iSohPG16LPjGE9BvYDwusUm2ZbYVNvmeZkmc7fzM9hWAX gfpTtjKN+jfDp5L3yO2qPcAyigWUXVnim48zu91eGGWnc8yqQlV5GmF6BUxKd8QKR6HY QcTvOOlGvlJqIeYiX3lReW2mOYhLYjqHBlc5b4iJg2k6KjQvpQqfLoY460bdwrV0kHYn VRAvciDPd+kh2DTauiVKahKxpal9R89hXlZN52tXyAXTJpLacR2DukQZP/BNsN+vwFSN WOEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BxWlv4WL; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd31-20020a170907969f00b007ae0ea72153si19940362ejc.696.2022.11.09.12.05.45; Wed, 09 Nov 2022 12:06:07 -0800 (PST) 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=pass header.i=@intel.com header.s=Intel header.b=BxWlv4WL; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbiKITLD (ORCPT + 92 others); Wed, 9 Nov 2022 14:11:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiKITK6 (ORCPT ); Wed, 9 Nov 2022 14:10:58 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC0B272C for ; Wed, 9 Nov 2022 11:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668021057; x=1699557057; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e6o2iw5GGxg52ODYXfhWmxxEkXpHYpZprWDIoibYlmQ=; b=BxWlv4WLTVeE3xsYNExGriUguSGZR1qbwR0ZLj5k4SStbCdQz13niJnI hEfyIlciDELI9CsfZolx/KSkzt1qmemryTgFpBD110qAX2LkFn1+lH+hW b+5eTZqbhd5cWMXkA36qit0z3FfNPpOpDXJXna3hDD7qAOMXGYEDQJBE9 Bia3n5lUN4EoLFWVm9NaQ1dEOkP4KweOGlJwg7AOTXH6hc5ZX16klzYQ/ ozqNk4Cg7Fk2xBZCd9Dkp0W1PnRR10vmcWt5vGKwRIhitEipsZ0Z5Aiu1 5CkCTwULdn2oxdcIfrlru+0Ur0Jg0FDLEUQOzj+BCcf8c413dqz/Un6mt A==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="312234713" X-IronPort-AV: E=Sophos;i="5.96,151,1665471600"; d="scan'208";a="312234713" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 11:10:53 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="668105834" X-IronPort-AV: E=Sophos;i="5.96,151,1665471600"; d="scan'208";a="668105834" Received: from jkrzyszt-mobl1.ger.corp.intel.com ([10.213.6.201]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 11:10:25 -0800 From: Janusz Krzysztofik To: Joonas Lahtinen Cc: Jani Nikula , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Chris Wilson , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] drm/i915: Fix unintended submission flush after retire times out Date: Wed, 9 Nov 2022 20:09:36 +0100 Message-Id: <20221109190937.64155-3-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109190937.64155-1-janusz.krzysztofik@linux.intel.com> References: <20221109190937.64155-1-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If wait on request DMA fence times out while we are retiring requests, -ETIME is stored as remaining time. Then, flush_submission() called thereafter proceeds with its work instead of returning immediately due to the value of timeout passed to it not equal 0. That's probably not what was intended. Fix it by replacing -ETIME value of the argument with 0. Fixes: 09137e945437 ("drm/i915/gem: Unpin idle contexts from kswapd reclaim") Signed-off-by: Janusz Krzysztofik --- drivers/gpu/drm/i915/gt/intel_gt_requests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt_requests.c b/drivers/gpu/drm/i915/gt/intel_gt_requests.c index 6c3b8ac3055c3..309d5937d6910 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_requests.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_requests.c @@ -204,7 +204,7 @@ out_active: spin_lock(&timelines->lock); list_for_each_entry_safe(tl, tn, &free, link) __intel_timeline_free(&tl->kref); - if (flush_submission(gt, timeout)) /* Wait, there's more! */ + if (flush_submission(gt, timeout > 0)) /* Wait, there's more! */ active_count++; if (remaining_timeout) -- 2.25.1