NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/49964: DRM/KMS panic with Radeon hardware



The relevant part of the error is that the radeon driver was unable to
read the video bios.  I asked asau@ privately to try to dump it from
[0xc0000, 0xe0000), and it looked like a plausible video bios to me --
so the next step is to try to find why every way radeon_get_bios tries
to get it fails.

First: can you send the output of `pcictl pci0 dump -b <bus> -d <dev>
-f <func>', where <bus>/<dev>/<func> are whatever locators the radeon
device is at?

Second: can you apply the attached patch to instrument the attempts to
read the video bios with debug prints, and try again?
Index: sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c
===================================================================
RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c,v
retrieving revision 1.4
diff -p -u -r1.4 radeon_bios.c
--- sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c	24 Jun 2015 18:23:23 -0000	1.4
+++ sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c	13 Oct 2015 00:20:09 -0000
@@ -56,9 +56,13 @@ static bool igp_read_bios_from_vram(stru
 	resource_size_t size = 256 * 1024; /* ??? */
 #endif
 
+	DRM_ERROR("\n");
+
 	if (!(rdev->flags & RADEON_IS_IGP))
-		if (!radeon_card_posted(rdev))
+		if (!radeon_card_posted(rdev)) {
+			DRM_ERROR("card not posted\n");
 			return false;
+		}
 
 	rdev->bios = NULL;
 #ifdef __NetBSD__
@@ -66,13 +70,16 @@ static bool igp_read_bios_from_vram(stru
 		/* XXX Dunno what type to expect here; fill me in...  */
 		pci_mapreg_type(rdev->pdev->pd_pa.pa_pc,
 		    rdev->pdev->pd_pa.pa_tag, PCI_BAR(0)),
-		0, &bst, &bsh, NULL, &size))
+		0, &bst, &bsh, NULL, &size)) {
+		DRM_ERROR("failed to map PCI BAR 0\n");
 		return false;
+	}
 	if ((size == 0) ||
 	    (size < 256 * 1024) ||
 	    (bus_space_read_1(bst, bsh, 0) != 0x55) ||
 	    (bus_space_read_1(bst, bsh, 1) != 0xaa) ||
 	    ((rdev->bios = kmalloc(size, GFP_KERNEL)) == NULL)) {
+		DRM_ERROR("bad-looking vbios or allocation failed\n");
 		bus_space_unmap(bst, bsh, size);
 		return false;
 	}
@@ -113,6 +120,7 @@ static bool radeon_read_bios(struct rade
 	/* XXX: some cards may return 0 for rom size? ddx has a workaround */
 	bios = pci_map_rom(rdev->pdev, &size);
 	if (!bios) {
+		DRM_ERROR("pci_map_rom failed\n");
 		return false;
 	}
 
@@ -130,11 +138,13 @@ static bool radeon_read_bios(struct rade
 	if (size == 0 ||
 	    bus_space_read_1(bst, bsh, 0) != 0x55 ||
 	    bus_space_read_1(bst, bsh, 1) != 0xaa) {
+		DRM_ERROR("bad-looking vbios\n");
 		pci_unmap_rom(rdev->pdev, bios);
 		return false;
 	}
 	rdev->bios = kmalloc(size, GFP_KERNEL);
 	if (rdev->bios == NULL) {
+		DRM_ERROR("allocation failed\n");
 		pci_unmap_rom(rdev->pdev, bios);
 		return false;
 	}


Home | Main Index | Thread Index | Old Index