Jesse Keating 2f82dd
From 967c89306de560a6da9539d24a0d63cb036d58ed Mon Sep 17 00:00:00 2001
Jesse Keating 2f82dd
From: Ben Skeggs <bskeggs@redhat.com>
Jesse Keating 2f82dd
Date: Tue, 16 Feb 2010 11:14:14 +1000
Jesse Keating 2f82dd
Subject: [PATCH] drm/nouveau: use mutex for vbios lock
Jesse Keating 2f82dd
Jesse Keating 2f82dd
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Jesse Keating 2f82dd
---
Jesse Keating 2f82dd
 drivers/gpu/drm/nouveau/nouveau_bios.c |    7 +++----
Jesse Keating 2f82dd
 drivers/gpu/drm/nouveau/nouveau_bios.h |    2 +-
Jesse Keating 2f82dd
 2 files changed, 4 insertions(+), 5 deletions(-)
Jesse Keating 2f82dd
Jesse Keating 2f82dd
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
Jesse Keating 2f82dd
index 2cd0fad..0e9cd1d 100644
Jesse Keating 2f82dd
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
Jesse Keating 2f82dd
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
Jesse Keating 2f82dd
@@ -5861,13 +5861,12 @@ nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table,
Jesse Keating 2f82dd
 	struct drm_nouveau_private *dev_priv = dev->dev_private;
Jesse Keating 2f82dd
 	struct nvbios *bios = &dev_priv->VBIOS;
Jesse Keating 2f82dd
 	struct init_exec iexec = { true, false };
Jesse Keating 2f82dd
-	unsigned long flags;
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
-	spin_lock_irqsave(&bios->lock, flags);
Jesse Keating 2f82dd
+	mutex_lock(&bios->lock);
Jesse Keating 2f82dd
 	bios->display.output = dcbent;
Jesse Keating 2f82dd
 	parse_init_table(bios, table, &iexec);
Jesse Keating 2f82dd
 	bios->display.output = NULL;
Jesse Keating 2f82dd
-	spin_unlock_irqrestore(&bios->lock, flags);
Jesse Keating 2f82dd
+	mutex_unlock(&bios->lock);
Jesse Keating 2f82dd
 }
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
 static bool NVInitVBIOS(struct drm_device *dev)
Jesse Keating 2f82dd
@@ -5876,7 +5875,7 @@ static bool NVInitVBIOS(struct drm_device *dev)
Jesse Keating 2f82dd
 	struct nvbios *bios = &dev_priv->VBIOS;
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
 	memset(bios, 0, sizeof(struct nvbios));
Jesse Keating 2f82dd
-	spin_lock_init(&bios->lock);
Jesse Keating 2f82dd
+	mutex_init(&bios->lock);
Jesse Keating 2f82dd
 	bios->dev = dev;
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
 	if (!NVShadowVBIOS(dev, bios->data))
Jesse Keating 2f82dd
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h
Jesse Keating 2f82dd
index 68446fd..fd94bd6 100644
Jesse Keating 2f82dd
--- a/drivers/gpu/drm/nouveau/nouveau_bios.h
Jesse Keating 2f82dd
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.h
Jesse Keating 2f82dd
@@ -205,7 +205,7 @@ struct nvbios {
Jesse Keating 2f82dd
 	struct drm_device *dev;
Jesse Keating 2f82dd
 	struct nouveau_bios_info pub;
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
-	spinlock_t lock;
Jesse Keating 2f82dd
+	struct mutex lock;
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
 	uint8_t data[NV_PROM_SIZE];
Jesse Keating 2f82dd
 	unsigned int length;
Jesse Keating 2f82dd
-- 
Jesse Keating 2f82dd
1.6.6.1
Jesse Keating 2f82dd