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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 19 Apr 2018 10:13:03 +0000 (11:13 +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 67d98ffc3af44c4ec1383bd775b0eb7deff59a4a..500e87df817690b9c789177b90c4d12321c2226c 100644 (file)
@@ -430,9 +430,12 @@ fw_get_filesystem_firmware(struct device *device, struct firmware_buf *buf)
        }
        __putname(path);
 
-       if (rc)
+       if (rc) {
                dev_err(device, "firmware: failed to load %s (%d)\n",
                        buf->fw_id, rc);
+               if (rc == -ENOENT)
+                       pr_err_once("See https://wiki.debian.org/Firmware for information about missing firmware\n");
+       }
 
        return rc;
 }
index 99ea811cf481d1de9365c4db66384d2a387761ec..baedc2863b3f9ad0094b759e69a27674118adc7b 100644 (file)
@@ -605,6 +605,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;
        }