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

Commit f9a3d1d7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: set queue DMA alignment to sector size for ATAPI too
  libata: DVR-212D can't do SETXFER DVD-RW DVR-212D
  ahci: add HFLAG_YES_FBS and apply it to 88SE9128
  pata_hpt37x: inherit prereset() method for HPT374
  ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs
  pata_hpt37x: fold 'if' statement into 'switch'
  pata_hpt{37x|3x2n}: use pr_*(DRV_NAME ...) instead of printk(KERN_* ...)
  pata_hpt{366|37x}: use pr_warning(...) instead of printk(KERN_WARNING ...)
  pata_mpc52xx: inherit from ata_bmdma_port_ops
parents ef9f2fa1 729a6a30
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -260,6 +260,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
	{ PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
	{ PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
	{ PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */
	{ PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */
	{ PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
	{ PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
	{ PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */


	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
	/* 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_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
@@ -379,6 +380,8 @@ static const struct pci_device_id ahci_pci_tbl[] = {
	{ PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv },	/* 6145 */
	{ PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv },	/* 6145 */
	{ PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv },	/* 6121 */
	{ PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv },	/* 6121 */
	{ PCI_DEVICE(0x1b4b, 0x9123),
	{ PCI_DEVICE(0x1b4b, 0x9123),
	  .class = PCI_CLASS_STORAGE_SATA_AHCI,
	  .class_mask = 0xffffff,
	  .driver_data = board_ahci_yes_fbs },			/* 88se9128 */
	  .driver_data = board_ahci_yes_fbs },			/* 88se9128 */


	/* Promise */
	/* Promise */
+1 −0
Original line number Original line Diff line number Diff line
@@ -4138,6 +4138,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
	 * device and controller are SATA.
	 * device and controller are SATA.
	 */
	 */
	{ "PIONEER DVD-RW  DVRTD08",	"1.00",	ATA_HORKAGE_NOSETXFER },
	{ "PIONEER DVD-RW  DVRTD08",	"1.00",	ATA_HORKAGE_NOSETXFER },
	{ "PIONEER DVD-RW  DVR-212D",	"1.28", ATA_HORKAGE_NOSETXFER },


	/* End Marker */
	/* End Marker */
	{ }
	{ }
+18 −6
Original line number Original line Diff line number Diff line
@@ -1099,9 +1099,9 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
		struct request_queue *q = sdev->request_queue;
		struct request_queue *q = sdev->request_queue;
		void *buf;
		void *buf;


		/* set the min alignment and padding */
		sdev->sector_size = ATA_SECT_SIZE;
		blk_queue_update_dma_alignment(sdev->request_queue,

					       ATA_DMA_PAD_SZ - 1);
		/* set DMA padding */
		blk_queue_update_dma_pad(sdev->request_queue,
		blk_queue_update_dma_pad(sdev->request_queue,
					 ATA_DMA_PAD_SZ - 1);
					 ATA_DMA_PAD_SZ - 1);


@@ -1115,13 +1115,25 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,


		blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN);
		blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN);
	} else {
	} else {
		/* ATA devices must be sector aligned */
		sdev->sector_size = ata_id_logical_sector_size(dev->id);
		sdev->sector_size = ata_id_logical_sector_size(dev->id);
		blk_queue_update_dma_alignment(sdev->request_queue,
					       sdev->sector_size - 1);
		sdev->manage_start_stop = 1;
		sdev->manage_start_stop = 1;
	}
	}


	/*
	 * ata_pio_sectors() expects buffer for each sector to not cross
	 * page boundary.  Enforce it by requiring buffers to be sector
	 * aligned, which works iff sector_size is not larger than
	 * PAGE_SIZE.  ATAPI devices also need the alignment as
	 * IDENTIFY_PACKET is executed as ATA_PROT_PIO.
	 */
	if (sdev->sector_size > PAGE_SIZE)
		ata_dev_printk(dev, KERN_WARNING,
			"sector_size=%u > PAGE_SIZE, PIO may malfunction\n",
			sdev->sector_size);

	blk_queue_update_dma_alignment(sdev->request_queue,
				       sdev->sector_size - 1);

	if (dev->flags & ATA_DFLAG_AN)
	if (dev->flags & ATA_DFLAG_AN)
		set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
		set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);


+3 −3
Original line number Original line Diff line number Diff line
@@ -25,7 +25,7 @@
#include <linux/libata.h>
#include <linux/libata.h>


#define DRV_NAME	"pata_hpt366"
#define DRV_NAME	"pata_hpt366"
#define DRV_VERSION	"0.6.9"
#define DRV_VERSION	"0.6.10"


struct hpt_clock {
struct hpt_clock {
	u8	xfer_mode;
	u8	xfer_mode;
@@ -160,7 +160,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,


	while (list[i] != NULL) {
	while (list[i] != NULL) {
		if (!strcmp(list[i], model_num)) {
		if (!strcmp(list[i], model_num)) {
			printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n",
			pr_warning(DRV_NAME ": %s is not supported for %s.\n",
				   modestr, list[i]);
				   modestr, list[i]);
			return 1;
			return 1;
		}
		}
+54 −58
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@
#include <linux/libata.h>
#include <linux/libata.h>


#define DRV_NAME	"pata_hpt37x"
#define DRV_NAME	"pata_hpt37x"
#define DRV_VERSION	"0.6.18"
#define DRV_VERSION	"0.6.22"


struct hpt_clock {
struct hpt_clock {
	u8	xfer_speed;
	u8	xfer_speed;
@@ -229,7 +229,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,


	while (list[i] != NULL) {
	while (list[i] != NULL) {
		if (!strcmp(list[i], model_num)) {
		if (!strcmp(list[i], model_num)) {
			printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n",
			pr_warning(DRV_NAME ": %s is not supported for %s.\n",
				   modestr, list[i]);
				   modestr, list[i]);
			return 1;
			return 1;
		}
		}
@@ -642,7 +642,6 @@ static struct ata_port_operations hpt372_port_ops = {
static struct ata_port_operations hpt374_fn1_port_ops = {
static struct ata_port_operations hpt374_fn1_port_ops = {
	.inherits	= &hpt372_port_ops,
	.inherits	= &hpt372_port_ops,
	.cable_detect	= hpt374_fn1_cable_detect,
	.cable_detect	= hpt374_fn1_cable_detect,
	.prereset	= hpt37x_pre_reset,
};
};


/**
/**
@@ -803,7 +802,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
		.udma_mask = ATA_UDMA6,
		.udma_mask = ATA_UDMA6,
		.port_ops = &hpt302_port_ops
		.port_ops = &hpt302_port_ops
	};
	};
	/* HPT374 - UDMA100, function 1 uses different prereset method */
	/* HPT374 - UDMA100, function 1 uses different cable_detect method */
	static const struct ata_port_info info_hpt374_fn0 = {
	static const struct ata_port_info info_hpt374_fn0 = {
		.flags = ATA_FLAG_SLAVE_POSS,
		.flags = ATA_FLAG_SLAVE_POSS,
		.pio_mask = ATA_PIO4,
		.pio_mask = ATA_PIO4,
@@ -838,7 +837,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
	if (rc)
	if (rc)
		return rc;
		return rc;


	if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
	switch (dev->device) {
	case PCI_DEVICE_ID_TTI_HPT366:
		/* May be a later chip in disguise. Check */
		/* May be a later chip in disguise. Check */
		/* Older chips are in the HPT366 driver. Ignore them */
		/* Older chips are in the HPT366 driver. Ignore them */
		if (rev < 3)
		if (rev < 3)
@@ -863,12 +863,11 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
			chip_table = &hpt372;
			chip_table = &hpt372;
			break;
			break;
		default:
		default:
			printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype, "
			pr_err(DRV_NAME ": Unknown HPT366 subtype, "
			       "please report (%d).\n", rev);
			       "please report (%d).\n", rev);
			return -ENODEV;
			return -ENODEV;
		}
		}
	} else {
		break;
		switch (dev->device) {
	case PCI_DEVICE_ID_TTI_HPT372:
	case PCI_DEVICE_ID_TTI_HPT372:
		/* 372N if rev >= 2 */
		/* 372N if rev >= 2 */
		if (rev >= 2)
		if (rev >= 2)
@@ -890,9 +889,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
		ppi[0] = &info_hpt302;
		ppi[0] = &info_hpt302;
		chip_table = &hpt371;
		chip_table = &hpt371;
		/*
		/*
			 * Single channel device, master is not present
		 * Single channel device, master is not present but the BIOS
			 * but the BIOS (or us for non x86) must mark it
		 * (or us for non x86) must mark it absent
			 * absent
		 */
		 */
		pci_read_config_byte(dev, 0x50, &mcr1);
		pci_read_config_byte(dev, 0x50, &mcr1);
		mcr1 &= ~0x04;
		mcr1 &= ~0x04;
@@ -906,12 +904,10 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
			*ppi = &info_hpt374_fn1;
			*ppi = &info_hpt374_fn1;
		break;
		break;
	default:
	default:
			printk(KERN_ERR
		pr_err(DRV_NAME ": PCI table is bogus, please report (%d).\n",
			       "pata_hpt37x: PCI table is bogus, please report (%d).\n",
		       dev->device);
		       dev->device);
		return -ENODEV;
		return -ENODEV;
	}
	}
	}
	/* Ok so this is a chip we support */
	/* Ok so this is a chip we support */


	pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
	pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
@@ -957,8 +953,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
		u8 sr;
		u8 sr;
		u32 total = 0;
		u32 total = 0;


		printk(KERN_WARNING
		pr_warning(DRV_NAME ": BIOS has not set timing clocks.\n");
		       "pata_hpt37x: BIOS has not set timing clocks.\n");


		/* This is the process the HPT371 BIOS is reported to use */
		/* This is the process the HPT371 BIOS is reported to use */
		for (i = 0; i < 128; i++) {
		for (i = 0; i < 128; i++) {
@@ -1014,7 +1009,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
					       (f_high << 16) | f_low | 0x100);
					       (f_high << 16) | f_low | 0x100);
		}
		}
		if (adjust == 8) {
		if (adjust == 8) {
			printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n");
			pr_err(DRV_NAME ": DPLL did not stabilize!\n");
			return -ENODEV;
			return -ENODEV;
		}
		}
		if (dpll == 3)
		if (dpll == 3)
@@ -1022,7 +1017,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
		else
		else
			private_data = (void *)hpt37x_timings_50;
			private_data = (void *)hpt37x_timings_50;


		printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using %dMHz DPLL.\n",
		pr_info(DRV_NAME ": bus clock %dMHz, using %dMHz DPLL.\n",
			MHz[clock_slot], MHz[dpll]);
			MHz[clock_slot], MHz[dpll]);
	} else {
	} else {
		private_data = (void *)chip_table->clocks[clock_slot];
		private_data = (void *)chip_table->clocks[clock_slot];
@@ -1036,7 +1031,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
			ppi[0] = &info_hpt370_33;
			ppi[0] = &info_hpt370_33;
		if (clock_slot < 2 && ppi[0] == &info_hpt370a)
		if (clock_slot < 2 && ppi[0] == &info_hpt370a)
			ppi[0] = &info_hpt370a_33;
			ppi[0] = &info_hpt370a_33;
		printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n",

		pr_info(DRV_NAME ": %s using %dMHz bus clock.\n",
			chip_table->name, MHz[clock_slot]);
			chip_table->name, MHz[clock_slot]);
	}
	}


Loading