Re: SCSI trow USB-STORAGE or SBP2 Debug for buggy device Kernels 2.6.X



El Martes, 25 de Abril de 2006 16:48, James Bottomley escribió:
OK ... My best guess has to be that this device accepted and completed
the command but is still processing it on the medium, hence the return.
Try the attached; I think it makes for these cases. I could be
persuaded to drop format and reconstruction in progress, because those
can be *very* long operations.
Let me see, the patch of course does not apply, but I can figure out how to
proceed on kernel 2.6.16.

But guess who, not Device busy as error, of course and NO BAD SECTORS With
pktcdvd UDF.

:)

Txs, do you think this modification I can use without care on Sata o other
devices going trow SCSI?, cause I be wonder if this could be into main kernel
line.

Regards!!!!

James

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 7b0f9a3..764a8b3 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1067,16 +1067,29 @@ void scsi_io_completion(struct scsi_cmnd
break;
case NOT_READY:
/*
- * If the device is in the process of becoming ready,
- * retry.
+ * If the device is in the process of becoming
+ * ready, or has a temporary blockage, retry.
*/
- if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) {
- scsi_requeue_command(q, cmd);
- return;
+ if (sshdr.asc == 0x04) {
+ switch (sshdr.ascq) {
+ case 0x01: /* becoming ready */
+ case 0x04: /* format in progress */
+ case 0x05: /* rebuild in progress */
+ case 0x06: /* recalculation in progress */
+ case 0x07: /* operation in progress */
+ case 0x08: /* Long write in progress */
+ case 0x09: /* self test in progress */
+ scsi_requeue_command(q, cmd);
+ return;
+ default:
+ break;
+ }
}
- if (!(req->flags & REQ_QUIET))
+ if (!(req->flags & REQ_QUIET)) {
scmd_printk(KERN_INFO, cmd,
- "Device not ready.\n");
+ "Device not ready: ");
+ scsi_print_sense_hdr("", &sshdr);
+ }
scsi_end_request(cmd, 0, this_count, 1);
return;
case VOLUME_OVERFLOW:

--
Gustavo Guillermo Pérez
Compunauta uLinux
www.compunauta.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH 19-rc1] Fix typos in /Documentation : Misc
    ... +do not have a corresponding kernel virtual address space mapping) and ... This command sets the scale factor for the ABSOLUTE MOUSE POSITIONING mode. ... If you check the source code you will see that what I draw here as a frame ... interrupt-parent: contains the phandle of the interrupt ...
    (Linux-Kernel)
  • [PATCH 19-rc1] Fix typos in /Documentation : Misc
    ... -> bus translation). ... +do not have a corresponding kernel virtual address space mapping) and ... This command sets the scale factor for the ABSOLUTE MOUSE POSITIONING mode. ... If you check the source code you will see that what I draw here as a frame ...
    (Linux-Kernel)
  • [PATCH] nfs: Update Documentation/nfsroot.txt to include dhcp, syslinux and isolinux
    ... Document the ip command a little differently to make the ... Update autoconfiguration the current set of options, ... The following text describes on how to use NFS for the ... Kernel command line ...
    (Linux-Kernel)
  • Re: allocating kernel threads from a pool
    ... kernel level threads to do IO, so that a user-level thread's IO calls ... you don't need signals at all. ... another thread writes a pointer to a command to another end of the ...
    (comp.unix.programmer)
  • dvd+rw-tools-5.15.4.8.5 and FreeBSD 5-current
    ... Forwarding this from -ports to -current, because more kernel wizards are ... automatically pull sense data for failed ATAPI command, ... REQUEST SENSE command. ... *implying* that requestor will periodically poll ...
    (freebsd-current)