Hello Matthew,
And.. have some more probs (was a little bit too fast), perhaps you have
an idea:
When I dd more than 556k bytes to the drive, I get errors.
I have attached a log, some ideas would be great.
If you sent the patch, it might help people have ideas about what might
be wrong with it.
Attached.
But "special" ugly hack, far away from final code.
I have only changed scsi_scan.c, but nothing else (only printk to track
the extecution, perhaps I should read a howto for kernel debugging...)
The problem, I think must have someting todo with:
cpqfcTSworker.c from linux-2.4.20:
---snip---
if( (Exchanges->fcExchange[ ExchangeID].type == BLS_ABTS)
&&
// Second, does the source of this ACC match the destination
// of who we originally sent it to?
((Exchanges->fcExchange[ ExchangeID].fchs.d_id & 0xFFFFFF) ==
(fchs->s_id & 0xFFFFFF)) )
{
// YES! NOTE: There is a bug in CPQ's RA-4000 box
// where the "reason code" isn't returned in the payload
// For now, simply presume the reject is because the target
// already completed the exchange...
// printk("complete x_ID %Xh on ABTS RJT\n", ExchangeID);
cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, ExchangeID );
}
---snap---
I have tracked down the prob till now to:
scsi_lib.c ->scsi_softirq_done
Will go on tomorrow.
cya,
Ingo
diff -r -u linux-2.6.16/drivers/scsi/constants.c linux-2.6.16_ra4x00/drivers/scsi/constants.c
--- linux-2.6.16/drivers/scsi/constants.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/constants.c 2006-03-22 21:31:13.000000000 +0100
@@ -1140,6 +1140,7 @@
{
const char *extd_sense_fmt = scsi_extd_sense_format(asc, ascq);
+ printk(KERN_INFO "scsi_if: scsi_show_extd_sense\n");
if (extd_sense_fmt) {
if (strstr(extd_sense_fmt, "%x")) {
printk("Additional sense: ");
@@ -1166,6 +1167,7 @@
*/
const char *error = scsi_sense_is_deferred(sshdr) ?
"<<DEFERRED>>" : "Current";
+ printk(KERN_INFO "scsi_if: scsi_print_sense_hdr\n");
printk(KERN_INFO "%s: %s", name, error);
if (sshdr->response_code >= 0x72)
printk(" [descriptor]");
@@ -1205,6 +1207,7 @@
printk("\n");
return;
}
+ printk(KERN_INFO "scsi_if: __scsi_print_sense\n");
scsi_print_sense_hdr(name, &ssh);
if (ssh.response_code < 0x72) {
/* only decode extras for "fixed" format now */
diff -r -u linux-2.6.16/drivers/scsi/scsi.c linux-2.6.16_ra4x00/drivers/scsi/scsi.c
--- linux-2.6.16/drivers/scsi/scsi.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/scsi.c 2006-03-22 21:38:26.000000000 +0100
@@ -490,6 +490,7 @@
* XXX The scsi_print_sense formatting/prefix
* doesn't match this function.
*/
+ printk(KERN_INFO "scsi_if: scsi_log_completion\n");
scsi_print_sense("", cmd);
}
if (level > 3) {
diff -r -u linux-2.6.16/drivers/scsi/scsi_devinfo.c linux-2.6.16_ra4x00/drivers/scsi/scsi_devinfo.c
--- linux-2.6.16/drivers/scsi/scsi_devinfo.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/scsi_devinfo.c 2006-03-22 14:32:03.000000000 +0100
@@ -132,6 +132,7 @@
{"CMD", "CRA-7280", NULL, BLIST_SPARSELUN}, /* CMD RAID Controller */
{"CNSI", "G7324", NULL, BLIST_SPARSELUN}, /* Chaparral G7324 RAID */
{"CNSi", "G8324", NULL, BLIST_SPARSELUN}, /* Chaparral G8324 RAID */
+ {"COMPAQ", "ARRAY CONTROLLER", NULL, BLIST_SPARSELUN | BLIST_REPORTLUN2}, /* compaq ra4x00 */
{"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN},
{"COMPAQ", "CR3500", NULL, BLIST_FORCELUN},
{"COMPAQ", "MSA1000", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
diff -r -u linux-2.6.16/drivers/scsi/scsi_error.c linux-2.6.16_ra4x00/drivers/scsi/scsi_error.c
--- linux-2.6.16/drivers/scsi/scsi_error.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/scsi_error.c 2006-03-22 21:54:47.000000000 +0100
@@ -161,6 +161,7 @@
**/
void scsi_times_out(struct scsi_cmnd *scmd)
{
+ printk(KERN_INFO "scsi_if: scsi_times_out\n");
scsi_log_completion(scmd, TIMEOUT_ERROR);
if (scmd->device->host->hostt->eh_timed_out)
@@ -467,6 +468,7 @@
scmd->request->rq_status = RQ_SCSI_DONE;
shost->eh_action = NULL;
+ printk(KERN_INFO "scsi_if: scsi_send_eh_cmnd\n");
scsi_log_completion(scmd, SUCCESS);
SCSI_LOG_ERROR_RECOVERY(3,
@@ -640,6 +642,7 @@
" result %x\n", scmd,
scmd->result));
SCSI_LOG_ERROR_RECOVERY(3, scsi_print_sense("bh", scmd));
+ printk(KERN_INFO "scsi_if: scsi_eh_get_sense\n");
rtn = scsi_decide_disposition(scmd);
diff -r -u linux-2.6.16/drivers/scsi/scsi_ioctl.c linux-2.6.16_ra4x00/drivers/scsi/scsi_ioctl.c
--- linux-2.6.16/drivers/scsi/scsi_ioctl.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/scsi_ioctl.c 2006-03-22 21:19:43.000000000 +0100
@@ -125,6 +125,7 @@
sdev_printk(KERN_INFO, sdev,
"ioctl_internal_command return code = %x\n",
result);
+ printk(KERN_INFO "scsi_if: ioctl_internal_command\n");
scsi_print_sense_hdr(" ", &sshdr);
break;
}
diff -r -u linux-2.6.16/drivers/scsi/scsi_lib.c linux-2.6.16_ra4x00/drivers/scsi/scsi_lib.c
--- linux-2.6.16/drivers/scsi/scsi_lib.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/scsi_lib.c 2006-03-22 21:53:58.000000000 +0100
@@ -1086,6 +1086,7 @@
"Volume overflow, CDB: ");
__scsi_print_command(cmd->data_cmnd);
scsi_print_sense("", cmd);
+ printk(KERN_INFO "scsi_if: scsi_io_completion\n");
}
scsi_end_request(cmd, 0, block_bytes, 1);
return;
@@ -1107,8 +1108,10 @@
scmd_printk(KERN_INFO, cmd,
"SCSI error: return code = 0x%x\n", result);
- if (driver_byte(result) & DRIVER_SENSE)
+ if (driver_byte(result) & DRIVER_SENSE) {
+ printk(KERN_INFO "scsi_if: scsi_io_completion\n");
scsi_print_sense("", cmd);
+ }
}
/*
* Mark a single buffer as not uptodate. Queue the remainder.
@@ -1512,6 +1515,7 @@
disposition = SUCCESS;
}
+ printk(KERN_INFO "scsi_if: scsi_softirq_done\n");
scsi_log_completion(cmd, disposition);
switch (disposition) {
diff -r -u linux-2.6.16/drivers/scsi/scsi_scan.c linux-2.6.16_ra4x00/drivers/scsi/scsi_scan.c
--- linux-2.6.16/drivers/scsi/scsi_scan.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/scsi_scan.c 2006-03-22 20:07:10.000000000 +0100
@@ -76,7 +76,8 @@
static const char *scsi_null_device_strs = "nullnullnullnull";
-#define MAX_SCSI_LUNS 512
+//#define MAX_SCSI_LUNS 512
+#define MAX_SCSI_LUNS 10000
#ifdef CONFIG_SCSI_MULTI_LUN
static unsigned int max_scsi_luns = MAX_SCSI_LUNS;
@@ -175,6 +176,8 @@
i = inq_result[0] & 0x1f;
+ // fake scsi version 2
+ inq_result[2] = 2;
printk(KERN_NOTICE " Type: %s ",
i <
MAX_SCSI_DEVICE_CODE ? scsi_device_types[i] :
@@ -446,6 +449,8 @@
int response_len = 0;
int pass, count, result;
struct scsi_sense_hdr sshdr;
+
+ //printk(KERN_INFO "scsi_if: scsi_probe_lun\n");
*bflags = 0;
@@ -577,7 +582,9 @@
* device is attached at LUN 0 (SCSI_SCAN_TARGET_PRESENT) so
* non-zero LUNs can be scanned.
*/
+ printk(KERN_INFO "scsi_if: scsi_probe_lun %x\n", inq_result[2]);
sdev->scsi_level = inq_result[2] & 0x07;
+ sdev->scsi_level = 2;
if (sdev->scsi_level >= 2 ||
(sdev->scsi_level == 1 && (inq_result[3] & 0x0f) == 1))
sdev->scsi_level++;
@@ -647,6 +654,7 @@
case TYPE_MEDIUM_CHANGER:
case TYPE_ENCLOSURE:
case TYPE_COMM:
+ case TYPE_RAID:
case TYPE_RBC:
sdev->writeable = 1;
break;
@@ -655,7 +663,7 @@
sdev->writeable = 0;
break;
default:
- printk(KERN_INFO "scsi: unknown device type %d\n", sdev->type);
+ printk(KERN_INFO "scsi_if: unknown device type %d\n", sdev->type);
}
print_inquiry(inq_result);
@@ -934,6 +942,8 @@
} else
sparse_lun = 0;
+ max_dev_lun = max_scsi_luns;
+ sparse_lun = 1;
/*
* If not sparse lun and no device attached at LUN 0 do not scan
* any further.
@@ -976,16 +986,20 @@
if (scsi_level < SCSI_3 && !(bflags & BLIST_LARGELUN))
max_dev_lun = min(8U, max_dev_lun);
+ max_dev_lun = max_scsi_luns;
/*
* We have already scanned LUN 0, so start at LUN 1. Keep scanning
* until we reach the max, or no LUN is found and we are not
* sparse_lun.
*/
- for (lun = 1; lun < max_dev_lun; ++lun)
+ for (lun = 1; lun < max_dev_lun; ++lun) {
if ((scsi_probe_and_add_lun(starget, lun, NULL, NULL, rescan,
NULL) != SCSI_SCAN_LUN_PRESENT) &&
- !sparse_lun)
+ !sparse_lun) {
return;
+ }
+ //printk(KERN_INFO "scsi_if: scsi_sequential_lun_scan round: %d\n", lun);
+ }
}
/**
@@ -1088,20 +1102,36 @@
* Also allow SCSI-2 if BLIST_REPORTLUN2 is set and host adapter does
* support more than 8 LUNs.
*/
+
+ if (bflags & BLIST_REPORTLUN2) {
+ printk(KERN_INFO "scsi_if: scsi_report_lun_scan: BLIST_REPORTLUN2\n");
+ }
+ printk(KERN_INFO "scsi_if: scsi_report_lun_scan: shost->max_lun %d\n", shost->max_lun);
+
+ printk(KERN_INFO "scsi_if: scsi_report_lun_scan: starget->scsi_level: %d SCSI_2: %d\n", starget->scsi_level, SCSI_2);
+
if ((bflags & BLIST_NOREPORTLUN) ||
starget->scsi_level < SCSI_2 ||
(starget->scsi_level < SCSI_3 &&
- (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8)) )
+ (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 20000)) ) {
+ printk(KERN_INFO "scsi_if: 1 scsi_report_lun_scan\n");
return 1;
- if (bflags & BLIST_NOLUN)
+ }
+ if (bflags & BLIST_NOLUN) {
+ printk(KERN_INFO "scsi_if: 2 scsi_report_lun_scan\n");
return 0;
+ }
if (!(sdev = scsi_device_lookup_by_target(starget, 0))) {
sdev = scsi_alloc_sdev(starget, 0, NULL);
- if (!sdev)
+ if (!sdev) {
+ printk(KERN_INFO "scsi_if: 3 scsi_report_lun_scan\n");
return 0;
- if (scsi_device_get(sdev))
+ }
+ if (scsi_device_get(sdev)) {
+ printk(KERN_INFO "scsi_if: 4 scsi_report_lun_scan\n");
return 0;
+ }
}
sprintf(devname, "host %d channel %d id %d",
@@ -1122,6 +1152,7 @@
(sdev->host->unchecked_isa_dma ? __GFP_DMA : 0));
if (!lun_data) {
printk(ALLOC_FAILURE_MSG, __FUNCTION__);
+ printk(KERN_INFO "scsi_if: 5 scsi_report_lun_scan\n");
goto out;
}
@@ -1165,11 +1196,17 @@
SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: REPORT LUNS"
" %s (try %d) result 0x%x\n", result
? "failed" : "successful", retries, result));
- if (result == 0)
+ printk(KERN_INFO "scsi_if: 10 scsi_report_lun_scan\n");
+ if (result == 0) {
+ printk(KERN_INFO "scsi_if: 11 scsi_report_lun_scan\n");
break;
+ }
else if (scsi_sense_valid(&sshdr)) {
- if (sshdr.sense_key != UNIT_ATTENTION)
+ printk(KERN_INFO "scsi_if: 12 scsi_report_lun_scan\n");
+ if (sshdr.sense_key != UNIT_ATTENTION) {
+ printk(KERN_INFO "scsi_if: 13 scsi_report_lun_scan\n");
break;
+ }
}
}
@@ -1178,6 +1215,7 @@
* The device probably does not support a REPORT LUN command
*/
ret = 1;
+ printk(KERN_INFO "scsi_if: 6 scsi_report_lun_scan\n");
goto out_err;
}
@@ -1195,10 +1233,12 @@
" max_scsi_report_luns.\n", devname,
max_scsi_report_luns, num_luns);
num_luns = max_scsi_report_luns;
+ printk(KERN_INFO "scsi_if: 14 scsi_report_lun_scan\n");
}
SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev,
"scsi scan: REPORT LUN scan\n"));
+ printk(KERN_INFO "scsi_if: 15 scsi_report_lun_scan\n");
/*
* Scan the luns in lun_data. The entry at offset 0 is really
@@ -1206,7 +1246,7 @@
*/
for (lunp = &lun_data[1]; lunp <= &lun_data[num_luns]; lunp++) {
lun = scsilun_to_int(lunp);
-
+
/*
* Check if the unused part of lunp is non-zero, and so
* does not fit in lun.
@@ -1247,8 +1287,10 @@
}
out_err:
+ printk(KERN_INFO "scsi_if: 8 scsi_report_lun_scan\n");
kfree(lun_data);
out:
+ printk(KERN_INFO "scsi_if: 9 scsi_report_lun_scan\n");
scsi_device_put(sdev);
if (sdev->sdev_state == SDEV_CREATED)
/*
@@ -1323,16 +1365,20 @@
int res;
struct scsi_target *starget;
+ printk(KERN_INFO "scsi_if: __scsi_scan_target\n");
+
if (shost->this_id == id)
/*
* Don't scan the host adapter
*/
return;
+ printk(KERN_INFO "scsi_if: 1__scsi_scan_target\n");
starget = scsi_alloc_target(parent, channel, id);
if (!starget)
return;
+ printk(KERN_INFO "scsi_if: 2__scsi_scan_target\n");
get_device(&starget->dev);
if (lun != SCAN_WILD_CARD) {
/*
@@ -1342,12 +1388,14 @@
goto out_reap;
}
+ printk(KERN_INFO "scsi_if: 3__scsi_scan_target\n");
/*
* Scan LUN 0, if there is some response, scan further. Ideally, we
* would not configure LUN 0 until all LUNs are scanned.
*/
res = scsi_probe_and_add_lun(starget, 0, &bflags, NULL, rescan, NULL);
if (res == SCSI_SCAN_LUN_PRESENT || res == SCSI_SCAN_TARGET_PRESENT) {
+ printk(KERN_INFO "scsi_if: 4__scsi_scan_target\n");
if (scsi_report_lun_scan(starget, bflags, rescan) != 0)
/*
* The REPORT LUN did not scan the target,
@@ -1355,6 +1403,7 @@
*/
scsi_sequential_lun_scan(starget, bflags,
res, starget->scsi_level, rescan);
+ printk(KERN_INFO "scsi_if: 5__scsi_scan_target\n");
}
out_reap:
@@ -1363,6 +1412,7 @@
scsi_target_reap(starget);
put_device(&starget->dev);
+ printk(KERN_INFO "scsi_if: 6__scsi_scan_target\n");
}
/**
diff -r -u linux-2.6.16/drivers/scsi/sd.c linux-2.6.16_ra4x00/drivers/scsi/sd.c
--- linux-2.6.16/drivers/scsi/sd.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/sd.c 2006-03-22 21:41:39.000000000 +0100
@@ -688,8 +688,10 @@
"host = %d, driver = %02x\n ",
status_byte(res), msg_byte(res),
host_byte(res), driver_byte(res));
- if (driver_byte(res) & DRIVER_SENSE)
+ if (driver_byte(res) & DRIVER_SENSE) {
+ printk(KERN_INFO "scsi_if: sd_sync_cache\n");
scsi_print_sense_hdr("sd", &sshdr);
+ }
}
return res;
@@ -869,6 +871,7 @@
* Inform the user, but make sure that it's not treated
* as a hard error.
*/
+ printk(KERN_INFO "scsi_if: sd_rw_intr\n");
scsi_print_sense("sd", SCpnt);
SCpnt->result = 0;
memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
@@ -1026,6 +1029,7 @@
if(!spintime) {
printk(KERN_NOTICE "%s: Unit Not Ready, "
"sense:\n", diskname);
+ printk(KERN_INFO "scsi_if: sd_spinup_disk\n");
scsi_print_sense_hdr("", &sshdr);
}
break;
@@ -1093,8 +1097,10 @@
host_byte(the_result),
driver_byte(the_result));
- if (driver_byte(the_result) & DRIVER_SENSE)
+ if (driver_byte(the_result) & DRIVER_SENSE) {
+ printk(KERN_INFO "scsi_if: sd_read_capacity\n");
scsi_print_sense_hdr("sd", &sshdr);
+ }
else
printk("%s : sense not available. \n", diskname);
diff -r -u linux-2.6.16/drivers/scsi/sr_ioctl.c linux-2.6.16_ra4x00/drivers/scsi/sr_ioctl.c
--- linux-2.6.16/drivers/scsi/sr_ioctl.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16_ra4x00/drivers/scsi/sr_ioctl.c 2006-03-22 21:22:14.000000000 +0100
@@ -242,6 +242,7 @@
if (!cgc->quiet)
printk(KERN_INFO "%s: CDROM not ready. Make sure there is a disc in the drive.\n", cd->cdi.name);
#ifdef DEBUG
+ printk(KERN_INFO "scsi_if: sr_do_ioctl\n");
scsi_print_sense_hdr("sr", &sshdr);
#endif
err = -ENOMEDIUM;