summaryrefslogtreecommitdiff
path: root/bsd-core/ati_pcigart.c
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2008-09-06 18:37:06 -0400
committerRobert Noland <rnoland@2hip.net>2008-09-06 18:37:06 -0400
commit6f2479c67432f764bfc4e248689f1737c1935237 (patch)
treed78b9dc1913cda30088176b534d8295334e25b25 /bsd-core/ati_pcigart.c
parent31709aa2be54877c45ca382bf370b41dbaf5c2ec (diff)
[FreeBSD] Ensure that drm_pci_alloc is never called while locks are held.
Diffstat (limited to 'bsd-core/ati_pcigart.c')
-rw-r--r--bsd-core/ati_pcigart.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/bsd-core/ati_pcigart.c b/bsd-core/ati_pcigart.c
index f8d3f18d..c4453ed5 100644
--- a/bsd-core/ati_pcigart.c
+++ b/bsd-core/ati_pcigart.c
@@ -42,12 +42,17 @@
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;
}