diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/ahci.c | 39 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 | ||||
-rw-r--r-- | drivers/ata/sata_nv.c | 14 | ||||
-rw-r--r-- | drivers/net/mv643xx_eth.c | 11 |
4 files changed, 27 insertions, 39 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index b517d2493551..e3c7b312287a 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -361,7 +361,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
361 | { PCI_VDEVICE(INTEL, 0x27c1), board_ahci }, /* ICH7 */ | 361 | { PCI_VDEVICE(INTEL, 0x27c1), board_ahci }, /* ICH7 */ |
362 | { PCI_VDEVICE(INTEL, 0x27c5), board_ahci }, /* ICH7M */ | 362 | { PCI_VDEVICE(INTEL, 0x27c5), board_ahci }, /* ICH7M */ |
363 | { PCI_VDEVICE(INTEL, 0x27c3), board_ahci }, /* ICH7R */ | 363 | { PCI_VDEVICE(INTEL, 0x27c3), board_ahci }, /* ICH7R */ |
364 | { PCI_VDEVICE(AL, 0x5288), board_ahci }, /* ULi M5288 */ | 364 | { PCI_VDEVICE(AL, 0x5288), board_ahci_ign_iferr }, /* ULi M5288 */ |
365 | { PCI_VDEVICE(INTEL, 0x2681), board_ahci }, /* ESB2 */ | 365 | { PCI_VDEVICE(INTEL, 0x2681), board_ahci }, /* ESB2 */ |
366 | { PCI_VDEVICE(INTEL, 0x2682), board_ahci }, /* ESB2 */ | 366 | { PCI_VDEVICE(INTEL, 0x2682), board_ahci }, /* ESB2 */ |
367 | { PCI_VDEVICE(INTEL, 0x2683), board_ahci }, /* ESB2 */ | 367 | { PCI_VDEVICE(INTEL, 0x2683), board_ahci }, /* ESB2 */ |
@@ -586,35 +586,18 @@ static void ahci_power_down(void __iomem *port_mmio, u32 cap) | |||
586 | { | 586 | { |
587 | u32 cmd, scontrol; | 587 | u32 cmd, scontrol; |
588 | 588 | ||
589 | cmd = readl(port_mmio + PORT_CMD) & ~PORT_CMD_ICC_MASK; | 589 | if (!(cap & HOST_CAP_SSS)) |
590 | 590 | return; | |
591 | if (cap & HOST_CAP_SSC) { | ||
592 | /* enable transitions to slumber mode */ | ||
593 | scontrol = readl(port_mmio + PORT_SCR_CTL); | ||
594 | if ((scontrol & 0x0f00) > 0x100) { | ||
595 | scontrol &= ~0xf00; | ||
596 | writel(scontrol, port_mmio + PORT_SCR_CTL); | ||
597 | } | ||
598 | |||
599 | /* put device into slumber mode */ | ||
600 | writel(cmd | PORT_CMD_ICC_SLUMBER, port_mmio + PORT_CMD); | ||
601 | |||
602 | /* wait for the transition to complete */ | ||
603 | ata_wait_register(port_mmio + PORT_CMD, PORT_CMD_ICC_SLUMBER, | ||
604 | PORT_CMD_ICC_SLUMBER, 1, 50); | ||
605 | } | ||
606 | 591 | ||
607 | /* put device into listen mode */ | 592 | /* put device into listen mode, first set PxSCTL.DET to 0 */ |
608 | if (cap & HOST_CAP_SSS) { | 593 | scontrol = readl(port_mmio + PORT_SCR_CTL); |
609 | /* first set PxSCTL.DET to 0 */ | 594 | scontrol &= ~0xf; |
610 | scontrol = readl(port_mmio + PORT_SCR_CTL); | 595 | writel(scontrol, port_mmio + PORT_SCR_CTL); |
611 | scontrol &= ~0xf; | ||
612 | writel(scontrol, port_mmio + PORT_SCR_CTL); | ||
613 | 596 | ||
614 | /* then set PxCMD.SUD to 0 */ | 597 | /* then set PxCMD.SUD to 0 */ |
615 | cmd &= ~PORT_CMD_SPIN_UP; | 598 | cmd = readl(port_mmio + PORT_CMD) & ~PORT_CMD_ICC_MASK; |
616 | writel(cmd, port_mmio + PORT_CMD); | 599 | cmd &= ~PORT_CMD_SPIN_UP; |
617 | } | 600 | writel(cmd, port_mmio + PORT_CMD); |
618 | } | 601 | } |
619 | 602 | ||
620 | static void ahci_init_port(void __iomem *port_mmio, u32 cap, | 603 | static void ahci_init_port(void __iomem *port_mmio, u32 cap, |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 836947da5b14..7cc5a4a910a4 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -372,7 +372,7 @@ struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev, | |||
372 | if (cmd->use_sg) { | 372 | if (cmd->use_sg) { |
373 | qc->__sg = (struct scatterlist *) cmd->request_buffer; | 373 | qc->__sg = (struct scatterlist *) cmd->request_buffer; |
374 | qc->n_elem = cmd->use_sg; | 374 | qc->n_elem = cmd->use_sg; |
375 | } else { | 375 | } else if (cmd->request_bufflen) { |
376 | qc->__sg = &qc->sgent; | 376 | qc->__sg = &qc->sgent; |
377 | qc->n_elem = 1; | 377 | qc->n_elem = 1; |
378 | } | 378 | } |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index f6d498e1cf80..f7a963eb1f02 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -700,7 +700,6 @@ static void nv_adma_check_cpb(struct ata_port *ap, int cpb_num, int force_err) | |||
700 | static int nv_host_intr(struct ata_port *ap, u8 irq_stat) | 700 | static int nv_host_intr(struct ata_port *ap, u8 irq_stat) |
701 | { | 701 | { |
702 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); | 702 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); |
703 | int handled; | ||
704 | 703 | ||
705 | /* freeze if hotplugged */ | 704 | /* freeze if hotplugged */ |
706 | if (unlikely(irq_stat & (NV_INT_ADDED | NV_INT_REMOVED))) { | 705 | if (unlikely(irq_stat & (NV_INT_ADDED | NV_INT_REMOVED))) { |
@@ -719,13 +718,7 @@ static int nv_host_intr(struct ata_port *ap, u8 irq_stat) | |||
719 | } | 718 | } |
720 | 719 | ||
721 | /* handle interrupt */ | 720 | /* handle interrupt */ |
722 | handled = ata_host_intr(ap, qc); | 721 | return ata_host_intr(ap, qc); |
723 | if (unlikely(!handled)) { | ||
724 | /* spurious, clear it */ | ||
725 | ata_check_status(ap); | ||
726 | } | ||
727 | |||
728 | return 1; | ||
729 | } | 722 | } |
730 | 723 | ||
731 | static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | 724 | static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) |
@@ -752,6 +745,11 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
752 | if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) { | 745 | if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) { |
753 | u8 irq_stat = readb(host->mmio_base + NV_INT_STATUS_CK804) | 746 | u8 irq_stat = readb(host->mmio_base + NV_INT_STATUS_CK804) |
754 | >> (NV_INT_PORT_SHIFT * i); | 747 | >> (NV_INT_PORT_SHIFT * i); |
748 | if(ata_tag_valid(ap->active_tag)) | ||
749 | /** NV_INT_DEV indication seems unreliable at times | ||
750 | at least in ADMA mode. Force it on always when a | ||
751 | command is active, to prevent losing interrupts. */ | ||
752 | irq_stat |= NV_INT_DEV; | ||
755 | handled += nv_host_intr(ap, irq_stat); | 753 | handled += nv_host_intr(ap, irq_stat); |
756 | continue; | 754 | continue; |
757 | } | 755 | } |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index c41ae4286eea..b3bf86422734 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -314,6 +314,13 @@ int mv643xx_eth_free_tx_descs(struct net_device *dev, int force) | |||
314 | 314 | ||
315 | while (mp->tx_desc_count > 0) { | 315 | while (mp->tx_desc_count > 0) { |
316 | spin_lock_irqsave(&mp->lock, flags); | 316 | spin_lock_irqsave(&mp->lock, flags); |
317 | |||
318 | /* tx_desc_count might have changed before acquiring the lock */ | ||
319 | if (mp->tx_desc_count <= 0) { | ||
320 | spin_unlock_irqrestore(&mp->lock, flags); | ||
321 | return released; | ||
322 | } | ||
323 | |||
317 | tx_index = mp->tx_used_desc_q; | 324 | tx_index = mp->tx_used_desc_q; |
318 | desc = &mp->p_tx_desc_area[tx_index]; | 325 | desc = &mp->p_tx_desc_area[tx_index]; |
319 | cmd_sts = desc->cmd_sts; | 326 | cmd_sts = desc->cmd_sts; |
@@ -332,13 +339,13 @@ int mv643xx_eth_free_tx_descs(struct net_device *dev, int force) | |||
332 | if (skb) | 339 | if (skb) |
333 | mp->tx_skb[tx_index] = NULL; | 340 | mp->tx_skb[tx_index] = NULL; |
334 | 341 | ||
335 | spin_unlock_irqrestore(&mp->lock, flags); | ||
336 | |||
337 | if (cmd_sts & ETH_ERROR_SUMMARY) { | 342 | if (cmd_sts & ETH_ERROR_SUMMARY) { |
338 | printk("%s: Error in TX\n", dev->name); | 343 | printk("%s: Error in TX\n", dev->name); |
339 | mp->stats.tx_errors++; | 344 | mp->stats.tx_errors++; |
340 | } | 345 | } |
341 | 346 | ||
347 | spin_unlock_irqrestore(&mp->lock, flags); | ||
348 | |||
342 | if (cmd_sts & ETH_TX_FIRST_DESC) | 349 | if (cmd_sts & ETH_TX_FIRST_DESC) |
343 | dma_unmap_single(NULL, addr, count, DMA_TO_DEVICE); | 350 | dma_unmap_single(NULL, addr, count, DMA_TO_DEVICE); |
344 | else | 351 | else |