All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SCSI: sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE
@ 2014-01-15 20:37 Alan Stern
  2014-02-05 11:04 ` Daniel Mack
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Stern @ 2014-01-15 20:37 UTC (permalink / raw)
  To: James Bottomley
  Cc: Sven Neumann, Daniel Mack, Oliver Neukum, SCSI development list

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@rowland.harvard.edu>
Reported-by: Sven Neumann <s.neumann@raumfeld.com>
Tested-by: Daniel Mack <zonque@gmail.com>
CC: Oliver Neukum <oliver@neukum.org>
CC: <stable@vger.kernel.org>

---


[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;
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] SCSI: sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE
  2014-01-15 20:37 [PATCH] SCSI: sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE Alan Stern
@ 2014-02-05 11:04 ` Daniel Mack
  2014-02-17 11:33   ` Daniel Mack
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Mack @ 2014-02-05 11:04 UTC (permalink / raw)
  To: Alan Stern, James Bottomley
  Cc: Sven Neumann, Oliver Neukum, SCSI development list,
	Greg Kroah-Hartman

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@rowland.harvard.edu>
> Reported-by: Sven Neumann <s.neumann@raumfeld.com>
> Tested-by: Daniel Mack <zonque@gmail.com>
> CC: Oliver Neukum <oliver@neukum.org>
> CC: <stable@vger.kernel.org>

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;
>  
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] SCSI: sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE
  2014-02-05 11:04 ` Daniel Mack
@ 2014-02-17 11:33   ` Daniel Mack
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Mack @ 2014-02-17 11:33 UTC (permalink / raw)
  To: Alan Stern, James Bottomley
  Cc: Sven Neumann, Oliver Neukum, SCSI development list,
	Greg Kroah-Hartman

On 02/05/2014 12:04 PM, Daniel Mack wrote:
> 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@rowland.harvard.edu>
>> Reported-by: Sven Neumann <s.neumann@raumfeld.com>
>> Tested-by: Daniel Mack <zonque@gmail.com>
>> CC: Oliver Neukum <oliver@neukum.org>
>> CC: <stable@vger.kernel.org>
> 
> Any objections about this patch? It would be good to get it merged for
> 3.14, if possible.

Ping? Did anyone queue this one up?


Thanks,
Daniel


>>  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;
>>  
>>
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-17 11:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 20:37 [PATCH] SCSI: sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE Alan Stern
2014-02-05 11:04 ` Daniel Mack
2014-02-17 11:33   ` Daniel Mack

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.