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>
Wed, 24 Jun 2020 18:56:57 +0000 (19:56 +0100)
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 dbd1324b216ec018b603a0c76e63714add0e08da..b7ac68809dfca8022d7281091d2b4a9adc826c15 100644 (file)
@@ -525,9 +525,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 bcc4ec30d9cc3ea1de902ff27fea2e5ef7bd9640..7ab6afc077ceade6bf79379d6bf7ea5ecb4912f3 100644 (file)
@@ -1098,6 +1098,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 3c65427f9b56810834d6a3782b0739fa5e11a769..2b4f6731b393730741c4fa08fd3462217a6c8d40 100644 (file)
@@ -386,6 +386,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;
        }