--- linux-2.4.18-orig/drivers/scsi/aic7xxx/aic7xxx.c Thu Oct 25 16:53:48 2001 +++ linux-2.4.18/drivers/scsi/aic7xxx/aic7xxx.c Wed Oct 2 11:42:57 2002 @@ -1073,6 +1073,15 @@ ahc_outb(ahc, MSG_OUT, mesg_out); } /* + * If a disk is hot-added, it sometimes gets here with a + * scsi parity error in data-in, and could hang, so we + * need to clear the error and rescan to correctly + * add the disk, so this would clear it: + * if (errorphase == P_DATAIN || errorphase == P_DATAIN_DT) + * ahc_reset_channel(ahc, intr_channel,FALSE); + * But it is less harsh to do the renegotiation below. + */ + /* * Force a renegotiation with this target just in * case we are out of sync for some external reason * unknown (or unreported) by the target. --- linux-2.4.18-orig/drivers/scsi/aic7xxx/aic7xxx_linux.c Mon Feb 25 14:38:04 2002 +++ linux-2.4.18/drivers/scsi/aic7xxx/aic7xxx_linux.c Wed Oct 2 11:42:57 2002 @@ -1973,6 +1973,9 @@ case AC_SENT_BDR: break; case AC_BUS_RESET: + printf(KERN_INFO "(scsi%d:%d:0:0) bus_reset, code=%x\n", + ahc->platform_data->host->host_no, + channel - 'A', code); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) if (ahc->platform_data->host != NULL) { scsi_report_bus_reset(ahc->platform_data->host, @@ -1981,7 +1984,10 @@ #endif break; default: - panic("ahc_send_async: Unexpected async event"); + panic("ahc_send_async: Unexpected async event, " + "code=%x, host=%x, channel=%x, target=%x\n", + code, ahc->platform_data->host->host_no, + channel - 'A', target); } } @@ -2008,7 +2014,7 @@ if ((scb->flags & SCB_ACTIVE) == 0) { printf("SCB %d done'd twice\n", scb->hscb->tag); ahc_dump_card_state(ahc); - panic("Stopping for safety"); + panic("SCB %d done'd twice, stopping.",scb->hscb->tag); } cmd = scb->io_ctx; dev = scb->platform_data->dev; @@ -2332,8 +2338,11 @@ break; } default: - panic("ahc_linux_filter_command: Unexpected Command type %x\n", - cmd->cmnd[0]); + /* + * Unexpected command, dont panic, just log & ignore it. + */ + printf(KERN_ERR "ahc_linux_filter_command: Unexpected Command type %x\n", + cmd->cmnd[0]); break; } }