patch-2.4.7 linux/drivers/s390/s390io.c

Next file: linux/drivers/sbus/char/aurora.c
Previous file: linux/drivers/pnp/isapnp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/drivers/s390/s390io.c linux/drivers/s390/s390io.c
@@ -2157,6 +2157,7 @@
 	 * Get interrupt info from lowcore
 	 */
 	volatile tpi_info_t *tpi_info = (tpi_info_t*)(__LC_SUBCHANNEL_ID);
+	int cpu = smp_processor_id();
 
 	/*
 	 * take fast exit if CPU is in sync. I/O state
@@ -2182,7 +2183,9 @@
 		if ( tpi_info->adapter_IO == 1 &&
 		     tpi_info->int_type == IO_INTERRUPT_TYPE )
 		{
+			irq_enter(cpu, -1);
 			do_adapter_IO( tpi_info->intparm );
+			irq_exit(cpu, -1);
 		} 
 		else 
 		{
@@ -2200,9 +2203,11 @@
 				return;	/* this keeps the device boxed ... */
 			}
 	
+			irq_enter(cpu, irq);
 			s390irq_spin_lock( irq );
 			s390_process_IRQ( irq );
 			s390irq_spin_unlock( irq );
+			irq_exit(cpu, irq);
 		}
 
 #ifdef CONFIG_FAST_IRQ
@@ -3166,8 +3171,11 @@
 
 		} /* endif */
 
-		if ( rc )	// can only happen if stsch/msch fails
+		if ( rc )	/* can only happen if stsch/msch fails */
+		{
 			sync_isc_cnt = 0;
+			atomic_set( &sync_isc, -1);
+		}
 	}
 	else
 	{
@@ -4276,12 +4284,7 @@
 		{
 			ret = enable_cpu_sync_isc( irq );
 
-			if ( ret )
-			{
-				free_irq( irq, &devstat );
-				return; // fixme ! fast exit ... grr
-			}
-			else
+			if ( !ret )
 			{
 				ioinfo[irq]->ui.flags.unknown = 0;
 
@@ -5270,24 +5273,28 @@
 
 					} /* endif */
 				}
-				else if ( ret )
+				else if ( ret == -EIO )
 				{
-
 #ifdef CONFIG_DEBUG_IO
-						printk( "PathVerification(%04X) "
-						        "- Device %04X doesn't "
-						        " support path grouping\n",
-						        irq,
-						        ioinfo[irq]->schib.pmcw.dev);
-
+					printk("PathVerification(%04X) - I/O error "
+					       "on device %04X\n", irq,
+					       ioinfo[irq]->schib.pmcw.dev);
 #endif
-
 					ioinfo[irq]->ui.flags.pgid_supp = 0;
-
+		    
+				} else {
+#ifdef CONFIG_DEBUG_IO
+					printk( "PathVerification(%04X) "
+						"- Unexpected error on device %04X\n",
+						irq,
+						ioinfo[irq]->schib.pmcw.dev);
+#endif
+					ioinfo[irq]->ui.flags.pgid_supp = 0;
+					
 				} /* endif */
 
 			} /* endif */
-
+			
 		} /* endfor */
 
 	} /* endif */
@@ -5442,9 +5449,9 @@
 
 						} /* endif */
 					}
-#ifdef CONFIG_DEBUG_IO
 					else
 					{
+#ifdef CONFIG_DEBUG_IO
 						printk( "SPID - device %04X,"
 						        " unit check,"
 						        " retry %d, cnt %02d,"
@@ -5462,8 +5469,10 @@
 						        pdevstat->ii.sense.data[6],
 						        pdevstat->ii.sense.data[7]);
 
-					} /* endif */
 #endif
+						retry--;
+
+					} /* endif */
 				}
 				else if ( pdevstat->flag & DEVSTAT_NOT_OPER )
 				{
@@ -5474,6 +5483,7 @@
 					        irq);
 
 					retry = 0;
+					irq_ret = -EIO;
 
 				} /* endif */
 			}
@@ -5489,6 +5499,12 @@
 
 		} while ( retry > 0 );
 
+		if ( retry == 0 )
+		{
+			irq_ret = -EIO;
+
+		} /* endif */		
+
 		if ( init_IRQ_complete )
 		{
 			kfree( spid_ccw );
@@ -5693,6 +5709,12 @@
 
 		} while ( retry > 0 );
 
+		if ( retry == 0 )
+		{
+			irq_ret = -EIO;
+
+		} /* endif */
+
 		if ( init_IRQ_complete )
 		{
 			kfree( snid_ccw );
@@ -5936,7 +5958,10 @@
 		}
 	}
 
-	do_reipl( 0x10000 | sch );
+	if (MACHINE_IS_VM)
+		cpcmd("IPL", NULL, 0);
+	else
+		do_reipl( 0x10000 | sch );
 }
 
 /* Display info on subchannels in /proc/subchannels. *

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)