aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-02-03 05:10:49 -0500
committerBen Skeggs <bskeggs@redhat.com>2011-02-24 15:44:56 -0500
commitc7ca4d1b6b529dac9de9ff3f951689f2e4365cc2 (patch)
treeffd03ef34616457984ae2fd11d56b8e93f55143e
parent8348f36d89d1c9630580932931aca51b6069097a (diff)
drm/nouveau: make vbios parser runnable from an atomic context
The nv50 display isr bh needs to be converted to a tasklet, which means we can't sleep anymore. The places we execute vbios init tables are rare, and not in any way performance critical, so this isn't a huge problem. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c16
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 6bdab891c64e..7b7a18493b46 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -282,7 +282,7 @@ static void still_alive(void)
282{ 282{
283#if 0 283#if 0
284 sync(); 284 sync();
285 msleep(2); 285 mdelay(2);
286#endif 286#endif
287} 287}
288 288
@@ -1904,7 +1904,7 @@ init_condition_time(struct nvbios *bios, uint16_t offset,
1904 BIOSLOG(bios, "0x%04X: " 1904 BIOSLOG(bios, "0x%04X: "
1905 "Condition not met, sleeping for 20ms\n", 1905 "Condition not met, sleeping for 20ms\n",
1906 offset); 1906 offset);
1907 msleep(20); 1907 mdelay(20);
1908 } 1908 }
1909 } 1909 }
1910 1910
@@ -1938,7 +1938,7 @@ init_ltime(struct nvbios *bios, uint16_t offset, struct init_exec *iexec)
1938 BIOSLOG(bios, "0x%04X: Sleeping for 0x%04X milliseconds\n", 1938 BIOSLOG(bios, "0x%04X: Sleeping for 0x%04X milliseconds\n",
1939 offset, time); 1939 offset, time);
1940 1940
1941 msleep(time); 1941 mdelay(time);
1942 1942
1943 return 3; 1943 return 3;
1944} 1944}
@@ -2962,7 +2962,7 @@ init_time(struct nvbios *bios, uint16_t offset, struct init_exec *iexec)
2962 if (time < 1000) 2962 if (time < 1000)
2963 udelay(time); 2963 udelay(time);
2964 else 2964 else
2965 msleep((time + 900) / 1000); 2965 mdelay((time + 900) / 1000);
2966 2966
2967 return 3; 2967 return 3;
2968} 2968}
@@ -3856,7 +3856,7 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_entr
3856 3856
3857 if (script == LVDS_PANEL_OFF) { 3857 if (script == LVDS_PANEL_OFF) {
3858 /* off-on delay in ms */ 3858 /* off-on delay in ms */
3859 msleep(ROM16(bios->data[bios->fp.xlated_entry + 7])); 3859 mdelay(ROM16(bios->data[bios->fp.xlated_entry + 7]));
3860 } 3860 }
3861#ifdef __powerpc__ 3861#ifdef __powerpc__
3862 /* Powerbook specific quirks */ 3862 /* Powerbook specific quirks */
@@ -6702,11 +6702,11 @@ nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table,
6702 struct nvbios *bios = &dev_priv->vbios; 6702 struct nvbios *bios = &dev_priv->vbios;
6703 struct init_exec iexec = { true, false }; 6703 struct init_exec iexec = { true, false };
6704 6704
6705 mutex_lock(&bios->lock); 6705 spin_lock_bh(&bios->lock);
6706 bios->display.output = dcbent; 6706 bios->display.output = dcbent;
6707 parse_init_table(bios, table, &iexec); 6707 parse_init_table(bios, table, &iexec);
6708 bios->display.output = NULL; 6708 bios->display.output = NULL;
6709 mutex_unlock(&bios->lock); 6709 spin_unlock_bh(&bios->lock);
6710} 6710}
6711 6711
6712static bool NVInitVBIOS(struct drm_device *dev) 6712static bool NVInitVBIOS(struct drm_device *dev)
@@ -6715,7 +6715,7 @@ static bool NVInitVBIOS(struct drm_device *dev)
6715 struct nvbios *bios = &dev_priv->vbios; 6715 struct nvbios *bios = &dev_priv->vbios;
6716 6716
6717 memset(bios, 0, sizeof(struct nvbios)); 6717 memset(bios, 0, sizeof(struct nvbios));
6718 mutex_init(&bios->lock); 6718 spin_lock_init(&bios->lock);
6719 bios->dev = dev; 6719 bios->dev = dev;
6720 6720
6721 if (!NVShadowVBIOS(dev, bios->data)) 6721 if (!NVShadowVBIOS(dev, bios->data))
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h
index 50a648e01c49..8a54fa7edf5c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.h
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.h
@@ -251,7 +251,7 @@ struct nvbios {
251 uint8_t digital_min_front_porch; 251 uint8_t digital_min_front_porch;
252 bool fp_no_ddc; 252 bool fp_no_ddc;
253 253
254 struct mutex lock; 254 spinlock_t lock;
255 255
256 uint8_t data[NV_PROM_SIZE]; 256 uint8_t data[NV_PROM_SIZE];
257 unsigned int length; 257 unsigned int length;