<div dir="ltr"><div><div>Hello Roeck,<br><br></div>This should be replaced everywhere in driver.what do you say ?<br><br></div>Regards<br>Sanjeev Sharma<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 11, 2014 at 10:01 AM, Guenter Roeck <span dir="ltr"><<a href="mailto:linux@roeck-us.net" target="_blank">linux@roeck-us.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">spin_is_locked() always returns false in uniprocessor configurations<br>
and can therefore not be used with BUG_ON. Replace it with<br>
assert_spin_locked(), which exists for that very purpose.<br>
<br>
Signed-off-by: Guenter Roeck <<a href="mailto:linux@roeck-us.net">linux@roeck-us.net</a>><br>
---<br>
 drivers/gpu/drm/msm/mdp/mdp_kms.c          | 2 +-<br>
 drivers/gpu/drm/nouveau/core/core/event.c  | 4 ++--<br>
 drivers/gpu/drm/nouveau/core/core/notify.c | 2 +-<br>
 drivers/gpu/drm/omapdrm/omap_irq.c         | 2 +-<br>
 4 files changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/msm/mdp/mdp_kms.c b/drivers/gpu/drm/msm/mdp/mdp_kms.c<br>
index 03455b6..92a1531 100644<br>
--- a/drivers/gpu/drm/msm/mdp/mdp_kms.c<br>
+++ b/drivers/gpu/drm/msm/mdp/mdp_kms.c<br>
@@ -34,7 +34,7 @@ static void update_irq(struct mdp_kms *mdp_kms)<br>
        struct mdp_irq *irq;<br>
        uint32_t irqmask = mdp_kms->vblank_mask;<br>
<br>
-       BUG_ON(!spin_is_locked(&list_lock));<br>
+       assert_spin_locked(&list_lock);<br>
<br>
        list_for_each_entry(irq, &mdp_kms->irq_list, node)<br>
                irqmask |= irq->irqmask;<br>
diff --git a/drivers/gpu/drm/nouveau/core/core/event.c b/drivers/gpu/drm/nouveau/core/core/event.c<br>
index 0540a48..9327117 100644<br>
--- a/drivers/gpu/drm/nouveau/core/core/event.c<br>
+++ b/drivers/gpu/drm/nouveau/core/core/event.c<br>
@@ -26,7 +26,7 @@<br>
 void<br>
 nvkm_event_put(struct nvkm_event *event, u32 types, int index)<br>
 {<br>
-       BUG_ON(!spin_is_locked(&event->refs_lock));<br>
+       assert_spin_locked(&event->refs_lock);<br>
        while (types) {<br>
                int type = __ffs(types); types &= ~(1 << type);<br>
                if (--event->refs[index * event->types_nr + type] == 0) {<br>
@@ -39,7 +39,7 @@ nvkm_event_put(struct nvkm_event *event, u32 types, int index)<br>
 void<br>
 nvkm_event_get(struct nvkm_event *event, u32 types, int index)<br>
 {<br>
-       BUG_ON(!spin_is_locked(&event->refs_lock));<br>
+       assert_spin_locked(&event->refs_lock);<br>
        while (types) {<br>
                int type = __ffs(types); types &= ~(1 << type);<br>
                if (++event->refs[index * event->types_nr + type] == 1) {<br>
diff --git a/drivers/gpu/drm/nouveau/core/core/notify.c b/drivers/gpu/drm/nouveau/core/core/notify.c<br>
index 76adb81..f70dbc4 100644<br>
--- a/drivers/gpu/drm/nouveau/core/core/notify.c<br>
+++ b/drivers/gpu/drm/nouveau/core/core/notify.c<br>
@@ -98,7 +98,7 @@ nvkm_notify_send(struct nvkm_notify *notify, void *data, u32 size)<br>
        struct nvkm_event *event = notify->event;<br>
        unsigned long flags;<br>
<br>
-       BUG_ON(!spin_is_locked(&event->list_lock));<br>
+       assert_spin_locked(&event->list_lock);<br>
        BUG_ON(size != notify->size);<br>
<br>
        spin_lock_irqsave(&event->refs_lock, flags);<br>
diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c<br>
index f035d2b..3eb097e 100644<br>
--- a/drivers/gpu/drm/omapdrm/omap_irq.c<br>
+++ b/drivers/gpu/drm/omapdrm/omap_irq.c<br>
@@ -34,7 +34,7 @@ static void omap_irq_update(struct drm_device *dev)<br>
        struct omap_drm_irq *irq;<br>
        uint32_t irqmask = priv->vblank_mask;<br>
<br>
-       BUG_ON(!spin_is_locked(&list_lock));<br>
+       assert_spin_locked(&list_lock);<br>
<br>
        list_for_each_entry(irq, &priv->irq_list, node)<br>
                irqmask |= irq->irqmask;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
--<br>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in<br>
the body of a message to <a href="mailto:majordomo@vger.kernel.org">majordomo@vger.kernel.org</a><br>
More majordomo info at  <a href="http://vger.kernel.org/majordomo-info.html" target="_blank">http://vger.kernel.org/majordomo-info.html</a><br>
Please read the FAQ at  <a href="http://www.tux.org/lkml/" target="_blank">http://www.tux.org/lkml/</a><br>
</font></span></blockquote></div><br></div>