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>
Sat, 6 Feb 2021 08:23:52 +0000 (08:23 +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 99ab69642f8295236544ffb4aaf7ed8f37a8a35c..d0f7e356d5107ceb9623eea618e3f68af4eac02e 100644 (file)
@@ -565,9 +565,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 ed03b2712246491004d257649709d3a74872a9c2..502a1810baee00907382b76e10c71669782d6d84 100644 (file)
@@ -1188,6 +1188,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 8add4be708f256eb7d70e5276e7ccb7efcd8b381..5e9b59831cefdff3ec42479b901b991311297e8c 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;
        }