Commit 9c6615ff authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390 update (21/27): sync i/o bug.

Remove bogus sanity check from {en,dis}able_sync_isc() and really disable all
interrupt sub classes except isc 7 in wait_cons_dev.
parent 9ef3b8ca
...@@ -1715,7 +1715,7 @@ wait_cons_dev (int irq) ...@@ -1715,7 +1715,7 @@ wait_cons_dev (int irq)
*/ */
__ctl_store (cr6, 6, 6); __ctl_store (cr6, 6, 6);
save_cr6 = cr6; save_cr6 = cr6;
cr6 &= 0x01FFFFFF; cr6 = 0x01000000;
__ctl_load (cr6, 6, 6); __ctl_load (cr6, 6, 6);
do { do {
...@@ -1855,47 +1855,39 @@ enable_cpu_sync_isc (int irq) ...@@ -1855,47 +1855,39 @@ enable_cpu_sync_isc (int irq)
/* This one spins until it can get the sync_isc lock for irq# irq */ /* This one spins until it can get the sync_isc lock for irq# irq */
if ((irq <= highest_subchannel) && if (atomic_read (&sync_isc) != irq)
(ioinfo[irq] != INVALID_STORAGE_AREA) && atomic_compare_and_swap_spin (-1, irq, &sync_isc);
(!ioinfo[irq]->st)) {
if (atomic_read (&sync_isc) != irq) sync_isc_cnt++;
atomic_compare_and_swap_spin (-1, irq, &sync_isc);
if (sync_isc_cnt > 255) { /* fixme : magic number */
sync_isc_cnt++; panic ("Too many recursive calls to enable_sync_isc");
if (sync_isc_cnt > 255) { /* fixme : magic number */ }
panic ("Too many recursive calls to enable_sync_isc"); /*
* we only run the STSCH/MSCH path for the first enablement
} */
/* else if (sync_isc_cnt == 1) {
* we only run the STSCH/MSCH path for the first enablement ioinfo[irq]->ui.flags.syncio = 1;
*/
else if (sync_isc_cnt == 1) { ccode = stsch (irq, &(ioinfo[irq]->schib));
ioinfo[irq]->ui.flags.syncio = 1;
if (!ccode) {
ccode = stsch (irq, &(ioinfo[irq]->schib)); ioinfo[irq]->schib.pmcw.isc = 5;
rc = s390_set_isc5(irq, 0);
if (!ccode) {
ioinfo[irq]->schib.pmcw.isc = 5; } else {
rc = s390_set_isc5(irq, 0); rc = -ENODEV; /* device is not-operational */
} else {
rc = -ENODEV; /* device is not-operational */
}
}
if (rc) { /* can only happen if stsch/msch fails */
sync_isc_cnt = 0;
atomic_set (&sync_isc, -1);
} }
} else { }
rc = -EINVAL; if (rc) { /* can only happen if stsch/msch fails */
sync_isc_cnt = 0;
atomic_set (&sync_isc, -1);
} }
return (rc); return rc;
} }
...@@ -1910,44 +1902,36 @@ disable_cpu_sync_isc (int irq) ...@@ -1910,44 +1902,36 @@ disable_cpu_sync_isc (int irq)
sprintf (dbf_txt, "disisc%x", irq); sprintf (dbf_txt, "disisc%x", irq);
CIO_TRACE_EVENT (4, dbf_txt); CIO_TRACE_EVENT (4, dbf_txt);
if ((irq <= highest_subchannel) && /*
(ioinfo[irq] != INVALID_STORAGE_AREA) && * We disable if we're the top user only, as we may
(!ioinfo[irq]->st)) { * run recursively ...
/* * We must not decrease the count immediately; during
* We disable if we're the top user only, as we may * msch() processing we may face another pending
* run recursively ... * status we have to process recursively (sync).
* We must not decrease the count immediately; during */
* msch() processing we may face another pending
* status we have to process recursively (sync). if (sync_isc_cnt == 1) {
*/ ccode = stsch (irq, &(ioinfo[irq]->schib));
if (sync_isc_cnt == 1) { if (!ccode) {
ccode = stsch (irq, &(ioinfo[irq]->schib));
ioinfo[irq]->schib.pmcw.isc = 3;
if (!ccode) { rc = s390_set_isc5(irq, 1);
ioinfo[irq]->schib.pmcw.isc = 3;
rc = s390_set_isc5(irq, 1);
} else {
rc = -ENODEV;
}
ioinfo[irq]->ui.flags.syncio = 0;
sync_isc_cnt = 0;
atomic_set (&sync_isc, -1);
} else { } else {
sync_isc_cnt--; rc = -ENODEV;
} }
ioinfo[irq]->ui.flags.syncio = 0;
sync_isc_cnt = 0;
atomic_set (&sync_isc, -1);
} else { } else {
sync_isc_cnt--;
rc = -EINVAL;
} }
return (rc); return rc;
} }
EXPORT_SYMBOL (halt_IO); EXPORT_SYMBOL (halt_IO);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment