Commit 5da38d32 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: fix last_reset timestamp handling
  libata: Avoid overflow in ata_tf_read_block() when tf->hba_lbal > 127
  [libata] pata_pcmcia: another memory card support
  [libata] pata_sch: notice attached slave devices
  [libata] pata_cs553*.c: cleanup kernel-doc
parents 7e2cec86 19b72321
...@@ -612,7 +612,7 @@ u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev) ...@@ -612,7 +612,7 @@ u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev)
if (tf->flags & ATA_TFLAG_LBA48) { if (tf->flags & ATA_TFLAG_LBA48) {
block |= (u64)tf->hob_lbah << 40; block |= (u64)tf->hob_lbah << 40;
block |= (u64)tf->hob_lbam << 32; block |= (u64)tf->hob_lbam << 32;
block |= tf->hob_lbal << 24; block |= (u64)tf->hob_lbal << 24;
} else } else
block |= (tf->device & 0xf) << 24; block |= (tf->device & 0xf) << 24;
......
...@@ -610,9 +610,6 @@ void ata_scsi_error(struct Scsi_Host *host) ...@@ -610,9 +610,6 @@ void ata_scsi_error(struct Scsi_Host *host)
if (ata_ncq_enabled(dev)) if (ata_ncq_enabled(dev))
ehc->saved_ncq_enabled |= 1 << devno; ehc->saved_ncq_enabled |= 1 << devno;
} }
/* set last reset timestamp to some time in the past */
ehc->last_reset = jiffies - 60 * HZ;
} }
ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS; ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS;
...@@ -2281,17 +2278,21 @@ int ata_eh_reset(struct ata_link *link, int classify, ...@@ -2281,17 +2278,21 @@ int ata_eh_reset(struct ata_link *link, int classify,
if (link->flags & ATA_LFLAG_NO_SRST) if (link->flags & ATA_LFLAG_NO_SRST)
softreset = NULL; softreset = NULL;
now = jiffies; /* make sure each reset attemp is at least COOL_DOWN apart */
deadline = ata_deadline(ehc->last_reset, ATA_EH_RESET_COOL_DOWN); if (ehc->i.flags & ATA_EHI_DID_RESET) {
if (time_before(now, deadline)) now = jiffies;
schedule_timeout_uninterruptible(deadline - now); WARN_ON(time_after(ehc->last_reset, now));
deadline = ata_deadline(ehc->last_reset,
ATA_EH_RESET_COOL_DOWN);
if (time_before(now, deadline))
schedule_timeout_uninterruptible(deadline - now);
}
spin_lock_irqsave(ap->lock, flags); spin_lock_irqsave(ap->lock, flags);
ap->pflags |= ATA_PFLAG_RESETTING; ap->pflags |= ATA_PFLAG_RESETTING;
spin_unlock_irqrestore(ap->lock, flags); spin_unlock_irqrestore(ap->lock, flags);
ata_eh_about_to_do(link, NULL, ATA_EH_RESET); ata_eh_about_to_do(link, NULL, ATA_EH_RESET);
ehc->last_reset = jiffies;
ata_link_for_each_dev(dev, link) { ata_link_for_each_dev(dev, link) {
/* If we issue an SRST then an ATA drive (not ATAPI) /* If we issue an SRST then an ATA drive (not ATAPI)
...@@ -2379,7 +2380,6 @@ int ata_eh_reset(struct ata_link *link, int classify, ...@@ -2379,7 +2380,6 @@ int ata_eh_reset(struct ata_link *link, int classify,
/* /*
* Perform reset * Perform reset
*/ */
ehc->last_reset = jiffies;
if (ata_is_host_link(link)) if (ata_is_host_link(link))
ata_eh_freeze_port(ap); ata_eh_freeze_port(ap);
...@@ -2391,6 +2391,7 @@ int ata_eh_reset(struct ata_link *link, int classify, ...@@ -2391,6 +2391,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
reset == softreset ? "soft" : "hard"); reset == softreset ? "soft" : "hard");
/* mark that this EH session started with reset */ /* mark that this EH session started with reset */
ehc->last_reset = jiffies;
if (reset == hardreset) if (reset == hardreset)
ehc->i.flags |= ATA_EHI_DID_HARDRESET; ehc->i.flags |= ATA_EHI_DID_HARDRESET;
else else
...@@ -2535,7 +2536,7 @@ int ata_eh_reset(struct ata_link *link, int classify, ...@@ -2535,7 +2536,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
ata_eh_done(link, NULL, ATA_EH_RESET); ata_eh_done(link, NULL, ATA_EH_RESET);
if (slave) if (slave)
ata_eh_done(slave, NULL, ATA_EH_RESET); ata_eh_done(slave, NULL, ATA_EH_RESET);
ehc->last_reset = jiffies; ehc->last_reset = jiffies; /* update to completion time */
ehc->i.action |= ATA_EH_REVALIDATE; ehc->i.action |= ATA_EH_REVALIDATE;
rc = 0; rc = 0;
......
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
/** /**
* cs5535_cable_detect - detect cable type * cs5535_cable_detect - detect cable type
* @ap: Port to detect on * @ap: Port to detect on
* @deadline: deadline jiffies for the operation
* *
* Perform cable detection for ATA66 capable cable. Return a libata * Perform cable detection for ATA66 capable cable. Return a libata
* cable type. * cable type.
......
...@@ -110,7 +110,6 @@ static inline int cs5536_write(struct pci_dev *pdev, int reg, int val) ...@@ -110,7 +110,6 @@ static inline int cs5536_write(struct pci_dev *pdev, int reg, int val)
/** /**
* cs5536_cable_detect - detect cable type * cs5536_cable_detect - detect cable type
* @ap: Port to detect on * @ap: Port to detect on
* @deadline: deadline jiffies for the operation
* *
* Perform cable detection for ATA66 capable cable. Return a libata * Perform cable detection for ATA66 capable cable. Return a libata
* cable type. * cable type.
......
...@@ -416,6 +416,7 @@ static struct pcmcia_device_id pcmcia_devices[] = { ...@@ -416,6 +416,7 @@ static struct pcmcia_device_id pcmcia_devices[] = {
PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209), PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e), PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e),
PCMCIA_MFC_DEVICE_PROD_ID12(1, "SanDisk", "ConnectPlus", 0x7a954bd9, 0x74be00c6), PCMCIA_MFC_DEVICE_PROD_ID12(1, "SanDisk", "ConnectPlus", 0x7a954bd9, 0x74be00c6),
PCMCIA_DEVICE_PROD_ID2("Flash Card", 0x5a362506),
PCMCIA_DEVICE_NULL, PCMCIA_DEVICE_NULL,
}; };
......
...@@ -83,7 +83,7 @@ static struct ata_port_operations sch_pata_ops = { ...@@ -83,7 +83,7 @@ static struct ata_port_operations sch_pata_ops = {
}; };
static struct ata_port_info sch_port_info = { static struct ata_port_info sch_port_info = {
.flags = 0, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, /* pio0-4 */ .pio_mask = ATA_PIO4, /* pio0-4 */
.mwdma_mask = ATA_MWDMA2, /* mwdma0-2 */ .mwdma_mask = ATA_MWDMA2, /* mwdma0-2 */
.udma_mask = ATA_UDMA5, /* udma0-5 */ .udma_mask = ATA_UDMA5, /* udma0-5 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment