Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1699745rwp; Thu, 13 Jul 2023 15:20:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlEaiityvysYwZgom22/Y9KAL5ilgIh7mX5bIy/qLL71fQajOJwrctyGiymeJZiSIZLxkpkb X-Received: by 2002:a05:6358:9996:b0:135:b4c:a4b4 with SMTP id j22-20020a056358999600b001350b4ca4b4mr3012370rwb.14.1689286804262; Thu, 13 Jul 2023 15:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689286804; cv=none; d=google.com; s=arc-20160816; b=orWVCCTsE1dAU+1CQW0mr/ZrGAR3UHqoeeiQ3zs/X+N6XAuzE9MfYQQ13K0B0LvHqO I3eHKd9rRGZSwrxfwXQBgmoBa4FEv4/MTCO+ck3JIvdmSUoTxgLJ1q6jYzERttM+Q7lU o7/+T/ysN9ur7guJ5hXbxn6A+ibmR9ZSg0eEyllQLDiE9KdtSPDaHIZw7yTG6pCfgcNU OuNNr8IAgBR88ri5h6V1xcsB/kVP+TF8xyYjbTkO1RNYRGXJa0EXuWtoz7K8GcsdCZOg L5FIUaEgz9AKeINewzndCqvZeNhkjcbbgVI11dNfI5dB6wbDZzxfaN4MGw+1Nn1JMqTU KYog== 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=wefOQXZQwSDcp2ccRjthMbBFASOk2LxGNeKu9meJsro=; fh=aYwOFvh45AiUk04AC35/CxFbCKpYy0XHNT+Ky7LGVhk=; b=T42afUCduRvBoMp43fiwYJRIYpA3qkrm2d8q0js4l93zckDO/AFyvlLPXNw0onQrlw B7RzjjkFIMoFEMPzrAtddPscsot3PGSUgA4b/tLS+WPPmvbbBXmgTrm/a+lFnQ/24l3z GuDYOMNP2RhtJI+k1tAszksVHFuXmwqCUPEgx+Ga4L2EHYZjxo1JRIaErVCy3b161wqE 4UFGv5Nb+2s2nm+GgmAWeSUqy5AdRieJOmGNFbeUdvkMaIFWfwimkhYQVfTndQHeOR3E 5Rr2ujEm3e0SqzMAO550ODH74L0ou6W1GK5msTZz47DF4uNL/FEOh8Be7KOtZ/t0HtGb Jq6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=JWFiob9E; 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 x71-20020a63864a000000b00543ed2931d2si5790517pgd.456.2023.07.13.15.19.51; Thu, 13 Jul 2023 15:20:04 -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=JWFiob9E; 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 S232578AbjGMVdu (ORCPT + 99 others); Thu, 13 Jul 2023 17:33:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231911AbjGMVdo (ORCPT ); Thu, 13 Jul 2023 17:33:44 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDAD430CA for ; Thu, 13 Jul 2023 14:33:36 -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=wefOQXZQwSDcp2ccRjthMbBFASOk2LxGNeKu9meJsro=; b=JWFiob9ERIYHygWAocTFwnHZf1 +uazyGuftVZPQH5KKgq25teyGk168GsBKhcFBFqUi/obWJuO2LA37ryauNp4qC2eIlxd84PN/izne e6QqDRYAmmluEC6QASXQQt7jIrN2RSaFR6/IRd6V3RRjTTIa+4H5rBQrZPzEyUwvsrnXpR5NupxRd z24lAv18gtid3d33S7jgeUr4A1nlfoCsjQ+2zA9qXf6rZy4XCmj9kAoxhhdv0leDCa9NWHtnPZ8CO rsBnk0D1ke2t1Ow9GTFjoUPwe8JZoUoDdv3nQcm+qL6+GN6feKodxezlRUoti2Z3iMGwhrNXa0N+c K2eyVsdA==; 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 1qK3wM-00EDEa-C8; Thu, 13 Jul 2023 23:33:34 +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 6/6] drm/amdgpu: Create version number for coredumps Date: Thu, 13 Jul 2023 18:32:42 -0300 Message-ID: <20230713213242.680944-7-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 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.h | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index cfeaf93934fd..905574acf3a0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1081,6 +1081,9 @@ struct amdgpu_device { }; #ifdef CONFIG_DEV_COREDUMP + +#define AMDGPU_COREDUMP_VERSION "1" + struct amdgpu_coredump_info { struct amdgpu_device *adev; struct amdgpu_task_info reset_task_info; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 431ccc3d7857..c83ea7aa135a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4985,6 +4985,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); -- 2.41.0