Brett Russ | 1 Sep 2004 03:41

how to enable write back cache on SATA drive?

A coworker is trying to get this done to no avail.  He's tried hdparm, 
blktool, sginfo, and scsiinfo without luck--drives appear in write 
through cache mode and performance testing confirms.  I've not been 
directly involved but need to see progress.  I had the most hope for 
blktool but that failed with "BLKFLSBUF: Operation not supported"

Devices are Maxtor 250G connected to ICH6R in Enhanced non-AHCI mode 
using Garzik's 2.6.8.1 libata bk kernel tree (last sync'd ~20040820).

See results of some commands below...all snippets from emails to me.

===> blktool
linux:~/blktool-4 # ./blktool /dev/sda wcache on
   BLKFLSBUF: Operation not supported

===> scsiinfo
I can't seem to write the caching mode page back:

     # scsiinfo -cRX /dev/sda 1 1 0 0 0 0 0 0 0
     Unable to store Caching Page 08h
     18 00 00 00 18 00 00 00 70 00 05 00 00 00 00 06
     00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Thinking I was calling it incorrectly, I installed the xscsi rpm to use
the recommended scsi-config command, and that fails when it tries to
run this command:

     # /usr/bin/scsiinfo  -c -X -m /dev/sda
     Unable to read Caching Page 08h
(Continue reading)

Tomita, Haruo | 1 Sep 2004 04:57
Picon

RE: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)

Hi Jeff,

Sorry for not writing you soon.

Haruo> Combined mode can be set up by the SATA controller of ESB of Intel tip. 
Haruo> This mode is the mode which can use SATA and PATA simultaneously. 
Haruo> In ata_piix driver, when combined mode is specified, it does not work.

Jeff> May I request, again, information on this.  In the current kernel you 
Jeff> are the only one reporting this problem.
Jeff> Does 2.6.9-rc1-bk work for you?

2.6.9-rc1-bk7 has no problem. It is worked.
But, 2.4.28-pre2-bk1 is not work.
As 2.4.28-pre2-bk1, I created the patch for solving this problem. 
Is it right? The patch is as follows.

===== SATA combined mode patch for linux-2.4.28-pre2 =====

diff -urN linux-2.4.28-pre2-bk1orig/drivers/pci/quirks.c linux-2.4.28-pre2-bk1/drivers/pci/quirks.c
--- linux-2.4.28-pre2-bk1orig/drivers/pci/quirks.c	2004-08-31 15:11:08.000000000 +0900
+++ linux-2.4.28-pre2-bk1/drivers/pci/quirks.c	2004-09-01 09:33:11.000000000 +0900
 <at>  <at>  -719,6 +719,61  <at>  <at> 
 	}
 }

+#ifdef CONFIG_SCSI_SATA
+static void __init quirk_intel_ide_combined(struct pci_dev *pdev)
+{
+	u8 prog, comb, tmp;
(Continue reading)

Alan Cox | 1 Sep 2004 14:01
Picon

Re: IDE class driver with SATA controllers

On Maw, 2004-08-31 at 22:03, Andrew Chew wrote:
> In my perusal of the kernel code, I noticed that the IDE subsystem
> handles IDE controllers at legacy IO ports if no other driver claims
> them (albeit without DMA support).  I was wondering if it could be
> extended to support SATA controllers 
> that aren't mapped to legacy I/O ports.

Generally no. It depends how the SATA controller provides interfaces.
If it provides the standards based interface with BIOS configured DMA
and timings but has no other support then add it to pci/generic.c. If it
doesn't then it'll need a driver anyway.

Alan

Jeff Garzik | 1 Sep 2004 15:19
Picon
Favicon

Re: IDE class driver with SATA controllers

Andrew Chew wrote:
> The reason I'm asking is because it would seem like a good thing to have
> SATA controllers that are broadly compatible with IDE to be usable
> without having to modify the core kernel drivers.  This would at least
> allow a user to perform a Linux install on a SATA drive even if that
> kernel doesn't have explicit support for the SATA controller.  A
> kernel/driver update can then take place after the install.
> 
> Also, are there plans for libata to take over the IDE class driver
> functionality in the future?

Once ATAPI is complete, then I will green-light PATA support in libata.

Since libata already supports the standard bmdma stuff, and can even 
work in PIO-only mode without DMA (or even without interrupts, in 100% 
polling mode), it is definitely possible to drive the hardware.

If you want to play, and don't care about lack of ATAPI support (i.e. 
just disks), then it is possible today to do this.  #define 
ATA_FORCE_PIO and play away :)

With regards to libata being the default, making that an _option_ is 
feasible, but we will probably default to the IDE driver for quite some 
time.  There are issues of /dev/hda versus /dev/sda, keeping existing 
user setups working, etc.

	Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
(Continue reading)

Julien Oster | 1 Sep 2004 17:45

Re: IDE class driver with SATA controllers

Quoting Jeff Garzik <jgarzik <at> pobox.com>:

Hello Jeff,

> With regards to libata being the default, making that an _option_ is 
> feasible, but we will probably default to the IDE driver for quite some 
> time.  There are issues of /dev/hda versus /dev/sda, keeping existing 
> user setups working, etc.

once there is reasonable support to indeed use libata as default,
we could just wrap a pass through IDE driver around, which allocates the
major numbers for /dev/hd* and just feeds everything to libata. Or are the
semantics too different?

Regards,
Julien

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Andy Warner | 1 Sep 2004 22:08
Picon
Favicon

WARN_ON(buflen > PAGE_SIZE) libata-core.c

I'm working on a tree pulled directly from
bk://gkernel.bkbits.net/libata-2.6

In libata-core.c:ata_sg_init_one() there is:

	WARN_ON(buflen > PAGE_SIZE);

Which (unsurpsingly) triggers for all non-tiny
transfers (I'm using sg_utils to generate disk
traffic.)

It's obviously there for a reason, what would
I need to do to get past it. Give me some background
and maybe I can come up with a patch :)
--

-- 
andyw <at> pobox.com

Andy Warner		Voice: (612) 801-8549	Fax: (208) 575-5634
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

janitor | 2 Sep 2004 01:19
Picon

[patch 1/5] MIN/MAX in ide-timing.h


I replaced the custom MIN/MAX macros with the type safe min/max macros
from linux/kernel.h.

On Sat, Jul 10, 2004 at 04:03:37PM +0200, Vojtech Pavlik wrote:
> How about if you used the "min_t" and "max_t" macros inside FIT? That
> could help get rid of the casts completely (assuming the second and
> third parameters to FIT are expected to be constants).

Yes, that's better. It reduces the necessary changes to a minimum.

Signed-off-by: Maximilian Attems <janitor <at> sternwelten.at>

---

 linux-2.6.9-rc1-bk7-max/drivers/ide/ide-timing.h |   25 +++++++++++------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff -puN drivers/ide/ide-timing.h~min-max-ide_ide-timing.h drivers/ide/ide-timing.h
--- linux-2.6.9-rc1-bk7/drivers/ide/ide-timing.h~min-max-ide_ide-timing.h	2004-09-01
19:34:21.000000000 +0200
+++ linux-2.6.9-rc1-bk7-max/drivers/ide/ide-timing.h	2004-09-01 19:34:21.000000000 +0200
 <at>  <at>  -27,6 +27,7  <at>  <at> 
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
  */

+#include <linux/kernel.h>
 #include <linux/hdreg.h>

 #define XFER_PIO_5		0x0d
(Continue reading)

janitor | 2 Sep 2004 01:19
Picon

[patch 2/5] ide-cd: replace schedule_timeout() with msleep()


I would appreciate any comments from the janitor <at> sternweltens list. This is one (of
many) cases where I made a decision about replacing

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);

with

msleep(jiffies_to_msecs(some_time));

msleep() is not exactly the same as the previous code, but I only did
this replacement where I thought long delays were *desired*. If this is
not the case here, then just disregard this patch. I think in this case,
though, because of the while() loop, this was the desired effect.

Thanks,
Nish

Description: Replace cdrom_sleep() with msleep() and remove
cdrom_sleep() definition.

Signed-off-by: Nishanth Aravamudan <nacc <at> us.ibm.com>
Signed-off-by: Maximilian Attems <janitor <at> sternwelten.at>

---

 linux-2.6.9-rc1-bk7-max/drivers/ide/ide-cd.c |   15 +--------------
 1 files changed, 1 insertion(+), 14 deletions(-)

(Continue reading)

janitor | 2 Sep 2004 01:19
Picon

[patch 4/5] ide-tape: replace schedule_timeout() with msleep()


I would appreciate any comments from the janitor <at> sternweltens list. This is one (of
many) cases where I made a decision about replacing

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);

with

msleep(jiffies_to_msecs(some_time));

msleep() is not exactly the same as the previous code, but I only did
this replacement where I thought long delays were *desired*. If this is
not the case here, then just disregard this patch.

Thanks,
Nish

Description: Uses msleep() instead of schedule_timeout() to guarantee
the task delays at least the desired time amount.

Signed-off-by: Nishanth Aravamudan <nacc <at> us.ibm.com>
Signed-off-by: Maximilian Attems <janitor <at> sternwelten.at>

---

 linux-2.6.9-rc1-bk7-max/drivers/ide/ide-tape.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN drivers/ide/ide-tape.c~msleep-drivers_ide_ide-tape drivers/ide/ide-tape.c
(Continue reading)

janitor | 2 Sep 2004 01:19
Picon

[patch 3/5] ide-cd: replace schedule_timeout() with msleep()


I would appreciate any comments from the janitor <at> sternweltens list. This is one (of
many) cases where I made a decision about replacing

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);

with

msleep(jiffies_to_msecs(some_time));

msleep() is not exactly the same as the previous code, but I only did
this replacement where I thought long delays were *desired*. If this is
not the case here, then just disregard this patch. I think in this case,
though, because of the while() loop, this was the desired effect.

Thanks,
Nish

Description: Replace cdrom_sleep() with msleep() and remove
cdrom_sleep() definition.

Signed-off-by: Nishanth Aravamudan <nacc <at> us.ibm.com>
Signed-off-by: Maximilian Attems <janitor <at> sternwelten.at>

---

 linux-2.6.9-rc1-bk7-max/drivers/ide/ide-cd.c |   15 +--------------
 1 files changed, 1 insertion(+), 14 deletions(-)

(Continue reading)


Gmane