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

Commit b5625481 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_sis: fix MWDMA for <= UDMA66 chipsets and UDMA for UDMA33 chipsets
  libata: blacklist SAMSUNG HD401LJ / ZZ100-15 for NCQ
  ata_piix: add Tecra M3 to broken suspend blacklist
  ata_piix: implement piix_borken_suspend()
  pci: rename __pci_reenable_device() to pci_reenable_device()
  libata-sff; Unbreak non DMA capable controllers again
  pata_cmd64x: Correct the speed ranges
parents 0fc4969b 4761c06c
Loading
Loading
Loading
Loading
+41 −33
Original line number Original line Diff line number Diff line
@@ -890,7 +890,9 @@ static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev)
}
}


#ifdef CONFIG_PM
#ifdef CONFIG_PM
static struct dmi_system_id piix_broken_suspend_dmi_table[] = {
static int piix_broken_suspend(void)
{
	static struct dmi_system_id sysids[] = {
		{
		{
			.ident = "TECRA M5",
			.ident = "TECRA M5",
			.matches = {
			.matches = {
@@ -898,13 +900,6 @@ static struct dmi_system_id piix_broken_suspend_dmi_table[] = {
				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
			},
			},
		},
		},
	{
		.ident = "Satellite U200",
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
			DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
		},
	},
		{
		{
			.ident = "Satellite U205",
			.ident = "Satellite U205",
			.matches = {
			.matches = {
@@ -921,6 +916,20 @@ static struct dmi_system_id piix_broken_suspend_dmi_table[] = {
		},
		},
		{ }
		{ }
	};
	};
	static const char *oemstrs[] = {
		"Tecra M3,",
	};
	int i;

	if (dmi_check_system(sysids))
		return 1;

	for (i = 0; i < ARRAY_SIZE(oemstrs); i++)
		if (dmi_find_device(DMI_DEV_TYPE_OEM_STRING, oemstrs[i], NULL))
			return 1;

	return 0;
}


static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
{
@@ -937,8 +946,7 @@ static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
	 * cycles and power trying to do something to the sleeping
	 * cycles and power trying to do something to the sleeping
	 * beauty.
	 * beauty.
	 */
	 */
	if (dmi_check_system(piix_broken_suspend_dmi_table) &&
	if (piix_broken_suspend() && mesg.event == PM_EVENT_SUSPEND) {
	    mesg.event == PM_EVENT_SUSPEND) {
		pci_save_state(pdev);
		pci_save_state(pdev);


		/* mark its power state as "unknown", since we don't
		/* mark its power state as "unknown", since we don't
@@ -973,10 +981,10 @@ static int piix_pci_device_resume(struct pci_dev *pdev)
		pci_restore_state(pdev);
		pci_restore_state(pdev);


		/* PCI device wasn't disabled during suspend.  Use
		/* PCI device wasn't disabled during suspend.  Use
		 * __pci_reenable_device() to avoid affecting the
		 * pci_reenable_device() to avoid affecting the enable
		 * enable count.
		 * count.
		 */
		 */
		rc = __pci_reenable_device(pdev);
		rc = pci_reenable_device(pdev);
		if (rc)
		if (rc)
			dev_printk(KERN_ERR, &pdev->dev, "failed to enable "
			dev_printk(KERN_ERR, &pdev->dev, "failed to enable "
				   "device after resume (%d)\n", rc);
				   "device after resume (%d)\n", rc);
+1 −0
Original line number Original line Diff line number Diff line
@@ -3788,6 +3788,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
	{ "WDC WD740ADFD-00NLR1", NULL,		ATA_HORKAGE_NONCQ, },
	{ "WDC WD740ADFD-00NLR1", NULL,		ATA_HORKAGE_NONCQ, },
	{ "FUJITSU MHV2080BH",	"00840028",	ATA_HORKAGE_NONCQ, },
	{ "FUJITSU MHV2080BH",	"00840028",	ATA_HORKAGE_NONCQ, },
	{ "ST9160821AS",	"3.CLF",	ATA_HORKAGE_NONCQ, },
	{ "ST9160821AS",	"3.CLF",	ATA_HORKAGE_NONCQ, },
	{ "SAMSUNG HD401LJ",	"ZZ100-15",	ATA_HORKAGE_NONCQ, },


	/* Devices with NCQ limits */
	/* Devices with NCQ limits */


+4 −0
Original line number Original line Diff line number Diff line
@@ -573,6 +573,10 @@ int ata_pci_init_bmdma(struct ata_host *host)
	struct pci_dev *pdev = to_pci_dev(gdev);
	struct pci_dev *pdev = to_pci_dev(gdev);
	int i, rc;
	int i, rc;


	/* No BAR4 allocation: No DMA */
	if (pci_resource_start(pdev, 4) == 0)
		return 0;

	/* TODO: If we get no DMA mask we should fall back to PIO */
	/* TODO: If we get no DMA mask we should fall back to PIO */
	rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
	rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
	if (rc)
	if (rc)
+4 −4
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@
#include <linux/libata.h>
#include <linux/libata.h>


#define DRV_NAME "pata_cmd64x"
#define DRV_NAME "pata_cmd64x"
#define DRV_VERSION "0.2.3"
#define DRV_VERSION "0.2.4"


/*
/*
 * CMD64x specific registers definition.
 * CMD64x specific registers definition.
@@ -397,7 +397,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
			.flags = ATA_FLAG_SLAVE_POSS,
			.flags = ATA_FLAG_SLAVE_POSS,
			.pio_mask = 0x1f,
			.pio_mask = 0x1f,
			.mwdma_mask = 0x07,
			.mwdma_mask = 0x07,
			.udma_mask = ATA_UDMA1,
			.udma_mask = ATA_UDMA2,
			.port_ops = &cmd64x_port_ops
			.port_ops = &cmd64x_port_ops
		},
		},
		{	/* CMD 646 rev 1  */
		{	/* CMD 646 rev 1  */
@@ -412,7 +412,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
			.flags = ATA_FLAG_SLAVE_POSS,
			.flags = ATA_FLAG_SLAVE_POSS,
			.pio_mask = 0x1f,
			.pio_mask = 0x1f,
			.mwdma_mask = 0x07,
			.mwdma_mask = 0x07,
			.udma_mask = ATA_UDMA2,
			.udma_mask = ATA_UDMA4,
			.port_ops = &cmd648_port_ops
			.port_ops = &cmd648_port_ops
		},
		},
		{	/* CMD 649 */
		{	/* CMD 649 */
@@ -420,7 +420,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
			.flags = ATA_FLAG_SLAVE_POSS,
			.flags = ATA_FLAG_SLAVE_POSS,
			.pio_mask = 0x1f,
			.pio_mask = 0x1f,
			.mwdma_mask = 0x07,
			.mwdma_mask = 0x07,
			.udma_mask = ATA_UDMA3,
			.udma_mask = ATA_UDMA5,
			.port_ops = &cmd648_port_ops
			.port_ops = &cmd648_port_ops
		}
		}
	};
	};
+9 −11
Original line number Original line Diff line number Diff line
@@ -2,6 +2,7 @@
 *    pata_sis.c - SiS ATA driver
 *    pata_sis.c - SiS ATA driver
 *
 *
 *	(C) 2005 Red Hat <alan@redhat.com>
 *	(C) 2005 Red Hat <alan@redhat.com>
 *	(C) 2007 Bartlomiej Zolnierkiewicz
 *
 *
 *    Based upon linux/drivers/ide/pci/sis5513.c
 *    Based upon linux/drivers/ide/pci/sis5513.c
 * Copyright (C) 1999-2000	Andre Hedrick <andre@linux-ide.org>
 * Copyright (C) 1999-2000	Andre Hedrick <andre@linux-ide.org>
@@ -35,7 +36,7 @@
#include "sis.h"
#include "sis.h"


#define DRV_NAME	"pata_sis"
#define DRV_NAME	"pata_sis"
#define DRV_VERSION	"0.5.1"
#define DRV_VERSION	"0.5.2"


struct sis_chipset {
struct sis_chipset {
	u16 device;				/* PCI host ID */
	u16 device;				/* PCI host ID */
@@ -237,7 +238,7 @@ static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev)
}
}


/**
/**
 *	sis_100_set_pioode - Initialize host controller PATA PIO timings
 *	sis_100_set_piomode - Initialize host controller PATA PIO timings
 *	@ap: Port whose timings we are configuring
 *	@ap: Port whose timings we are configuring
 *	@adev: Device we are configuring for.
 *	@adev: Device we are configuring for.
 *
 *
@@ -262,7 +263,7 @@ static void sis_100_set_piomode (struct ata_port *ap, struct ata_device *adev)
}
}


/**
/**
 *	sis_133_set_pioode - Initialize host controller PATA PIO timings
 *	sis_133_set_piomode - Initialize host controller PATA PIO timings
 *	@ap: Port whose timings we are configuring
 *	@ap: Port whose timings we are configuring
 *	@adev: Device we are configuring for.
 *	@adev: Device we are configuring for.
 *
 *
@@ -334,7 +335,7 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev)
	int drive_pci = sis_old_port_base(adev);
	int drive_pci = sis_old_port_base(adev);
	u16 timing;
	u16 timing;


	const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 };
	const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
	const u16 udma_bits[]  = { 0xE000, 0xC000, 0xA000 };
	const u16 udma_bits[]  = { 0xE000, 0xC000, 0xA000 };


	pci_read_config_word(pdev, drive_pci, &timing);
	pci_read_config_word(pdev, drive_pci, &timing);
@@ -344,13 +345,13 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev)
		   the higer bits are dependant on the device */
		   the higer bits are dependant on the device */
		timing &= ~0x870F;
		timing &= ~0x870F;
		timing |= mwdma_bits[speed];
		timing |= mwdma_bits[speed];
		pci_write_config_word(pdev, drive_pci, timing);
	} else {
	} else {
		/* Bit 15 is UDMA on/off, bit 13-14 are cycle time */
		/* Bit 15 is UDMA on/off, bit 13-14 are cycle time */
		speed = adev->dma_mode - XFER_UDMA_0;
		speed = adev->dma_mode - XFER_UDMA_0;
		timing &= ~0x6000;
		timing &= ~0x6000;
		timing |= udma_bits[speed];
		timing |= udma_bits[speed];
	}
	}
	pci_write_config_word(pdev, drive_pci, timing);
}
}


/**
/**
@@ -373,7 +374,7 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
	int drive_pci = sis_old_port_base(adev);
	int drive_pci = sis_old_port_base(adev);
	u16 timing;
	u16 timing;


	const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 };
	const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
	const u16 udma_bits[]  = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000};
	const u16 udma_bits[]  = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000};


	pci_read_config_word(pdev, drive_pci, &timing);
	pci_read_config_word(pdev, drive_pci, &timing);
@@ -432,8 +433,7 @@ static void sis_100_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 *	@adev: Device to program
 *	@adev: Device to program
 *
 *
 *	Set UDMA/MWDMA mode for device, in host controller PCI config space.
 *	Set UDMA/MWDMA mode for device, in host controller PCI config space.
 *	Handles early SiS 961 bridges. Supports MWDMA as well unlike
 *	Handles early SiS 961 bridges.
 *	the old ide/pci driver.
 *
 *
 *	LOCKING:
 *	LOCKING:
 *	None (inherited from caller).
 *	None (inherited from caller).
@@ -467,8 +467,6 @@ static void sis_133_early_set_dmamode (struct ata_port *ap, struct ata_device *a
 *	@adev: Device to program
 *	@adev: Device to program
 *
 *
 *	Set UDMA/MWDMA mode for device, in host controller PCI config space.
 *	Set UDMA/MWDMA mode for device, in host controller PCI config space.
 *	Handles early SiS 961 bridges. Supports MWDMA as well unlike
 *	the old ide/pci driver.
 *
 *
 *	LOCKING:
 *	LOCKING:
 *	None (inherited from caller).
 *	None (inherited from caller).
Loading