Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: Power off empty ports
  libata-pmp: add support for Thermaltake BlackX Duet esata drive dock
  ATA: Don't powerdown Compaq Triflex IDE device on suspend
  libata: Use Maximum Write Same Length to report discard size limit
  drivers/ata/acard-ahci.c: fix enum warning
  pata_at91: SMC settings calculation bugfixes, support for t6z and IORDY
  libata-sff: prevent irq descriptions for dummy ports
  pata_cm64x: fix boot crash on parisc
  • Loading branch information
torvalds committed May 20, 2011
2 parents be84bfc + 8a745f1 commit 557eed6
Show file tree
Hide file tree
Showing 11 changed files with 289 additions and 111 deletions.
2 changes: 1 addition & 1 deletion drivers/ata/acard-ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id

VPRINTK("ENTER\n");

WARN_ON(ATA_MAX_QUEUE > AHCI_MAX_CMDS);
WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS);

if (!printed_version++)
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
Expand Down
10 changes: 8 additions & 2 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3619,8 +3619,14 @@ int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy,
scontrol |= (0x2 << 8);
break;
case ATA_LPM_MIN_POWER:
/* no restrictions on LPM transitions */
scontrol &= ~(0x3 << 8);
if (ata_link_nr_enabled(link) > 0)
/* no restrictions on LPM transitions */
scontrol &= ~(0x3 << 8);
else {
/* empty port, power off */
scontrol &= ~0xf;
scontrol |= (0x1 << 2);
}
break;
default:
WARN_ON(1);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -3423,7 +3423,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
return rc;
}

static int ata_link_nr_enabled(struct ata_link *link)
int ata_link_nr_enabled(struct ata_link *link)
{
struct ata_device *dev;
int cnt = 0;
Expand Down
10 changes: 10 additions & 0 deletions drivers/ata/libata-pmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,16 @@ static void sata_pmp_quirks(struct ata_port *ap)
* otherwise. Don't try hard to recover it.
*/
ap->pmp_link[ap->nr_pmp_links - 1].flags |= ATA_LFLAG_NO_RETRY;
} else if (vendor == 0x197b && devid == 0x2352) {
/* chip found in Thermaltake BlackX Duet, jmicron JMB350? */
ata_for_each_link(link, ap, EDGE) {
/* SRST breaks detection and disks get misclassified
* LPM disabled to avoid potential problems
*/
link->flags |= ATA_LFLAG_NO_LPM |
ATA_LFLAG_NO_SRST |
ATA_LFLAG_ASSUME_ATA;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,7 @@ static unsigned int ata_scsiop_inq_b0(struct ata_scsi_args *args, u8 *rbuf)
* with the unmap bit set.
*/
if (ata_id_has_trim(args->id)) {
put_unaligned_be32(65535 * 512 / 8, &rbuf[20]);
put_unaligned_be64(65535 * 512 / 8, &rbuf[36]);
put_unaligned_be32(1, &rbuf[28]);
}

Expand Down
9 changes: 7 additions & 2 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2447,13 +2447,18 @@ int ata_pci_sff_activate_host(struct ata_host *host,
return -ENOMEM;

if (!legacy_mode && pdev->irq) {
int i;

rc = devm_request_irq(dev, pdev->irq, irq_handler,
IRQF_SHARED, drv_name, host);
if (rc)
goto out;

ata_port_desc(host->ports[0], "irq %d", pdev->irq);
ata_port_desc(host->ports[1], "irq %d", pdev->irq);
for (i = 0; i < 2; i++) {
if (ata_port_is_dummy(host->ports[i]))
continue;
ata_port_desc(host->ports[i], "irq %d", pdev->irq);
}
} else if (legacy_mode) {
if (!ata_port_is_dummy(host->ports[0])) {
rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev),
Expand Down
Loading

0 comments on commit 557eed6

Please sign in to comment.