Skip to contentSkip to conversation

libata for SATA HDs.

DISCUSSION Mark Lord 4 participants 9 messages Aug 9, 2005 – Aug 10, 2005 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mark Lord

author
#1 lore raw
Quoted 4 lines · James Courtier-Dutton

Google did not help me.

Can I use the kernel libata and do commands like this now? :
hdparm -S60 /dev/sda

Yes, but only if you manually apply the "libata-passthru" patch.

The copy (below) works with 2.6.12, and I'm including it here for the benefit of the many who aren't yet ready to adopt a new religion (git) just for obtaining this vital functionality.

Cheers

drivers/scsi/libata.h +2 -1
diff -u --recursive --new-file --exclude='.*' linux-2.6.12/drivers/scsi/libata.h linux/drivers/scsi/libata.h
@@ -44,10 +44,11 @@
                            unsigned int wait, unsigned int can_sleep);
 extern void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf);
 extern void swap_buf_le16(u16 *buf, unsigned int buf_words);
+extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg);
+extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
 
 
 /* libata-scsi.c */
-extern void ata_to_sense_error(struct ata_queued_cmd *qc, u8 drv_stat);
 extern int ata_scsi_error(struct Scsi_Host *host);
 extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
 			       unsigned int buflen);
drivers/scsi/libata-scsi.c +546 -99

734 lines not on this page · raw message

include/scsi/scsi.h +3 -0
diff -u --recursive --new-file --exclude='.*' linux-2.6.12/include/scsi/scsi.h linux/include/scsi/scsi.h
@@ -113,6 +113,9 @@
 /* values for service action in */
 #define	SAI_READ_CAPACITY_16  0x10
 
+/* Values for T10/04-262r7 */
+#define	ATA_16		      0x85	/* 16-byte pass-thru */
+#define	ATA_12		      0xa1	/* 12-byte pass-thru */
 
 /*
  *  SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
#2 lore raw
Quoted 8 lines
Quoted 3 lines

Google did not help me.
Can I use the kernel libata and do commands like this now? :
hdparm -S60 /dev/sda

Yes, but only if you manually apply the "libata-passthru" patch.

The copy (below) works with 2.6.12, and I'm including it here for the benefit of the many who aren't yet ready to adopt a new religion (git) just for obtaining this vital functionality.

Right on the spot! Thanks!

#3 lore raw
In reply to Mark Lord
Quoted 8 lines · Mark Lord
Quoted 4 lines · James Courtier-Dutton

Google did not help me.

Can I use the kernel libata and do commands like this now? :
hdparm -S60 /dev/sda

Quoted 8 lines

Yes, but only if you manually apply the "libata-passthru" patch.

The copy (below) works with 2.6.12, and I'm including it here for the benefit of the many who aren't yet ready to adopt a new religion (git) just for obtaining this vital functionality.

Cheers

So, why hasn't that patch got into the kernel?

James

#4 lore raw
Quoted 11 lines · James Courtier-Dutton
Quoted 10 lines · Mark Lord
Quoted 4 lines · James Courtier-Dutton

Google did not help me.

Can I use the kernel libata and do commands like this now? :
hdparm -S60 /dev/sda

Yes, but only if you manually apply the "libata-passthru" patch.

Quoted 8 lines
Quoted 6 lines

The copy (below) works with 2.6.12, and I'm including it here for the benefit of the many who aren't yet ready to adopt a new religion (git) just for obtaining this vital functionality.

Cheers

So, why hasn't that patch got into the kernel?

Because there are several reports of it causing problems, when used on a loaded system.

Jeff

#5 lore raw
Quoted 22 lines · Jeff Garzik
Quoted 20 lines · James Courtier-Dutton
Quoted 17 lines · Mark Lord
Quoted 4 lines · James Courtier-Dutton

Google did not help me.

Can I use the kernel libata and do commands like this now? :
hdparm -S60 /dev/sda

Yes, but only if you manually apply the "libata-passthru" patch.

The copy (below) works with 2.6.12, and I'm including it here for the benefit of the many who aren't yet ready to adopt a new religion (git) just for obtaining this vital functionality.

Cheers

Quoted 8 lines
Quoted 1 line

So, why hasn't that patch got into the kernel?

Because there are several reports of it causing problems, when used on a loaded system.

Jeff

Jeff,

What sort of problems? Loss of data?
I don't really have the time to do a full restore cycle just to try libata.

James

author
#6 lore raw
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Yes, but only if you manually apply the "libata-passthru" patch.

So, why hasn't that patch got into the kernel?

Because there are several reports of it causing problems, when used on a loaded system.

Please post more information about these "problems".

I wonder if it might be another occurance of the libata eh lockups. Those are NOT unique to ATAPI -- the lockups can happen anytime the libata eh code is run, like on a busy RAID, or "loaded system" suffering failed "passthru" commands.

Perhaps kill a couple of birds with one stone, if we're lucky.

So far, the one-liner from Tejun Heo (below) is holding steady here, but it needs to soak for another day before I pronounce it "cured".

Cheers!

drivers/scsi/libata-scsi.c +1 -0
@@ -385,6 +385,7 @@ int ata_scsi_error(struct Scsi_Host *hos
         * appropriate place
         */
        host->host_failed--;
+       INIT_LIST_HEAD(&host->eh_cmd_q);
 
        DPRINTK("EXIT\n");
        return 0;
#7 lore raw
In reply to Mark Lord
Quoted 4 lines · Mark Lord
Quoted 2 lines

Can I use the kernel libata and do commands like this now? :
hdparm -S60 /dev/sda

Yes, but only if you manually apply the "libata-passthru" patch.

Hmmm, hdparm -S indeed works now, but smartctl doesn't work yet :-(. I was silently hoping that would start working as well.

author
#8 lore raw
Quoted 3 lines · Erik Slagter

Hmmm, hdparm -S indeed works now, but smartctl doesn't work yet :-(. I was silently hoping that would start working as well.

Smartctl wants the "-d ata" option set to speak to libata.

Cheers

#9 lore raw
Quoted 4 lines · Mark Lord
Quoted 2 lines

Hmmm, hdparm -S indeed works now, but smartctl doesn't work yet :-(. I was silently hoping that would start working as well.

Smartctl wants the "-d ata" option set to speak to libata.

Once again right on the spot! Thanks! Now I think about it, it seems logical...