aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/css.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/css.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/css.c')
-rw-r--r--drivers/s390/cio/css.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 55895c83d499..65939e2eb415 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -91,9 +91,9 @@ css_free_subchannel(struct subchannel *sch)
91 /* Reset intparm to zeroes. */ 91 /* Reset intparm to zeroes. */
92 sch->schib.pmcw.intparm = 0; 92 sch->schib.pmcw.intparm = 0;
93 cio_modify(sch); 93 cio_modify(sch);
94 kfree(sch->lock);
94 kfree(sch); 95 kfree(sch);
95 } 96 }
96
97} 97}
98 98
99static void 99static void
@@ -102,8 +102,10 @@ css_subchannel_release(struct device *dev)
102 struct subchannel *sch; 102 struct subchannel *sch;
103 103
104 sch = to_subchannel(dev); 104 sch = to_subchannel(dev);
105 if (!cio_is_console(sch->schid)) 105 if (!cio_is_console(sch->schid)) {
106 kfree(sch->lock);
106 kfree(sch); 107 kfree(sch);
108 }
107} 109}
108 110
109extern int css_get_ssd_info(struct subchannel *sch); 111extern int css_get_ssd_info(struct subchannel *sch);
@@ -206,18 +208,18 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
206 unsigned long flags; 208 unsigned long flags;
207 enum { NONE, UNREGISTER, UNREGISTER_PROBE, REPROBE } action; 209 enum { NONE, UNREGISTER, UNREGISTER_PROBE, REPROBE } action;
208 210
209 spin_lock_irqsave(&sch->lock, flags); 211 spin_lock_irqsave(sch->lock, flags);
210 disc = device_is_disconnected(sch); 212 disc = device_is_disconnected(sch);
211 if (disc && slow) { 213 if (disc && slow) {
212 /* Disconnected devices are evaluated directly only.*/ 214 /* Disconnected devices are evaluated directly only.*/
213 spin_unlock_irqrestore(&sch->lock, flags); 215 spin_unlock_irqrestore(sch->lock, flags);
214 return 0; 216 return 0;
215 } 217 }
216 /* No interrupt after machine check - kill pending timers. */ 218 /* No interrupt after machine check - kill pending timers. */
217 device_kill_pending_timer(sch); 219 device_kill_pending_timer(sch);
218 if (!disc && !slow) { 220 if (!disc && !slow) {
219 /* Non-disconnected devices are evaluated on the slow path. */ 221 /* Non-disconnected devices are evaluated on the slow path. */
220 spin_unlock_irqrestore(&sch->lock, flags); 222 spin_unlock_irqrestore(sch->lock, flags);
221 return -EAGAIN; 223 return -EAGAIN;
222 } 224 }
223 event = css_get_subchannel_status(sch); 225 event = css_get_subchannel_status(sch);
@@ -242,9 +244,9 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
242 /* Ask driver what to do with device. */ 244 /* Ask driver what to do with device. */
243 action = UNREGISTER; 245 action = UNREGISTER;
244 if (sch->driver && sch->driver->notify) { 246 if (sch->driver && sch->driver->notify) {
245 spin_unlock_irqrestore(&sch->lock, flags); 247 spin_unlock_irqrestore(sch->lock, flags);
246 ret = sch->driver->notify(&sch->dev, event); 248 ret = sch->driver->notify(&sch->dev, event);
247 spin_lock_irqsave(&sch->lock, flags); 249 spin_lock_irqsave(sch->lock, flags);
248 if (ret) 250 if (ret)
249 action = NONE; 251 action = NONE;
250 } 252 }
@@ -269,9 +271,9 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
269 case UNREGISTER: 271 case UNREGISTER:
270 case UNREGISTER_PROBE: 272 case UNREGISTER_PROBE:
271 /* Unregister device (will use subchannel lock). */ 273 /* Unregister device (will use subchannel lock). */
272 spin_unlock_irqrestore(&sch->lock, flags); 274 spin_unlock_irqrestore(sch->lock, flags);
273 css_sch_device_unregister(sch); 275 css_sch_device_unregister(sch);
274 spin_lock_irqsave(&sch->lock, flags); 276 spin_lock_irqsave(sch->lock, flags);
275 277
276 /* Reset intparm to zeroes. */ 278 /* Reset intparm to zeroes. */
277 sch->schib.pmcw.intparm = 0; 279 sch->schib.pmcw.intparm = 0;
@@ -283,7 +285,7 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
283 default: 285 default:
284 break; 286 break;
285 } 287 }
286 spin_unlock_irqrestore(&sch->lock, flags); 288 spin_unlock_irqrestore(sch->lock, flags);
287 /* Probe if necessary. */ 289 /* Probe if necessary. */
288 if (action == UNREGISTER_PROBE) 290 if (action == UNREGISTER_PROBE)
289 ret = css_probe_device(sch->schid); 291 ret = css_probe_device(sch->schid);