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

Commit 7d9ef601 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:
  [libata] Bump driver versions
  ata_piix: implement IOCFG bit18 quirk
  libata: implement BROKEN_HPA horkage and apply it to affected drives
  sata_promise: FastTrack TX4200 is a second-generation chip
  pata_marvell: Add more identifiers
  ata_piix: add Satellite U200 to broken suspend list
  ata: add ATA_MWDMA* and ATA_SWDMA* defines
  ata_piix: IDE mode SATA patch for Intel Tolapai
  libata-core: Allow translation setting to fail
parents 3b42d28b 2a3103ce
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#include <linux/libata.h>

#define DRV_NAME "ata_generic"
#define DRV_VERSION "0.2.12"
#define DRV_VERSION "0.2.13"

/*
 *	A generic parallel ATA driver using libata
+71 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@
#include <linux/dmi.h>

#define DRV_NAME	"ata_piix"
#define DRV_VERSION	"2.11"
#define DRV_VERSION	"2.12"

enum {
	PIIX_IOCFG		= 0x54, /* IDE I/O configuration register */
@@ -130,6 +130,7 @@ enum {
	ich6m_sata_ahci		= 8,
	ich8_sata_ahci		= 9,
	piix_pata_mwdma		= 10,	/* PIIX3 MWDMA only */
	tolapai_sata_ahci	= 11,

	/* constants for mapping table */
	P0			= 0,  /* port 0 */
@@ -253,6 +254,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
	{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
	/* SATA Controller IDE (ICH9M) */
	{ 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
	/* SATA Controller IDE (Tolapai) */
	{ 0x8086, 0x5028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, tolapai_sata_ahci },

	{ }	/* terminate list */
};
@@ -441,12 +444,25 @@ static const struct piix_map_db ich8_map_db = {
	},
};

static const struct piix_map_db tolapai_map_db = {
        .mask = 0x3,
        .port_enable = 0x3,
        .map = {
                /* PM   PS   SM   SS       MAP */
                {  P0,  NA,  P1,  NA }, /* 00b */
                {  RV,  RV,  RV,  RV }, /* 01b */
                {  RV,  RV,  RV,  RV }, /* 10b */
                {  RV,  RV,  RV,  RV },
        },
};

static const struct piix_map_db *piix_map_db_table[] = {
	[ich5_sata]		= &ich5_map_db,
	[ich6_sata]		= &ich6_map_db,
	[ich6_sata_ahci]	= &ich6_map_db,
	[ich6m_sata_ahci]	= &ich6m_map_db,
	[ich8_sata_ahci]	= &ich8_map_db,
	[tolapai_sata_ahci]	= &tolapai_map_db,
};

static struct ata_port_info piix_port_info[] = {
@@ -560,6 +576,17 @@ static struct ata_port_info piix_port_info[] = {
		.mwdma_mask	= 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
		.port_ops	= &piix_pata_ops,
	},

	/* tolapai_sata_ahci: 11: */
	{
		.sht		= &piix_sht,
		.flags		= PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
				  PIIX_FLAG_AHCI,
		.pio_mask	= 0x1f,	/* pio0-4 */
		.mwdma_mask	= 0x07, /* mwdma0-2 */
		.udma_mask	= ATA_UDMA6,
		.port_ops	= &piix_sata_ops,
	},
};

static struct pci_bits piix_enable_bits[] = {
@@ -907,6 +934,13 @@ static int piix_broken_suspend(void)
				DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M7"),
			},
		},
		{
			.ident = "Satellite U200",
			.matches = {
				DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
				DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
			},
		},
		{
			.ident = "Satellite U205",
			.matches = {
@@ -1139,6 +1173,39 @@ static void __devinit piix_init_sata_map(struct pci_dev *pdev,
	hpriv->map = map;
}

static void piix_iocfg_bit18_quirk(struct pci_dev *pdev)
{
	static struct dmi_system_id sysids[] = {
		{
			/* Clevo M570U sets IOCFG bit 18 if the cdrom
			 * isn't used to boot the system which
			 * disables the channel.
			 */
			.ident = "M570U",
			.matches = {
				DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."),
				DMI_MATCH(DMI_PRODUCT_NAME, "M570U"),
			},
		},
	};
	u32 iocfg;

	if (!dmi_check_system(sysids))
		return;

	/* The datasheet says that bit 18 is NOOP but certain systems
	 * seem to use it to disable a channel.  Clear the bit on the
	 * affected systems.
	 */
	pci_read_config_dword(pdev, PIIX_IOCFG, &iocfg);
	if (iocfg & (1 << 18)) {
		dev_printk(KERN_INFO, &pdev->dev,
			   "applying IOCFG bit18 quirk\n");
		iocfg &= ~(1 << 18);
		pci_write_config_dword(pdev, PIIX_IOCFG, iocfg);
	}
}

/**
 *	piix_init_one - Register PIIX ATA PCI device with kernel services
 *	@pdev: PCI device to register
@@ -1200,6 +1267,9 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
			      piix_map_db_table[ent->driver_data]);
	}

	/* apply IOCFG bit18 quirk */
	piix_iocfg_bit18_quirk(pdev);

	/* On ICH5, some BIOSen disable the interrupt using the
	 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3.
	 * On ICH6, this bit has the same effect, but only when
+13 −3
Original line number Diff line number Diff line
@@ -1911,7 +1911,8 @@ int ata_dev_configure(struct ata_device *dev)
					dev->flags |= ATA_DFLAG_FLUSH_EXT;
			}

			if (ata_id_hpa_enabled(dev->id))
			if (!(dev->horkage & ATA_HORKAGE_BROKEN_HPA) &&
			    ata_id_hpa_enabled(dev->id))
 				dev->n_sectors = ata_hpa_resize(dev);

			/* config NCQ */
@@ -3795,7 +3796,11 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
	{ "ST9160821AS",	"3.CLF",	ATA_HORKAGE_NONCQ, },
	{ "SAMSUNG HD401LJ",	"ZZ100-15",	ATA_HORKAGE_NONCQ, },

	/* Devices with NCQ limits */
	/* devices which puke on READ_NATIVE_MAX */
	{ "HDS724040KLSA80",	"KFAOA20N",	ATA_HORKAGE_BROKEN_HPA, },
	{ "WDC WD3200JD-00KLB0", "WD-WCAMR1130137", ATA_HORKAGE_BROKEN_HPA },
	{ "WDC WD2500JD-00HBB0", "WD-WMAL71490727", ATA_HORKAGE_BROKEN_HPA },
	{ "MAXTOR 6L080L4",	"A93.0500",	ATA_HORKAGE_BROKEN_HPA },

	/* End Marker */
	{ }
@@ -3985,6 +3990,11 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
	tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */

	err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
	/* A clean abort indicates an original or just out of spec drive
	   and we should continue as we issue the setup based on the
	   drive reported working geometry */
	if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED))
		err_mask = 0;

	DPRINTK("EXIT, err_mask=%x\n", err_mask);
	return err_mask;
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
#include <linux/dmi.h>

#define DRV_NAME "pata_ali"
#define DRV_VERSION "0.7.4"
#define DRV_VERSION "0.7.5"

/*
 *	Cable special cases
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_amd"
#define DRV_VERSION "0.3.8"
#define DRV_VERSION "0.3.9"

/**
 *	timing_setup		-	shared timing computation and load
Loading