Re: [PATCH] SCSI: sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/15/2014 09:37 PM, Alan Stern wrote:
> Evidently some wacky USB-ATA bridges don't recognize the SYNCHRONIZE
> CACHE command, as shown in this email thread:
> 
> 	http://marc.info/?t=138978356200002&r=1&w=2
> 
> The fact that we can't tell them to drain their caches shouldn't
> prevent the system from going into suspend.  Therefore sd_sync_cache()
> shouldn't return an error if the device replies with an Invalid
> Command ASC.
> 
> Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Reported-by: Sven Neumann <s.neumann@xxxxxxxxxxxx>
> Tested-by: Daniel Mack <zonque@xxxxxxxxx>
> CC: Oliver Neukum <oliver@xxxxxxxxxx>
> CC: <stable@xxxxxxxxxxxxxxx>

Any objections about this patch? It would be good to get it merged for
3.14, if possible.


Thanks,
Daniel


> 
> ---
> 
> 
> [as1734]
> 
> 
>  drivers/scsi/sd.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: usb-3.13/drivers/scsi/sd.c
> ===================================================================
> --- usb-3.13.orig/drivers/scsi/sd.c
> +++ usb-3.13/drivers/scsi/sd.c
> @@ -1463,8 +1463,8 @@ static int sd_sync_cache(struct scsi_dis
>  			sd_print_sense_hdr(sdkp, &sshdr);
>  		/* we need to evaluate the error return  */
>  		if (scsi_sense_valid(&sshdr) &&
> -			/* 0x3a is medium not present */
> -			sshdr.asc == 0x3a)
> +			(sshdr.asc == 0x3a ||	/* medium not present */
> +			 sshdr.asc == 0x20))	/* invalid command */
>  				/* this is no error here */
>  				return 0;
>  
> 

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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux