All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Russell <kent.russell@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Kent Russell <kent.russell@amd.com>
Subject: [PATCH 3/4] drm/amdgpu: Only overwrite serial if field is empty
Date: Mon, 13 Dec 2021 14:34:01 -0500	[thread overview]
Message-ID: <20211213193402.96278-3-kent.russell@amd.com> (raw)
In-Reply-To: <20211213193402.96278-1-kent.russell@amd.com>

On Aldebaran, the serial may be obtained from the FRU. Only overwrite
the serial with the unique_id if the serial is empty. This will support
printing serial numbers for mGPU devices where there are 2 unique_ids
for the 2 GPUs, but only one serial number for the board

Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
index 6e781cee8bb6..dfcf9a53e5ea 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
@@ -1615,7 +1615,8 @@ static void aldebaran_get_unique_id(struct smu_context *smu)
 	mutex_unlock(&smu->metrics_lock);
 
 	adev->unique_id = ((uint64_t)upper32 << 32) | lower32;
-	sprintf(adev->serial, "%016llx", adev->unique_id);
+	if (adev->serial[0] == '\0')
+		sprintf(adev->serial, "%016llx", adev->unique_id);
 }
 
 static bool aldebaran_is_baco_supported(struct smu_context *smu)
-- 
2.25.1


  parent reply	other threads:[~2021-12-13 19:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 19:33 [PATCH 1/4] drm/amdgpu: Increase potential product_name to 64 characters Kent Russell
2021-12-13 19:34 ` [PATCH 2/4] drm/amdgpu: Enable unique_id for Aldebaran Kent Russell
2021-12-13 19:34 ` Kent Russell [this message]
2021-12-13 19:34 ` [PATCH 4/4] drm/amdgpu: Access the FRU on Aldebaran Kent Russell
2021-12-14  3:16   ` Chen, Guchun
2021-12-14  3:38     ` Chen, Guchun
2021-12-14 15:23       ` Russell, Kent
2021-12-14  3:32 ` [PATCH 1/4] drm/amdgpu: Increase potential product_name to 64 characters Chen, Guchun
2021-12-14 15:23   ` Russell, Kent
2021-12-17 15:31 Kent Russell
2021-12-17 15:31 ` [PATCH 3/4] drm/amdgpu: Only overwrite serial if field is empty Kent Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211213193402.96278-3-kent.russell@amd.com \
    --to=kent.russell@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.