提交 c48d865c 编写于 作者: C Cornelia Huck 提交者: Linus Torvalds

[PATCH] s390: fix locking in __chp_add() and s390_subchannel_remove_chpid()

Fix locking in __chp_add() and s390_subchannel_remove_chpid(): Need to
disable/enable because they are always called from a thread (and not
directly from a machine check...)
Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 c0cdf193
...@@ -232,7 +232,7 @@ s390_subchannel_remove_chpid(struct device *dev, void *data) ...@@ -232,7 +232,7 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
return 0; return 0;
mask = 0x80 >> j; mask = 0x80 >> j;
spin_lock(&sch->lock); spin_lock_irq(&sch->lock);
stsch(sch->schid, &schib); stsch(sch->schid, &schib);
if (!schib.pmcw.dnv) if (!schib.pmcw.dnv)
...@@ -281,10 +281,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data) ...@@ -281,10 +281,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
if (sch->driver && sch->driver->verify) if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(&sch->dev);
out_unlock: out_unlock:
spin_unlock(&sch->lock); spin_unlock_irq(&sch->lock);
return 0; return 0;
out_unreg: out_unreg:
spin_unlock(&sch->lock); spin_unlock_irq(&sch->lock);
sch->lpm = 0; sch->lpm = 0;
if (css_enqueue_subchannel_slow(sch->schid)) { if (css_enqueue_subchannel_slow(sch->schid)) {
css_clear_subchannel_slow_list(); css_clear_subchannel_slow_list();
...@@ -652,7 +652,7 @@ __chp_add(struct subchannel_id schid, void *data) ...@@ -652,7 +652,7 @@ __chp_add(struct subchannel_id schid, void *data)
if (!sch) if (!sch)
/* Check if the subchannel is now available. */ /* Check if the subchannel is now available. */
return __chp_add_new_sch(schid); return __chp_add_new_sch(schid);
spin_lock(&sch->lock); spin_lock_irq(&sch->lock);
for (i=0; i<8; i++) for (i=0; i<8; i++)
if (sch->schib.pmcw.chpid[i] == chp->id) { if (sch->schib.pmcw.chpid[i] == chp->id) {
if (stsch(sch->schid, &sch->schib) != 0) { if (stsch(sch->schid, &sch->schib) != 0) {
...@@ -674,7 +674,7 @@ __chp_add(struct subchannel_id schid, void *data) ...@@ -674,7 +674,7 @@ __chp_add(struct subchannel_id schid, void *data)
if (sch->driver && sch->driver->verify) if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev); sch->driver->verify(&sch->dev);
spin_unlock(&sch->lock); spin_unlock_irq(&sch->lock);
put_device(&sch->dev); put_device(&sch->dev);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册