Skip to content

Commit

Permalink
Merge branch 'libata/for-3.10-fixes' into libata/for-3.11
Browse files Browse the repository at this point in the history
libata/for-3.10-fixes never got submitted during v3.10 cycle.  Merge
it into for-3.11 so that it can be routed together with other changes
scheduled for v3.11.

Three trivial conflicts in drivers/ata/sata_rcar.c.  All are caused by
1b20f6a ("sata_rcar: add 'base' local variable to some functions")
conflicting with logic updates in for-3.10-fixes.  The offending
commit simply adds local variable @base on functions which
dereferences sata_rcar_priv->base multiple times.  The resolutions are
trivial - applying s/priv->base/base/ in the conflicting logic
updates.

Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Tejun Heo committed Jul 3, 2013
2 parents 9bbb1b0 + 1cfc7df commit 5a0a6a4
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 46 deletions.
2 changes: 1 addition & 1 deletion drivers/ata/acard-ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* acard-ahci.c - ACard AHCI SATA support
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down
5 changes: 4 additions & 1 deletion drivers/ata/ahci.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* ahci.c - AHCI SATA support
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down Expand Up @@ -291,6 +291,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x8d64), board_ahci }, /* Wellsburg RAID */
{ PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */
{ PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */
{ PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */

/* JMicron 360/1/3/5/6, match class to avoid IDE function */
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
Expand Down Expand Up @@ -423,6 +424,8 @@ static const struct pci_device_id ahci_pci_tbl[] = {
.driver_data = board_ahci_yes_fbs }, /* 88se9125 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a),
.driver_data = board_ahci_yes_fbs }, /* 88se9172 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9172),
.driver_data = board_ahci_yes_fbs }, /* 88se9172 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9192),
.driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3),
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/ahci.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* ahci.h - Common AHCI SATA definitions and declarations
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down
19 changes: 18 additions & 1 deletion drivers/ata/ata_piix.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* ata_piix.c - Intel PATA/SATA controllers
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down Expand Up @@ -151,6 +151,7 @@ enum piix_controller_ids {
piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */
ich8_sata_snb,
ich8_2port_sata_snb,
ich8_2port_sata_byt,
};

struct piix_map_db {
Expand Down Expand Up @@ -334,6 +335,11 @@ static const struct pci_device_id piix_pci_tbl[] = {
{ 0x8086, 0x8d60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
/* SATA Controller IDE (Wellsburg) */
{ 0x8086, 0x8d68, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (BayTrail) */
{ 0x8086, 0x0F20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt },
{ 0x8086, 0x0F21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt },
/* SATA Controller IDE (Coleto Creek) */
{ 0x8086, 0x23a6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },

{ } /* terminate list */
};
Expand Down Expand Up @@ -441,6 +447,7 @@ static const struct piix_map_db *piix_map_db_table[] = {
[tolapai_sata] = &tolapai_map_db,
[ich8_sata_snb] = &ich8_map_db,
[ich8_2port_sata_snb] = &ich8_2port_map_db,
[ich8_2port_sata_byt] = &ich8_2port_map_db,
};

static struct pci_bits piix_enable_bits[] = {
Expand Down Expand Up @@ -1254,6 +1261,16 @@ static struct ata_port_info piix_port_info[] = {
.udma_mask = ATA_UDMA6,
.port_ops = &piix_sata_ops,
},

[ich8_2port_sata_byt] =
{
.flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR | PIIX_FLAG_PIO16,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA2,
.udma_mask = ATA_UDMA6,
.port_ops = &piix_sata_ops,
},

};

#define AHCI_PCI_BAR 5
Expand Down
5 changes: 2 additions & 3 deletions drivers/ata/libahci.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* libahci.c - Common AHCI SATA low-level routines
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down Expand Up @@ -1561,8 +1561,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
u32 fbs = readl(port_mmio + PORT_FBS);
int pmp = fbs >> PORT_FBS_DWE_OFFSET;

if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links) &&
ata_link_online(&ap->pmp_link[pmp])) {
if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links)) {
link = &ap->pmp_link[pmp];
fbs_need_dec = true;
}
Expand Down
8 changes: 7 additions & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* libata-core.c - helper library for ATA
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down Expand Up @@ -1602,6 +1602,12 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
qc->tf = *tf;
if (cdb)
memcpy(qc->cdb, cdb, ATAPI_CDB_LEN);

/* some SATA bridges need us to indicate data xfer direction */
if (tf->protocol == ATAPI_PROT_DMA && (dev->flags & ATA_DFLAG_DMADIR) &&
dma_dir == DMA_FROM_DEVICE)
qc->tf.feature |= ATAPI_DMADIR;

qc->flags |= ATA_QCFLAG_RESULT_TF;
qc->dma_dir = dma_dir;
if (dma_dir != DMA_NONE) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* libata-eh.c - libata error handling
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down
33 changes: 17 additions & 16 deletions drivers/ata/libata-pmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,30 +389,31 @@ static void sata_pmp_quirks(struct ata_port *ap)
/* link reports offline after LPM */
link->flags |= ATA_LFLAG_NO_LPM;

/* Class code report is unreliable. */
/*
* Class code report is unreliable and SRST times
* out under certain configurations.
*/
if (link->pmp < 5)
link->flags |= ATA_LFLAG_ASSUME_ATA;
link->flags |= ATA_LFLAG_NO_SRST |
ATA_LFLAG_ASSUME_ATA;

/* port 5 is for SEMB device and it doesn't like SRST */
if (link->pmp == 5)
link->flags |= ATA_LFLAG_NO_SRST |
ATA_LFLAG_ASSUME_SEMB;
}
} else if (vendor == 0x1095 && devid == 0x4723) {
/* sil4723 quirks */
ata_for_each_link(link, ap, EDGE) {
/* link reports offline after LPM */
link->flags |= ATA_LFLAG_NO_LPM;

/* class code report is unreliable */
if (link->pmp < 2)
link->flags |= ATA_LFLAG_ASSUME_ATA;

/* the config device at port 2 locks up on SRST */
if (link->pmp == 2)
link->flags |= ATA_LFLAG_NO_SRST |
ATA_LFLAG_ASSUME_ATA;
}
/*
* sil4723 quirks
*
* Link reports offline after LPM. Class code report is
* unreliable. SIMG PMPs never got SRST reliable and the
* config device at port 2 locks up on SRST.
*/
ata_for_each_link(link, ap, EDGE)
link->flags |= ATA_LFLAG_NO_LPM |
ATA_LFLAG_NO_SRST |
ATA_LFLAG_ASSUME_ATA;
} else if (vendor == 0x1095 && devid == 0x4726) {
/* sil4726 quirks */
ata_for_each_link(link, ap, EDGE) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* libata-scsi.c - helper library for ATA
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* libata-sff.c - helper library for PCI IDE BMDMA
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/pdc_adma.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* pdc_adma.c - Pacific Digital Corporation ADMA
*
* Maintained by: Mark Lord <mlord@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
*
* Copyright 2005 Mark Lord
*
Expand Down
20 changes: 18 additions & 2 deletions drivers/ata/sata_highbank.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,18 +339,34 @@ static int highbank_initialize_phys(struct device *dev, void __iomem *addr)
return 0;
}

/*
* The Calxeda SATA phy intermittently fails to bring up a link with Gen3
* Retrying the phy hard reset can work around the issue, but the drive
* may fail again. In less than 150 out of 15000 test runs, it took more
* than 10 tries for the link to be established (but never more than 35).
* Triple the maximum observed retry count to provide plenty of margin for
* rare events and to guarantee that the link is established.
*
* Also, the default 2 second time-out on a failed drive is too long in
* this situation. The uboot implementation of the same driver function
* uses a much shorter time-out period and never experiences a time out
* issue. Reducing the time-out to 500ms improves the responsiveness.
* The other timing constants were kept the same as the stock AHCI driver.
* This change was also tested 15000 times on 24 drives and none of them
* experienced a time out.
*/
static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline)
{
const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
static const unsigned long timing[] = { 5, 100, 500};
struct ata_port *ap = link->ap;
struct ahci_port_priv *pp = ap->private_data;
u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
struct ata_taskfile tf;
bool online;
u32 sstatus;
int rc;
int retry = 10;
int retry = 100;

ahci_stop_engine(ap);

Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/sata_promise.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* sata_promise.c - Promise SATA
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Mikael Pettersson <mikpe@it.uu.se>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
Expand Down
25 changes: 13 additions & 12 deletions drivers/ata/sata_rcar.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static void sata_rcar_thaw(struct ata_port *ap)
void __iomem *base = priv->base;

/* ack */
iowrite32(~SATA_RCAR_INT_MASK, base + SATAINTSTAT_REG);
iowrite32(~(u32)SATA_RCAR_INT_MASK, base + SATAINTSTAT_REG);

ata_sff_thaw(ap);

Expand Down Expand Up @@ -545,6 +545,7 @@ static void sata_rcar_bmdma_start(struct ata_queued_cmd *qc)

/* start host DMA transaction */
dmactl = ioread32(base + ATAPI_CONTROL1_REG);
dmactl &= ~ATAPI_CONTROL1_STOP;
dmactl |= ATAPI_CONTROL1_START;
iowrite32(dmactl, base + ATAPI_CONTROL1_REG);
}
Expand Down Expand Up @@ -622,17 +623,16 @@ static struct ata_port_operations sata_rcar_port_ops = {
.bmdma_status = sata_rcar_bmdma_status,
};

static int sata_rcar_serr_interrupt(struct ata_port *ap)
static void sata_rcar_serr_interrupt(struct ata_port *ap)
{
struct sata_rcar_priv *priv = ap->host->private_data;
struct ata_eh_info *ehi = &ap->link.eh_info;
int freeze = 0;
int handled = 0;
u32 serror;

serror = ioread32(priv->base + SCRSERR_REG);
if (!serror)
return 0;
return;

DPRINTK("SError @host_intr: 0x%x\n", serror);

Expand All @@ -645,19 +645,16 @@ static int sata_rcar_serr_interrupt(struct ata_port *ap)
ata_ehi_push_desc(ehi, "%s", "hotplug");

freeze = serror & SERR_COMM_WAKE ? 0 : 1;
handled = 1;
}

/* freeze or abort */
if (freeze)
ata_port_freeze(ap);
else
ata_port_abort(ap);

return handled;
}

static int sata_rcar_ata_interrupt(struct ata_port *ap)
static void sata_rcar_ata_interrupt(struct ata_port *ap)
{
struct ata_queued_cmd *qc;
int handled = 0;
Expand All @@ -666,7 +663,9 @@ static int sata_rcar_ata_interrupt(struct ata_port *ap)
if (qc)
handled |= ata_bmdma_port_intr(ap, qc);

return handled;
/* be sure to clear ATA interrupt */
if (!handled)
sata_rcar_check_status(ap);
}

static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance)
Expand All @@ -682,19 +681,21 @@ static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance)
spin_lock_irqsave(&host->lock, flags);

sataintstat = ioread32(base + SATAINTSTAT_REG);
sataintstat &= SATA_RCAR_INT_MASK;
if (!sataintstat)
goto done;
/* ack */
iowrite32(sataintstat & ~SATA_RCAR_INT_MASK, base + SATAINTSTAT_REG);
iowrite32(~sataintstat & 0x7ff, base + SATAINTSTAT_REG);

ap = host->ports[0];

if (sataintstat & SATAINTSTAT_ATA)
handled |= sata_rcar_ata_interrupt(ap);
sata_rcar_ata_interrupt(ap);

if (sataintstat & SATAINTSTAT_SERR)
handled |= sata_rcar_serr_interrupt(ap);
sata_rcar_serr_interrupt(ap);

handled = 1;
done:
spin_unlock_irqrestore(&host->lock, flags);

Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/sata_sil.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* sata_sil.c - Silicon Image SATA
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/sata_sx4.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* sata_sx4.c - Promise SATA
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/sata_via.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* sata_via.c - VIA Serial ATA controllers
*
* Maintained by: Jeff Garzik <jgarzik@pobox.com>
* Maintained by: Tejun Heo <tj@kernel.org>
* Please ALWAYS copy linux-ide@vger.kernel.org
* on emails.
*
Expand Down

0 comments on commit 5a0a6a4

Please sign in to comment.