diff options
author | rnoland <rnoland@FreeBSD.org> | 2008-09-09 02:05:03 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2008-09-09 02:05:03 +0000 |
commit | 016be156e0964094bf2d383d94aef409a35dc78c (patch) | |
tree | b049bd3bd13dc9dbf8c993171dae2fd568b69bed /sys/dev/drm/mach64_dma.c | |
parent | 1af31f868a04970e4e460e2e08c563289e42b042 (diff) | |
download | FreeBSD-src-016be156e0964094bf2d383d94aef409a35dc78c.zip FreeBSD-src-016be156e0964094bf2d383d94aef409a35dc78c.tar.gz |
We should never call drm_pci_alloc() while holding locks, due the the
calls to bus_dma. There were multiple paths that held different locks or
no locks at all. This patch ensures that all of the calling paths drop
their lock(s) before calling drm_pci_alloc().
Reviewed by: kib
Diffstat (limited to 'sys/dev/drm/mach64_dma.c')
-rw-r--r-- | sys/dev/drm/mach64_dma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/drm/mach64_dma.c b/sys/dev/drm/mach64_dma.c index 1cb7779..6068c85 100644 --- a/sys/dev/drm/mach64_dma.c +++ b/sys/dev/drm/mach64_dma.c @@ -837,8 +837,14 @@ static int mach64_bm_dma_test(struct drm_device * dev) /* FIXME: get a dma buffer from the freelist here */ DRM_DEBUG("Allocating data memory ...\n"); +#ifdef __FreeBSD__ + DRM_UNLOCK(); +#endif cpu_addr_dmah = drm_pci_alloc(dev, 0x1000, 0x1000, 0xfffffffful); +#ifdef __FreeBSD__ + DRM_LOCK(); +#endif if (!cpu_addr_dmah) { DRM_INFO("data-memory allocation failed!\n"); return -ENOMEM; |