Skip to contentSkip to conversation

libata fixes

PATCH In review Jeff Garzik 2 participants 2 messages May 25, 2007 – May 31, 2007

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

PATCH 1/1 libata fixes

And a few trivial documentation patches.

Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus

to receive the following updates:

 drivers/ata/libata-scsi.c  |    5 ++-
 drivers/ata/pata_artop.c   |    2 +-
 drivers/ata/pata_hpt37x.c  |   27 ++++++++++---------------
 drivers/ata/pata_it821x.c  |    3 +-
 drivers/ata/pata_scc.c     |   46 ++++++++++++++++++++++++++-----------------
 drivers/ata/pata_via.c     |    9 ++++---
 drivers/ata/sata_mv.c      |   44 ++++++++++++++++++++++++++++++++++++++++++
 drivers/ata/sata_promise.c |    2 +-
 drivers/ata/sata_sis.c     |    2 +-
 drivers/ata/sata_via.c     |    3 ++
 10 files changed, 98 insertions(+), 45 deletions(-)

Alan Cox (2):
pata: Trivia
pata_hpt37x: Further improvements based on the IDE updates and vendor drivers

Jeff Garzik (4):
[libata] sata_promise: fix flags typo
[libata] sata_mv: add TODO list
[libata] Fix decoding of 6-byte commands
[libata] sata_via, pata_via: Add PCI IDs.

Tony Breeds (1):
Fix build failure for drivers/ata/pata_scc.c

Uwe Koziolek (1):
libata: sata_sis fixes

drivers/ata/libata-scsi.c +3 -2
index 242c43e..b3900cf 100644
@@ -1050,14 +1050,15 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc)
 static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen)
 {
 	u64 lba = 0;
-	u32 len = 0;
+	u32 len;
 
 	VPRINTK("six-byte command\n");
 
+	lba |= ((u64)(cdb[1] & 0x1f)) << 16;
 	lba |= ((u64)cdb[2]) << 8;
 	lba |= ((u64)cdb[3]);
 
-	len |= ((u32)cdb[4]);
+	len = cdb[4];
 
 	*plba = lba;
 	*plen = len;
drivers/ata/pata_artop.c +1 -1
index 7b4810c..03b6ddd 100644
@@ -97,7 +97,7 @@ static int artop6260_pre_reset(struct ata_port *ap, unsigned long deadline)
  *	artop6260_cable_detect	-	identify cable type
  *	@ap: Port
  *
- *	Identify the cable type for the ARTOp interface in question
+ *	Identify the cable type for the ARTOP interface in question
  */
 
 static int artop6260_cable_detect(struct ata_port *ap)
drivers/ata/pata_hpt37x.c +11 -16
index a54c174..6446735 100644
@@ -26,7 +26,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME	"pata_hpt37x"
-#define DRV_VERSION	"0.6.5"
+#define DRV_VERSION	"0.6.6"
 
 struct hpt_clock {
 	u8	xfer_speed;
@@ -931,15 +931,6 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 		.udma_mask = 0x7f,
 		.port_ops = &hpt372_port_ops
 	};
-	/* HPT371, 372 and friends - UDMA100 at 50MHz clock */
-	static const struct ata_port_info info_hpt372_50 = {
-		.sht = &hpt37x_sht,
-		.flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
-		.pio_mask = 0x1f,
-		.mwdma_mask = 0x07,
-		.udma_mask = 0x3f,
-		.port_ops = &hpt372_port_ops
-	};
 	/* HPT374 - UDMA133 */
 	static const struct ata_port_info info_hpt374 = {
 		.sht = &hpt37x_sht,
@@ -1098,17 +1089,21 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 		 *	use a 50MHz DPLL by choice
 		 */
 		unsigned int f_low, f_high;
-		int adjust;
+		int dpll, adjust;
 
-		clock_slot = 2;
+		/* Compute DPLL */
+		dpll = 2;
 		if (port->udma_mask & 0xE0)
-			clock_slot = 3;
+			dpll = 3;
 
-		f_low = (MHz[clock_slot] * chip_table->base) / 192;
+		f_low = (MHz[clock_slot] * 48) / MHz[dpll];
 		f_high = f_low + 2;
+		if (clock_slot > 1)
+			f_high += 2;
 
 		/* Select the DPLL clock. */
 		pci_write_config_byte(dev, 0x5b, 0x21);
+		pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
 
 		for(adjust = 0; adjust < 8; adjust++) {
 			if (hpt37x_calibrate_dpll(dev))
@@ -1124,12 +1119,12 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 			printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n");
 			return -ENODEV;
 		}
-		if (clock_slot == 3)
+		if (dpll == 3)
 			private_data = (void *)hpt37x_timings_66;
 		else
 			private_data = (void *)hpt37x_timings_50;
 
-		printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[clock_slot]);
+		printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]);
 	} else {
 		private_data = (void *)chip_table->clocks[clock_slot];
 		/*
drivers/ata/pata_it821x.c +1 -2
index ff9a6fd..b3456d7 100644
@@ -1,5 +1,5 @@
 /*
- * ata-it821x.c 	- IT821x PATA for new ATA layer
+ * pata_it821x.c 	- IT821x PATA for new ATA layer
  *			  (C) 2005 Red Hat Inc
  *			  Alan Cox <[email protected]>
  *
@@ -65,7 +65,6 @@
  *
  *  TODO
  *	-	ATAPI and other speed filtering
- *	-	Command filter in smart mode
  *	-	RAID configuration ioctls
  */
 
drivers/ata/pata_scc.c +28 -18

123 lines not on this page · raw message

drivers/ata/pata_via.c +5 -4
index 708dfc0..a8462f1 100644
@@ -621,10 +621,11 @@ static int via_reinit_one(struct pci_dev *pdev)
 #endif
 
 static const struct pci_device_id via[] = {
-	{ PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), },
-	{ PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C586_1), },
-	{ PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_6410), },
-	{ PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_SATA_EIDE), },
+	{ PCI_VDEVICE(VIA, 0x0571), },
+	{ PCI_VDEVICE(VIA, 0x0581), },
+	{ PCI_VDEVICE(VIA, 0x1571), },
+	{ PCI_VDEVICE(VIA, 0x3164), },
+	{ PCI_VDEVICE(VIA, 0x5324), },
 
 	{ },
 };
drivers/ata/sata_mv.c +44 -0

50 lines not on this page · raw message

drivers/ata/sata_promise.c +1 -1
index 3a7d9b5..2b924a6 100644
@@ -297,7 +297,7 @@ static const struct ata_port_info pdc_port_info[] = {
 
 	/* board_2057x_pata */
 	{
-		.flags		= PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS,
+		.flags		= PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS |
 				  PDC_FLAG_GEN_II,
 		.pio_mask	= 0x1f, /* pio0-4 */
 		.mwdma_mask	= 0x07, /* mwdma0-2 */
drivers/ata/sata_sis.c +1 -1
index 51d9251..221099d 100644
@@ -255,7 +255,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int printed_version;
 	struct ata_port_info pi = sis_port_info;
-	const struct ata_port_info *ppi[] = { &pi, NULL };
+	const struct ata_port_info *ppi[] = { &pi, &pi };
 	struct ata_host *host;
 	u32 genctl, val;
 	u8 pmr;
drivers/ata/sata_via.c +3 -0
index 01bba26..e8b90e7 100644
@@ -85,6 +85,9 @@ static const struct pci_device_id svia_pci_tbl[] = {
 	{ PCI_VDEVICE(VIA, 0x0591), vt6420 },
 	{ PCI_VDEVICE(VIA, 0x3149), vt6420 },
 	{ PCI_VDEVICE(VIA, 0x3249), vt6421 },
+	{ PCI_VDEVICE(VIA, 0x5287), vt6420 },
+	{ PCI_VDEVICE(VIA, 0x5372), vt6420 },
+	{ PCI_VDEVICE(VIA, 0x7372), vt6420 },
 
 	{ }	/* terminate list */
 };
#1 lore raw
Quoted 47 lines · Jeff Garzik

And a few trivial documentation patches.

Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus

to receive the following updates:

 drivers/ata/libata-scsi.c  |    5 ++-
 drivers/ata/pata_artop.c   |    2 +-
 drivers/ata/pata_hpt37x.c  |   27 ++++++++++---------------
 drivers/ata/pata_it821x.c  |    3 +-
 drivers/ata/pata_scc.c     |   46 ++++++++++++++++++++++++++-----------------
 drivers/ata/pata_via.c     |    9 ++++---
 drivers/ata/sata_mv.c      |   44 ++++++++++++++++++++++++++++++++++++++++++
 drivers/ata/sata_promise.c |    2 +-
 drivers/ata/sata_sis.c     |    2 +-
 drivers/ata/sata_via.c     |    3 ++
 10 files changed, 98 insertions(+), 45 deletions(-)

Alan Cox (2):
pata: Trivia
pata_hpt37x: Further improvements based on the IDE updates and vendor drivers

Jeff Garzik (4):
[libata] sata_promise: fix flags typo
[libata] sata_mv: add TODO list
[libata] Fix decoding of 6-byte commands
[libata] sata_via, pata_via: Add PCI IDs.

Tony Breeds (1):
Fix build failure for drivers/ata/pata_scc.c

Uwe Koziolek (1):
libata: sata_sis fixes

drivers/ata/libata-scsi.c +1 -1
index 242c43e..b3900cf 100644
@@ -1050,14 +1050,15 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc)
 static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen)
 {
 	u64 lba = 0;
-	u32 len = 0;
+	u32 len;
 
 	VPRINTK("six-byte command\n");

drivers/ata/libata-scsi.c static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc) · line 1064

Quoted 10 lines
drivers/ata/libata-scsi.c +2 -1
 
+	lba |= ((u64)(cdb[1] & 0x1f)) << 16;
 	lba |= ((u64)cdb[2]) << 8;
 	lba |= ((u64)cdb[3]);
 
-	len |= ((u32)cdb[4]);
+	len = cdb[4];
 
 	*plba = lba;
 	*plen = len;

Oops, I overlooked the MSB bits. :(
Thanks for catching this.
--
albert