Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp147488lqb; Thu, 14 Mar 2024 07:42:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWes/qJzVC/VVaJ+bLZuDgykBbfM/o9v5Hdnrll8hQ8AeFrkzNY90/9ACTeERdAVYngq6R26L3DIk42M74ZvYMm7JIAWWfBkHPn4kfZ1Q== X-Google-Smtp-Source: AGHT+IFIw3ID1NDyyvCLf9FTQqDa2i5flb2UXWfH5h00p4LGCWcSNXEyW0o2aI5ea42ibfVqghxx X-Received: by 2002:a17:906:b4e:b0:a45:2d35:2c22 with SMTP id v14-20020a1709060b4e00b00a452d352c22mr1355753ejg.64.1710427356829; Thu, 14 Mar 2024 07:42:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710427356; cv=pass; d=google.com; s=arc-20160816; b=VH0RrhdVeDGTAMnPQ9hT6eHqWndmVYZId4zpD8yWMjfj3bUDYhI1HXSl49PXTyey24 ZD3d4F0ctwkcVo/5RxcY0/AzIaN0zOCBeyD5MGDmQc+6UZ3eSgapNyD8Hq1B6zYvyeC6 tARTmB38rebBbHwBvuy8U6AeJup7fK+RYSBqEU+OmwNNE1BO4TDc1Qa0z3yW7PYnfNVY ESCFw/dNzPNl1rhJkWY45Ohnxhbh3DKYtDSOoEElNPMKLr0uKHLdZl7zoy8VsU0VTzWi 7/xPnaB3LiQwC+FoEmfBExSP1sl06DsTJw0YSZtCIEkRpXuiGgM/yr1hy+VMO/h2eYKw lIuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Za5iucYxSXOJJRA/mt5b8AE1A6QwDe4Iqg1yMlydUGA=; fh=Lc3KpiqJ0x/Y8/KRg8W7vuy+HJxbs3EmZcT5AZDx8xs=; b=Legzr1bTX72VgLeT0tYmtKMNyISuFpmcXO4JPgtnAHyjYlSF+3HvXZItuIZu6JgUCn oujvh5xVET8RXsCFe90qxkejf7A9PhsQqv6NIbVi54wCeEzR6fe30NKmVJprVPpgktzc KNqsoBkVodH7n7/8y8CKIlL8yYs/e9jJ3TY3Xq5+yGTdeuuCoI7BVQVI3C5mz4RgrrpM mYaf5S2aNlzhKn8H5uEDKYaansQnl0nRf4JXvPz4al02gpXKIvIFF0vzCj7LZwa4S0L4 HT7kx4kabk1Mo0LAWAX00aG+lbWJ9lB+m53h1sQyqb+suokdEfk8Le0giqd4UiY0KajP hfMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PeLGiayu; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-103421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qh9-20020a170906eca900b00a440b62c67fsi773992ejb.291.2024.03.14.07.42.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 07:42:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PeLGiayu; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-103421-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5DF351F209AF for ; Thu, 14 Mar 2024 14:42:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A5ED70CBC; Thu, 14 Mar 2024 14:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PeLGiayu" Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 900D65D756 for ; Thu, 14 Mar 2024 14:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710427341; cv=none; b=sJMTmdGJUNgsMrOW0VE3ZQvkqMYEHm8pTqYJ3q4jzPC/JWKtDpfTbeYcALa2w6liL75mBRgumfejmGHQR/Q6eVb2v4PTkqIhBjB4KrtcJNklk9++Hs5F+FSW+4lCX9Ww24caDo3+hMupuklEW4bAlZCn2mSvG6sV20PYz121q2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710427341; c=relaxed/simple; bh=PZgguATQJxMG3xWOh3Fg79pBfvVKAazktmQ4UUvzWHw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LkuvIF7A8Du+XFCPcCPOZnwYPyqo7/5Q1mkzr0gAI0ZVTifK2LULawbbp0GMRs4LeSQi8q8GBnbNjhmIWGwbqyl9ZOn1FzOAZfDzXbcN3j23niUf98YVaSY7/QmPpyNR98lsCPGA/3PKsBKc9B73Bvwe7lD3Fn2faqGxM8Y8+nI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PeLGiayu; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-29de2dd22d8so215324a91.2 for ; Thu, 14 Mar 2024 07:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710427339; x=1711032139; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Za5iucYxSXOJJRA/mt5b8AE1A6QwDe4Iqg1yMlydUGA=; b=PeLGiayuYhJ5mTmDeXt6JwOafT7y8ezPl7JGvFJv9N4VsEP3OtKLP9lnXn6aTHW73f 2XQLBKZ/HN+8AkVeef8Ikt1IMPXFiZTHlXEEnrA3xfROeq1hHcM8AxzNlpQ0PmLb+zRB b+9uHx7N+vlYwGdCVRg+87zQ5mPFoQrkdDR4KAvmXrVIAyPKA4WKmFfMStYZLwEgw8xI KvEEY4BueTo909/vdbc1vsMTq7D4LcfRXszgN8a8Mhh3T3TMVX0ypWMtYEgN+snvZ/9K ZaJdieuzyztlvrAAmEqqerujPVHZY4X5Y5SyxwHETtbe12HWZz6t9MiBnrjMJPXf5WTC SM/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710427339; x=1711032139; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Za5iucYxSXOJJRA/mt5b8AE1A6QwDe4Iqg1yMlydUGA=; b=kCcl8Oxmu562od9EYtf1QT49/eE+UNYyV30DLQcz2Uw4Rk6ix9pDOjs8rk1umpqfDV 2tueu0mm6yaXYF5kDXgK/RqNmEc/8lN1Bs7rjWX8G6LhOn9hZnuDtJNWjnP1IQdPaeCN 5qoEk69kkqLEAS3TnoVuGs8RDrXLqq13vqYLz+yL6CTbvfvB3YUcsfZdNKHvGLdOeqhn 7aY9G9Z29sdyOx3Dl5Osc5u4pWEFFmPw1119NRqRL9OAnDlP8bEZb1EyIp0x9XWO2pe0 m6pZBCmZG9YrwwvoqRdZbHSlevm4fZYuOF+hgLe56YVIpSMWLb9WIVDNei688H98mJAp 91Bg== X-Forwarded-Encrypted: i=1; AJvYcCWGsSSnOyJgE1byr/bBCShueaGLqRPoovxczzTmnFO+nKHDhpDbHAZxTmnLRw6euKMySNvwDsaIwoxVjIBwxnwRVAK+sQcHhOjIuzaI X-Gm-Message-State: AOJu0YzslUKfOI4a0+zwgqHAlqIVjD0Al0Ml2xeUcJTWsQmmiTeAHXh8 4D1/Dvua+2IDBhFjsh+2bUHabj3eoROiAJKxXOXdXKUYW7Wt/g+v+rG3AITevn2QR6RmkjVeEY3 VFSsTUuyAlKBN8rJ3tdXuZzRjYlU= X-Received: by 2002:a17:90b:30c6:b0:299:1777:134c with SMTP id hi6-20020a17090b30c600b002991777134cmr1752577pjb.33.1710427338838; Thu, 14 Mar 2024 07:42:18 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240312124148.257067-1-sunil.khatri@amd.com> <59cf081e-5924-42b5-a3f1-de8b012f09d1@amd.com> In-Reply-To: <59cf081e-5924-42b5-a3f1-de8b012f09d1@amd.com> From: Alex Deucher Date: Thu, 14 Mar 2024 10:42:06 -0400 Message-ID: Subject: Re: [PATCH 1/2] drm/amdgpu: add the IP information of the soc To: "Khatri, Sunil" Cc: Sunil Khatri , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , Shashank Sharma , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 14, 2024 at 1:44=E2=80=AFAM Khatri, Sunil wr= ote: > > > On 3/14/2024 1:58 AM, Alex Deucher wrote: > > On Tue, Mar 12, 2024 at 8:41=E2=80=AFAM Sunil Khatri wrote: > >> Add all the IP's information on a SOC to the > >> devcoredump. > >> > >> Signed-off-by: Sunil Khatri > >> --- > >> drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 19 +++++++++++++++++++ > >> 1 file changed, 19 insertions(+) > >> > >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/d= rm/amd/amdgpu/amdgpu_reset.c > >> index a0dbccad2f53..611fdb90a1fc 100644 > >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c > >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c > >> @@ -196,6 +196,25 @@ amdgpu_devcoredump_read(char *buffer, loff_t offs= et, size_t count, > >> coredump->reset_task_info.process_name, > >> coredump->reset_task_info.pid); > >> > >> + /* GPU IP's information of the SOC */ > >> + if (coredump->adev) { > >> + drm_printf(&p, "\nIP Information\n"); > >> + drm_printf(&p, "SOC Family: %d\n", coredump->adev->fam= ily); > >> + drm_printf(&p, "SOC Revision id: %d\n", coredump->adev= ->rev_id); > >> + > >> + for (int i =3D 0; i < coredump->adev->num_ip_blocks; i= ++) { > >> + struct amdgpu_ip_block *ip =3D > >> + &coredump->adev->ip_blocks[i]; > >> + drm_printf(&p, "IP type: %d IP name: %s\n", > >> + ip->version->type, > >> + ip->version->funcs->name); > >> + drm_printf(&p, "IP version: (%d,%d,%d)\n\n", > >> + ip->version->major, > >> + ip->version->minor, > >> + ip->version->rev); > >> + } > >> + } > > I think the IP discovery table would be more useful. Either walk the > > adev->ip_versions structure, or just include the IP discovery binary. > > I did explore the adev->ip_versions and if i just go through the array > it doesn't give any useful information directly. > There are no ways to find directly from adev->ip_versions below things > until i also reparse the discovery binary again like done the discovery > amdgpu_discovery_reg_base_init and walk through the headers of various > ips using discovery binary. > a. Which IP is available on soc or not. > b. How many instances are there > Also i again have to change back to major, minor and rev convention for > this information to be useful. I am exploring it more if i find some > other information i will update. > > adev->ip_block[] is derived from ip discovery only for each block which > is there on the SOC, so we are not reading information which isnt > applicable for the soc. We have name , type and version no of the IPs > available on the soc. If you want i could add no of instances of each IP > too if you think that's useful information here. Could you share what > information is missing in this approach so i can include that. I was hoping to get the actual IP versions for the IPs from IP discovery rather than the versions from the ip_block array. The latter are common so you can end up with the same version used across a wide variety of chips (e.g., all gfx10.x based chips use the same gfx 10 IP code even if the actual IP version is different for most of the chips). > > For dumping the IP discovery binary, i dont understand how that > information would be useful directly and needs to be decoded like we are > doing in discovery init. Please correct me if my understanding is wrong > here. It's probably not a high priority, I was just thinking it might be useful to have in case there ended up being some problem related to the IP discovery table on some boards. E.g., we'd know that all boards with a certain harvest config seem to align with a reported problem. Similar for vbios. It's more for telemetry. E.g., all the boards reporting some problem have a particular powerplay config or whatever. Alex > > Alex > > > >> + > >> if (coredump->ring) { > >> drm_printf(&p, "\nRing timed out details\n"); > >> drm_printf(&p, "IP Type: %d Ring Name: %s\n", > >> -- > >> 2.34.1 > >>