hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
....@@ -25,10 +25,11 @@
2525 * Alex Deucher
2626 * Jerome Glisse
2727 */
28
-#include <drm/drmP.h>
28
+
2929 #include "amdgpu.h"
3030 #include "atom.h"
3131
32
+#include <linux/pci.h>
3233 #include <linux/slab.h>
3334 #include <linux/acpi.h>
3435 /*
....@@ -312,6 +313,7 @@
312313
313314 if (!found)
314315 return false;
316
+ pci_dev_put(pdev);
315317
316318 adev->bios = kmalloc(size, GFP_KERNEL);
317319 if (!adev->bios) {
....@@ -416,26 +418,40 @@
416418
417419 bool amdgpu_get_bios(struct amdgpu_device *adev)
418420 {
419
- if (amdgpu_atrm_get_bios(adev))
421
+ if (amdgpu_atrm_get_bios(adev)) {
422
+ dev_info(adev->dev, "Fetched VBIOS from ATRM\n");
420423 goto success;
424
+ }
421425
422
- if (amdgpu_acpi_vfct_bios(adev))
426
+ if (amdgpu_acpi_vfct_bios(adev)) {
427
+ dev_info(adev->dev, "Fetched VBIOS from VFCT\n");
423428 goto success;
429
+ }
424430
425
- if (igp_read_bios_from_vram(adev))
431
+ if (igp_read_bios_from_vram(adev)) {
432
+ dev_info(adev->dev, "Fetched VBIOS from VRAM BAR\n");
426433 goto success;
434
+ }
427435
428
- if (amdgpu_read_bios(adev))
436
+ if (amdgpu_read_bios(adev)) {
437
+ dev_info(adev->dev, "Fetched VBIOS from ROM BAR\n");
429438 goto success;
439
+ }
430440
431
- if (amdgpu_read_bios_from_rom(adev))
441
+ if (amdgpu_read_bios_from_rom(adev)) {
442
+ dev_info(adev->dev, "Fetched VBIOS from ROM\n");
432443 goto success;
444
+ }
433445
434
- if (amdgpu_read_disabled_bios(adev))
446
+ if (amdgpu_read_disabled_bios(adev)) {
447
+ dev_info(adev->dev, "Fetched VBIOS from disabled ROM BAR\n");
435448 goto success;
449
+ }
436450
437
- if (amdgpu_read_platform_bios(adev))
451
+ if (amdgpu_read_platform_bios(adev)) {
452
+ dev_info(adev->dev, "Fetched VBIOS from platform\n");
438453 goto success;
454
+ }
439455
440456 DRM_ERROR("Unable to locate a BIOS ROM\n");
441457 return false;