Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE6EDC71136 for ; Fri, 13 Jun 2025 21:41:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 36AA810E6B8; Fri, 13 Jun 2025 21:41:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="fDWpgk8B"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 66F4210E6B8 for ; Fri, 13 Jun 2025 21:41:14 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E89C75C491C; Fri, 13 Jun 2025 21:38:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDDA4C4CEE3; Fri, 13 Jun 2025 21:41:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749850865; bh=U3P84Zur3Pp5wh1XRSdRO/XL8uexjSbqPHJQbGTNAFE=; h=From:To:Cc:Subject:Date:From; b=fDWpgk8BLrHi3VyiUZfUyreEpeMSOIYGoXUt0CPwXjm29vZN/CejHPE4VG+4DVtFC BUZP2XM5JzoRUAmMMhReTMeeSgbhY9oecyN7Mtvsb+wfpDxGlNGMeJc2PW0gHHy/EC 733fATocrWKCwDRa67/TkQpJHcflOsD8pZIqGRdB+ejrhYSv8x2TlG0PTbbHNNkTZY JDXkKa3tbOFWqw4mZtMZaMWN3aiUkJ9g8xvdimmRb0qRz0vLXeHa1RTj+6po5j9zi+ R9c29q159+WN0Th+uZZvQnno6vjhdcEr+Bw5dSq3KVHGTLzpug8hUjBzpAgVdNfWTI rOuOONOd8Cvsw== From: Mario Limonciello To: amd-gfx@lists.freedesktop.org Cc: Mario Limonciello Subject: [PATCH] drm/amd: Adjust output for discovery error handling Date: Fri, 13 Jun 2025 16:41:01 -0500 Message-ID: <20250613214101.4117000-1-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" From: Mario Limonciello commit 017fbb6690c22 ("drm/amdgpu/discovery: check ip_discovery fw file available") added support for reading an amdgpu IP discovery bin file for some specific products. If it's not found then it will fallback to hardcoded values. However if it's not found there is also a lot of noise about missing files and errors. Adjust the error handling to decrease most messages to DEBUG and to show at most one message to a user about the missing file at INFO level. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4312 Fixes: 017fbb6690c22 ("drm/amdgpu/discovery: check ip_discovery fw file available") Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index a0e9bf9b27108..8e4526a8c2600 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -321,10 +321,9 @@ static int amdgpu_discovery_read_binary_from_file(struct amdgpu_device *adev, const struct firmware *fw; int r; - r = request_firmware(&fw, fw_name, adev->dev); + r = firmware_request_nowarn(&fw, fw_name, adev->dev); if (r) { - dev_err(adev->dev, "can't load firmware \"%s\"\n", - fw_name); + drm_info(&adev->ddev, "Optional firmware \"%s\" was not found\n", fw_name); return r; } @@ -459,16 +458,12 @@ static int amdgpu_discovery_init(struct amdgpu_device *adev) /* Read from file if it is the preferred option */ fw_name = amdgpu_discovery_get_fw_name(adev); if (fw_name != NULL) { - dev_info(adev->dev, "use ip discovery information from file"); + drm_dbg(&adev->ddev, "use ip discovery information from file"); r = amdgpu_discovery_read_binary_from_file(adev, adev->mman.discovery_bin, fw_name); - - if (r) { - dev_err(adev->dev, "failed to read ip discovery binary from file\n"); - r = -EINVAL; + if (r) goto out; - } - } else { + drm_dbg(&adev->ddev, "use ip discovery information from memory"); r = amdgpu_discovery_read_binary_from_mem( adev, adev->mman.discovery_bin); if (r) @@ -1339,7 +1334,7 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev) r = amdgpu_discovery_init(adev); if (r) { - DRM_ERROR("amdgpu_discovery_init failed\n"); + drm_warn(&adev->ddev, "%s failed: %d\n", __func__, r); return r; } -- 2.43.0