From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94A21C433F5 for ; Fri, 8 Apr 2022 10:57:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 242E610F026; Fri, 8 Apr 2022 10:57:14 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6231010F00B; Fri, 8 Apr 2022 10:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649415432; x=1680951432; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=Wh4xhNSrs9SN6yQgchGEEUO9o9HS+tpvYB6hKEMDrxw=; b=L2dIlNEvNeJEmDRXzQOGQKSKdOEggZuffwencw53VfGWrLJy4It/6NUt Db19WOq1Oov4FkAdiun9mDceHWyq+Ch14nLDCdb40BeZDelVK++El+RTw VH46GOSSlVyk6VMq/amGu/sLFNmhYqYljDGkA7qpKMY2Sa4MIcldEZMqw atXIiCj+N0KhV6//vV25/Pc/a7FSWZMyKUh6PVLHvFNdpRN3y81DQpb6M hbd/78E4aj/QCdcv2QgWzR8Ukb2aVtSr4Rgx1yhz5n/8UVLedl+y5eAcG ABVpF9PxZcXkoW7a1FTxQUBplzwbtDKTDDRM/n7uxO2vvvpjADCLQf5Vy g==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="286556376" X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="286556376" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 03:57:11 -0700 X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="723350400" Received: from ajomalle-mobl.ger.corp.intel.com (HELO [10.252.1.141]) ([10.252.1.141]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 03:57:10 -0700 Message-ID: Date: Fri, 8 Apr 2022 11:57:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2] drm/i915: fix i915_gem_object_wait_moving_fence Content-Language: en-GB From: Matthew Auld To: =?UTF-8?Q?Christian_K=c3=b6nig?= , intel-gfx@lists.freedesktop.org References: <20220408084205.1353427-1-matthew.auld@intel.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Lucas De Marchi , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 08/04/2022 10:48, Matthew Auld wrote: > On 08/04/2022 09:59, Christian König wrote: >> Am 08.04.22 um 10:42 schrieb Matthew Auld: >>> All of CI is just failing with the following, which prevents loading of >>> the module: >>> >>>      i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed >>> >>> Best guess is that this comes from the pin_map() for the scratch page, >>> which does an i915_gem_object_wait_moving_fence() somewhere. It looks >>> like this now calls into dma_resv_wait_timeout() which can return the >>> remaining timeout, leading to the caller thinking this is an error. >>> >>> v2(Lucas): handle ret == 0 >>> >>> Fixes: 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency") >>> Signed-off-by: Matthew Auld >>> Cc: Christian König >>> Cc: Lucas De Marchi >>> Cc: Daniel Vetter >>> Reviewed-by: Christian König #v1 >> >> Reviewed-by: Christian König >> >> Should I push it to drm-misc-next? > > I guess we need to wait for at least BAT result to come back. I will > ping here, assuming that comes back green. Thanks. Ok, please go ahead with merging. > >> >>> --- >>>   drivers/gpu/drm/i915/gem/i915_gem_object.c | 11 +++++++++-- >>>   1 file changed, 9 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c >>> b/drivers/gpu/drm/i915/gem/i915_gem_object.c >>> index 2998d895a6b3..747ac65e060f 100644 >>> --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c >>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c >>> @@ -772,9 +772,16 @@ int i915_gem_object_get_moving_fence(struct >>> drm_i915_gem_object *obj, >>>   int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj, >>>                         bool intr) >>>   { >>> +    long ret; >>> + >>>       assert_object_held(obj); >>> -    return dma_resv_wait_timeout(obj->base. resv, >>> DMA_RESV_USAGE_KERNEL, >>> -                     intr, MAX_SCHEDULE_TIMEOUT); >>> + >>> +    ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL, >>> +                    intr, MAX_SCHEDULE_TIMEOUT); >>> +    if (!ret) >>> +        ret = -ETIME; >>> + >>> +    return ret < 0 ? ret : 0; >>>   } >>>   #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) >> From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EBB1AC433EF for ; Fri, 8 Apr 2022 10:57:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A75410F00B; Fri, 8 Apr 2022 10:57:13 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6231010F00B; Fri, 8 Apr 2022 10:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649415432; x=1680951432; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=Wh4xhNSrs9SN6yQgchGEEUO9o9HS+tpvYB6hKEMDrxw=; b=L2dIlNEvNeJEmDRXzQOGQKSKdOEggZuffwencw53VfGWrLJy4It/6NUt Db19WOq1Oov4FkAdiun9mDceHWyq+Ch14nLDCdb40BeZDelVK++El+RTw VH46GOSSlVyk6VMq/amGu/sLFNmhYqYljDGkA7qpKMY2Sa4MIcldEZMqw atXIiCj+N0KhV6//vV25/Pc/a7FSWZMyKUh6PVLHvFNdpRN3y81DQpb6M hbd/78E4aj/QCdcv2QgWzR8Ukb2aVtSr4Rgx1yhz5n/8UVLedl+y5eAcG ABVpF9PxZcXkoW7a1FTxQUBplzwbtDKTDDRM/n7uxO2vvvpjADCLQf5Vy g==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="286556376" X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="286556376" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 03:57:11 -0700 X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="723350400" Received: from ajomalle-mobl.ger.corp.intel.com (HELO [10.252.1.141]) ([10.252.1.141]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 03:57:10 -0700 Message-ID: Date: Fri, 8 Apr 2022 11:57:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-GB From: Matthew Auld To: =?UTF-8?Q?Christian_K=c3=b6nig?= , intel-gfx@lists.freedesktop.org References: <20220408084205.1353427-1-matthew.auld@intel.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: fix i915_gem_object_wait_moving_fence X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Lucas De Marchi , dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 08/04/2022 10:48, Matthew Auld wrote: > On 08/04/2022 09:59, Christian König wrote: >> Am 08.04.22 um 10:42 schrieb Matthew Auld: >>> All of CI is just failing with the following, which prevents loading of >>> the module: >>> >>>      i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed >>> >>> Best guess is that this comes from the pin_map() for the scratch page, >>> which does an i915_gem_object_wait_moving_fence() somewhere. It looks >>> like this now calls into dma_resv_wait_timeout() which can return the >>> remaining timeout, leading to the caller thinking this is an error. >>> >>> v2(Lucas): handle ret == 0 >>> >>> Fixes: 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency") >>> Signed-off-by: Matthew Auld >>> Cc: Christian König >>> Cc: Lucas De Marchi >>> Cc: Daniel Vetter >>> Reviewed-by: Christian König #v1 >> >> Reviewed-by: Christian König >> >> Should I push it to drm-misc-next? > > I guess we need to wait for at least BAT result to come back. I will > ping here, assuming that comes back green. Thanks. Ok, please go ahead with merging. > >> >>> --- >>>   drivers/gpu/drm/i915/gem/i915_gem_object.c | 11 +++++++++-- >>>   1 file changed, 9 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c >>> b/drivers/gpu/drm/i915/gem/i915_gem_object.c >>> index 2998d895a6b3..747ac65e060f 100644 >>> --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c >>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c >>> @@ -772,9 +772,16 @@ int i915_gem_object_get_moving_fence(struct >>> drm_i915_gem_object *obj, >>>   int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj, >>>                         bool intr) >>>   { >>> +    long ret; >>> + >>>       assert_object_held(obj); >>> -    return dma_resv_wait_timeout(obj->base. resv, >>> DMA_RESV_USAGE_KERNEL, >>> -                     intr, MAX_SCHEDULE_TIMEOUT); >>> + >>> +    ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL, >>> +                    intr, MAX_SCHEDULE_TIMEOUT); >>> +    if (!ret) >>> +        ret = -ETIME; >>> + >>> +    return ret < 0 ? ret : 0; >>>   } >>>   #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) >>