NetBSD-Bugs archive

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

re: port-i386/42966: kernel built from today's netbsd-5 crashes




unfortunately, none of the ideas changes are "right".  this is partly
fixed in -current already, but there are two places to fix.  thanks to
matthias drochner for helping me understand all the parts..

this patch should work for netbsd-5.  i'll work on getting the 2nd
part fixed up for -current as well, and submit a pullup.


.mrg.


Index: bsd-core/drm_pci.c
===================================================================
RCS file: /cvsroot/src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c,v
retrieving revision 1.4.10.1
diff -p -r1.4.10.1 drm_pci.c
*** bsd-core/drm_pci.c  20 Jun 2009 23:36:59 -0000      1.4.10.1
--- bsd-core/drm_pci.c  19 Mar 2010 01:59:10 -0000
*************** drm_pci_alloc(struct drm_device *dev, si
*** 110,118 ****
                return NULL;
        }
  #elif   defined(__NetBSD__)
        dmah->tag = dev->pa.pa_dmat;
  
!       if ((ret = bus_dmamem_alloc(dmah->tag, size, align, maxaddr,
            dmah->segs, 1, &nsegs, BUS_DMA_WAITOK)) != 0) {
                printf("drm: Unable to allocate %zu bytes of DMA, error %d\n",
                    size, ret);
--- 110,119 ----
                return NULL;
        }
  #elif   defined(__NetBSD__)
+       KASSERT(maxaddr >= 0xffffffffUL); /* no way to tell bus_dma_alloc */
        dmah->tag = dev->pa.pa_dmat;
  
!       if ((ret = bus_dmamem_alloc(dmah->tag, size, align, 0,
            dmah->segs, 1, &nsegs, BUS_DMA_WAITOK)) != 0) {
                printf("drm: Unable to allocate %zu bytes of DMA, error %d\n",
                    size, ret);
*************** drm_pci_alloc(struct drm_device *dev, si
*** 136,142 ****
                free(dmah, DRM_MEM_DMA);
                return NULL;
        }
!       if ((ret = bus_dmamap_create(dmah->tag, size, 1, size, maxaddr,
             BUS_DMA_NOWAIT, &dmah->map)) != 0) {
                printf("drm: Unable to create DMA map, error %d\n", ret);
                bus_dmamem_unmap(dmah->tag, dmah->vaddr, size);
--- 137,143 ----
                free(dmah, DRM_MEM_DMA);
                return NULL;
        }
!       if ((ret = bus_dmamap_create(dmah->tag, size, 1, size, 0,
             BUS_DMA_NOWAIT, &dmah->map)) != 0) {
                printf("drm: Unable to create DMA map, error %d\n", ret);
                bus_dmamem_unmap(dmah->tag, dmah->vaddr, size);


Home | Main Index | Thread Index | Old Index