Skip to contentSkip to conversation

libata-dev queue updated

SATA Jeff Garzik 8 participants 26 messages Jun 4, 2005 – Jun 23, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Several updates to the libata-dev.git repository. Some of the branches have been folded into a new upstream-2.6.13 branch, which holds several changes (see attached). Other branches were updated to the most recent kernel, which contained doc updates that caused some minor merge conflicts.

I haven't yet updated 'passthru' and 'chs-support' branches to the latest kernel.

Git Repository URL:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git

List of branches:

adma          chs-support  master    pdc2027x           sleeping-eh
adma-mwi      iomap        ncq       promise-sata-pata  upstream-2.6.13
atapi-enable  iomap-step1  passthru  sil24

The "sleeping-eh" branch will be going upstream via James B and the SCSI crew (sounds like a hiphop group, doesn't it?)

Jeff

Brad Campbell <[email protected]>:
libata basic detection and errata for PATA->SATA bridges

Jeff Garzik <[email protected]>:
[libata] ahci: finish ATAPI support (hopefully) [libata] ahci: minor PCI MSI cleanup
[libata] ahci: Update for recent ->host_stop() API change [libata ahci] support PCI MSI interrupt vector

Narendra Sankar <[email protected]>:
sata_svw: Add support for new device IDs

Tobias Lorenz <[email protected]>:
[libata sata_promise] pdc20619 (PATA) support

 drivers/scsi/ahci.c         |  100 +++++++++++++++++++++++++++++++++-----------
 drivers/scsi/libata-core.c  |   35 ++++++++++++++-
 drivers/scsi/sata_promise.c |   26 +++++++++++
 drivers/scsi/sata_svw.c     |   25 +++++++----
 include/linux/ata.h         |    1 
 include/linux/libata.h      |    1 
 6 files changed, 151 insertions(+), 37 deletions(-)
drivers/scsi/ahci.c +75 -25
@@ -39,7 +39,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME	"ahci"
-#define DRV_VERSION	"1.00"
+#define DRV_VERSION	"1.01"
 
 
 enum {
@@ -50,6 +50,7 @@ enum {
 	AHCI_CMD_SLOT_SZ	= 32 * 32,
 	AHCI_RX_FIS_SZ		= 256,
 	AHCI_CMD_TBL_HDR	= 0x80,
+	AHCI_CMD_TBL_CDB	= 0x40,
 	AHCI_CMD_TBL_SZ		= AHCI_CMD_TBL_HDR + (AHCI_MAX_SG * 16),
 	AHCI_PORT_PRIV_DMA_SZ	= AHCI_CMD_SLOT_SZ + AHCI_CMD_TBL_SZ +
 				  AHCI_RX_FIS_SZ,
@@ -134,6 +135,9 @@ enum {
 	PORT_CMD_ICC_ACTIVE	= (0x1 << 28), /* Put i/f in active state */
 	PORT_CMD_ICC_PARTIAL	= (0x2 << 28), /* Put i/f in partial state */
 	PORT_CMD_ICC_SLUMBER	= (0x6 << 28), /* Put i/f in slumber state */
+
+	/* hpriv->flags bits */
+	AHCI_FLAG_MSI		= (1 << 0),
 };
 
 struct ahci_cmd_hdr {
@@ -183,6 +187,7 @@ static void ahci_qc_prep(struct ata_queu
 static u8 ahci_check_status(struct ata_port *ap);
 static u8 ahci_check_err(struct ata_port *ap);
 static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
+static void ahci_remove_one (struct pci_dev *pdev);
 
 static Scsi_Host_Template ahci_sht = {
 	.module			= THIS_MODULE,
@@ -272,7 +277,7 @@ static struct pci_driver ahci_pci_driver
 	.name			= DRV_NAME,
 	.id_table		= ahci_pci_tbl,
 	.probe			= ahci_init_one,
-	.remove			= ata_pci_remove_one,
+	.remove			= ahci_remove_one,
 };
 
 
@@ -506,7 +511,8 @@ static void ahci_fill_sg(struct ata_queu
 
 static void ahci_qc_prep(struct ata_queued_cmd *qc)
 {
-	struct ahci_port_priv *pp = qc->ap->private_data;
+	struct ata_port *ap = qc->ap;
+	struct ahci_port_priv *pp = ap->private_data;
 	u32 opts;
 	const u32 cmd_fis_len = 5; /* five dwords */
 
@@ -518,18 +524,8 @@ static void ahci_qc_prep(struct ata_queu
 	opts = (qc->n_elem << 16) | cmd_fis_len;
 	if (qc->tf.flags & ATA_TFLAG_WRITE)
 		opts |= AHCI_CMD_WRITE;
-
-	switch (qc->tf.protocol) {
-	case ATA_PROT_ATAPI:
-	case ATA_PROT_ATAPI_NODATA:
-	case ATA_PROT_ATAPI_DMA:
+	if (is_atapi_taskfile(&qc->tf))
 		opts |= AHCI_CMD_ATAPI;
-		break;
-
-	default:
-		/* do nothing */
-		break;
-	}
 
 	pp->cmd_slot[0].opts = cpu_to_le32(opts);
 	pp->cmd_slot[0].status = 0;
@@ -541,6 +537,10 @@ static void ahci_qc_prep(struct ata_queu
 	 * a SATA Register - Host to Device command FIS.
 	 */
 	ata_tf_to_fis(&qc->tf, pp->cmd_tbl, 0);
+	if (opts & AHCI_CMD_ATAPI) {
+		memset(pp->cmd_tbl + AHCI_CMD_TBL_CDB, 0, 32);
+		memcpy(pp->cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, ap->cdb_len);
+	}
 
 	if (!(qc->flags & ATA_QCFLAG_DMAMAP))
 		return;
@@ -795,8 +795,6 @@ static int ahci_host_init(struct ata_pro
 				return rc;
 			}
 		}
-
-		hpriv->flags |= HOST_CAP_64;
 	} else {
 		rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
 		if (rc) {
@@ -879,15 +877,19 @@ static int ahci_host_init(struct ata_pro
 }
 
 /* move to PCI layer, integrate w/ MSI stuff */
-static void pci_enable_intx(struct pci_dev *pdev)
+static void pci_intx(struct pci_dev *pdev, int enable)
 {
-	u16 pci_command;
+	u16 pci_command, new;
 
 	pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
-	if (pci_command & PCI_COMMAND_INTX_DISABLE) {
-		pci_command &= ~PCI_COMMAND_INTX_DISABLE;
+
+	if (enable)
+		new = pci_command & ~PCI_COMMAND_INTX_DISABLE;
+	else
+		new = pci_command | PCI_COMMAND_INTX_DISABLE;
+
+	if (new != pci_command)
 		pci_write_config_word(pdev, PCI_COMMAND, pci_command);
-	}
 }
 
 static void ahci_print_info(struct ata_probe_ent *probe_ent)
@@ -969,7 +971,7 @@ static int ahci_init_one (struct pci_dev
 	unsigned long base;
 	void *mmio_base;
 	unsigned int board_idx = (unsigned int) ent->driver_data;
-	int pci_dev_busy = 0;
+	int have_msi, pci_dev_busy = 0;
 	int rc;
 
 	VPRINTK("ENTER\n");
@@ -987,12 +989,17 @@ static int ahci_init_one (struct pci_dev
 		goto err_out;
 	}
 
-	pci_enable_intx(pdev);
+	if (pci_enable_msi(pdev) == 0)
+		have_msi = 1;
+	else {
+		pci_intx(pdev, 1);
+		have_msi = 0;
+	}
 
 	probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
 	if (probe_ent == NULL) {
 		rc = -ENOMEM;
-		goto err_out_regions;
+		goto err_out_msi;
 	}
 
 	memset(probe_ent, 0, sizeof(*probe_ent));
@@ -1025,6 +1032,9 @@ static int ahci_init_one (struct pci_dev
 	probe_ent->mmio_base = mmio_base;
 	probe_ent->private_data = hpriv;
 
+	if (have_msi)
+		hpriv->flags |= AHCI_FLAG_MSI;
+
 	/* initialize adapter */
 	rc = ahci_host_init(probe_ent);
 	if (rc)
@@ -1044,7 +1054,11 @@ err_out_iounmap:
 	iounmap(mmio_base);
 err_out_free_ent:
 	kfree(probe_ent);
-err_out_regions:
+err_out_msi:
+	if (have_msi)
+		pci_disable_msi(pdev);
+	else
+		pci_intx(pdev, 0);
 	pci_release_regions(pdev);
 err_out:
 	if (!pci_dev_busy)
@@ -1052,6 +1066,42 @@ err_out:
 	return rc;
 }
 
+static void ahci_remove_one (struct pci_dev *pdev)
+{
+	struct device *dev = pci_dev_to_dev(pdev);
+	struct ata_host_set *host_set = dev_get_drvdata(dev);
+	struct ahci_host_priv *hpriv = host_set->private_data;
+	struct ata_port *ap;
+	unsigned int i;
+	int have_msi;
+
+	for (i = 0; i < host_set->n_ports; i++) {
+		ap = host_set->ports[i];
+
+		scsi_remove_host(ap->host);
+	}
+
+	have_msi = hpriv->flags & AHCI_FLAG_MSI;
+	free_irq(host_set->irq, host_set);
+
+	for (i = 0; i < host_set->n_ports; i++) {
+		ap = host_set->ports[i];
+
+		ata_scsi_release(ap->host);
+		scsi_host_put(ap->host);
+	}
+
+	host_set->ops->host_stop(host_set);
+	kfree(host_set);
+
+	if (have_msi)
+		pci_disable_msi(pdev);
+	else
+		pci_intx(pdev, 0);
+	pci_release_regions(pdev);
+	pci_disable_device(pdev);
+	dev_set_drvdata(dev, NULL);
+}
 
 static int __init ahci_init(void)
 {
drivers/scsi/libata-core.c +33 -2
@@ -1295,6 +1295,37 @@ err_out:
 	DPRINTK("EXIT, err\n");
 }
 
+
+static inline u8 ata_dev_knobble(struct ata_port *ap)
+{
+	return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id)));
+}
+
+/**
+ * 	ata_dev_config - Run device specific handlers and check for
+ * 			 SATA->PATA bridges
+ * 	@ap: Bus 
+ * 	@i:  Device
+ *
+ * 	LOCKING:
+ */
+ 
+void ata_dev_config(struct ata_port *ap, unsigned int i)
+{
+	/* limit bridge transfers to udma5, 200 sectors */
+	if (ata_dev_knobble(ap)) {
+		printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
+			ap->id, ap->device->devno);
+		ap->udma_mask &= ATA_UDMA5;
+		ap->host->max_sectors = ATA_MAX_SECTORS;
+		ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
+		ap->device->flags |= ATA_DFLAG_LOCK_SECTORS;
+	}
+
+	if (ap->ops->dev_config)
+		ap->ops->dev_config(ap, &ap->device[i]);
+}
+
 /**
  *	ata_bus_probe - Reset and probe ATA bus
  *	@ap: Bus to probe
@@ -1322,8 +1353,7 @@ static int ata_bus_probe(struct ata_port
 		ata_dev_identify(ap, i);
 		if (ata_dev_present(&ap->device[i])) {
 			found = 1;
-			if (ap->ops->dev_config)
-				ap->ops->dev_config(ap, &ap->device[i]);
+			ata_dev_config(ap,i);
 		}
 	}
 
@@ -4408,6 +4438,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_release);
 EXPORT_SYMBOL_GPL(ata_host_intr);
 EXPORT_SYMBOL_GPL(ata_dev_classify);
 EXPORT_SYMBOL_GPL(ata_dev_id_string);
+EXPORT_SYMBOL_GPL(ata_dev_config);
 EXPORT_SYMBOL_GPL(ata_scsi_simulate);
 
 #ifdef CONFIG_PCI
drivers/scsi/sata_promise.c +25 -1
@@ -59,6 +59,7 @@ enum {
 
 	board_2037x		= 0,	/* FastTrak S150 TX2plus */
 	board_20319		= 1,	/* FastTrak S150 TX4 */
+	board_20619		= 2,	/* FastTrak TX4000 */
 
 	PDC_HAS_PATA		= (1 << 1), /* PDC20375 has PATA */
 
@@ -147,6 +148,17 @@ static struct ata_port_info pdc_port_inf
 		.udma_mask	= 0x7f, /* udma0-6 ; FIXME */
 		.port_ops	= &pdc_ata_ops,
 	},
+
+	/* board_20619 */
+	{
+		.sht		= &pdc_ata_sht,
+		.host_flags	= ATA_FLAG_NO_LEGACY | ATA_FLAG_SRST |
+				  ATA_FLAG_MMIO | ATA_FLAG_SLAVE_POSS,
+		.pio_mask	= 0x1f, /* pio0-4 */
+		.mwdma_mask	= 0x07, /* mwdma0-2 */
+		.udma_mask	= 0x7f, /* udma0-6 ; FIXME */
+		.port_ops	= &pdc_ata_ops,
+	},
 };
 
 static struct pci_device_id pdc_ata_pci_tbl[] = {
@@ -172,6 +184,9 @@ static struct pci_device_id pdc_ata_pci_
 	{ PCI_VENDOR_ID_PROMISE, 0x3d18, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 	  board_20319 },
 
+	{ PCI_VENDOR_ID_PROMISE, 0x6629, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+	  board_20619 },
+
 	{ }	/* terminate list */
 };
 
@@ -636,6 +651,15 @@ static int pdc_ata_init_one (struct pci_
 	case board_2037x:
        		probe_ent->n_ports = 2;
 		break;
+	case board_20619:
+		probe_ent->n_ports = 4;
+
+		pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
+		pdc_ata_setup_port(&probe_ent->port[3], base + 0x380);
+
+		probe_ent->port[2].scr_addr = base + 0x600;
+		probe_ent->port[3].scr_addr = base + 0x700;
+                break;
 	default:
 		BUG();
 		break;
@@ -676,7 +700,7 @@ static void __exit pdc_ata_exit(void)
 
 
 MODULE_AUTHOR("Jeff Garzik");
-MODULE_DESCRIPTION("Promise SATA TX2/TX4 low-level driver");
+MODULE_DESCRIPTION("Promise ATA TX2/TX4/TX4000 low-level driver");
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, pdc_ata_pci_tbl);
 MODULE_VERSION(DRV_VERSION);
drivers/scsi/sata_svw.c +16 -9
@@ -344,6 +344,7 @@ static int k2_sata_init_one (struct pci_
 	void *mmio_base;
 	int pci_dev_busy = 0;
 	int rc;
+	int i;
 
 	if (!printed_version++)
 		printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
@@ -421,11 +422,11 @@ static int k2_sata_init_one (struct pci_
 	probe_ent->mwdma_mask = 0x7;
 	probe_ent->udma_mask = 0x7f;
 
-	/* We have 4 ports per PCI function */
-	k2_sata_setup_port(&probe_ent->port[0], base + 0 * K2_SATA_PORT_OFFSET);
-	k2_sata_setup_port(&probe_ent->port[1], base + 1 * K2_SATA_PORT_OFFSET);
-	k2_sata_setup_port(&probe_ent->port[2], base + 2 * K2_SATA_PORT_OFFSET);
-	k2_sata_setup_port(&probe_ent->port[3], base + 3 * K2_SATA_PORT_OFFSET);
+	/* different controllers have different number of ports - currently 4 or 8 */
+	/* All ports are on the same function. Multi-function device is no
+	 * longer available. This should not be seen in any system. */
+	for (i = 0; i < ent->driver_data; i++)
+		k2_sata_setup_port(&probe_ent->port[i], base + i * K2_SATA_PORT_OFFSET);
 
 	pci_set_master(pdev);
 
@@ -445,11 +446,17 @@ err_out:
 	return rc;
 }
 
-
+/* 0x240 is device ID for Apple K2 device
+ * 0x241 is device ID for Serverworks Frodo4
+ * 0x242 is device ID for Serverworks Frodo8
+ * 0x24a is device ID for BCM5785 (aka HT1000) HT southbridge integrated SATA
+ * controller
+ * */
 static struct pci_device_id k2_sata_pci_tbl[] = {
-	{ 0x1166, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1166, 0x0241, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1166, 0x0242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ 0x1166, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
+	{ 0x1166, 0x0241, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
+	{ 0x1166, 0x0242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 },
+	{ 0x1166, 0x024a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
 	{ }
 };
 
include/linux/ata.h +1 -0
@@ -224,6 +224,7 @@ struct ata_taskfile {
 };
 
 #define ata_id_is_ata(id)	(((id)[0] & (1 << 15)) == 0)
+#define ata_id_is_sata(id)	((id)[93] == 0)
 #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
 #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
 #define ata_id_has_flush(id) ((id)[83] & (1 << 12))
include/linux/libata.h +1 -0
@@ -421,6 +421,7 @@ extern void ata_sg_init(struct ata_queue
 extern unsigned int ata_dev_classify(struct ata_taskfile *tf);
 extern void ata_dev_id_string(u16 *id, unsigned char *s,
 			      unsigned int ofs, unsigned int len);
+extern void ata_dev_config(struct ata_port *ap, unsigned int i);
 extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
 extern void ata_bmdma_start (struct ata_queued_cmd *qc);
 extern void ata_bmdma_stop(struct ata_port *ap);
#1 lore raw
Quoted 8 lines · Jeff Garzik

Several updates to the libata-dev.git repository. Some of the branches have been folded into a new upstream-2.6.13 branch, which holds several changes (see attached). Other branches were updated to the most recent kernel, which contained doc updates that caused some minor merge conflicts.

I haven't yet updated 'passthru' and 'chs-support' branches to the latest kernel.

Quoted 7 lines

Git Repository URL:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git

List of branches:

adma          chs-support  master    pdc2027x           sleeping-eh
adma-mwi      iomap        ncq       promise-sata-pata  upstream-2.6.13
atapi-enable  iomap-step1  passthru  sil24

Are there diffs downloadable for these? In particular I'm looking for passthru. I'm imagining that with passthru SMART works?

Signature · 1 line
greg
#2 lore raw
Quoted 14 lines · Greg Stark
Quoted 11 lines · Jeff Garzik

Several updates to the libata-dev.git repository. Some of the branches have been folded into a new upstream-2.6.13 branch, which holds several changes (see attached). Other branches were updated to the most recent kernel, which contained doc updates that caused some minor merge conflicts.

I haven't yet updated 'passthru' and 'chs-support' branches to the latest kernel.

Git Repository URL:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git

Quoted 8 lines
Quoted 4 lines

List of branches:

adma          chs-support  master    pdc2027x           sleeping-eh
adma-mwi      iomap        ncq       promise-sata-pata  upstream-2.6.13
atapi-enable  iomap-step1  passthru  sil24

Are there diffs downloadable for these? In particular I'm looking for passthru. I'm imagining that with passthru SMART works?

You'll need to generate the diffs yourself, I'm afraid.

Jeff

#3 lore raw
Quoted 23 lines · Jeff Garzik
Quoted 22 lines · Greg Stark
Quoted 17 lines · Jeff Garzik

Several updates to the libata-dev.git repository. Some of the branches have
been folded into a new upstream-2.6.13 branch, which holds several changes (see
attached). Other branches were updated to the most recent kernel, which contained doc updates that caused some minor merge conflicts.

I haven't yet updated 'passthru' and 'chs-support' branches to the latest kernel.

Git Repository URL:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git

List of branches:

adma          chs-support  master    pdc2027x           sleeping-eh
adma-mwi      iomap        ncq       promise-sata-pata  upstream-2.6.13
atapi-enable  iomap-step1  passthru  sil24
Quoted 4 lines
Quoted 2 lines

Are there diffs downloadable for these? In particular I'm looking for passthru. I'm imagining that with passthru SMART works?

You'll need to generate the diffs yourself, I'm afraid.

I haven't tried git, but is there really no way to tell git to do "For every branch, generate a diff against Linus' tree" ?

This together with making them available at some URL would make life easier for some people.

Quoted 1 line

Jeff

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw
Quoted 25 lines · Adrian Bunk
Quoted 23 lines · Jeff Garzik
Quoted 21 lines · Greg Stark
Quoted 15 lines · Jeff Garzik

Several updates to the libata-dev.git repository. Some of the branches have been folded into a new upstream-2.6.13 branch, which holds several changes (see attached). Other branches were updated to the most recent kernel, which contained doc updates that caused some minor merge conflicts.

I haven't yet updated 'passthru' and 'chs-support' branches to the latest kernel.

Git Repository URL:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git

List of branches:

adma          chs-support  master    pdc2027x           sleeping-eh
adma-mwi      iomap        ncq       promise-sata-pata  upstream-2.6.13
atapi-enable  iomap-step1  passthru  sil24
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Are there diffs downloadable for these? In particular I'm looking for passthru. I'm imagining that with passthru SMART works?

You'll need to generate the diffs yourself, I'm afraid.

I haven't tried git, but is there really no way to tell git to do "For every branch, generate a diff against Linus' tree" ?

for branch in .git/refs/heads/*
do

	...

done

Quoted 1 line

This together with making them available at some URL would make life easier for some people.

And you, or anyone else, is welcome to take on this past and create a website that auto-posts patches for trees.

All my development is in public; all the data is there for anyone who wishes to use it.

Jeff

#5 lore raw
Quoted 2 lines · Jeff Garzik

All my development is in public; all the data is there for anyone who wishes to use it.

That is cool. And it's nice that there seems to have been an upsurge in the quantity of communication from you and other libata developers on this list too.

I expect if git catches on then it would be about as effective as most projects which publish their CVS tree and expect people to be able to do checkouts from there. Currently, though, approximately nobody has git tools or any idea how to use it.

So my question is, if I did tackle this riddle trail and figured out how to fetch the passthru branch against 2.6.12, what would it buy me? Would SMART just start working? Or would it just confuse the SMART tools until they're updated? Or would it just crash my machine?

Signature · 1 line
greg
#6 lore raw
Quoted 4 lines · Greg Stark

So my question is, if I did tackle this riddle trail and figured out how to fetch the passthru branch against 2.6.12, what would it buy me? Would SMART just start working? Or would it just confuse the SMART tools until they're updated? Or would it just crash my machine?

SMART should just start working. It adds the ioctls that existing smartd and hdparm already know about.

The two reasons why passthru is not upstream are:

* I need to make sure that it is 100% up-to-date for the latest ATA passthru spec, which clarified some SCSI CDB and descriptor codes.

* There was at least one report of ATA passthru use causing a device under load to start timing out, which could possibly indicate a driver bug. I need to do a serious analysis and final review of the patch, to make sure that it is plugged into the ATA host state machine at the correct places.

Jeff

#7 lore raw
Quoted 8 lines · Jeff Garzik
Quoted 4 lines · Greg Stark

So my question is, if I did tackle this riddle trail and figured out how to fetch the passthru branch against 2.6.12, what would it buy me? Would SMART just start working? Or would it just confuse the SMART tools until they're updated? Or would it just crash my machine?

SMART should just start working. It adds the ioctls that existing smartd and hdparm already know about.

So, uh, where do I get git? Where is your "git repository" and Linus' "git repository" and how do I set that up?

Or, at least, where do I find all this info?

I take it it's not this:

Package: git
Priority: optional
Section: utils
Installed-Size: 919
Maintainer: Ian Beckwith <[email protected]>
Architecture: i386
Version: 4.3.20-7
Depends: libc6 (>= 2.3.2.ds1-4), libncurses5 (>= 5.4-1), libreadline4 (>= 4.3-1)
Filename: pool/main/g/git/git_4.3.20-7_i386.deb
Size: 261822
MD5sum: a708688e17259ed1e99d2828e1acb3f6
Description: GNU Interactive Tools, a file browser/viewer and process viewer/killer
git (GNU Interactive Tools) is a set of interactive text-mode tools, closely integrated with the shell. It contains an extensible file system browser, an ascii/hex file viewer, a process viewer/killer and some other related utilities and shell scripts. It can be used to increase the speed and efficiency of most of the daily tasks such as copying and moving files and directories, invoking editors, compressing and uncompressing files, creating and expanding archives, compiling programs, sending mail, etc. It looks nice, has colors (if the standard ANSI color sequences are supported) and is user-friendly. .
One of the main advantages of Git is its flexibility. It is not limited to a given set of commands. The configuration file can be easily enhanced, allowing the user to add new commands or file operations, depending on its needs or preferences.

Signature · 1 line
greg
#9 lore raw
Quoted 5 lines · Jeff Garzik
Quoted 2 lines · Greg Stark

So, uh, where do I get git? Where is your "git repository" and Linus' "git repository" and how do I set that up?

http://lkml.org/lkml/2005/5/26/11

Ah, very nice. Thank you.

Signature · 1 line
greg
#10 lore raw
In reply to Jeff Garzik
Quoted 7 lines · Jeff Garzik
Quoted 1 line · Greg Stark

So, uh, where do I get git? Where is your "git repository" and Linus' "git repository" and how do I set that up?

http://lkml.org/lkml/2005/5/26/11

Jeff

Okay, so now I have two separate git repositories, one for Linus's tree (currently at 2.6.12), and another that is Jeff's libata-dev bundle of goodies.

But I have no idea whatsoever what to do next.

What I *want*, is the patchset for "passthru", so that I can apply those patches to 2.6.12 and then test that kernel.

But it is nowhere even remotely close to possibly perhaps someday eventually maybe suggestively obvious how to do that.

Anyone care to volunteer the info? Jeff?

Thanks

#11 lore raw
Quoted 16 lines · Mark Lord
Quoted 8 lines · Jeff Garzik
Quoted 1 line · Greg Stark

So, uh, where do I get git? Where is your "git repository" and Linus' "git repository" and how do I set that up?

http://lkml.org/lkml/2005/5/26/11

Jeff

Okay, so now I have two separate git repositories, one for Linus's tree (currently at 2.6.12), and another that is Jeff's libata-dev bundle of goodies.

Quoted 8 lines

But I have no idea whatsoever what to do next.

What I *want*, is the patchset for "passthru", so that I can apply those patches to 2.6.12 and then test that kernel.

But it is nowhere even remotely close to possibly perhaps someday eventually maybe suggestively obvious how to do that.

Boy that's an unparseable sentence, if I ever saw one :)

You can obtain a patch from the 'passthru' branch by doing

git checkout -f passthru
git-diff-tree -p master HEAD > /tmp/patch

or simply by downloading what I just uploaded a few minutes ago,

http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/2.6.12-git4-passthru1.patch.bz2

#12 lore raw
Quoted 7 lines · Jeff Garzik

You can obtain a patch from the 'passthru' branch by doing

git checkout -f passthru
git-diff-tree -p master HEAD > /tmp/patch

or simply by downloading what I just uploaded a few minutes ago

Great, it works now! I had actually stumbled across a similar recipe on my own, but prior to your very recent update of libata-dev.git it gave me a huge unruly diff that didn't look right.

Now, though, the recipe above gives me exactly the same patch that you posted, thanks!

Now if only the same were possible for atapi-enable, though I suspect that branch is simply a one-liner to libata.h.

Do you have the suspend/resume stuff (Jens A.) in a tree some place?

Thanks Jeff!

#13 lore raw
In reply to Greg Stark
Quoted 8 lines · Greg Stark
Quoted 6 lines · Jeff Garzik
Quoted 4 lines · Greg Stark

So my question is, if I did tackle this riddle trail and figured out how to fetch the passthru branch against 2.6.12, what would it buy me? Would SMART just start working? Or would it just confuse the SMART tools until they're updated? Or would it just crash my machine?

Quoted 9 lines
Quoted 2 lines

SMART should just start working. It adds the ioctls that existing smartd and hdparm already know about.

So, uh, where do I get git? Where is your "git repository" and Linus' "git repository" and how do I set that up?

Or, at least, where do I find all this info?

Your best bet is probably to read Jeff's short git how-to at
http://kerneltrap.org/node/5196 and just about every other LKML-oriented site. Hopefully that gives you a good start.

Drew

#14 lore raw
In reply to Greg Stark
Quoted 8 lines · Greg Stark

So, uh, where do I get git? Where is your "git repository" and Linus' "git repository" and how do I set that up?

Or, at least, where do I find all this info?

I take it it's not this:

No, but there is a cogito package in sid that includes the git tools.

Quoted 19 lines

Package: git
Priority: optional
Section: utils
Installed-Size: 919
Maintainer: Ian Beckwith <[email protected]>
Architecture: i386
Version: 4.3.20-7
Depends: libc6 (>= 2.3.2.ds1-4), libncurses5 (>= 5.4-1), libreadline4 (>= 4.3-1)
Filename: pool/main/g/git/git_4.3.20-7_i386.deb
Size: 261822
MD5sum: a708688e17259ed1e99d2828e1acb3f6
Description: GNU Interactive Tools, a file browser/viewer and process viewer/killer
git (GNU Interactive Tools) is a set of interactive text-mode tools, closely integrated with the shell. It contains an extensible file system browser, an ascii/hex file viewer, a process viewer/killer and some other related utilities and shell scripts. It can be used to increase the speed and efficiency of most of the daily tasks such as copying and moving files and directories, invoking editors,

Quoted 12 lines

compressing and uncompressing files, creating and expanding archives, compiling programs, sending mail, etc. It looks nice, has colors (if the standard ANSI color sequences are supported) and is user-friendly. .
One of the main advantages of Git is its flexibility. It is not limited to a given set of commands. The configuration file can be easily enhanced, allowing the user to add new commands or file operations, depending on its needs or preferences.

Signature · 1 line
greg

Jim.

#15 lore raw
In reply to Greg Stark
Quoted 3 lines · Greg Stark

Are there diffs downloadable for these? In particular I'm looking for passthru. I'm imagining that with passthru SMART works?

SMART works already using the HDIO_* ioctls in libata-dev (these may be built on top of the passthru stuff.. dunno).

Eg. smartctl -data -a /dev/sda

Cheers

#16 lore raw
Quoted 9 lines · Mark Lord
Quoted 3 lines · Greg Stark

Are there diffs downloadable for these? In particular I'm looking for passthru. I'm imagining that with passthru SMART works?

SMART works already using the HDIO_* ioctls in libata-dev (these may be built on top of the passthru stuff.. dunno).

Eg. smartctl -data -a /dev/sda

Uh, this is 2.6.12-rc4 with the latest libata-dev patch from Garzik's web site:

bash-3.00$ smartctl -data -a /dev/sda smartctl version 5.32 Copyright (C) 2002-4 Bruce Allen Home page is http://smartmontools.sourceforge.net/

Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

Signature · 1 line
greg
#17 lore raw
Quoted 9 lines · Greg Stark
Quoted 1 line · Mark Lord

Eg. smartctl -data -a /dev/sda

Uh, this is 2.6.12-rc4 with the latest libata-dev patch from Garzik's web site:

bash-3.00$ smartctl -data -a /dev/sda

smartctl -d ata -a /dev/sda

Regards,
Brad

Signature · 3 lines
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams
#18 lore raw
Quoted 6 lines · Brad Campbell
Quoted 5 lines · Greg Stark

Uh, this is 2.6.12-rc4 with the latest libata-dev patch from Garzik's web site:

bash-3.00$ smartctl -data -a /dev/sda
Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

That's weird. So, is your /dev/sda a (S)ATA drive?
I haven't tried it on 2.6.12-rc* (breaks VMware for me+ libata-dev), but it does work fine for 2.6.11 + libata-dev on my PATA drive.

Maybe there's something screwy with true SATA drives and libata (doubtful)?

I also have "smartctl -data" working with SATA drives through the qstor driver (the non-libata version) without any issues, so we know the drives themselves are happy with it.

Quoted 1 line

smartctl -d ata -a /dev/sda

Same thing as "-data". Either works.

#19 lore raw
Quoted 4 lines · Mark Lord

Brad Campbell wrote:

That's weird. So, is your /dev/sda a (S)ATA drive?

Yep.. I have 28 Maxtor Maxline-II drives on Promise SATA150TX4's They all show up under /dev/scsi/host??

Quoted 2 lines

Maybe there's something screwy with true SATA drives and libata (doubtful)?

Not that I know of.. it has been working great here for months now.. (bar the odd oops)

Quoted 8 lines

I also have "smartctl -data" working with SATA drives through the qstor driver (the non-libata version) without any issues, so we know the drives themselves are happy with it.

Quoted 1 line

smartctl -d ata -a /dev/sda

Same thing as "-data". Either works.

So it does..

I'm still using a 2.6.10-bk10 kernel here with the libata-dev patches and some minor md patches.. It's stable unless one of the drives throws an error, whereapon libata oops and stops talking to the other drives (and then it gets really messy).. Have not had time to reproduce/upgrade to see if it's fixed though.

Regards,
Brad

Signature · 3 lines
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams
#20 lore raw
In reply to Greg Stark
Quoted 8 lines · Greg Stark

Uh, this is 2.6.12-rc4 with the latest libata-dev patch from Garzik's web site:

bash-3.00$ smartctl -data -a /dev/sda smartctl version 5.32 Copyright (C) 2002-4 Bruce Allen Home page is http://smartmontools.sourceforge.net/

Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

Oh, wait a sec -- Jeff just posted that he's nuked the "read identity" ioctl(), so I suppose that has now broken smartmontools compatibility.

So Linux either goes without S.M.A.R.T. for SATA (again), or Jeff puts it back, or smartmontools gets upgraded Real Soon Now.

Cheers

#21 lore raw
Quoted 10 lines · Mark Lord
Quoted 6 lines · Greg Stark

Uh, this is 2.6.12-rc4 with the latest libata-dev patch from Garzik's web site:
bash-3.00$ smartctl -data -a /dev/sda
smartctl version 5.32 Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

Oh, wait a sec -- Jeff just posted that he's nuked the "read identity" ioctl(), so I suppose that has now broken smartmontools compatibility.

I think this libata-dev patch was prior to that announcement.

It's 2.6.11-bk6-libata-dev1.patch which I appear to have downloaded May 15th. (Sorry I guess "latest" wasn't very precise)

Quoted 2 lines

So Linux either goes without S.M.A.R.T. for SATA (again), or Jeff puts it back, or smartmontools gets upgraded Real Soon Now.

:(

What I really want to get working is actually hddtemp which uses SMART just to get the temperature:

bash-3.00$ hddtemp /dev/hda
/dev/hda: MAXTOR 6L080J4: 50 C
bash-3.00$ hddtemp /dev/sda
/dev/sda: Maxtor 7Y250M0 YAR5: drive is sleeping
bash-3.00$ hddtemp /dev/sdb
/dev/sdb: Maxtor 6Y120M0 YAR5: drive is sleeping

The two M0 drives are SATA drives and they certainly are not sleeping. Come to think of it that's awfully hot for the PATA drive. I think I'll put it to sleep for a while.

Signature · 1 line
greg
#22 lore raw
Quoted 3 lines · Greg Stark

It's 2.6.11-bk6-libata-dev1.patch which I appear to have downloaded May 15th. (Sorry I guess "latest" wasn't very precise)

Mmm.. the relevant ioctl's look identical to the 02-Mar-2005 libata-dev1.patch that I am using here, so if that is what you really are using, then smartctl should be working.

???

#23 lore raw
In reply to Greg Stark
Quoted 2 lines · Greg Stark

Uh, this is 2.6.12-rc4 with the latest libata-dev patch from Garzik's web site:

Where did you get "the latest libata-dev patch" from?

I don't see anything for 2.6.12 on Jeff's web directory, just a bunch of older 2.6.11 patches instead.

Sure, I (and everyone else on the planet) could do the 15-gadzillion steps to download and install the piecemeal git stuff, but that shouldn't be necessary for non-developers to do.

Is there a cumulative libata-dev patch for 2.6.12 available somewhere?

Cheers

#24 lore raw
Quoted 6 lines · Mark Lord

Sure, I (and everyone else on the planet) could do the 15-gadzillion steps to download and install the piecemeal git stuff, but that shouldn't be necessary for non-developers to do.

Is there a cumulative libata-dev patch for 2.6.12 available somewhere?

yes please, provide such patch. i'd like to try it but given the burden of git i continue to postpone all the required work. BTW, is it in 2.6.12-rc6? will it be in 2.6.12? many thanks.

cheers
domenico

-----[ Domenico Andreoli, aka cavok
--[ http://people.debian.org/~cavok/gpgkey.asc
---[ 3A0F 2F80 F79C 678A 8936 4FEE 0677 9033 A20E BC50

#25 lore raw
In reply to Mark Lord
Quoted 1 line · Mark Lord

Is there a cumulative libata-dev patch for 2.6.12 available somewhere?

Nope; somebody needs to be script that...

Jeff