Skip to content

Commit

Permalink
[PATCH] s390: fix locking in __chp_add() and s390_subchannel_remove_c…
Browse files Browse the repository at this point in the history
…hpid()

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: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Cornelia Huck authored and Linus Torvalds committed Feb 12, 2006
1 parent c0cdf19 commit c48d865
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/s390/cio/chsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
return 0;

mask = 0x80 >> j;
spin_lock(&sch->lock);
spin_lock_irq(&sch->lock);

stsch(sch->schid, &schib);
if (!schib.pmcw.dnv)
Expand Down Expand Up @@ -281,10 +281,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev);
out_unlock:
spin_unlock(&sch->lock);
spin_unlock_irq(&sch->lock);
return 0;
out_unreg:
spin_unlock(&sch->lock);
spin_unlock_irq(&sch->lock);
sch->lpm = 0;
if (css_enqueue_subchannel_slow(sch->schid)) {
css_clear_subchannel_slow_list();
Expand Down Expand Up @@ -652,7 +652,7 @@ __chp_add(struct subchannel_id schid, void *data)
if (!sch)
/* Check if the subchannel is now available. */
return __chp_add_new_sch(schid);
spin_lock(&sch->lock);
spin_lock_irq(&sch->lock);
for (i=0; i<8; i++)
if (sch->schib.pmcw.chpid[i] == chp->id) {
if (stsch(sch->schid, &sch->schib) != 0) {
Expand All @@ -674,7 +674,7 @@ __chp_add(struct subchannel_id schid, void *data)
if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev);

spin_unlock(&sch->lock);
spin_unlock_irq(&sch->lock);
put_device(&sch->dev);
return 0;
}
Expand Down

0 comments on commit c48d865

Please sign in to comment.