Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37473914rwd; Tue, 11 Jul 2023 15:03:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGJb1xsSRgKsdhSjtfzrZMglkov3eQVrQE8KUSLG1dLfitXxV3YBznwID5j0GQNsOs9ZGb9 X-Received: by 2002:a17:90a:ce8d:b0:263:fbe5:2125 with SMTP id g13-20020a17090ace8d00b00263fbe52125mr13137589pju.15.1689113015440; Tue, 11 Jul 2023 15:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689113015; cv=none; d=google.com; s=arc-20160816; b=S0uAjNnl/+QNCAyQGMLn2TE7Nu2ztITWsth6hnVZMikhv9mj2U+nkEBd0gcqUoae3Q /p8aXx2FRzrTVbIX+16NrFLtx0ykuIEJ9QtL1ZHzdCPGHIHaVATuys1osI0rtupcdqX8 UppA/+2NG/yGqWxUA1m8YGTHnTb3km9mMUZVKhahMrQnOcSe1JysccgfRKCcj9cCks2V 8xDIT/f/yf/L8DCqbz9iXdm1yAIkq92GITSq2mkAsdl92E3AS/ovDor8F9H6OKzpMtia CIGGWjfN+dZ3in8+S/VW1PEOlEXaVQKRtS423YKGN4WHv2kE36w3SIbw4EC+DvUifPN0 OWfA== 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=WH7Cm3VveDbv6D+GxRpXLNfTbvl+zR6aYn4to7mM5e0=; fh=aYwOFvh45AiUk04AC35/CxFbCKpYy0XHNT+Ky7LGVhk=; b=JvWtZ2GvK24SdBuMw9m1PUL1jx8IuzPcLx3AaD7ubGMQWxtLeMEGA14sPyeVIFM0do Y4547NVqL/KO08Trx58H7Lq8B/fKucrgfue3il1RwtAo8/dddmFLQkDSv4ApECaUV8Mp SnTvgugx3IA/RvkGem8L7UeZVWw+2ADOHfqol1iuwQg8fugZuCTJHKFkZ9oMVUEWeISn okjXEmpuK/eLagfLpiiXPM9jHrtFFdG1yAfHfhRHshq/Rk6I975qV88gaQwrnqHjBa/v r7Gnrymtk9KPO+ovrIIYVag/iuEFnbUbbzWoUrQYkT0umF2JwE60958w7RWq2di15ZfT D/Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=o6ZCvMVt; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x15-20020a17090a46cf00b0025339314a7bsi9774753pjg.79.2023.07.11.15.03.22; Tue, 11 Jul 2023 15:03:35 -0700 (PDT) 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=fail header.i=@igalia.com header.s=20170329 header.b=o6ZCvMVt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbjGKVgC (ORCPT + 99 others); Tue, 11 Jul 2023 17:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbjGKVf6 (ORCPT ); Tue, 11 Jul 2023 17:35:58 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46F40171E for ; Tue, 11 Jul 2023 14:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WH7Cm3VveDbv6D+GxRpXLNfTbvl+zR6aYn4to7mM5e0=; b=o6ZCvMVtkCfTreopWJ0LzaVhuw BpyVOSfP1bMdVfWrbafOBb2fOdFbsHfTlv+klJvaVKoNt6j3iQ/0q/U8Og+M9LC5pEtMURUGNXGS5 fci8b6lrQ20/F99S8foYZPyG7KGKd97Vm2vwFlvIS9P3x7TmIqXSz5qApGZSfoSxF/ybGn1g27XgN /GgLePM+/Pov1YFOnw5OzewKz2tl6pvAUqSs2SslC5GucnwcfaPCBXtBqXd+PSDBYKQH/tNr2AbsH ACHoxrtQT1Ejq5c4nTQIJ5w2Jx86RrCBUSKlWkC90wYL/0RBPnxrGi5l0G9RqT32rEBh1acgWAyQi SIpq0c1g==; Received: from [187.74.70.209] (helo=steammachine.lan) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1qJL1U-00Cl0M-Ph; Tue, 11 Jul 2023 23:35:53 +0200 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: kernel-dev@igalia.com, alexander.deucher@amd.com, christian.koenig@amd.com, pierre-eric.pelloux-prayer@amd.com, =?UTF-8?q?=27Marek=20Ol=C5=A1=C3=A1k=27?= , Samuel Pitoiset , Bas Nieuwenhuizen , =?UTF-8?q?Timur=20Krist=C3=B3f?= , michel.daenzer@mailbox.org, =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH 4/6] drm/amdgpu: Limit info in coredump for kernel threads Date: Tue, 11 Jul 2023 18:34:59 -0300 Message-ID: <20230711213501.526237-5-andrealmeid@igalia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230711213501.526237-1-andrealmeid@igalia.com> References: <20230711213501.526237-1-andrealmeid@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 a kernel thread caused the reset, the information available to be logged will be limited, so return early in the dump function. Signed-off-by: André Almeida --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 23b9784e9787..7449aead1e13 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4988,10 +4988,14 @@ static ssize_t amdgpu_devcoredump_read(char *buffer, loff_t offset, drm_printf(&p, "kernel: " UTS_RELEASE "\n"); drm_printf(&p, "module: " KBUILD_MODNAME "\n"); drm_printf(&p, "time: %lld.%09ld\n", coredump->reset_time.tv_sec, coredump->reset_time.tv_nsec); - if (coredump->reset_task_info.pid) + if (coredump->reset_task_info.pid) { drm_printf(&p, "process_name: %s PID: %d\n", coredump->reset_task_info.process_name, coredump->reset_task_info.pid); + } else { + drm_printf(&p, "GPU reset caused by a kernel thread\n"); + return count - iter.remain; + } if (coredump->reset_vram_lost) drm_printf(&p, "VRAM is lost due to GPU reset!\n"); -- 2.41.0