Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2545772ybk; Tue, 12 May 2020 02:02:57 -0700 (PDT) X-Google-Smtp-Source: APiQypIUM5zVG+aY3+2baYt/4JcY1yi6eqjApp7Cua0z6Tnirtrq5EevQDF02AqDAD+prtpyb7OM X-Received: by 2002:a17:906:4eda:: with SMTP id i26mr16936152ejv.180.1589274177034; Tue, 12 May 2020 02:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589274177; cv=none; d=google.com; s=arc-20160816; b=Q3ALWutIkw+1a4pqApKlEVi6280Lqn6noxnhQfERtU/N63LrF2aJmpwQENX5CN4Nt+ i0S8bLvmr6Og5K63CBA24UjzuceslIeviDnhRqGSa4OcWpd85lkGFzjSA7sIVLUMY5oU R/f/94PrvjcP5IB8ulaAyu9Gr2ZY1j+IPDVDGuhTDGlYH7TiV9l+SNO/ciFKXc1xawHG DOKxYm/CY8pn7+++hhfhbIcWG2CaiB3D1dCMcssnt4FmGS3EsyevFmfKTETBFII4zh0R //kBHc0gH9nw3laO9+SXhdKl1lWOEm5Y462yMW8fw0wm3sMf5L28W4LfJzRl2B0RZx4G nPcQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=u5gM1ohPbNVORxsODI5ngB8Z3LljD1/NzUrdRFpQw6k=; b=gXBkoMhTaWjawNa8aw/0KCE1DY1voRCm30O0o1uCvshjyULPWHF2UrOzjgT0cu+nvH /jHF1Dv3UBKeCwyqOgkw7IUbdbO7WMId0QOqgP0osp6sDBkYyZoLSREZbb5mVtidZGAD 1TxqIpFAS1lY0y0SZgjFhAeDMjoh/WNMUYF0QsByEeFetER4ko71UP6mYTbvWE1AeENh 1zBzA1kcQ3jAsZ+y09yzkSAE/UsReQTVJTl04YSMjP29BtFVcz8azmasEKe4kL3iHNgm hdiK68mSHMs5iE3Ig+e3gTWm0xgssqsb+RbaWpwaSNTdRjfrb03EeFCSpQeV+A9qRwk2 aJ7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=eo6XCFnG; 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 n7si7666810ejy.248.2020.05.12.02.02.33; Tue, 12 May 2020 02:02:57 -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; dkim=pass header.i=@ffwll.ch header.s=google header.b=eo6XCFnG; 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 S1729303AbgELJAj (ORCPT + 99 others); Tue, 12 May 2020 05:00:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729454AbgELJAN (ORCPT ); Tue, 12 May 2020 05:00:13 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D1A3C061A0F for ; Tue, 12 May 2020 02:00:13 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id u16so22340925wmc.5 for ; Tue, 12 May 2020 02:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u5gM1ohPbNVORxsODI5ngB8Z3LljD1/NzUrdRFpQw6k=; b=eo6XCFnGqS3UTbV+XFLkZTkDoh8UHvgOyRRDESLFJ7MP+5Cj3/IxjzAl127GN5O9rY VXDXGt6n7g7rCnvzywPZOWCjrMfNywQXd3+W+fn3un22WolNWV/n9WI+YAZlftq1Ve6F gC89CnJ6agJOr1dSjp+3V/HsmrsJiwJEQFsVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u5gM1ohPbNVORxsODI5ngB8Z3LljD1/NzUrdRFpQw6k=; b=s/gUIQcF8wLj+0HMS84CjUAjjK633Zja5jd4ex8MhUUVGAGdPImfmjYS6Pii0kDrzJ /op7lgVo8hRIEgkJw8KZ6xJ5Y7csBOnZpnK09Kv5RpkdVVPDJ//cdFiuBB53xGR5XcO1 gxb8+eI7MwPFPPfJ7lXW4FmRGHgcIqSzxuFnnXzrFqRVaxGsq85184tmczW6cCxooWUB pDw4EFBSFHtdtqJajrQ1LVgVt6zxy0a0st9pET2txfsN4xx7Wnc/TdgI6cKm4PdQTOHU 3KtSpCETVdLFHrXzXGy8O4eKCxzLbMlB16mUh40cf1oanQkLhfXj9Zp9sHdTWecC6KcS +UgA== X-Gm-Message-State: AGi0PuZpAuRHJva3KKDTLf3DkKHUUf6txrRLPBmv4mw+ysWBFDST7M0I l7XQlD9UtbKMyxYmnQe2V4qI/Q== X-Received: by 2002:a1c:9e52:: with SMTP id h79mr35953921wme.84.1589274012210; Tue, 12 May 2020 02:00:12 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id y10sm18845457wrd.95.2020.05.12.02.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 02:00:11 -0700 (PDT) From: Daniel Vetter To: DRI Development Cc: LKML , Daniel Vetter , linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Chris Wilson , Maarten Lankhorst , =?UTF-8?q?Christian=20K=C3=B6nig?= Subject: [RFC 14/17] drm/amdgpu: use dma-fence annotations for gpu reset code Date: Tue, 12 May 2020 10:59:41 +0200 Message-Id: <20200512085944.222637-15-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512085944.222637-1-daniel.vetter@ffwll.ch> References: <20200512085944.222637-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To improve coverage also annotate the gpu reset code itself, since that's called from other places than drm/scheduler (which is already annotated). Annotations nests, so this doesn't break anything, and allows easier testing. Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Cc: linux-rdma@vger.kernel.org Cc: amd-gfx@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Christian König Signed-off-by: Daniel Vetter --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index b038ddbb2ece..5560d045b2e0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4140,6 +4140,9 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, bool use_baco = (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) ? true : false; + bool fence_cookie; + + fence_cookie = dma_fence_begin_signalling(); /* * Flush RAM to disk so that after reboot @@ -4168,6 +4171,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, DRM_INFO("Bailing on TDR for s_job:%llx, hive: %llx as another already in progress", job ? job->base.id : -1, hive->hive_id); mutex_unlock(&hive->hive_lock); + dma_fence_end_signalling(fence_cookie); return 0; } @@ -4178,8 +4182,10 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, */ INIT_LIST_HEAD(&device_list); if (adev->gmc.xgmi.num_physical_nodes > 1) { - if (!hive) + if (!hive) { + dma_fence_end_signalling(fence_cookie); return -ENODEV; + } if (!list_is_first(&adev->gmc.xgmi.head, &hive->device_list)) list_rotate_to_front(&adev->gmc.xgmi.head, &hive->device_list); device_list_handle = &hive->device_list; @@ -4194,6 +4200,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, DRM_INFO("Bailing on TDR for s_job:%llx, as another already in progress", job ? job->base.id : -1); mutex_unlock(&hive->hive_lock); + dma_fence_end_signalling(fence_cookie); return 0; } @@ -4319,6 +4326,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, if (r) dev_info(adev->dev, "GPU reset end with ret = %d\n", r); + dma_fence_end_signalling(fence_cookie); return r; } -- 2.26.2