--- linux-2.5.36-orig/drivers/scsi/aic7xxx/aic7xxx_core.c Tue Sep 17 20:58:57 2002 +++ linux-2.5.36/drivers/scsi/aic7xxx/aic7xxx_core.c Mon Nov 18 17:19:12 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.5.36-orig/drivers/scsi/aic7xxx/aic7xxx_linux.c Tue Sep 17 20:58:52 2002 +++ linux-2.5.36/drivers/scsi/aic7xxx/aic7xxx_linux.c Mon Nov 18 17:19:12 2002 @@ -1975,6 +1975,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, @@ -1983,7 +1986,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); } } @@ -2010,7 +2016,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; @@ -2334,8 +2340,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; } }