aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/chsc.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2006-12-08 09:54:26 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-12-08 09:54:26 -0500
commit2ec2298412e1ab4674b3780005058d4f0b8bd858 (patch)
tree7d48542e666636de17ac18e50ed33b4639be43fb /drivers/s390/cio/chsc.c
parent7674da77cb2d27ae6559c55151da171ceb02beb4 (diff)
[S390] subchannel lock conversion.
Convert the subchannel lock to a pointer to a lock. Needed for the dynamic subchannel mapping patch. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/chsc.c')
-rw-r--r--drivers/s390/cio/chsc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index dbfb77b03928..cbab8d2ce5cf 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -183,7 +183,7 @@ css_get_ssd_info(struct subchannel *sch)
183 page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 183 page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
184 if (!page) 184 if (!page)
185 return -ENOMEM; 185 return -ENOMEM;
186 spin_lock_irq(&sch->lock); 186 spin_lock_irq(sch->lock);
187 ret = chsc_get_sch_desc_irq(sch, page); 187 ret = chsc_get_sch_desc_irq(sch, page);
188 if (ret) { 188 if (ret) {
189 static int cio_chsc_err_msg; 189 static int cio_chsc_err_msg;
@@ -197,7 +197,7 @@ css_get_ssd_info(struct subchannel *sch)
197 cio_chsc_err_msg = 1; 197 cio_chsc_err_msg = 1;
198 } 198 }
199 } 199 }
200 spin_unlock_irq(&sch->lock); 200 spin_unlock_irq(sch->lock);
201 free_page((unsigned long)page); 201 free_page((unsigned long)page);
202 if (!ret) { 202 if (!ret) {
203 int j, chpid, mask; 203 int j, chpid, mask;
@@ -233,7 +233,7 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
233 if (j >= 8) 233 if (j >= 8)
234 return 0; 234 return 0;
235 235
236 spin_lock_irq(&sch->lock); 236 spin_lock_irq(sch->lock);
237 237
238 stsch(sch->schid, &schib); 238 stsch(sch->schid, &schib);
239 if (!schib.pmcw.dnv) 239 if (!schib.pmcw.dnv)
@@ -265,10 +265,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
265 else if (sch->lpm == mask) 265 else if (sch->lpm == mask)
266 goto out_unreg; 266 goto out_unreg;
267out_unlock: 267out_unlock:
268 spin_unlock_irq(&sch->lock); 268 spin_unlock_irq(sch->lock);
269 return 0; 269 return 0;
270out_unreg: 270out_unreg:
271 spin_unlock_irq(&sch->lock); 271 spin_unlock_irq(sch->lock);
272 sch->lpm = 0; 272 sch->lpm = 0;
273 if (css_enqueue_subchannel_slow(sch->schid)) { 273 if (css_enqueue_subchannel_slow(sch->schid)) {
274 css_clear_subchannel_slow_list(); 274 css_clear_subchannel_slow_list();
@@ -378,12 +378,12 @@ __s390_process_res_acc(struct subchannel_id schid, void *data)
378 /* Check if a subchannel is newly available. */ 378 /* Check if a subchannel is newly available. */
379 return s390_process_res_acc_new_sch(schid); 379 return s390_process_res_acc_new_sch(schid);
380 380
381 spin_lock_irq(&sch->lock); 381 spin_lock_irq(sch->lock);
382 382
383 chp_mask = s390_process_res_acc_sch(res_data, sch); 383 chp_mask = s390_process_res_acc_sch(res_data, sch);
384 384
385 if (chp_mask == 0) { 385 if (chp_mask == 0) {
386 spin_unlock_irq(&sch->lock); 386 spin_unlock_irq(sch->lock);
387 put_device(&sch->dev); 387 put_device(&sch->dev);
388 return 0; 388 return 0;
389 } 389 }
@@ -397,7 +397,7 @@ __s390_process_res_acc(struct subchannel_id schid, void *data)
397 else if (sch->driver && sch->driver->verify) 397 else if (sch->driver && sch->driver->verify)
398 sch->driver->verify(&sch->dev); 398 sch->driver->verify(&sch->dev);
399 399
400 spin_unlock_irq(&sch->lock); 400 spin_unlock_irq(sch->lock);
401 put_device(&sch->dev); 401 put_device(&sch->dev);
402 return 0; 402 return 0;
403} 403}
@@ -635,21 +635,21 @@ __chp_add(struct subchannel_id schid, void *data)
635 if (!sch) 635 if (!sch)
636 /* Check if the subchannel is now available. */ 636 /* Check if the subchannel is now available. */
637 return __chp_add_new_sch(schid); 637 return __chp_add_new_sch(schid);
638 spin_lock_irq(&sch->lock); 638 spin_lock_irq(sch->lock);
639 for (i=0; i<8; i++) { 639 for (i=0; i<8; i++) {
640 mask = 0x80 >> i; 640 mask = 0x80 >> i;
641 if ((sch->schib.pmcw.pim & mask) && 641 if ((sch->schib.pmcw.pim & mask) &&
642 (sch->schib.pmcw.chpid[i] == chp->id)) { 642 (sch->schib.pmcw.chpid[i] == chp->id)) {
643 if (stsch(sch->schid, &sch->schib) != 0) { 643 if (stsch(sch->schid, &sch->schib) != 0) {
644 /* Endgame. */ 644 /* Endgame. */
645 spin_unlock_irq(&sch->lock); 645 spin_unlock_irq(sch->lock);
646 return -ENXIO; 646 return -ENXIO;
647 } 647 }
648 break; 648 break;
649 } 649 }
650 } 650 }
651 if (i==8) { 651 if (i==8) {
652 spin_unlock_irq(&sch->lock); 652 spin_unlock_irq(sch->lock);
653 return 0; 653 return 0;
654 } 654 }
655 sch->lpm = ((sch->schib.pmcw.pim & 655 sch->lpm = ((sch->schib.pmcw.pim &
@@ -660,7 +660,7 @@ __chp_add(struct subchannel_id schid, void *data)
660 if (sch->driver && sch->driver->verify) 660 if (sch->driver && sch->driver->verify)
661 sch->driver->verify(&sch->dev); 661 sch->driver->verify(&sch->dev);
662 662
663 spin_unlock_irq(&sch->lock); 663 spin_unlock_irq(sch->lock);
664 put_device(&sch->dev); 664 put_device(&sch->dev);
665 return 0; 665 return 0;
666} 666}
@@ -750,7 +750,7 @@ __s390_subchannel_vary_chpid(struct subchannel *sch, __u8 chpid, int on)
750 if (!sch->ssd_info.valid) 750 if (!sch->ssd_info.valid)
751 return; 751 return;
752 752
753 spin_lock_irqsave(&sch->lock, flags); 753 spin_lock_irqsave(sch->lock, flags);
754 old_lpm = sch->lpm; 754 old_lpm = sch->lpm;
755 for (chp = 0; chp < 8; chp++) { 755 for (chp = 0; chp < 8; chp++) {
756 if (sch->ssd_info.chpid[chp] != chpid) 756 if (sch->ssd_info.chpid[chp] != chpid)
@@ -785,7 +785,7 @@ __s390_subchannel_vary_chpid(struct subchannel *sch, __u8 chpid, int on)
785 sch->driver->verify(&sch->dev); 785 sch->driver->verify(&sch->dev);
786 break; 786 break;
787 } 787 }
788 spin_unlock_irqrestore(&sch->lock, flags); 788 spin_unlock_irqrestore(sch->lock, flags);
789} 789}
790 790
791static int 791static int