Re: [PATCH] sd.c

From: Pete Zaitcev (zaitcev@redhat.com)
Date: Sat Jan 11 2003 - 22:45:26 EST


> @@ -809,9 +809,22 @@
> if (media_not_present(sdkp, SRpnt))
> return;
>
> - /* Look for devices that return NOT_READY.
> - * Issue command to spin up drive for these cases. */
> - if (the_result && SRpnt->sr_sense_buffer[2] == NOT_READY) {
> + if (the_result == 0)
> + break; /* all is well now */
> +
> + /*
> + * If manual intervention is required, or this is an
> + * absent USB storage device, a spinup is meaningless.
> + */
> + if (SRpnt->sr_sense_buffer[2] == NOT_READY &&
> + SRpnt->sr_sense_buffer[12] == 4 /* not ready */ &&
> + SRpnt->sr_sense_buffer[13] == 3)

Why is this not inside media_not_present?

> +/*
> + * sd_read_cache_type - called only from sd_init_onedisk()

Was it necessary to move and change sd_read_cache_type
simultaneously? Makes a joke of the diff.

> + /* without media there is no reason to ask;
> + moreover, some devices react badly if we do */
> + if (sdkp->media_present)
> + sd_read_cache_type(sdkp, disk->disk_name, SRpnt, buffer);

Hmm... cautiously ok.

-- Pete
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:39 EST