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

Gustavo Guillermo PĂ©rez <[email protected]> Fri, 28 Apr 2006 20:24:15 -0500
Newsgroups gmane.linux.suse.packet-writing
Organization www.compunauta.com
Message-ID <[email protected]>
El Martes, 25 de Abril de 2006 16:48, James Bottomley escribi=C3=B3:
The attached patch was posted on scsi-lib to fix UDF Bad Sectors on Pioneer=
=20
DVD 110D 109D 108D 107D 106D and many others from pioneer trow usb storage=
=20
devices.

I have no more bad sectors with pktcdvd using this devices.

> 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 =3D=3D 0x04 && sshdr.ascq =3D=3D 0x01) {
> -				scsi_requeue_command(q, cmd);
> -				return;
> +			if (sshdr.asc =3D=3D 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:

=2D-=20
Gustavo Guillermo P=C3=A9rez
Compunauta uLinux
www.compunauta.com