Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp209338yba; Fri, 5 Apr 2019 05:14:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp09gIzR0sA1JLd2K5E4tLjKGpyXJQotG+zY822g2Lkv4aRPfDDC7AG97MLZTa7YuvgFFz X-Received: by 2002:a17:902:28e6:: with SMTP id f93mr12704865plb.264.1554466496666; Fri, 05 Apr 2019 05:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554466496; cv=none; d=google.com; s=arc-20160816; b=GkkYqDURV3rQNGzgAlgLodIj7lkfZkgOJ/Tge3ZY6QB3VSCWsAfHkU77Zg2nsa7C3x Kam2VJtnKdkzNIkBEuFvKuHtsIq8nVUuP2QYY5oOG+mXiibLrWkKJdgZCD7XPBuMc1VS NQEfib4m8xw2OnH6aRwWmbe3UwfRfJtcKlEbrMSL3wseSoAwcHgM/xobSQb+3JwTmRQc zMgjrAgSb3USxucVR9tuzzsaY4lHtBZNRIHOow4drPvx/gci9Zsy+qPNf9lMGZbwSvS5 jgLz9ZhveV0+Z6RGfa3uZpDQctpJPO3LK59d4e+j9vqAMfPWqE+hIrs9xg3Hg4nw3Tl6 nX7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=gdCbdthXF8ZGGBAYlvhFyclyLGZj3WqgSikmLvAEZEc=; b=0rknIlMIVm4nB5UwrjzJNCAar5P0ayKGTfRNkdFlLvI/VsQUVSXg1RzrIBjnbA5wE2 +CI1k/sAZkHbPUtUdz2bdEZd/9LT9RDHCEO1E3rDrbxI3/6bxIY8UuApCyXN5NjL6Si3 OyQjllPoKypdw9yV/x4pFICA66Hk4JPQxW9SN/5r9+h41y4jZb3Uuh2CbB/bUix/TTar ZmHpAa36CCQ6UG6fdXSa+/ra8EORgsy7fZaSfGfYFKl/BCM3d61CSMo/DrwJG/0ydL75 F8IW6KIpAPT2RtMhBJs8e0O4n7gxO3mMo20OvPJnpegrahrfL51yY4foYm8f4TJH8lxS Qu4A== 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 z2si19034227plo.368.2019.04.05.05.14.40; Fri, 05 Apr 2019 05:14:56 -0700 (PDT) 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 S1728762AbfDEMOA (ORCPT + 99 others); Fri, 5 Apr 2019 08:14:00 -0400 Received: from mga18.intel.com ([134.134.136.126]:60304 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbfDEMOA (ORCPT ); Fri, 5 Apr 2019 08:14:00 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2019 05:13:59 -0700 X-IronPort-AV: E=Sophos;i="5.60,312,1549958400"; d="scan'208";a="313405733" Received: from jkrzyszt-desk.igk.intel.com ([172.22.244.18]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2019 05:13:56 -0700 From: Janusz Krzysztofik To: Joonas Lahtinen , Jani Nikula , Rodrigo Vivi Cc: David Airlie , Daniel Vetter , Chris Wilson , michal.wajdeczko@intel.com, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik Subject: [RFC PATCH] drm/i915: Don't panic on non-empty list of free cachelines Date: Fri, 5 Apr 2019 14:13:31 +0200 Message-Id: <20190405121331.6524-1-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Janusz Krzysztofik If there are active users of a device during driver unbind, the driver now panics on non-empty list of free cachelines. By design, chachelines which are not in use are kept on a list of free chachelines associated with a timeline and rmoved from that list either when in use or when the timeline is destroyed. Timelines in turn are assigned to open file descriptors. As long as a device file is open, its associated timeline with its list of free cachelines will be hopefully destroyed on device close, either while outstanding execlists are destroyed or on i915_timeline_put() called directly, so as long as device file descriptors are protected from unwanted user activities by the device being marked unplugged, there should be no reason to panic. Moreover, timeline mutex which is destroyed right after the check for emptyness of a free cacheline list succeeds is never used to protect that list, only a list of active cachelines, so it can be freely destroyed even if the former is not empty. Simply remove the GEM_BUG_ON(!list_empty(>->hwsp_free_list)); line from i915_timelines_fini(). Signed-off-by: Janusz Krzysztofik --- drivers/gpu/drm/i915/i915_timeline.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_timeline.c b/drivers/gpu/drm/i915/i915_timeline.c index b2202d2e58a2..1f23c2dcc0da 100644 --- a/drivers/gpu/drm/i915/i915_timeline.c +++ b/drivers/gpu/drm/i915/i915_timeline.c @@ -325,7 +325,6 @@ void i915_timelines_fini(struct drm_i915_private *i915) struct i915_gt_timelines *gt = &i915->gt.timelines; GEM_BUG_ON(!list_empty(>->active_list)); - GEM_BUG_ON(!list_empty(>->hwsp_free_list)); mutex_destroy(>->mutex); } -- 2.20.1