Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a41d7f00 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  pata_hpt37x: Further improvements based on the IDE updates and vendor drivers
  pata: Trivia
  [libata] sata_via, pata_via: Add PCI IDs.
  [libata] Fix decoding of 6-byte commands
  libata: sata_sis fixes
  Fix build failure for drivers/ata/pata_scc.c
  [libata] sata_mv: add TODO list
  [libata] sata_promise: fix flags typo
parents d9b08b9e 960c8a10
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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)
+11 −16
Original line number Diff line number Diff line
@@ -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];
		/*
+1 −2
Original line number Diff line number Diff line
/*
 * 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 <alan@redhat.com>
 *
@@ -65,7 +65,6 @@
 *
 *  TODO
 *	-	ATAPI and other speed filtering
 *	-	Command filter in smart mode
 *	-	RAID configuration ioctls
 */

+28 −18
Original line number Diff line number Diff line
@@ -489,23 +489,26 @@ static unsigned int scc_devchk (struct ata_port *ap,
 *	Note: Original code is ata_bus_post_reset().
 */

static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask,
                              unsigned long deadline)
{
	struct ata_ioports *ioaddr = &ap->ioaddr;
	unsigned int dev0 = devmask & (1 << 0);
	unsigned int dev1 = devmask & (1 << 1);
	unsigned long timeout;
	int rc;

	/* if device 0 was found in ata_devchk, wait for its
	 * BSY bit to clear
	 */
	if (dev0)
		ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
	if (dev0) {
		rc = ata_wait_ready(ap, deadline);
		if (rc && rc != -ENODEV)
			return rc;
	}

	/* if device 1 was found in ata_devchk, wait for
	 * register access, then wait for BSY to clear
	 */
	timeout = jiffies + ATA_TMOUT_BOOT;
	while (dev1) {
		u8 nsect, lbal;

@@ -514,14 +517,15 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
		lbal = in_be32(ioaddr->lbal_addr);
		if ((nsect == 1) && (lbal == 1))
			break;
		if (time_after(jiffies, timeout)) {
			dev1 = 0;
			break;
		}
		if (time_after(jiffies, deadline))
			return -EBUSY;
		msleep(50);	/* give drive a breather */
	}
	if (dev1)
		ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
	if (dev1) {
		rc = ata_wait_ready(ap, deadline);
		if (rc && rc != -ENODEV)
			return rc;
	}

	/* is all this really necessary? */
	ap->ops->dev_select(ap, 0);
@@ -529,6 +533,8 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
		ap->ops->dev_select(ap, 1);
	if (dev0)
		ap->ops->dev_select(ap, 0);

	return 0;
}

/**
@@ -537,8 +543,8 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
 *	Note: Original code is ata_bus_softreset().
 */

static unsigned int scc_bus_softreset (struct ata_port *ap,
				       unsigned int devmask)
static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
                                      unsigned long deadline)
{
	struct ata_ioports *ioaddr = &ap->ioaddr;

@@ -570,7 +576,7 @@ static unsigned int scc_bus_softreset (struct ata_port *ap,
	if (scc_check_status(ap) == 0xFF)
		return 0;

	scc_bus_post_reset(ap, devmask);
	scc_bus_post_reset(ap, devmask, deadline);

	return 0;
}
@@ -579,11 +585,13 @@ static unsigned int scc_bus_softreset (struct ata_port *ap,
 *	scc_std_softreset - reset host port via ATA SRST
 *	@ap: port to reset
 *	@classes: resulting classes of attached devices
 *	@deadline: deadline jiffies for the operation
 *
 *	Note: Original code is ata_std_softreset().
 */

static int scc_std_softreset (struct ata_port *ap, unsigned int *classes)
static int scc_std_softreset (struct ata_port *ap, unsigned int *classes,
                              unsigned long deadline)
{
	unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
	unsigned int devmask = 0, err_mask;
@@ -607,7 +615,7 @@ static int scc_std_softreset (struct ata_port *ap, unsigned int *classes)

	/* issue bus reset */
	DPRINTK("about to softreset, devmask=%x\n", devmask);
	err_mask = scc_bus_softreset(ap, devmask);
	err_mask = scc_bus_softreset(ap, devmask, deadline);
	if (err_mask) {
		ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n",
				err_mask);
@@ -676,10 +684,11 @@ static void scc_bmdma_stop (struct ata_queued_cmd *qc)

		if (reg & INTSTS_BMSINT) {
			unsigned int classes;
			unsigned long deadline = jiffies + ATA_TMOUT_BOOT;
			printk(KERN_WARNING "%s: Internal Bus Error\n", DRV_NAME);
			out_be32(bmid_base + SCC_DMA_INTST, INTSTS_BMSINT);
			/* TBD: SW reset */
			scc_std_softreset(ap, &classes);
			scc_std_softreset(ap, &classes, deadline);
			continue;
		}

@@ -862,6 +871,7 @@ static void scc_bmdma_freeze (struct ata_port *ap)
/**
 *	scc_pata_prereset - prepare for reset
 *	@ap: ATA port to be reset
 *	@deadline: deadline jiffies for the operation
 */

static int scc_pata_prereset(struct ata_port *ap, unsigned long deadline)
Loading