cio.c (b3a686f47a3615fcfec0a01c4103c50bb9621369) cio.c (23d805b647db6c2063a13089497615efa9deacdd)
1/*
2 * drivers/s390/cio/cio.c
3 * S/390 common I/O routines -- low level i/o calls
4 *
5 * Copyright IBM Corp. 1999,2008
6 * Author(s): Ingo Adlung (adlung@de.ibm.com)
7 * Cornelia Huck (cornelia.huck@de.ibm.com)
8 * Arnd Bergmann (arndb@de.ibm.com)

--- 114 unchanged lines hidden (view full) ---

123 /* Not status pending or not operational. */
124 return 1;
125 sch = (struct subchannel *)(unsigned long)tpi_info->intparm;
126 if (!sch)
127 return 1;
128 local_bh_disable();
129 irq_enter ();
130 spin_lock(sch->lock);
1/*
2 * drivers/s390/cio/cio.c
3 * S/390 common I/O routines -- low level i/o calls
4 *
5 * Copyright IBM Corp. 1999,2008
6 * Author(s): Ingo Adlung (adlung@de.ibm.com)
7 * Cornelia Huck (cornelia.huck@de.ibm.com)
8 * Arnd Bergmann (arndb@de.ibm.com)

--- 114 unchanged lines hidden (view full) ---

123 /* Not status pending or not operational. */
124 return 1;
125 sch = (struct subchannel *)(unsigned long)tpi_info->intparm;
126 if (!sch)
127 return 1;
128 local_bh_disable();
129 irq_enter ();
130 spin_lock(sch->lock);
131 memcpy (&sch->schib.scsw, &irb->scsw, sizeof (struct scsw));
131 memcpy(&sch->schib.scsw, &irb->scsw, sizeof(union scsw));
132 if (sch->driver && sch->driver->irq)
133 sch->driver->irq(sch);
134 spin_unlock(sch->lock);
135 irq_exit ();
136 _local_bh_enable();
137 return 1;
138}
139

--- 57 unchanged lines hidden (view full) ---

197 sprintf(dbf_txt, "ccode:%d", ccode);
198 CIO_TRACE_EVENT(4, dbf_txt);
199
200 switch (ccode) {
201 case 0:
202 /*
203 * initialize device status information
204 */
132 if (sch->driver && sch->driver->irq)
133 sch->driver->irq(sch);
134 spin_unlock(sch->lock);
135 irq_exit ();
136 _local_bh_enable();
137 return 1;
138}
139

--- 57 unchanged lines hidden (view full) ---

197 sprintf(dbf_txt, "ccode:%d", ccode);
198 CIO_TRACE_EVENT(4, dbf_txt);
199
200 switch (ccode) {
201 case 0:
202 /*
203 * initialize device status information
204 */
205 sch->schib.scsw.actl |= SCSW_ACTL_START_PEND;
205 sch->schib.scsw.cmd.actl |= SCSW_ACTL_START_PEND;
206 return 0;
207 case 1: /* status pending */
208 case 2: /* busy */
209 return -EBUSY;
210 default: /* device/path not operational */
211 return cio_start_handle_notoper(sch, lpm);
212 }
213}

--- 18 unchanged lines hidden (view full) ---

232
233 ccode = rsch (sch->schid);
234
235 sprintf (dbf_txt, "ccode:%d", ccode);
236 CIO_TRACE_EVENT (4, dbf_txt);
237
238 switch (ccode) {
239 case 0:
206 return 0;
207 case 1: /* status pending */
208 case 2: /* busy */
209 return -EBUSY;
210 default: /* device/path not operational */
211 return cio_start_handle_notoper(sch, lpm);
212 }
213}

--- 18 unchanged lines hidden (view full) ---

232
233 ccode = rsch (sch->schid);
234
235 sprintf (dbf_txt, "ccode:%d", ccode);
236 CIO_TRACE_EVENT (4, dbf_txt);
237
238 switch (ccode) {
239 case 0:
240 sch->schib.scsw.actl |= SCSW_ACTL_RESUME_PEND;
240 sch->schib.scsw.cmd.actl |= SCSW_ACTL_RESUME_PEND;
241 return 0;
242 case 1:
243 return -EBUSY;
244 case 2:
245 return -EINVAL;
246 default:
247 /*
248 * useless to wait for request completion

--- 23 unchanged lines hidden (view full) ---

272 */
273 ccode = hsch (sch->schid);
274
275 sprintf (dbf_txt, "ccode:%d", ccode);
276 CIO_TRACE_EVENT (2, dbf_txt);
277
278 switch (ccode) {
279 case 0:
241 return 0;
242 case 1:
243 return -EBUSY;
244 case 2:
245 return -EINVAL;
246 default:
247 /*
248 * useless to wait for request completion

--- 23 unchanged lines hidden (view full) ---

272 */
273 ccode = hsch (sch->schid);
274
275 sprintf (dbf_txt, "ccode:%d", ccode);
276 CIO_TRACE_EVENT (2, dbf_txt);
277
278 switch (ccode) {
279 case 0:
280 sch->schib.scsw.actl |= SCSW_ACTL_HALT_PEND;
280 sch->schib.scsw.cmd.actl |= SCSW_ACTL_HALT_PEND;
281 return 0;
282 case 1: /* status pending */
283 case 2: /* busy */
284 return -EBUSY;
285 default: /* device not operational */
286 return -ENODEV;
287 }
288}

--- 18 unchanged lines hidden (view full) ---

307 */
308 ccode = csch (sch->schid);
309
310 sprintf (dbf_txt, "ccode:%d", ccode);
311 CIO_TRACE_EVENT (2, dbf_txt);
312
313 switch (ccode) {
314 case 0:
281 return 0;
282 case 1: /* status pending */
283 case 2: /* busy */
284 return -EBUSY;
285 default: /* device not operational */
286 return -ENODEV;
287 }
288}

--- 18 unchanged lines hidden (view full) ---

307 */
308 ccode = csch (sch->schid);
309
310 sprintf (dbf_txt, "ccode:%d", ccode);
311 CIO_TRACE_EVENT (2, dbf_txt);
312
313 switch (ccode) {
314 case 0:
315 sch->schib.scsw.actl |= SCSW_ACTL_CLEAR_PEND;
315 sch->schib.scsw.cmd.actl |= SCSW_ACTL_CLEAR_PEND;
316 return 0;
317 default: /* device not operational */
318 return -ENODEV;
319 }
320}
321
322/*
323 * Function: cio_cancel

--- 129 unchanged lines hidden (view full) ---

453 CIO_TRACE_EVENT (2, sch->dev.bus_id);
454
455 if (sch_is_pseudo_sch(sch))
456 return 0;
457 ccode = stsch (sch->schid, &sch->schib);
458 if (ccode == 3) /* Not operational. */
459 return -ENODEV;
460
316 return 0;
317 default: /* device not operational */
318 return -ENODEV;
319 }
320}
321
322/*
323 * Function: cio_cancel

--- 129 unchanged lines hidden (view full) ---

453 CIO_TRACE_EVENT (2, sch->dev.bus_id);
454
455 if (sch_is_pseudo_sch(sch))
456 return 0;
457 ccode = stsch (sch->schid, &sch->schib);
458 if (ccode == 3) /* Not operational. */
459 return -ENODEV;
460
461 if (sch->schib.scsw.actl != 0)
461 if (scsw_actl(&sch->schib.scsw) != 0)
462 /*
463 * the disable function must not be called while there are
464 * requests pending for completion !
465 */
466 return -EBUSY;
467
468 for (retry = 5, ret = 0; retry > 0; retry--) {
469 sch->schib.pmcw.ena = 0;

--- 233 unchanged lines hidden (view full) ---

703 cr6 = 0x40000000;
704 __ctl_load (cr6, 6, 6);
705
706 do {
707 spin_unlock(console_subchannel.lock);
708 if (!cio_tpi())
709 cpu_relax();
710 spin_lock(console_subchannel.lock);
462 /*
463 * the disable function must not be called while there are
464 * requests pending for completion !
465 */
466 return -EBUSY;
467
468 for (retry = 5, ret = 0; retry > 0; retry--) {
469 sch->schib.pmcw.ena = 0;

--- 233 unchanged lines hidden (view full) ---

703 cr6 = 0x40000000;
704 __ctl_load (cr6, 6, 6);
705
706 do {
707 spin_unlock(console_subchannel.lock);
708 if (!cio_tpi())
709 cpu_relax();
710 spin_lock(console_subchannel.lock);
711 } while (console_subchannel.schib.scsw.actl != 0);
711 } while (console_subchannel.schib.scsw.cmd.actl != 0);
712 /*
713 * restore previous isc value
714 */
715 __ctl_load (save_cr6, 6, 6);
716}
717
718static int
719cio_test_for_console(struct subchannel_id schid, void *data)

--- 350 unchanged lines hidden ---
712 /*
713 * restore previous isc value
714 */
715 __ctl_load (save_cr6, 6, 6);
716}
717
718static int
719cio_test_for_console(struct subchannel_id schid, void *data)

--- 350 unchanged lines hidden ---