firmware_class: Refer to Debian wiki page when logging missing firmware
authorBen Hutchings <ben@decadent.org.uk>
Mon, 12 Mar 2018 01:14:03 +0000 (01:14 +0000)
committerSalvatore Bonaccorso <carnil@debian.org>
Tue, 13 Dec 2022 20:46:50 +0000 (20:46 +0000)
Bug-Debian: https://bugs.debian.org/888405
Forwarded: not-needed

If firmware loading fails due to a missing file, log a second error
message referring to our wiki page about firmware.  This will explain
why some firmware is in non-free, or can't be packaged at all.  Only
do this once per boot.

Do something similar in the radeon and amdgpu drivers, where we have
an early check to avoid failing at a point where we cannot display
anything.

Gbp-Pq: Topic debian
Gbp-Pq: Name firmware_class-refer-to-debian-wiki-firmware-page.patch

drivers/base/firmware_loader/main.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/radeon/radeon_drv.c

index c56dfe12bbd1d957da3a0768e6a1a2c66388e5c3..18c8500eba4f86d1a693d1df09499c4983948096 100644 (file)
@@ -566,9 +566,12 @@ fw_get_filesystem_firmware(struct device *device, struct fw_priv *fw_priv,
        }
        __putname(path);
 
-       if (rc)
+       if (rc) {
                dev_err(device, "firmware: failed to load %s (%d)\n",
                        fw_priv->fw_name, rc);
+               if (rc == -ENOENT)
+                       pr_err_once("See https://wiki.debian.org/Firmware for information about missing firmware\n");
+       }
 
        return rc;
 }
index 0ff403f0dd840f7367f8059b950419448d99189a..2c6e9ed27cf6a85e102fe2922bf57310d8054c0f 100644 (file)
@@ -1193,6 +1193,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 
        if (!amdgpu_firmware_installed()) {
                DRM_ERROR("amdgpu requires firmware installed\n");
+               pr_err_once("See https://wiki.debian.org/Firmware for information about missing firmware\n");
                return -ENODEV;
        }
 
index 8c16f84c2fcd5bb8c4a367da10f09f131e5d66ea..f0ed1e4cf851073292fb2c9e8bdeeb58b92d4db8 100644 (file)
@@ -381,6 +381,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
        if ((ent->driver_data & RADEON_FAMILY_MASK) >= CHIP_R600 &&
            !radeon_firmware_installed()) {
                DRM_ERROR("radeon kernel modesetting for R600 or later requires firmware installed\n");
+               pr_err_once("See https://wiki.debian.org/Firmware for information about missing firmware\n");
                return -ENODEV;
        }