Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp588779ybz; Wed, 15 Apr 2020 14:38:54 -0700 (PDT) X-Google-Smtp-Source: APiQypL51wTuLXhtieplvVgwr+MFJ4m0ZtCP5bIeG4S7UvhEg860kzIjap6FbJne4D95uvfbbQgO X-Received: by 2002:a17:906:4714:: with SMTP id y20mr2795657ejq.5.1586986734688; Wed, 15 Apr 2020 14:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586986734; cv=none; d=google.com; s=arc-20160816; b=FVvHwIM2HIiT7mcumk5vUbcG7veUMljGsaF2UH+XSQTrhDYJmy362KimE3TX2W6Fna uc6Jy6HmYw6kzgw/7LWbRnkI5fCGQCB83obzERNMGXhMIxA7L0byHBJrvpIqopDm+92Q FKBmhMBrE7DaQq8/dGDL/QeSozYPPls6Eka6PHWfGqImAkiyZwvCo0JXcmXZZJxOsf5e 16/h2k6XfDAwmL8EIagfaTmmJDKP8gEhfaCMjLxS9wI/V4lx7vy2HgYqA0j8ywcFZWe+ 1o0ja+B3tehtOsNUWvgSD711lFiAU7/6UQWYSp6E9/JO9gWviQClZ+aotQv+4edm1bMY dfzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ISpaCA7mjN5YjkHYISL3HSq+S++mjTHZ6Lu/DzWzgxg=; b=iHwspDz+jhYkWBHpBqBbotJksEz1GhId5foXwdmzzMlWipUlsFgZcIe1e79ac88SVA YMEji3jFK1LY3WXg1OiBIRgRjtVCvyp/AmYQ5GAQonnlr3h5rYkj+UXEDCJjeWfWThjG bWhJYYAZXwrb1NbeiyOTXS1dmlxtGfmj1TDv5q2OH23mJtxrrvrQf28tw63Z/j/zNtT0 y+ZoQDRB8U707GUnEkkRq881sfUi8XvngCVyuQEpAJ1aMD58++GiLAyI24kJ35wyZOrm 05U5TDiwTnGMRzh9xz+uyd+KYphc+2Viv0vgkGwQXde6N4cBD/iBesxC8F0j7UzV/IyW CMIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p22si10893592ejw.220.2020.04.15.14.38.31; Wed, 15 Apr 2020 14:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403947AbgDNOn3 (ORCPT + 99 others); Tue, 14 Apr 2020 10:43:29 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42749 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403941AbgDNOnQ (ORCPT ); Tue, 14 Apr 2020 10:43:16 -0400 Received: by mail-pg1-f194.google.com with SMTP id g6so6081794pgs.9; Tue, 14 Apr 2020 07:43:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ISpaCA7mjN5YjkHYISL3HSq+S++mjTHZ6Lu/DzWzgxg=; b=TIBdpUNc4hD0uk2v2NBi0PeszdnyJON+rnJHdFQYgr7JrMXnHxSIUDHPJEsI5+bkvp R9xbA1No7G+7LpEFf09bDylFQEBEXryTs3dLX4zC7cF2sU0K3pJr1Z6IONZj0F0zj117 eyDvkJrc5O/1oH+nYUdEPJ2WFI2TISRfMhJIdPxWqUOlXgDNOUN7iMIMCU80XS34dWAO NcscPxY+EDhcCEt5EXB9W2PbEN4d+2kH6edPtktidRl+Uf9QHEDt8qEe1Md0wbxj/TLm Leekl/OsI3ILhn5e5R2agXIL0mThBAy6AAsQ6RsgBHCa+rddZnHeizT906kmgMI603Dm KqzA== X-Gm-Message-State: AGi0PubPgpMjmatSIfg87sg+HzWp/Rx5hN2+JFPjeq+KFymRZ4FZE4fc zVw1McGY9DFuzhJo2odXV7Y= X-Received: by 2002:a63:ec44:: with SMTP id r4mr21490047pgj.425.1586875395070; Tue, 14 Apr 2020 07:43:15 -0700 (PDT) Received: from sultan-box.localdomain (static-198-54-129-52.cust.tzulo.com. [198.54.129.52]) by smtp.gmail.com with ESMTPSA id y123sm11056229pfb.13.2020.04.14.07.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 07:43:14 -0700 (PDT) Date: Tue, 14 Apr 2020 07:43:09 -0700 From: Sultan Alsawaf To: Chris Wilson Cc: stable@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Matthew Auld , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] drm/i915: Synchronize active and retire callbacks Message-ID: <20200414144309.GB2082@sultan-box.localdomain> References: <20200404024156.GA10382@sultan-box.localdomain> <20200407064007.7599-1-sultan@kerneltoast.com> <20200414061312.GA90768@sultan-box.localdomain> <158685263618.16269.9317893477736764675@build.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <158685263618.16269.9317893477736764675@build.alporthouse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 09:23:56AM +0100, Chris Wilson wrote: > Quoting Sultan Alsawaf (2020-04-14 07:13:12) > > Chris, > > > > Could you please take a look at this? This really is quite an important fix. > > It's crazy. See a266bf420060 for a patch that should be applied to v5.4 > -Chris What? a266bf420060 was part of 5.4.0-rc7, so it's already in 5.4. And if you read the commit message, you would see that the problem in question affects Linus' tree. You can break i915 in 5.6 by just adding a small delay: diff --git a/drivers/gpu/drm/i915/gt/intel_ring.c b/drivers/gpu/drm/i915/gt/intel_ring.c index 6ff803f397c4..3a7968effdfd 100644 --- a/drivers/gpu/drm/i915/gt/intel_ring.c +++ b/drivers/gpu/drm/i915/gt/intel_ring.c @@ -10,6 +10,7 @@ #include "intel_engine.h" #include "intel_ring.h" #include "intel_timeline.h" +#include unsigned int intel_ring_update_space(struct intel_ring *ring) { @@ -92,6 +93,9 @@ void intel_ring_unpin(struct intel_ring *ring) else i915_gem_object_unpin_map(vma->obj); + mdelay(1); + ring->vaddr = NULL; + i915_vma_make_purgeable(vma); i915_vma_unpin(vma); } This is how I reproduced the race in question. I can't even reach the greeter on my laptop with this, because i915 dies before that. Sultan