Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de2b8b8b authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/bios: attempt to fetch entire acpi rom image in one shot



v2: fdo#55948 - the _ROM method silently truncates size to 4KiB, perform
    a checksum test and fall back to slow _ROM access on failure.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 28164fda
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -210,13 +210,21 @@ nouveau_bios_shadow_acpi(struct nouveau_bios *bios)
		return;

	bios->data = kmalloc(bios->size, GFP_KERNEL);
	for (i = 0; bios->data && i < bios->size; i += cnt) {
	if (bios->data) {
		/* disobey the acpi spec - much faster on at least w530 ... */
		ret = nouveau_acpi_get_bios_chunk(bios->data, 0, bios->size);
		if (ret != bios->size ||
		    nvbios_checksum(bios->data, bios->size)) {
			/* ... that didn't work, ok, i'll be good now */
			for (i = 0; i < bios->size; i += cnt) {
				cnt = min((bios->size - i), (u32)4096);
				ret = nouveau_acpi_get_bios_chunk(bios->data, i, cnt);
				if (ret != cnt)
					break;
			}
		}
	}
}

static void
nouveau_bios_shadow_pci(struct nouveau_bios *bios)