public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sd: assign appropriate log level
@ 2016-10-17 16:51 David Singleton
  2016-10-17 17:15 ` Joe Perches
  2016-10-17 17:19 ` James Bottomley
  0 siblings, 2 replies; 4+ messages in thread
From: David Singleton @ 2016-10-17 16:51 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Shikhar Dogra, xe-kernel, linux-scsi, linux-kernel

From: Shikhar Dogra <shidogra@cisco.com>

Reduce chatter on console for usb hotplug.
KERN_ERR is too high severity for these messages, moving them
to KERN_WARNING

USB devices never have a Caching Mode page, it doesn't make
sense to make it an error when you have tons of USB devices where
the print is useless, and not an error.

For second message, the condition is not an error. The existing
workaround of assuming a write through cache doesn't limit
functionality in any way.

Cc: xe-kernel@external.cisco.com
Signed-off-by: Shikhar Dogra <shidogra@cisco.com>
Signed-off-by: David Singleton <davsingl@cisco.com>
---
 drivers/scsi/sd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 51e5629..ab7bfe3 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2540,7 +2540,7 @@ 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:
@@ -2594,7 +2594,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;
 	}
-- 
2.9.3

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

* Re: [PATCH] sd: assign appropriate log level
  2016-10-17 16:51 [PATCH] sd: assign appropriate log level David Singleton
@ 2016-10-17 17:15 ` Joe Perches
  2016-10-17 17:19 ` James Bottomley
  1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2016-10-17 17:15 UTC (permalink / raw)
  To: David Singleton, James E.J. Bottomley, Martin K. Petersen
  Cc: Shikhar Dogra, xe-kernel, linux-scsi, linux-kernel

On Mon, 2016-10-17 at 09:51 -0700, David Singleton wrote:
> From: Shikhar Dogra <shidogra@cisco.com>
> 
> Reduce chatter on console for usb hotplug.
> KERN_ERR is too high severity for these messages, moving them
> to KERN_WARNING

Perhaps KERN_NOTICE is more appropriate.
That's the level for most of these sd_first_printk already.

> USB devices never have a Caching Mode page, it doesn't make
> sense to make it an error when you have tons of USB devices where
> the print is useless, and not an error.
> 
> For second message, the condition is not an error. The existing
> workaround of assuming a write through cache doesn't limit
> functionality in any way.
> 
> Cc: xe-kernel@external.cisco.com
> Signed-off-by: Shikhar Dogra <shidogra@cisco.com>
> Signed-off-by: David Singleton <davsingl@cisco.com>
> ---
>  drivers/scsi/sd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 51e5629..ab7bfe3 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2540,7 +2540,7 @@ 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:
> @@ -2594,7 +2594,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
>  				"Assuming drive cache: write back\n");
>  		sdkp->WCE = 1;
>  	} else {s
> -		sd_first_printk(KERN_ERR, sdkp,
> +		sd_first_printk(KERN_WARNING, sdkp,
>  				"Assuming drive cache: write through\n");
>  		sdkp->WCE = 0;
>  	}
> 

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

* Re: [PATCH] sd: assign appropriate log level
  2016-10-17 16:51 [PATCH] sd: assign appropriate log level David Singleton
  2016-10-17 17:15 ` Joe Perches
@ 2016-10-17 17:19 ` James Bottomley
  2016-10-17 17:22   ` Daniel Walker
  1 sibling, 1 reply; 4+ messages in thread
From: James Bottomley @ 2016-10-17 17:19 UTC (permalink / raw)
  To: David Singleton, Martin K. Petersen
  Cc: Shikhar Dogra, xe-kernel, linux-scsi, linux-kernel

On Mon, 2016-10-17 at 09:51 -0700, David Singleton wrote:
> From: Shikhar Dogra <shidogra@cisco.com>
> 
> Reduce chatter on console for usb hotplug.
> KERN_ERR is too high severity for these messages, moving them
> to KERN_WARNING

It's an error because we have several USB to IDE bridges that have
write back cache drives but report nothing to the caching mode page. 
 For them this is a serious error because their data integrity is at
risk.  I'm open to other ways to fix your problem, but downgrading the
message severity because *you* don't have an issue would mask the
problem for others, so it's not really viable.

> USB devices never have a Caching Mode page, it doesn't make
> sense to make it an error when you have tons of USB devices where
> the print is useless, and not an error.
> 
> For second message, the condition is not an error. The existing
> workaround of assuming a write through cache doesn't limit
> functionality in any way.

Yes, it does if the cache is actually write back ...

James


> Cc: xe-kernel@external.cisco.com
> Signed-off-by: Shikhar Dogra <shidogra@cisco.com>
> Signed-off-by: David Singleton <davsingl@cisco.com>
> ---
>  drivers/scsi/sd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 51e5629..ab7bfe3 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2540,7 +2540,7 @@ 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:
> @@ -2594,7 +2594,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;
>  	}

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

* Re: [PATCH] sd: assign appropriate log level
  2016-10-17 17:19 ` James Bottomley
@ 2016-10-17 17:22   ` Daniel Walker
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Walker @ 2016-10-17 17:22 UTC (permalink / raw)
  To: James Bottomley, David Singleton, Martin K. Petersen
  Cc: Shikhar Dogra, xe-kernel, linux-scsi, linux-kernel

On 10/17/2016 10:19 AM, James Bottomley wrote:
> On Mon, 2016-10-17 at 09:51 -0700, David Singleton wrote:
>> From: Shikhar Dogra <shidogra@cisco.com>
>>
>> Reduce chatter on console for usb hotplug.
>> KERN_ERR is too high severity for these messages, moving them
>> to KERN_WARNING
> It's an error because we have several USB to IDE bridges that have
> write back cache drives but report nothing to the caching mode page.
>   For them this is a serious error because their data integrity is at
> risk.  I'm open to other ways to fix your problem, but downgrading the
> message severity because *you* don't have an issue would mask the
> problem for others, so it's not really viable.

Is there a way to detect when you have a device of the type where this 
is a serious issue ? This typically happen for USB drives, but seems to 
have no effect on them.


Daniel

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

end of thread, other threads:[~2016-10-17 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-17 16:51 [PATCH] sd: assign appropriate log level David Singleton
2016-10-17 17:15 ` Joe Perches
2016-10-17 17:19 ` James Bottomley
2016-10-17 17:22   ` Daniel Walker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox