summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/ati_pcigart.c
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2008-09-09 02:05:03 +0000
committerrnoland <rnoland@FreeBSD.org>2008-09-09 02:05:03 +0000
commit016be156e0964094bf2d383d94aef409a35dc78c (patch)
treeb049bd3bd13dc9dbf8c993171dae2fd568b69bed /sys/dev/drm/ati_pcigart.c
parent1af31f868a04970e4e460e2e08c563289e42b042 (diff)
downloadFreeBSD-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/ati_pcigart.c')
-rw-r--r--sys/dev/drm/ati_pcigart.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/drm/ati_pcigart.c b/sys/dev/drm/ati_pcigart.c
index dac400d..597479c 100644
--- a/sys/dev/drm/ati_pcigart.c
+++ b/sys/dev/drm/ati_pcigart.c
@@ -45,12 +45,17 @@ __FBSDID("$FreeBSD$");
static int drm_ati_alloc_pcigart_table(struct drm_device *dev,
struct drm_ati_pcigart_info *gart_info)
{
- dev->sg->dmah = drm_pci_alloc(dev, gart_info->table_size,
- PAGE_SIZE,
- gart_info->table_mask);
- if (dev->sg->dmah == NULL)
+ drm_dma_handle_t *dmah;
+
+ DRM_UNLOCK();
+ dmah = drm_pci_alloc(dev, gart_info->table_size, PAGE_SIZE,
+ gart_info->table_mask);
+ DRM_LOCK();
+ if (dmah == NULL)
return ENOMEM;
+ dev->sg->dmah = dmah;
+
return 0;
}
OpenPOWER on IntegriCloud