@@ -278,6 +278,7 @@ int css_enumerate(void);
#define IO_SCH_ISC 3
int css_enable(int schid, int isc);
+bool css_enabled(int schid);
/* Library functions */
int start_ccw1_chain(unsigned int sid, struct ccw1 *ccw);
@@ -161,6 +161,31 @@ out:
return schid;
}
+/*
+ * css_enabled: report if the subchannel is enabled
+ * @schid: Subchannel Identifier
+ * Return value:
+ * true if the subchannel is enabled
+ * false otherwise
+ */
+bool css_enabled(int schid)
+{
+ struct pmcw *pmcw = &schib.pmcw;
+ int cc;
+
+ cc = stsch(schid, &schib);
+ if (cc) {
+ report_info("stsch: updating sch %08x failed with cc=%d",
+ schid, cc);
+ return false;
+ }
+
+ if (!(pmcw->flags & PMCW_ENABLE)) {
+ report_info("stsch: sch %08x not enabled", schid);
+ return false;
+ }
+ return true;
+}
/*
* css_enable: enable the subchannel with the specified ISC
* @schid: Subchannel Identifier
@@ -210,18 +235,8 @@ retry:
/*
* Read the SCHIB again to verify the enablement
*/
- cc = stsch(schid, &schib);
- if (cc) {
- report_info("stsch: updating sch %08x failed with cc=%d",
- schid, cc);
- return cc;
- }
-
- if ((pmcw->flags & flags) == flags) {
- report_info("stsch: sch %08x successfully modified after %d retries",
- schid, retry_count);
+ if (css_enabled(schid))
return 0;
- }
if (retry_count++ < MAX_ENABLE_RETRIES) {
mdelay(10); /* the hardware was not ready, give it some time */
@@ -143,6 +143,9 @@ error_senseid:
static void css_init(void)
{
+ assert(register_io_int_func(css_irq_io) == 0);
+ lowcore_ptr->io_int_param = 0;
+
report(get_chsc_scsc(), "Store Channel Characteristics");
}