lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] aic7xxx reset loop.
Hi. 

Before, the scsi controller was correctly detected, but when trying to
detect the harddiscs connected, it would go into a reset loop.

This patch, found on the scsi mailing list, solves the above problem -
tested on a dual PIII with an Adaptec AHA-2940U2/W (using the aic7xxx
driver).

The patch is against 2.4.0-test7

Who is the maintainer of scan_scsi, as I would like to see this patch go
into the kernel tree.


Regards
Anders Fugmann

--
. . . . . . . . . . . . F r a m f a b A / S . . . . . . . . . . . . .
Anders Fugmann Livjægergade 17A, 2.sal.
Systems Developer DK-2100 København Ø.
E-mail: anders.fugmann@framfab.dk Telefon: +45 39 17 48 48
Direkte: +45 39 17 48 38 http://www.framfab.dk
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .--- linux/drivers/scsi/scsi_scan.c.orig Wed Jul 19 07:26:13 2000
+++ linux/drivers/scsi/scsi_scan.c Wed Aug 16 11:34:45 2000
@@ -488,7 +488,38 @@
SDpnt->expecting_cc_ua = 0;
SDpnt->starved = 0;

+ scsi_cmd[0] = TEST_UNIT_READY;
+ scsi_cmd[1] = lun << 5;
+ scsi_cmd[2] = scsi_cmd[3] = scsi_cmd[4] = scsi_cmd[5] = 0;
+
SRpnt = scsi_allocate_request(SDpnt);
+
+ SRpnt->sr_data_direction = SCSI_DATA_NONE;
+ scsi_wait_req (SRpnt, (void *) scsi_cmd,
+ (void *) NULL,
+ 0, SCSI_TIMEOUT + 4 * HZ, 5);
+
+ SCSI_LOG_SCAN_BUS(3, printk("scsi: scan_scsis_single id %d lun %d. Return code 0x%08x\n",
+ dev, lun, SRpnt->sr_result));
+ SCSI_LOG_SCAN_BUS(3, print_driverbyte(SRpnt->sr_result));
+ SCSI_LOG_SCAN_BUS(3, print_hostbyte(SRpnt->sr_result));
+ SCSI_LOG_SCAN_BUS(3, printk("\n"));
+
+ if (SRpnt->sr_result) {
+ if (((driver_byte(SRpnt->sr_result) & DRIVER_SENSE) ||
+ (status_byte(SRpnt->sr_result) & CHECK_CONDITION)) &&
+ ((SRpnt->sr_sense_buffer[0] & 0x70) >> 4) == 7) {
+ if (((SRpnt->sr_sense_buffer[2] & 0xf) != NOT_READY) &&
+ ((SRpnt->sr_sense_buffer[2] & 0xf) != UNIT_ATTENTION) &&
+ ((SRpnt->sr_sense_buffer[2] & 0xf) != ILLEGAL_REQUEST || lun > 0)) {
+ scsi_release_request(SRpnt);
+ return 1;
+ }
+ } else {
+ scsi_release_request(SRpnt);
+ return 0;
+ }
+ }

/*
* We used to do a TEST_UNIT_READY before the INQUIRY but that was
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.024 / U:5.364 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site