On Sun, 2 Dec 2007, James Bottomley wrote:

> Actually, the night train is a good place to do coding.  I know this
> compiles, but could someone check it out?  It's the form I think we
> should do, since the ASC/ASCQ codes for esoteric conditions which we
> might eventually check for are different for CDs and removable discs.

This part is puzzling:

> +     /* try to eat the UNIT_ATTENTION if there are enough retries */
> +     do {
> +             result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr,
> +                                       timeout, retries);
> +     } while ((driver_byte(result) & DRIVER_SENSE) &&
> +              sshdr && sshdr->sense_key == UNIT_ATTENTION &&
> +              --retries);

For one thing, you've using retries to control both an outer loop and 
an inner loop -- meaning the total number of attempts could be on the 
order of retries**2.

For another, why do you want to swallow a UNIT_ATTENTION?  Shouldn't 
that be up to the code calling scsi_test_unit_ready()?

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to