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

Commit 08eacc31 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:
  Fix Maple PATA IRQ assignment.
  ahci: use 0x80 as wait stat value instead of 0xff
  sata_via: style clean up, no indirect method call in LLD
  ahci: fix endianness in spurious interrupt message
  libata-sff: Don't call bmdma_stop on non DMA capable controllers
  libata: implement ATA_FLAG_IGN_SIMPLEX and use it in sata_uli
  ahci: improve and limit spurious interrupt messages, take#3
  sata_via: don't diddle with ATA_NIEN in ->freeze
  libata: set_mode, Fix the FIXME
  libata hpt3xn: Hopefully sort out the DPLL logic versus the vendor code
  libata cmd64x: whack into a shape that looks like the documentation
parents 496a0fc8 8cdf92a9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -484,6 +484,7 @@ config PPC_MAPLE
	select PPC_970_NAP
	select PPC_NATIVE
	select PPC_RTAS
	select ATA_NONSTANDARD if ATA
	default n
	help
          This option enables support for the Maple 970FX Evaluation Board.
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,10 @@ config ATA

if ATA

config ATA_NONSTANDARD
       bool
       default n

config SATA_AHCI
	tristate "AHCI SATA support"
	depends on PCI
+51 −9
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ enum {
	AHCI_CMD_CLR_BUSY	= (1 << 10),

	RX_FIS_D2H_REG		= 0x40,	/* offset of D2H Register FIS data */
	RX_FIS_SDB		= 0x58, /* offset of SDB FIS data */
	RX_FIS_UNK		= 0x60, /* offset of Unknown FIS data */

	board_ahci		= 0,
@@ -202,6 +203,10 @@ struct ahci_port_priv {
	dma_addr_t		cmd_tbl_dma;
	void			*rx_fis;
	dma_addr_t		rx_fis_dma;
	/* for NCQ spurious interrupt analysis */
	int			ncq_saw_spurious_sdb_cnt;
	unsigned int		ncq_saw_d2h:1;
	unsigned int		ncq_saw_dmas:1;
};

static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg);
@@ -898,7 +903,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class)

	/* clear D2H reception area to properly wait for D2H FIS */
	ata_tf_init(ap->device, &tf);
	tf.command = 0xff;
	tf.command = 0x80;
	ata_tf_to_fis(&tf, d2h_fis, 0);

	rc = sata_std_hardreset(ap, class);
@@ -1109,8 +1114,9 @@ static void ahci_host_intr(struct ata_port *ap)
	void __iomem *mmio = ap->host->mmio_base;
	void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
	struct ata_eh_info *ehi = &ap->eh_info;
	struct ahci_port_priv *pp = ap->private_data;
	u32 status, qc_active;
	int rc;
	int rc, known_irq = 0;

	status = readl(port_mmio + PORT_IRQ_STAT);
	writel(status, port_mmio + PORT_IRQ_STAT);
@@ -1137,17 +1143,53 @@ static void ahci_host_intr(struct ata_port *ap)

	/* hmmm... a spurious interupt */

	/* some devices send D2H reg with I bit set during NCQ command phase */
	if (ap->sactive && (status & PORT_IRQ_D2H_REG_FIS))
	/* if !NCQ, ignore.  No modern ATA device has broken HSM
	 * implementation for non-NCQ commands.
	 */
	if (!ap->sactive)
		return;

	/* ignore interim PIO setup fis interrupts */
	if (ata_tag_valid(ap->active_tag) && (status & PORT_IRQ_PIOS_FIS))
		return;
	if (status & PORT_IRQ_D2H_REG_FIS) {
		if (!pp->ncq_saw_d2h)
			ata_port_printk(ap, KERN_INFO,
				"D2H reg with I during NCQ, "
				"this message won't be printed again\n");
		pp->ncq_saw_d2h = 1;
		known_irq = 1;
	}

	if (status & PORT_IRQ_DMAS_FIS) {
		if (!pp->ncq_saw_dmas)
			ata_port_printk(ap, KERN_INFO,
				"DMAS FIS during NCQ, "
				"this message won't be printed again\n");
		pp->ncq_saw_dmas = 1;
		known_irq = 1;
	}

	if (status & PORT_IRQ_SDB_FIS &&
		   pp->ncq_saw_spurious_sdb_cnt < 10) {
		/* SDB FIS containing spurious completions might be
		 * dangerous, we need to know more about them.  Print
		 * more of it.
		 */
		const u32 *f = pp->rx_fis + RX_FIS_SDB;

	if (ata_ratelimit())
		ata_port_printk(ap, KERN_INFO, "Spurious SDB FIS during NCQ "
				"issue=0x%x SAct=0x%x FIS=%08x:%08x%s\n",
				readl(port_mmio + PORT_CMD_ISSUE),
				readl(port_mmio + PORT_SCR_ACT),
				le32_to_cpu(f[0]), le32_to_cpu(f[1]),
				pp->ncq_saw_spurious_sdb_cnt < 10 ?
				"" : ", shutting up");

		pp->ncq_saw_spurious_sdb_cnt++;
		known_irq = 1;
	}

	if (!known_irq)
		ata_port_printk(ap, KERN_INFO, "spurious interrupt "
				"(irq_stat 0x%x active_tag %d sactive 0x%x)\n",
				"(irq_stat 0x%x active_tag 0x%x sactive 0x%x)\n",
				status, ap->active_tag, ap->sactive);
}

+4 −2
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ static void generic_error_handler(struct ata_port *ap)
/**
 *	generic_set_mode	-	mode setting
 *	@ap: interface to set up
 *	@unused: returned device on error
 *
 *	Use a non standard set_mode function. We don't want to be tuned.
 *	The BIOS configured everything. Our job is not to fiddle. We
@@ -71,7 +72,7 @@ static void generic_error_handler(struct ata_port *ap)
 *	and respect them.
 */

static void generic_set_mode(struct ata_port *ap)
static int generic_set_mode(struct ata_port *ap, struct ata_device **unused)
{
	int dma_enabled = 0;
	int i;
@@ -82,7 +83,7 @@ static void generic_set_mode(struct ata_port *ap)

	for (i = 0; i < ATA_MAX_DEVICES; i++) {
		struct ata_device *dev = &ap->device[i];
		if (ata_dev_enabled(dev)) {
		if (ata_dev_ready(dev)) {
			/* We don't really care */
			dev->pio_mode = XFER_PIO_0;
			dev->dma_mode = XFER_MW_DMA_0;
@@ -99,6 +100,7 @@ static void generic_set_mode(struct ata_port *ap)
			}
		}
	}
	return 0;
}

static struct scsi_host_template generic_sht = {
+2 −12
Original line number Diff line number Diff line
@@ -2431,18 +2431,8 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
	int i, rc = 0, used_dma = 0, found = 0;

	/* has private set_mode? */
	if (ap->ops->set_mode) {
		/* FIXME: make ->set_mode handle no device case and
		 * return error code and failing device on failure.
		 */
		for (i = 0; i < ATA_MAX_DEVICES; i++) {
			if (ata_dev_ready(&ap->device[i])) {
				ap->ops->set_mode(ap);
				break;
			}
		}
		return 0;
	}
	if (ap->ops->set_mode)
		return ap->ops->set_mode(ap, r_failed_dev);

	/* step 1: calculate xfer_mask */
	for (i = 0; i < ATA_MAX_DEVICES; i++) {
Loading