linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SCSI/SD: clearer output of disk cache state
@ 2006-11-04 19:54 Luben Tuikov
  2006-11-04 20:13 ` Christoph Hellwig
  2006-11-04 23:12 ` James Bottomley
  0 siblings, 2 replies; 9+ messages in thread
From: Luben Tuikov @ 2006-11-04 19:54 UTC (permalink / raw)
  To: linux-scsi

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 drivers/scsi/sd.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

This patch is 8 months old.

     Luben

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9d98723..f157747 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1354,11 +1354,6 @@ sd_read_cache_type(struct scsi_disk *sdk
 	res = sd_do_mode_sense(sdp, dbd, modepage, buffer, len, &data, &sshdr);
 
 	if (scsi_status_is_good(res)) {
-		const char *types[] = {
-			"write through", "none", "write back",
-			"write back, no read (daft)"
-		};
-		int ct = 0;
 		int offset = data.header_length + data.block_descriptor_length;
 
 		if (offset >= SD_BUF_SIZE - 2) {
@@ -1387,11 +1382,13 @@ sd_read_cache_type(struct scsi_disk *sdk
 			sdkp->DPOFUA = 0;
 		}
 
-		ct =  sdkp->RCD + 2*sdkp->WCE;
-
-		printk(KERN_NOTICE "SCSI device %s: drive cache: %s%s\n",
-		       diskname, types[ct],
-		       sdkp->DPOFUA ? " w/ FUA" : "");
+		printk(KERN_NOTICE "SCSI device %s: "
+		       "write cache: %s, read cache: %s, %s\n",
+		       diskname,
+		       sdkp->WCE ? "enabled" : "disabled",
+		       sdkp->RCD ? "disabled" : "enabled",
+		       sdkp->DPOFUA ? "supports DPO and FUA"
+		       : "doesn't support DPO or FUA");
 
 		return;
 	}
-- 
1.4.3.3.g8478



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

* Re: [PATCH] SCSI/SD: clearer output of disk cache state
  2006-11-04 19:54 [PATCH] SCSI/SD: clearer output of disk cache state Luben Tuikov
@ 2006-11-04 20:13 ` Christoph Hellwig
  2006-11-04 23:12 ` James Bottomley
  1 sibling, 0 replies; 9+ messages in thread
From: Christoph Hellwig @ 2006-11-04 20:13 UTC (permalink / raw)
  To: Luben Tuikov; +Cc: linux-scsi

> -		ct =  sdkp->RCD + 2*sdkp->WCE;
> -
> -		printk(KERN_NOTICE "SCSI device %s: drive cache: %s%s\n",
> -		       diskname, types[ct],
> -		       sdkp->DPOFUA ? " w/ FUA" : "");
> +		printk(KERN_NOTICE "SCSI device %s: "
> +		       "write cache: %s, read cache: %s, %s\n",
> +		       diskname,
> +		       sdkp->WCE ? "enabled" : "disabled",
> +		       sdkp->RCD ? "disabled" : "enabled",
> +		       sdkp->DPOFUA ? "supports DPO and FUA"
> +		       : "doesn't support DPO or FUA");

Looks good to me.

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

* Re: [PATCH] SCSI/SD: clearer output of disk cache state
  2006-11-04 19:54 [PATCH] SCSI/SD: clearer output of disk cache state Luben Tuikov
  2006-11-04 20:13 ` Christoph Hellwig
@ 2006-11-04 23:12 ` James Bottomley
  2006-11-05  0:45   ` Luben Tuikov
  1 sibling, 1 reply; 9+ messages in thread
From: James Bottomley @ 2006-11-04 23:12 UTC (permalink / raw)
  To: ltuikov; +Cc: linux-scsi

On Sat, 2006-11-04 at 11:54 -0800, Luben Tuikov wrote:
> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
> ---
>  drivers/scsi/sd.c |   17 +++++++----------
>  1 files changed, 7 insertions(+), 10 deletions(-)
> 
> This patch is 8 months old.

Um:

patching file drivers/scsi/sd.c
Hunk #1 FAILED at 1354.
Hunk #2 FAILED at 1382.
2 out of 2 hunks FAILED -- saving rejects to file drivers/scsi/sd.c.rej

I think the code you're trying to change has altered a bit in the latest
kernels.

James



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

* Re: [PATCH] SCSI/SD: clearer output of disk cache state
  2006-11-04 23:12 ` James Bottomley
@ 2006-11-05  0:45   ` Luben Tuikov
  2006-11-05  3:57     ` Jeff Garzik
                       ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Luben Tuikov @ 2006-11-05  0:45 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

--- James Bottomley <James.Bottomley@SteelEye.com> wrote:
> On Sat, 2006-11-04 at 11:54 -0800, Luben Tuikov wrote:
> > Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
> > ---
> >  drivers/scsi/sd.c |   17 +++++++----------
> >  1 files changed, 7 insertions(+), 10 deletions(-)
> > 
> > This patch is 8 months old.
> 
> Um:
> 
> patching file drivers/scsi/sd.c
> Hunk #1 FAILED at 1354.
> Hunk #2 FAILED at 1382.
> 2 out of 2 hunks FAILED -- saving rejects to file drivers/scsi/sd.c.rej
> 
> I think the code you're trying to change has altered a bit in the latest
> kernels.

Re-based:

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>

--- 
 drivers/scsi/sd.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 84ff203..ffbd021 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1467,7 +1467,6 @@ sd_read_cache_type(struct scsi_disk *sdk
        res = sd_do_mode_sense(sdp, dbd, modepage, buffer, len, &data, &sshdr);
 
        if (scsi_status_is_good(res)) {
-               int ct = 0;
                int offset = data.header_length + data.block_descriptor_length;
 
                if (offset >= SD_BUF_SIZE - 2) {
@@ -1496,11 +1495,13 @@ sd_read_cache_type(struct scsi_disk *sdk
                        sdkp->DPOFUA = 0;
                }
 
-               ct =  sdkp->RCD + 2*sdkp->WCE;
-
-               printk(KERN_NOTICE "SCSI device %s: drive cache: %s%s\n",
-                      diskname, sd_cache_types[ct],
-                      sdkp->DPOFUA ? " w/ FUA" : "");
+               printk(KERN_NOTICE "SCSI device %s: "
+                      "write cache: %s, read cache: %s, %s\n",
+                      diskname,
+                      sdkp->WCE ? "enabled" : "disabled",
+                      sdkp->RCD ? "disabled" : "enabled",
+                      sdkp->DPOFUA ? "supports DPO and FUA"
+                      : "doesn't support DPO or FUA");
 
                return;
        }




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

* Re: [PATCH] SCSI/SD: clearer output of disk cache state
  2006-11-05  0:45   ` Luben Tuikov
@ 2006-11-05  3:57     ` Jeff Garzik
  2006-11-05  5:36     ` James Bottomley
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Jeff Garzik @ 2006-11-05  3:57 UTC (permalink / raw)
  To: ltuikov; +Cc: James Bottomley, linux-scsi

Luben Tuikov wrote:
> --- James Bottomley <James.Bottomley@SteelEye.com> wrote:
>> On Sat, 2006-11-04 at 11:54 -0800, Luben Tuikov wrote:
>>> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
>>> ---
>>>  drivers/scsi/sd.c |   17 +++++++----------
>>>  1 files changed, 7 insertions(+), 10 deletions(-)
>>>
>>> This patch is 8 months old.
>> Um:
>>
>> patching file drivers/scsi/sd.c
>> Hunk #1 FAILED at 1354.
>> Hunk #2 FAILED at 1382.
>> 2 out of 2 hunks FAILED -- saving rejects to file drivers/scsi/sd.c.rej
>>
>> I think the code you're trying to change has altered a bit in the latest
>> kernels.
> 
> Re-based:
> 
> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>

ACK



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

* Re: [PATCH] SCSI/SD: clearer output of disk cache state
  2006-11-05  0:45   ` Luben Tuikov
  2006-11-05  3:57     ` Jeff Garzik
@ 2006-11-05  5:36     ` James Bottomley
  2006-11-05 14:47     ` Douglas Gilbert
  2006-11-15 20:26     ` James Bottomley
  3 siblings, 0 replies; 9+ messages in thread
From: James Bottomley @ 2006-11-05  5:36 UTC (permalink / raw)
  To: ltuikov; +Cc: linux-scsi

On Sat, 2006-11-04 at 16:45 -0800, Luben Tuikov wrote:
> Re-based:

Thanks,

If you want to go the whole hog on this one, we probably also need WCE
and RCD files (taking 1 or 0) for the scsi_disk class and a date in the
feature removal file for dumping the cache_type file.

James





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

* Re: [PATCH] SCSI/SD: clearer output of disk cache state
  2006-11-05  0:45   ` Luben Tuikov
  2006-11-05  3:57     ` Jeff Garzik
  2006-11-05  5:36     ` James Bottomley
@ 2006-11-05 14:47     ` Douglas Gilbert
  2006-11-15 20:26     ` James Bottomley
  3 siblings, 0 replies; 9+ messages in thread
From: Douglas Gilbert @ 2006-11-05 14:47 UTC (permalink / raw)
  To: ltuikov; +Cc: James Bottomley, linux-scsi

Luben Tuikov wrote:
> --- James Bottomley <James.Bottomley@SteelEye.com> wrote:
>> On Sat, 2006-11-04 at 11:54 -0800, Luben Tuikov wrote:
>>> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
>>> ---
>>>  drivers/scsi/sd.c |   17 +++++++----------
>>>  1 files changed, 7 insertions(+), 10 deletions(-)
>>>
>>> This patch is 8 months old.
>> Um:
>>
>> patching file drivers/scsi/sd.c
>> Hunk #1 FAILED at 1354.
>> Hunk #2 FAILED at 1382.
>> 2 out of 2 hunks FAILED -- saving rejects to file drivers/scsi/sd.c.rej
>>
>> I think the code you're trying to change has altered a bit in the latest
>> kernels.
> 
> Re-based:
> 
> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
> 
> --- 
>  drivers/scsi/sd.c |   13 +++++++------
>  1 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 84ff203..ffbd021 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1467,7 +1467,6 @@ sd_read_cache_type(struct scsi_disk *sdk
>         res = sd_do_mode_sense(sdp, dbd, modepage, buffer, len, &data, &sshdr);
>  
>         if (scsi_status_is_good(res)) {
> -               int ct = 0;
>                 int offset = data.header_length + data.block_descriptor_length;
>  
>                 if (offset >= SD_BUF_SIZE - 2) {
> @@ -1496,11 +1495,13 @@ sd_read_cache_type(struct scsi_disk *sdk
>                         sdkp->DPOFUA = 0;
>                 }
>  
> -               ct =  sdkp->RCD + 2*sdkp->WCE;
> -
> -               printk(KERN_NOTICE "SCSI device %s: drive cache: %s%s\n",
> -                      diskname, sd_cache_types[ct],
> -                      sdkp->DPOFUA ? " w/ FUA" : "");
> +               printk(KERN_NOTICE "SCSI device %s: "
> +                      "write cache: %s, read cache: %s, %s\n",
> +                      diskname,
> +                      sdkp->WCE ? "enabled" : "disabled",
> +                      sdkp->RCD ? "disabled" : "enabled",
> +                      sdkp->DPOFUA ? "supports DPO and FUA"
> +                      : "doesn't support DPO or FUA");
>  
>                 return;
>         }

The definition of the DPOFUA flag (in the block descriptor
returned by MODE SENSE for direct access devices) is a bit
fuzzy in practice. When I queried the t10 reflector a
member from a disk company said it should be interpreted as
... we support DPO and/or FUA.

I also noticed that one disk manufacturer's unit attention mode
page had a bit to disable FUA (force unit access). So you can
set the FUA bit (in a READ or WRITE), we will ignore it! The
associated note says that it improves performance :-)

Doug Gilbert

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

* Re: [PATCH] SCSI/SD: clearer output of disk cache state
  2006-11-05  0:45   ` Luben Tuikov
                       ` (2 preceding siblings ...)
  2006-11-05 14:47     ` Douglas Gilbert
@ 2006-11-15 20:26     ` James Bottomley
  2006-11-15 20:47       ` Luben Tuikov
  3 siblings, 1 reply; 9+ messages in thread
From: James Bottomley @ 2006-11-15 20:26 UTC (permalink / raw)
  To: ltuikov; +Cc: linux-scsi

On Sat, 2006-11-04 at 16:45 -0800, Luben Tuikov wrote:
> Re-based:
> 
> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>

It still won't apply ... this time it looks like a mailer tab->space
conversion problem.

James



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

* Re: [PATCH] SCSI/SD: clearer output of disk cache state
  2006-11-15 20:26     ` James Bottomley
@ 2006-11-15 20:47       ` Luben Tuikov
  0 siblings, 0 replies; 9+ messages in thread
From: Luben Tuikov @ 2006-11-15 20:47 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

--- James Bottomley <James.Bottomley@SteelEye.com> wrote:
> On Sat, 2006-11-04 at 16:45 -0800, Luben Tuikov wrote:
> > Re-based:
> > 
> > Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
> 
> It still won't apply ... this time it looks like a mailer tab->space
> conversion problem.

Attached.

    Luben

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>


[-- Attachment #2: 2974651858-sd.txt --]
[-- Type: text/plain, Size: 1007 bytes --]

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 84ff203..ffbd021 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1467,7 +1467,6 @@ sd_read_cache_type(struct scsi_disk *sdk
 	res = sd_do_mode_sense(sdp, dbd, modepage, buffer, len, &data, &sshdr);
 
 	if (scsi_status_is_good(res)) {
-		int ct = 0;
 		int offset = data.header_length + data.block_descriptor_length;
 
 		if (offset >= SD_BUF_SIZE - 2) {
@@ -1496,11 +1495,13 @@ sd_read_cache_type(struct scsi_disk *sdk
 			sdkp->DPOFUA = 0;
 		}
 
-		ct =  sdkp->RCD + 2*sdkp->WCE;
-
-		printk(KERN_NOTICE "SCSI device %s: drive cache: %s%s\n",
-		       diskname, sd_cache_types[ct],
-		       sdkp->DPOFUA ? " w/ FUA" : "");
+		printk(KERN_NOTICE "SCSI device %s: "
+		       "write cache: %s, read cache: %s, %s\n",
+		       diskname,
+		       sdkp->WCE ? "enabled" : "disabled",
+		       sdkp->RCD ? "disabled" : "enabled",
+		       sdkp->DPOFUA ? "supports DPO and FUA"
+		       : "doesn't support DPO or FUA");
 
 		return;
 	}

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

end of thread, other threads:[~2006-11-15 20:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04 19:54 [PATCH] SCSI/SD: clearer output of disk cache state Luben Tuikov
2006-11-04 20:13 ` Christoph Hellwig
2006-11-04 23:12 ` James Bottomley
2006-11-05  0:45   ` Luben Tuikov
2006-11-05  3:57     ` Jeff Garzik
2006-11-05  5:36     ` James Bottomley
2006-11-05 14:47     ` Douglas Gilbert
2006-11-15 20:26     ` James Bottomley
2006-11-15 20:47       ` Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).