Commit 0637810f 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:
  sata_nv: give up hardreset on nf2
  libata-sff: fix 32-bit PIO ATAPI regression
parents 51f26773 7dac745b
...@@ -773,18 +773,32 @@ unsigned int ata_sff_data_xfer32(struct ata_device *dev, unsigned char *buf, ...@@ -773,18 +773,32 @@ unsigned int ata_sff_data_xfer32(struct ata_device *dev, unsigned char *buf,
else else
iowrite32_rep(data_addr, buf, words); iowrite32_rep(data_addr, buf, words);
/* Transfer trailing bytes, if any */
if (unlikely(slop)) { if (unlikely(slop)) {
__le32 pad; unsigned char pad[4];
/* Point buf to the tail of buffer */
buf += buflen - slop;
/*
* Use io*_rep() accessors here as well to avoid pointlessly
* swapping bytes to and fro on the big endian machines...
*/
if (rw == READ) { if (rw == READ) {
pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr)); if (slop < 3)
memcpy(buf + buflen - slop, &pad, slop); ioread16_rep(data_addr, pad, 1);
else
ioread32_rep(data_addr, pad, 1);
memcpy(buf, pad, slop);
} else { } else {
memcpy(&pad, buf + buflen - slop, slop); memcpy(pad, buf, slop);
iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr); if (slop < 3)
iowrite16_rep(data_addr, pad, 1);
else
iowrite32_rep(data_addr, pad, 1);
} }
words++;
} }
return words << 2; return (buflen + 1) & ~1;
} }
EXPORT_SYMBOL_GPL(ata_sff_data_xfer32); EXPORT_SYMBOL_GPL(ata_sff_data_xfer32);
......
...@@ -421,19 +421,21 @@ static struct ata_port_operations nv_generic_ops = { ...@@ -421,19 +421,21 @@ static struct ata_port_operations nv_generic_ops = {
.hardreset = ATA_OP_NULL, .hardreset = ATA_OP_NULL,
}; };
/* OSDL bz3352 reports that nf2/3 controllers can't determine device /* nf2 is ripe with hardreset related problems.
* signature reliably. Also, the following thread reports detection *
* failure on cold boot with the standard debouncing timing. * kernel bz#3352 reports nf2/3 controllers can't determine device
* signature reliably. The following thread reports detection failure
* on cold boot with the standard debouncing timing.
* *
* http://thread.gmane.org/gmane.linux.ide/34098 * http://thread.gmane.org/gmane.linux.ide/34098
* *
* Debounce with hotplug timing and request follow-up SRST. * And bz#12176 reports that hardreset simply doesn't work on nf2.
* Give up on it and just don't do hardreset.
*/ */
static struct ata_port_operations nv_nf2_ops = { static struct ata_port_operations nv_nf2_ops = {
.inherits = &nv_common_ops, .inherits = &nv_generic_ops,
.freeze = nv_nf2_freeze, .freeze = nv_nf2_freeze,
.thaw = nv_nf2_thaw, .thaw = nv_nf2_thaw,
.hardreset = nv_noclassify_hardreset,
}; };
/* For initial probing after boot and hot plugging, hardreset mostly /* For initial probing after boot and hot plugging, hardreset mostly
......
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