Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1661454rwp; Thu, 13 Jul 2023 14:36:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlG7ErK3iSnicHadLHZl1gqfKFl7fjoXY0exzgXb9Jt8G87loKMu2wzKFNroweCCY0YICVcN X-Received: by 2002:a17:906:9e1f:b0:977:ceab:3996 with SMTP id fp31-20020a1709069e1f00b00977ceab3996mr2237621ejc.76.1689284161415; Thu, 13 Jul 2023 14:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689284161; cv=none; d=google.com; s=arc-20160816; b=ufadYVkLMPurUWmnlKJW8wBNMilXXNQL3Z6/KYDMAsC0bdhCRjKOyknpCsYk2lVOBx 7Nin8tASWD3ZW15llpTkYFr1JJOvKjLqNPn0Yrsx0o+Cqiq3jtOt1ulHR2NXGlfnBBnt 1e0hOVmRIJVnL97p+sgmilRJzYLmcrMzoMgfY84Zyu9IE5PztOvFGbko0Isu1ZPtMw15 B9DWfkKnpovmGiaNVG7GhJScjsZVdNA5z6nTm94HSRMeqMOryEh/F/q1PMFt26lm8hiE RgJO5WnXqtsJVG9OPFYBCx9TXkZ/Z81TWwYAz0gnUL56TDGtqOuhyjVQMcpzaj52MMoP SEhA== 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=Z8+yHUBLE2x/uwIO5VHayp0mcRdlKPk55oOFlYjjXeQ=; fh=aYwOFvh45AiUk04AC35/CxFbCKpYy0XHNT+Ky7LGVhk=; b=hSLk50Ubz8mnS2l5RFfmrRTHyGD2XYkRSxRCAroAZyw5b0gy4jnDHO/EASwMICAQxF rVk0h1naWgc1SBnDlcHxjdZD1mlZcVUtxOu7Bwmi0Wn2GEofT21jqVO+W9AMCS+q4YN6 794Uq1DhXt71HMYm7EJl4rpoNpHRd8i978Z4w2uX0z+GM8XvCdg0tKBNN/++/P889YES 2Zdkwp1ggEVWAHGynyCaucMS86HahtGiDxmYV8SC8Js2Qf8qCpe9s5NTyF9d/WgciKty gfdrofCCZyEXRuAc6CHzgvwn3lfUF8uAODkk04HC/mK+GsII1WeCt1kSZcyVq755on6d G3HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=UfYOM+5k; 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 j25-20020a170906279900b00992d6e88087si8236613ejc.955.2023.07.13.14.35.37; Thu, 13 Jul 2023 14:36:01 -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=UfYOM+5k; 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 S232542AbjGMVdl (ORCPT + 99 others); Thu, 13 Jul 2023 17:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232089AbjGMVdb (ORCPT ); Thu, 13 Jul 2023 17:33:31 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CA8C2D60 for ; Thu, 13 Jul 2023 14:33:30 -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=Z8+yHUBLE2x/uwIO5VHayp0mcRdlKPk55oOFlYjjXeQ=; b=UfYOM+5kJXM9Evp9TRM9IXUy6f kkyhp0JWYUGqYYVuAYJqEyeTwPVwTTGAf9u7xvCanubbmyzcMMekutTEYvL/cJgS5CzHcNLX2rt0S MookQemT4QHCBBeMrptMCymBJqCNr/cu0nY6L3EsSu3GFqlXuBd3v/7wr28pgc2kHyhj20n1kUQyo yybxaA5aq58BYDjuScRc1N3qSt580ll7Gipcc26k0yb6GwUpg447aUHp0W/Gw8gm0jqQHA2NksmVr sPTmYmCdyvX9XRwH4G9UaFHGlKHz+VegD+f5tk1BSG6y0cSQ8x/sBefbIwYvtH6RL9KbYIaGX5Ihu Qi8ABpGA==; 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 1qK3wF-00EDEa-Qs; Thu, 13 Jul 2023 23:33:28 +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 v2 4/6] drm/amdgpu: Limit info in coredump for kernel threads Date: Thu, 13 Jul 2023 18:32:40 -0300 Message-ID: <20230713213242.680944-5-andrealmeid@igalia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230713213242.680944-1-andrealmeid@igalia.com> References: <20230713213242.680944-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 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 e80670420586..07546781b8b8 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