diff mbox series

scsi: sd: print write through due to no caching mode page as warning

Message ID 20211013075050.3870354-1-martin.kepplinger@puri.sm (mailing list archive)
State Accepted
Headers show
Series scsi: sd: print write through due to no caching mode page as warning | expand

Commit Message

Martin Kepplinger Oct. 13, 2021, 7:50 a.m. UTC
For SD cardreaders it's extremely common not to find cache on disk.
The following error messages are thus very common and don't point
to a real error one could try to fix but rather describe how the disk
works:

sd 0:0:0:0: [sda] No Caching mode page found
sd 0:0:0:0: [sda] Assuming drive cache: write through

Print these messages as warnings instead of errors.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
---

hi Bart and all who it may concern,

I only resending the same patch I sent in January before:
https://lore.kernel.org/linux-scsi/20210122083000.32598-1-martin.kepplinger@puri.sm/

I like it more when messages printed as errors point to real problems that
need fixing.

thanks,
                         martin




 drivers/scsi/sd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Bart Van Assche Oct. 14, 2021, 4:18 a.m. UTC | #1
On 10/13/21 00:50, Martin Kepplinger wrote:
> I only resending the same patch I sent in January before:
> https://lore.kernel.org/linux-scsi/20210122083000.32598-1-martin.kepplinger@puri.sm/

A common way to indicate this is to start the email subject with [PATCH 
RESEND].

> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index a646d27df681..33ea36b41136 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2793,7 +2793,8 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
>   			}
>   		}
>   
> -		sd_first_printk(KERN_ERR, sdkp, "No Caching mode page found\n");
> +		sd_first_printk(KERN_WARNING, sdkp,
> +				"No Caching mode page found\n");
>   		goto defaults;
>   
>   	Page_found:
> @@ -2848,7 +2849,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
>   				"Assuming drive cache: write back\n");
>   		sdkp->WCE = 1;
>   	} else {
> -		sd_first_printk(KERN_ERR, sdkp,
> +		sd_first_printk(KERN_WARNING, sdkp,
>   				"Assuming drive cache: write through\n");
>   		sdkp->WCE = 0;
>   	}

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Martin K. Petersen Oct. 17, 2021, 2:09 a.m. UTC | #2
Martin,

> For SD cardreaders it's extremely common not to find cache on disk.
> The following error messages are thus very common and don't point to a
> real error one could try to fix but rather describe how the disk
> works:

Applied to 5.16/scsi-staging, thanks!
Martin K. Petersen Oct. 21, 2021, 3:42 a.m. UTC | #3
On Wed, 13 Oct 2021 09:50:50 +0200, Martin Kepplinger wrote:

> For SD cardreaders it's extremely common not to find cache on disk.
> The following error messages are thus very common and don't point
> to a real error one could try to fix but rather describe how the disk
> works:
> 
> sd 0:0:0:0: [sda] No Caching mode page found
> sd 0:0:0:0: [sda] Assuming drive cache: write through
> 
> [...]

Applied to 5.16/scsi-queue, thanks!

[1/1] scsi: sd: print write through due to no caching mode page as warning
      https://git.kernel.org/mkp/scsi/c/c4da1205752d
diff mbox series

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index a646d27df681..33ea36b41136 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2793,7 +2793,8 @@  sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
 			}
 		}
 
-		sd_first_printk(KERN_ERR, sdkp, "No Caching mode page found\n");
+		sd_first_printk(KERN_WARNING, sdkp,
+				"No Caching mode page found\n");
 		goto defaults;
 
 	Page_found:
@@ -2848,7 +2849,7 @@  sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
 				"Assuming drive cache: write back\n");
 		sdkp->WCE = 1;
 	} else {
-		sd_first_printk(KERN_ERR, sdkp,
+		sd_first_printk(KERN_WARNING, sdkp,
 				"Assuming drive cache: write through\n");
 		sdkp->WCE = 0;
 	}