View | Details | Raw Unified | Return to bug 8923 | Differences between
and this patch

Collapse All | Expand All

(-)a/drivers/ata/ahci.c (+28 lines)
Lines 44-49 Link Here
44
#include <scsi/scsi_host.h>
44
#include <scsi/scsi_host.h>
45
#include <scsi/scsi_cmnd.h>
45
#include <scsi/scsi_cmnd.h>
46
#include <linux/libata.h>
46
#include <linux/libata.h>
47
#include <linux/dmi.h>
47
48
48
#define DRV_NAME	"ahci"
49
#define DRV_NAME	"ahci"
49
#define DRV_VERSION	"2.3"
50
#define DRV_VERSION	"2.3"
Lines 1631-1636 static int ahci_pci_device_resume(struct pci_dev *pdev) Link Here
1631
}
1632
}
1632
#endif
1633
#endif
1633
1634
1635
static void ahci_port_mark_nosrst(struct ata_port *ap)
1636
{
1637
	static struct dmi_system_id sysids[] = {
1638
		{
1639
			.ident = "P5W DH Deluxe",
1640
			.matches = {
1641
				DMI_MATCH(DMI_SYS_VENDOR, "ASUSTEK COMPUTER INC"),
1642
				DMI_MATCH(DMI_PRODUCT_NAME, "P5W DH Deluxe"),
1643
			},
1644
		},
1645
		{ }
1646
	};
1647
	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
1648
1649
	/* The second port of the PCI device 00:1f.2 is connected to a
1650
	 * SIMG PMP which pukes on SRST.
1651
	 */
1652
	if (pdev->bus->number == 0 && pdev->devfn == PCI_DEVFN(0x1f, 2) &&
1653
	    ap->port_no == 1 && dmi_check_system(sysids)) {
1654
		dev_printk(KERN_INFO, &pdev->dev,
1655
			   "enabling ASUS on-board PMP workaround\n");
1656
		ap->flags |= ATA_FLAG_NO_SRST;
1657
	}
1658
}
1659
1634
static int ahci_port_start(struct ata_port *ap)
1660
static int ahci_port_start(struct ata_port *ap)
1635
{
1661
{
1636
	struct device *dev = ap->host->dev;
1662
	struct device *dev = ap->host->dev;
Lines 1639-1644 static int ahci_port_start(struct ata_port *ap) Link Here
1639
	dma_addr_t mem_dma;
1665
	dma_addr_t mem_dma;
1640
	int rc;
1666
	int rc;
1641
1667
1668
	ahci_port_mark_nosrst(ap);
1669
1642
	pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL);
1670
	pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL);
1643
	if (!pp)
1671
	if (!pp)
1644
		return -ENOMEM;
1672
		return -ENOMEM;
(-)a/drivers/ata/libata-eh.c (-3 / +7 lines)
Lines 1759-1767 static int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset, Link Here
1759
	return 0;
1759
	return 0;
1760
}
1760
}
1761
1761
1762
static int ata_eh_followup_srst_needed(int rc, int classify,
1762
static int ata_eh_followup_srst_needed(struct ata_port *ap,
1763
				       int rc, int classify,
1763
				       const unsigned int *classes)
1764
				       const unsigned int *classes)
1764
{
1765
{
1766
	if (ap->flags & ATA_FLAG_NO_SRST)
1767
		return 0;
1765
	if (rc == -EAGAIN)
1768
	if (rc == -EAGAIN)
1766
		return 1;
1769
		return 1;
1767
	if (rc != 0)
1770
	if (rc != 0)
Lines 1792-1798 static int ata_eh_reset(struct ata_port *ap, int classify, Link Here
1792
	 */
1795
	 */
1793
	action = ehc->i.action;
1796
	action = ehc->i.action;
1794
	ehc->i.action &= ~ATA_EH_RESET_MASK;
1797
	ehc->i.action &= ~ATA_EH_RESET_MASK;
1795
	if (softreset && (!hardreset || (!sata_set_spd_needed(ap) &&
1798
	if (softreset && (!hardreset || (!(ap->flags & ATA_FLAG_NO_SRST) &&
1799
					 !sata_set_spd_needed(ap) &&
1796
					 !(action & ATA_EH_HARDRESET))))
1800
					 !(action & ATA_EH_HARDRESET))))
1797
		ehc->i.action |= ATA_EH_SOFTRESET;
1801
		ehc->i.action |= ATA_EH_SOFTRESET;
1798
	else
1802
	else
Lines 1855-1861 static int ata_eh_reset(struct ata_port *ap, int classify, Link Here
1855
	rc = ata_do_reset(ap, reset, classes, deadline);
1859
	rc = ata_do_reset(ap, reset, classes, deadline);
1856
1860
1857
	if (reset == hardreset &&
1861
	if (reset == hardreset &&
1858
	    ata_eh_followup_srst_needed(rc, classify, classes)) {
1862
	    ata_eh_followup_srst_needed(ap, rc, classify, classes)) {
1859
		/* okay, let's do follow-up softreset */
1863
		/* okay, let's do follow-up softreset */
1860
		reset = softreset;
1864
		reset = softreset;
1861
1865
(-)a/include/linux/libata.h (+1 lines)
Lines 177-182 enum { Link Here
177
	ATA_FLAG_IGN_SIMPLEX	= (1 << 15), /* ignore SIMPLEX */
177
	ATA_FLAG_IGN_SIMPLEX	= (1 << 15), /* ignore SIMPLEX */
178
	ATA_FLAG_NO_IORDY	= (1 << 16), /* controller lacks iordy */
178
	ATA_FLAG_NO_IORDY	= (1 << 16), /* controller lacks iordy */
179
	ATA_FLAG_ACPI_SATA	= (1 << 17), /* need native SATA ACPI layout */
179
	ATA_FLAG_ACPI_SATA	= (1 << 17), /* need native SATA ACPI layout */
180
	ATA_FLAG_NO_SRST	= (1 << 18), /* avoid softreset */
180
181
181
	/* The following flag belongs to ap->pflags but is kept in
182
	/* The following flag belongs to ap->pflags but is kept in
182
	 * ap->flags because it's referenced in many LLDs and will be
183
	 * ap->flags because it's referenced in many LLDs and will be

Return to bug 8923