Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2665840rwp; Fri, 14 Jul 2023 09:21:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlFryAaWpaniT17sBF2pXd1jzRYKmP338lKMaBKkDUyCLFWI5CNLVl4tSq9y83HMLSujao1x X-Received: by 2002:a05:6808:2385:b0:3a3:61fc:f913 with SMTP id bp5-20020a056808238500b003a361fcf913mr7261100oib.0.1689351705086; Fri, 14 Jul 2023 09:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689351705; cv=none; d=google.com; s=arc-20160816; b=WcHScGkhYE3W3njNkAj5LGJLGvKOnSncWCI/uZlj1/mwbmBZCFRh3BEH/Qr7ZfFBjm ko3JEb09nooE8KiXvCm/Rlefcm+zQi7cdlJhOmMKlVO7T9HR3ef9POyqG+7vQBCj2Pk5 qHzpMtnxVawpBVetj2Wn5GQhg0u41i76WsXL705KfmPtXSejoVMkJ/SnkbbKqDwiW8/D WXgg7Qfhw1W/tqQPJwH/sjJaEh5GK0nGyhe2GF4A9zgrW5WMmFlZssRTHybnTAzzD4zc RA4vBzO3ZKBC2tQ7qK4FI3QDqUXqDCr/PDipZlfw4YtHmYv73zMIKux9JwW64UVbi6Fg AH4g== 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=nhGZVSWSn6mtbEKzKTGtlDNdAdMZQ2RiJK0D2JyHWac=; fh=aYwOFvh45AiUk04AC35/CxFbCKpYy0XHNT+Ky7LGVhk=; b=yGA2Hg9jNw5FBczatpmAzC0MDvMQSNFdwl5pl+ATIMza+YzD7DJxS9XYVUt6+cX5Av WtfuoUnvEPzBpUpUMG/desHNE6qjn7j8uYcPncbNs+9Rp8jOES2+uvLye/HvPR3ISimn Po+EMb/uCXk0E9qs2ixf66x3VXR5qS0toNe/OeMZhTYew7EoZlojsulba6BahkInDrIh ZevgvBgRkJUznTXeQ/GcZbIZZYrxTHd4R6C4lu1jMLKyghmnLHmU+yK3pwXu+EfiH8gk 6RGRlGFrTojH27s6G02ToVlIYQKBbf9YiPRp5AbXGVQklNgY41q6A4m65xxXx2I5irdZ Evhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=aw2mqb3U; 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 s2-20020a637702000000b005576ebe803bsi7024842pgc.319.2023.07.14.09.21.32; Fri, 14 Jul 2023 09:21:45 -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=aw2mqb3U; 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 S236261AbjGNQMG (ORCPT + 99 others); Fri, 14 Jul 2023 12:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236203AbjGNQLy (ORCPT ); Fri, 14 Jul 2023 12:11:54 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AD132D64 for ; Fri, 14 Jul 2023 09:11:52 -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=nhGZVSWSn6mtbEKzKTGtlDNdAdMZQ2RiJK0D2JyHWac=; b=aw2mqb3UjXpyfRVOdST/PkQaM5 5XCYIhALq+vuob1227YOvJY1fwX53CPTbpRCcDcFwdH/vqKyLvOVM7igY/SxbCIQLJiuXVzsSgeVw p0VVW96j83R96Iu3Es8w1xmWyzhlJBeNSKA/pwlTsiKu/WO4U52vw0+Psgood5EDxlCHBN0WBToV6 6PlaoIMr8wqli8W7/uBoQ4afSC0+btg5n0LFG8MwwRdpsUZnv4bmFnz+ZT4DdlFp+NPL7E27l8EKo VVpXVasoY6KlTZCklisRLKyqjL2RNblCV27obQHZv1cOih2jIDaaJpQ77UvCk7Pdv0AzAvbxopE6X CBhO6Ogw==; 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 1qKLOY-00Eaot-Co; Fri, 14 Jul 2023 18:11:50 +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 v3 5/5] drm/amdgpu: Create version number for coredumps Date: Fri, 14 Jul 2023 13:11:28 -0300 Message-ID: <20230714161128.69545-6-andrealmeid@igalia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230714161128.69545-1-andrealmeid@igalia.com> References: <20230714161128.69545-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 Even if there's nothing currently parsing amdgpu's coredump files, if we eventually have such tools they will be glad to find a version field to properly read the file. Create a version number to be displayed on top of coredump file, to be incremented when the file format or content get changed. Signed-off-by: André Almeida --- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c index 081cdf3bc267..dab385f9dd80 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c @@ -192,6 +192,7 @@ static ssize_t amdgpu_devcoredump_read(char *buffer, loff_t offset, p = drm_coredump_printer(&iter); drm_printf(&p, "**** AMDGPU Device Coredump ****\n"); + drm_printf(&p, "version: " AMDGPU_COREDUMP_VERSION "\n"); 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); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h index 362954521721..7b6767ca8127 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h @@ -88,6 +88,9 @@ struct amdgpu_reset_domain { }; #ifdef CONFIG_DEV_COREDUMP + +#define AMDGPU_COREDUMP_VERSION "1" + struct amdgpu_coredump_info { struct amdgpu_device *adev; struct amdgpu_task_info reset_task_info; -- 2.41.0