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

Commit 562aa1d4 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:
  ahci: improve spurious SDB FIS handling
  ahci/pata_jmicron: match class not function number
  jmicron ATA: reimplement jmicron ATA quirk
  pata_jmicron: drop unnecessary device programming in [re]init
  libata: blacklist FUJITSU MHT2060BH for NCQ
  sata_sil24: kill unused local variable idx in sil24_fill_sg()
  libata: clear drvdata in ata_host_release(), take#2
parents b4350861 afb2d552
Loading
Loading
Loading
Loading
+27 −28
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ struct ahci_port_priv {
	/* for NCQ spurious interrupt analysis */
	unsigned int		ncq_saw_d2h:1;
	unsigned int		ncq_saw_dmas:1;
	unsigned int		ncq_saw_sdb:1;
};

static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg);
@@ -384,12 +385,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
	{ PCI_VDEVICE(INTEL, 0x294d), board_ahci_pi }, /* ICH9 */
	{ PCI_VDEVICE(INTEL, 0x294e), board_ahci_pi }, /* ICH9M */

	/* JMicron */
	{ PCI_VDEVICE(JMICRON, 0x2360), board_ahci_ign_iferr }, /* JMB360 */
	{ PCI_VDEVICE(JMICRON, 0x2361), board_ahci_ign_iferr }, /* JMB361 */
	{ PCI_VDEVICE(JMICRON, 0x2363), board_ahci_ign_iferr }, /* JMB363 */
	{ PCI_VDEVICE(JMICRON, 0x2365), board_ahci_ign_iferr }, /* JMB365 */
	{ PCI_VDEVICE(JMICRON, 0x2366), board_ahci_ign_iferr }, /* JMB366 */
	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
	  PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr },

	/* ATI */
	{ PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
@@ -1160,23 +1158,31 @@ static void ahci_host_intr(struct ata_port *ap)
	}

	if (status & PORT_IRQ_SDB_FIS) {
		/* SDB FIS containing spurious completions might be
		 * dangerous, whine and fail commands with HSM
		 * violation.  EH will turn off NCQ after several such
		 * failures.
  		 */
		const __le32 *f = pp->rx_fis + RX_FIS_SDB;

		ata_ehi_push_desc(ehi, "spurious completion during NCQ "
		if (le32_to_cpu(f[1])) {
			/* SDB FIS containing spurious completions
			 * might be dangerous, whine and fail commands
			 * with HSM violation.  EH will turn off NCQ
			 * after several such failures.
			 */
			ata_ehi_push_desc(ehi,
				"spurious completions during NCQ "
				"issue=0x%x SAct=0x%x FIS=%08x:%08x",
				readl(port_mmio + PORT_CMD_ISSUE),
				readl(port_mmio + PORT_SCR_ACT),
				le32_to_cpu(f[0]), le32_to_cpu(f[1]));

			ehi->err_mask |= AC_ERR_HSM;
			ehi->action |= ATA_EH_SOFTRESET;
			ata_port_freeze(ap);

		} else {
			if (!pp->ncq_saw_sdb)
				ata_port_printk(ap, KERN_INFO,
					"spurious SDB FIS %08x:%08x during NCQ, "
					"this message won't be printed again\n",
					le32_to_cpu(f[0]), le32_to_cpu(f[1]));
			pp->ncq_saw_sdb = 1;
		}
		known_irq = 1;
	}

@@ -1665,13 +1671,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
	if (!printed_version++)
		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");

	if (pdev->vendor == PCI_VENDOR_ID_JMICRON) {
		/* Function 1 is the PATA controller except on the 368, where
		   we are not AHCI anyway */
		if (PCI_FUNC(pdev->devfn))
			return -ENODEV;
	}

	rc = pcim_enable_device(pdev);
	if (rc)
		return rc;
+4 −1
Original line number Diff line number Diff line
@@ -3346,6 +3346,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
	/* Devices where NCQ should be avoided */
	/* NCQ is slow */
        { "WDC WD740ADFD-00",   NULL,		ATA_HORKAGE_NONCQ },
	/* http://thread.gmane.org/gmane.linux.ide/14907 */
	{ "FUJITSU MHT2060BH",	NULL,		ATA_HORKAGE_NONCQ },

	/* Devices with NCQ limits */

@@ -5680,6 +5682,8 @@ static void ata_host_release(struct device *gendev, void *res)

	if (host->ops->host_stop)
		host->ops->host_stop(host);

	dev_set_drvdata(gendev, NULL);
}

/**
@@ -5902,7 +5906,6 @@ int ata_device_add(const struct ata_probe_ent *ent)

 err_out:
	devres_release_group(dev, ata_device_add);
	dev_set_drvdata(dev, NULL);
	VPRINTK("EXIT, returning %d\n", rc);
	return 0;
}
+0 −1
Original line number Diff line number Diff line
@@ -306,7 +306,6 @@ static void __devexit cs5520_remove_one(struct pci_dev *pdev)
	struct ata_host *host = dev_get_drvdata(dev);

	ata_host_detach(host);
	dev_set_drvdata(dev, NULL);
}

/**
+0 −1
Original line number Diff line number Diff line
@@ -128,7 +128,6 @@ static void isapnp_remove_one(struct pnp_dev *idev)
	struct ata_host *host = dev_get_drvdata(dev);

	ata_host_detach(host);
	dev_set_drvdata(dev, NULL);
}

static struct pnp_device_id isapnp_devices[] = {
+11 −40
Original line number Diff line number Diff line
@@ -202,49 +202,20 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i
	};
	struct ata_port_info *port_info[2] = { &info, &info };

	u32 reg;

	/* PATA controller is fn 1, AHCI is fn 0 */
	if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1)
		return -ENODEV;

	/* The 365/66 have two PATA channels, redirect the second */
	if (id->driver_data == 365 || id->driver_data == 366) {
		pci_read_config_dword(pdev, 0x80, &reg);
		reg |= (1 << 24);	/* IDE1 to PATA IDE secondary */
		pci_write_config_dword(pdev, 0x80, reg);
	}

	return ata_pci_init_one(pdev, port_info, 2);
}

static int jmicron_reinit_one(struct pci_dev *pdev)
{
	u32 reg;

	switch(pdev->device) {
		case PCI_DEVICE_ID_JMICRON_JMB368:
			break;
		case PCI_DEVICE_ID_JMICRON_JMB365:
		case PCI_DEVICE_ID_JMICRON_JMB366:
			/* Restore mapping or disks swap and boy does it get ugly */
			pci_read_config_dword(pdev, 0x80, &reg);
			reg |= (1 << 24);	/* IDE1 to PATA IDE secondary */
			pci_write_config_dword(pdev, 0x80, reg);
			/* Fall through */
		default:
			/* Make sure AHCI is turned back on */
			pci_write_config_byte(pdev, 0x41, 0xa1);
	}
	return ata_pci_device_resume(pdev);
}

static const struct pci_device_id jmicron_pci_tbl[] = {
	{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 361},
	{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 363},
	{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB365), 365},
	{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB366), 366},
	{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB368), 368},
	{ PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361,
	  PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xffff00, 361 },
	{ PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363,
	  PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xffff00, 363 },
	{ PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365,
	  PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xffff00, 365 },
	{ PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366,
	  PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xffff00, 366 },
	{ PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368,
	  PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xffff00, 368 },

	{ }	/* terminate list */
};
@@ -255,7 +226,7 @@ static struct pci_driver jmicron_pci_driver = {
	.probe			= jmicron_init_one,
	.remove			= ata_pci_remove_one,
	.suspend		= ata_pci_device_suspend,
	.resume			= jmicron_reinit_one,
	.resume			= ata_pci_device_resume,
};

static int __init jmicron_init(void)
Loading