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)
committerBastian Blank <waldi@debian.org>
Fri, 22 Jun 2018 09:50:22 +0000 (10:50 +0100)
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_class.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/radeon/radeon_drv.c

index 21732f1bfb32d155d2584d5e081284371c4a6d58..d36349abf8fee8a2289b46ace37c313266fe75b7 100644 (file)
@@ -455,9 +455,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 2a57257f4242525d91bea135cf04074a632b292f..bd4ce06c2b88844114e5fe2e860040f40e118c4a 100644 (file)
@@ -609,6 +609,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 b47474e2e76639a1c86ca54e1adc18496fe93243..f2777545d1e6dbff4c31b1f2c004382f623a38c5 100644 (file)
@@ -367,6 +367,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;
        }