Commit c9a512f8 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

ata: make qc_prep return ata_completion_errors

commit 95364f36 upstream.

In case a driver wants to return an error from qc_prep, return enum
ata_completion_errors. sata_mv is one of those drivers -- see the next
patch. Other drivers return the newly defined AC_ERR_OK.

[v2] use enum ata_completion_errors and AC_ERR_OK.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-ide@vger.kernel.org
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a34e3ce8
...@@ -250,7 +250,7 @@ High-level taskfile hooks ...@@ -250,7 +250,7 @@ High-level taskfile hooks
:: ::
void (*qc_prep) (struct ata_queued_cmd *qc); enum ata_completion_errors (*qc_prep) (struct ata_queued_cmd *qc);
int (*qc_issue) (struct ata_queued_cmd *qc); int (*qc_issue) (struct ata_queued_cmd *qc);
......
...@@ -72,7 +72,7 @@ struct acard_sg { ...@@ -72,7 +72,7 @@ struct acard_sg {
__le32 size; /* bit 31 (EOT) max==0x10000 (64k) */ __le32 size; /* bit 31 (EOT) max==0x10000 (64k) */
}; };
static void acard_ahci_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc);
static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc); static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc);
static int acard_ahci_port_start(struct ata_port *ap); static int acard_ahci_port_start(struct ata_port *ap);
static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
...@@ -257,7 +257,7 @@ static unsigned int acard_ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) ...@@ -257,7 +257,7 @@ static unsigned int acard_ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl)
return si; return si;
} }
static void acard_ahci_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct ahci_port_priv *pp = ap->private_data; struct ahci_port_priv *pp = ap->private_data;
...@@ -295,6 +295,8 @@ static void acard_ahci_qc_prep(struct ata_queued_cmd *qc) ...@@ -295,6 +295,8 @@ static void acard_ahci_qc_prep(struct ata_queued_cmd *qc)
opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH; opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH;
ahci_fill_cmd_slot(pp, qc->hw_tag, opts); ahci_fill_cmd_slot(pp, qc->hw_tag, opts);
return AC_ERR_OK;
} }
static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc) static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
......
...@@ -73,7 +73,7 @@ static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); ...@@ -73,7 +73,7 @@ static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc); static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc);
static int ahci_port_start(struct ata_port *ap); static int ahci_port_start(struct ata_port *ap);
static void ahci_port_stop(struct ata_port *ap); static void ahci_port_stop(struct ata_port *ap);
static void ahci_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors ahci_qc_prep(struct ata_queued_cmd *qc);
static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc); static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc);
static void ahci_freeze(struct ata_port *ap); static void ahci_freeze(struct ata_port *ap);
static void ahci_thaw(struct ata_port *ap); static void ahci_thaw(struct ata_port *ap);
...@@ -1640,7 +1640,7 @@ static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc) ...@@ -1640,7 +1640,7 @@ static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc)
return sata_pmp_qc_defer_cmd_switch(qc); return sata_pmp_qc_defer_cmd_switch(qc);
} }
static void ahci_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors ahci_qc_prep(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct ahci_port_priv *pp = ap->private_data; struct ahci_port_priv *pp = ap->private_data;
...@@ -1676,6 +1676,8 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc) ...@@ -1676,6 +1676,8 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH; opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH;
ahci_fill_cmd_slot(pp, qc->hw_tag, opts); ahci_fill_cmd_slot(pp, qc->hw_tag, opts);
return AC_ERR_OK;
} }
static void ahci_fbs_dec_intr(struct ata_port *ap) static void ahci_fbs_dec_intr(struct ata_port *ap)
......
...@@ -4996,7 +4996,10 @@ int ata_std_qc_defer(struct ata_queued_cmd *qc) ...@@ -4996,7 +4996,10 @@ int ata_std_qc_defer(struct ata_queued_cmd *qc)
return ATA_DEFER_LINK; return ATA_DEFER_LINK;
} }
void ata_noop_qc_prep(struct ata_queued_cmd *qc) { } enum ata_completion_errors ata_noop_qc_prep(struct ata_queued_cmd *qc)
{
return AC_ERR_OK;
}
/** /**
* ata_sg_init - Associate command with scatter-gather table. * ata_sg_init - Associate command with scatter-gather table.
...@@ -5483,7 +5486,9 @@ void ata_qc_issue(struct ata_queued_cmd *qc) ...@@ -5483,7 +5486,9 @@ void ata_qc_issue(struct ata_queued_cmd *qc)
return; return;
} }
ap->ops->qc_prep(qc); qc->err_mask |= ap->ops->qc_prep(qc);
if (unlikely(qc->err_mask))
goto err;
trace_ata_qc_issue(qc); trace_ata_qc_issue(qc);
qc->err_mask |= ap->ops->qc_issue(qc); qc->err_mask |= ap->ops->qc_issue(qc);
if (unlikely(qc->err_mask)) if (unlikely(qc->err_mask))
......
...@@ -2695,12 +2695,14 @@ static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc) ...@@ -2695,12 +2695,14 @@ static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc)
* LOCKING: * LOCKING:
* spin_lock_irqsave(host lock) * spin_lock_irqsave(host lock)
*/ */
void ata_bmdma_qc_prep(struct ata_queued_cmd *qc) enum ata_completion_errors ata_bmdma_qc_prep(struct ata_queued_cmd *qc)
{ {
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
ata_bmdma_fill_sg(qc); ata_bmdma_fill_sg(qc);
return AC_ERR_OK;
} }
EXPORT_SYMBOL_GPL(ata_bmdma_qc_prep); EXPORT_SYMBOL_GPL(ata_bmdma_qc_prep);
...@@ -2713,12 +2715,14 @@ EXPORT_SYMBOL_GPL(ata_bmdma_qc_prep); ...@@ -2713,12 +2715,14 @@ EXPORT_SYMBOL_GPL(ata_bmdma_qc_prep);
* LOCKING: * LOCKING:
* spin_lock_irqsave(host lock) * spin_lock_irqsave(host lock)
*/ */
void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc) enum ata_completion_errors ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc)
{ {
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
ata_bmdma_fill_sg_dumb(qc); ata_bmdma_fill_sg_dumb(qc);
return AC_ERR_OK;
} }
EXPORT_SYMBOL_GPL(ata_bmdma_dumb_qc_prep); EXPORT_SYMBOL_GPL(ata_bmdma_dumb_qc_prep);
......
...@@ -507,7 +507,7 @@ static int pata_macio_cable_detect(struct ata_port *ap) ...@@ -507,7 +507,7 @@ static int pata_macio_cable_detect(struct ata_port *ap)
return ATA_CBL_PATA40; return ATA_CBL_PATA40;
} }
static void pata_macio_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors pata_macio_qc_prep(struct ata_queued_cmd *qc)
{ {
unsigned int write = (qc->tf.flags & ATA_TFLAG_WRITE); unsigned int write = (qc->tf.flags & ATA_TFLAG_WRITE);
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
...@@ -520,7 +520,7 @@ static void pata_macio_qc_prep(struct ata_queued_cmd *qc) ...@@ -520,7 +520,7 @@ static void pata_macio_qc_prep(struct ata_queued_cmd *qc)
__func__, qc, qc->flags, write, qc->dev->devno); __func__, qc, qc->flags, write, qc->dev->devno);
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
table = (struct dbdma_cmd *) priv->dma_table_cpu; table = (struct dbdma_cmd *) priv->dma_table_cpu;
...@@ -565,6 +565,8 @@ static void pata_macio_qc_prep(struct ata_queued_cmd *qc) ...@@ -565,6 +565,8 @@ static void pata_macio_qc_prep(struct ata_queued_cmd *qc)
table->command = cpu_to_le16(DBDMA_STOP); table->command = cpu_to_le16(DBDMA_STOP);
dev_dbgdma(priv->dev, "%s: %d DMA list entries\n", __func__, pi); dev_dbgdma(priv->dev, "%s: %d DMA list entries\n", __func__, pi);
return AC_ERR_OK;
} }
......
...@@ -58,25 +58,27 @@ static void pxa_ata_dma_irq(void *d) ...@@ -58,25 +58,27 @@ static void pxa_ata_dma_irq(void *d)
/* /*
* Prepare taskfile for submission. * Prepare taskfile for submission.
*/ */
static void pxa_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors pxa_qc_prep(struct ata_queued_cmd *qc)
{ {
struct pata_pxa_data *pd = qc->ap->private_data; struct pata_pxa_data *pd = qc->ap->private_data;
struct dma_async_tx_descriptor *tx; struct dma_async_tx_descriptor *tx;
enum dma_transfer_direction dir; enum dma_transfer_direction dir;
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
dir = (qc->dma_dir == DMA_TO_DEVICE ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM); dir = (qc->dma_dir == DMA_TO_DEVICE ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM);
tx = dmaengine_prep_slave_sg(pd->dma_chan, qc->sg, qc->n_elem, dir, tx = dmaengine_prep_slave_sg(pd->dma_chan, qc->sg, qc->n_elem, dir,
DMA_PREP_INTERRUPT); DMA_PREP_INTERRUPT);
if (!tx) { if (!tx) {
ata_dev_err(qc->dev, "prep_slave_sg() failed\n"); ata_dev_err(qc->dev, "prep_slave_sg() failed\n");
return; return AC_ERR_OK;
} }
tx->callback = pxa_ata_dma_irq; tx->callback = pxa_ata_dma_irq;
tx->callback_param = pd; tx->callback_param = pd;
pd->dma_cookie = dmaengine_submit(tx); pd->dma_cookie = dmaengine_submit(tx);
return AC_ERR_OK;
} }
/* /*
......
...@@ -132,7 +132,7 @@ static int adma_ata_init_one(struct pci_dev *pdev, ...@@ -132,7 +132,7 @@ static int adma_ata_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent); const struct pci_device_id *ent);
static int adma_port_start(struct ata_port *ap); static int adma_port_start(struct ata_port *ap);
static void adma_port_stop(struct ata_port *ap); static void adma_port_stop(struct ata_port *ap);
static void adma_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors adma_qc_prep(struct ata_queued_cmd *qc);
static unsigned int adma_qc_issue(struct ata_queued_cmd *qc); static unsigned int adma_qc_issue(struct ata_queued_cmd *qc);
static int adma_check_atapi_dma(struct ata_queued_cmd *qc); static int adma_check_atapi_dma(struct ata_queued_cmd *qc);
static void adma_freeze(struct ata_port *ap); static void adma_freeze(struct ata_port *ap);
...@@ -311,7 +311,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc) ...@@ -311,7 +311,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
return i; return i;
} }
static void adma_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors adma_qc_prep(struct ata_queued_cmd *qc)
{ {
struct adma_port_priv *pp = qc->ap->private_data; struct adma_port_priv *pp = qc->ap->private_data;
u8 *buf = pp->pkt; u8 *buf = pp->pkt;
...@@ -322,7 +322,7 @@ static void adma_qc_prep(struct ata_queued_cmd *qc) ...@@ -322,7 +322,7 @@ static void adma_qc_prep(struct ata_queued_cmd *qc)
adma_enter_reg_mode(qc->ap); adma_enter_reg_mode(qc->ap);
if (qc->tf.protocol != ATA_PROT_DMA) if (qc->tf.protocol != ATA_PROT_DMA)
return; return AC_ERR_OK;
buf[i++] = 0; /* Response flags */ buf[i++] = 0; /* Response flags */
buf[i++] = 0; /* reserved */ buf[i++] = 0; /* reserved */
...@@ -387,6 +387,7 @@ static void adma_qc_prep(struct ata_queued_cmd *qc) ...@@ -387,6 +387,7 @@ static void adma_qc_prep(struct ata_queued_cmd *qc)
printk("%s\n", obuf); printk("%s\n", obuf);
} }
#endif #endif
return AC_ERR_OK;
} }
static inline void adma_packet_start(struct ata_queued_cmd *qc) static inline void adma_packet_start(struct ata_queued_cmd *qc)
......
...@@ -507,7 +507,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc, ...@@ -507,7 +507,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
return num_prde; return num_prde;
} }
static void sata_fsl_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors sata_fsl_qc_prep(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct sata_fsl_port_priv *pp = ap->private_data; struct sata_fsl_port_priv *pp = ap->private_data;
...@@ -553,6 +553,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc) ...@@ -553,6 +553,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)
VPRINTK("SATA FSL : xx_qc_prep, di = 0x%x, ttl = %d, num_prde = %d\n", VPRINTK("SATA FSL : xx_qc_prep, di = 0x%x, ttl = %d, num_prde = %d\n",
desc_info, ttl_dwords, num_prde); desc_info, ttl_dwords, num_prde);
return AC_ERR_OK;
} }
static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc) static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc)
......
...@@ -472,7 +472,7 @@ static void inic_fill_sg(struct inic_prd *prd, struct ata_queued_cmd *qc) ...@@ -472,7 +472,7 @@ static void inic_fill_sg(struct inic_prd *prd, struct ata_queued_cmd *qc)
prd[-1].flags |= PRD_END; prd[-1].flags |= PRD_END;
} }
static void inic_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors inic_qc_prep(struct ata_queued_cmd *qc)
{ {
struct inic_port_priv *pp = qc->ap->private_data; struct inic_port_priv *pp = qc->ap->private_data;
struct inic_pkt *pkt = pp->pkt; struct inic_pkt *pkt = pp->pkt;
...@@ -532,6 +532,8 @@ static void inic_qc_prep(struct ata_queued_cmd *qc) ...@@ -532,6 +532,8 @@ static void inic_qc_prep(struct ata_queued_cmd *qc)
inic_fill_sg(prd, qc); inic_fill_sg(prd, qc);
pp->cpb_tbl[0] = pp->pkt_dma; pp->cpb_tbl[0] = pp->pkt_dma;
return AC_ERR_OK;
} }
static unsigned int inic_qc_issue(struct ata_queued_cmd *qc) static unsigned int inic_qc_issue(struct ata_queued_cmd *qc)
......
...@@ -605,8 +605,8 @@ static int mv5_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val) ...@@ -605,8 +605,8 @@ static int mv5_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val)
static int mv_port_start(struct ata_port *ap); static int mv_port_start(struct ata_port *ap);
static void mv_port_stop(struct ata_port *ap); static void mv_port_stop(struct ata_port *ap);
static int mv_qc_defer(struct ata_queued_cmd *qc); static int mv_qc_defer(struct ata_queued_cmd *qc);
static void mv_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors mv_qc_prep(struct ata_queued_cmd *qc);
static void mv_qc_prep_iie(struct ata_queued_cmd *qc); static enum ata_completion_errors mv_qc_prep_iie(struct ata_queued_cmd *qc);
static unsigned int mv_qc_issue(struct ata_queued_cmd *qc); static unsigned int mv_qc_issue(struct ata_queued_cmd *qc);
static int mv_hardreset(struct ata_link *link, unsigned int *class, static int mv_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline); unsigned long deadline);
...@@ -2044,7 +2044,7 @@ static void mv_rw_multi_errata_sata24(struct ata_queued_cmd *qc) ...@@ -2044,7 +2044,7 @@ static void mv_rw_multi_errata_sata24(struct ata_queued_cmd *qc)
* LOCKING: * LOCKING:
* Inherited from caller. * Inherited from caller.
*/ */
static void mv_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors mv_qc_prep(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct mv_port_priv *pp = ap->private_data; struct mv_port_priv *pp = ap->private_data;
...@@ -2056,15 +2056,15 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) ...@@ -2056,15 +2056,15 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
switch (tf->protocol) { switch (tf->protocol) {
case ATA_PROT_DMA: case ATA_PROT_DMA:
if (tf->command == ATA_CMD_DSM) if (tf->command == ATA_CMD_DSM)
return; return AC_ERR_OK;
/* fall-thru */ /* fall-thru */
case ATA_PROT_NCQ: case ATA_PROT_NCQ:
break; /* continue below */ break; /* continue below */
case ATA_PROT_PIO: case ATA_PROT_PIO:
mv_rw_multi_errata_sata24(qc); mv_rw_multi_errata_sata24(qc);
return; return AC_ERR_OK;
default: default:
return; return AC_ERR_OK;
} }
/* Fill in command request block /* Fill in command request block
...@@ -2129,8 +2129,10 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) ...@@ -2129,8 +2129,10 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
mv_crqb_pack_cmd(cw++, tf->command, ATA_REG_CMD, 1); /* last */ mv_crqb_pack_cmd(cw++, tf->command, ATA_REG_CMD, 1); /* last */
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
mv_fill_sg(qc); mv_fill_sg(qc);
return AC_ERR_OK;
} }
/** /**
...@@ -2145,7 +2147,7 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) ...@@ -2145,7 +2147,7 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
* LOCKING: * LOCKING:
* Inherited from caller. * Inherited from caller.
*/ */
static void mv_qc_prep_iie(struct ata_queued_cmd *qc) static enum ata_completion_errors mv_qc_prep_iie(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct mv_port_priv *pp = ap->private_data; struct mv_port_priv *pp = ap->private_data;
...@@ -2156,9 +2158,9 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc) ...@@ -2156,9 +2158,9 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)
if ((tf->protocol != ATA_PROT_DMA) && if ((tf->protocol != ATA_PROT_DMA) &&
(tf->protocol != ATA_PROT_NCQ)) (tf->protocol != ATA_PROT_NCQ))
return; return AC_ERR_OK;
if (tf->command == ATA_CMD_DSM) if (tf->command == ATA_CMD_DSM)
return; /* use bmdma for this */ return AC_ERR_OK; /* use bmdma for this */
/* Fill in Gen IIE command request block */ /* Fill in Gen IIE command request block */
if (!(tf->flags & ATA_TFLAG_WRITE)) if (!(tf->flags & ATA_TFLAG_WRITE))
...@@ -2199,8 +2201,10 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc) ...@@ -2199,8 +2201,10 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)
); );
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
mv_fill_sg(qc); mv_fill_sg(qc);
return AC_ERR_OK;
} }
/** /**
......
...@@ -313,7 +313,7 @@ static void nv_ck804_freeze(struct ata_port *ap); ...@@ -313,7 +313,7 @@ static void nv_ck804_freeze(struct ata_port *ap);
static void nv_ck804_thaw(struct ata_port *ap); static void nv_ck804_thaw(struct ata_port *ap);
static int nv_adma_slave_config(struct scsi_device *sdev); static int nv_adma_slave_config(struct scsi_device *sdev);
static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc); static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc);
static void nv_adma_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors nv_adma_qc_prep(struct ata_queued_cmd *qc);
static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc); static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc);
static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance); static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance);
static void nv_adma_irq_clear(struct ata_port *ap); static void nv_adma_irq_clear(struct ata_port *ap);
...@@ -335,7 +335,7 @@ static void nv_mcp55_freeze(struct ata_port *ap); ...@@ -335,7 +335,7 @@ static void nv_mcp55_freeze(struct ata_port *ap);
static void nv_swncq_error_handler(struct ata_port *ap); static void nv_swncq_error_handler(struct ata_port *ap);
static int nv_swncq_slave_config(struct scsi_device *sdev); static int nv_swncq_slave_config(struct scsi_device *sdev);
static int nv_swncq_port_start(struct ata_port *ap); static int nv_swncq_port_start(struct ata_port *ap);
static void nv_swncq_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors nv_swncq_qc_prep(struct ata_queued_cmd *qc);
static void nv_swncq_fill_sg(struct ata_queued_cmd *qc); static void nv_swncq_fill_sg(struct ata_queued_cmd *qc);
static unsigned int nv_swncq_qc_issue(struct ata_queued_cmd *qc); static unsigned int nv_swncq_qc_issue(struct ata_queued_cmd *qc);
static void nv_swncq_irq_clear(struct ata_port *ap, u16 fis); static void nv_swncq_irq_clear(struct ata_port *ap, u16 fis);
...@@ -1365,7 +1365,7 @@ static int nv_adma_use_reg_mode(struct ata_queued_cmd *qc) ...@@ -1365,7 +1365,7 @@ static int nv_adma_use_reg_mode(struct ata_queued_cmd *qc)
return 1; return 1;
} }
static void nv_adma_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors nv_adma_qc_prep(struct ata_queued_cmd *qc)
{ {
struct nv_adma_port_priv *pp = qc->ap->private_data; struct nv_adma_port_priv *pp = qc->ap->private_data;
struct nv_adma_cpb *cpb = &pp->cpb[qc->hw_tag]; struct nv_adma_cpb *cpb = &pp->cpb[qc->hw_tag];
...@@ -1377,7 +1377,7 @@ static void nv_adma_qc_prep(struct ata_queued_cmd *qc) ...@@ -1377,7 +1377,7 @@ static void nv_adma_qc_prep(struct ata_queued_cmd *qc)
(qc->flags & ATA_QCFLAG_DMAMAP)); (qc->flags & ATA_QCFLAG_DMAMAP));
nv_adma_register_mode(qc->ap); nv_adma_register_mode(qc->ap);
ata_bmdma_qc_prep(qc); ata_bmdma_qc_prep(qc);
return; return AC_ERR_OK;
} }
cpb->resp_flags = NV_CPB_RESP_DONE; cpb->resp_flags = NV_CPB_RESP_DONE;
...@@ -1409,6 +1409,8 @@ static void nv_adma_qc_prep(struct ata_queued_cmd *qc) ...@@ -1409,6 +1409,8 @@ static void nv_adma_qc_prep(struct ata_queued_cmd *qc)
cpb->ctl_flags = ctl_flags; cpb->ctl_flags = ctl_flags;
wmb(); wmb();
cpb->resp_flags = 0; cpb->resp_flags = 0;
return AC_ERR_OK;
} }
static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc) static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)
...@@ -1972,17 +1974,19 @@ static int nv_swncq_port_start(struct ata_port *ap) ...@@ -1972,17 +1974,19 @@ static int nv_swncq_port_start(struct ata_port *ap)
return 0; return 0;
} }
static void nv_swncq_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors nv_swncq_qc_prep(struct ata_queued_cmd *qc)
{ {
if (qc->tf.protocol != ATA_PROT_NCQ) { if (qc->tf.protocol != ATA_PROT_NCQ) {
ata_bmdma_qc_prep(qc); ata_bmdma_qc_prep(qc);
return; return AC_ERR_OK;
} }
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
nv_swncq_fill_sg(qc); nv_swncq_fill_sg(qc);
return AC_ERR_OK;
} }
static void nv_swncq_fill_sg(struct ata_queued_cmd *qc) static void nv_swncq_fill_sg(struct ata_queued_cmd *qc)
......
...@@ -155,7 +155,7 @@ static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 va ...@@ -155,7 +155,7 @@ static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 va
static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static int pdc_common_port_start(struct ata_port *ap); static int pdc_common_port_start(struct ata_port *ap);
static int pdc_sata_port_start(struct ata_port *ap); static int pdc_sata_port_start(struct ata_port *ap);
static void pdc_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors pdc_qc_prep(struct ata_queued_cmd *qc);
static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf); static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf); static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
static int pdc_check_atapi_dma(struct ata_queued_cmd *qc); static int pdc_check_atapi_dma(struct ata_queued_cmd *qc);
...@@ -649,7 +649,7 @@ static void pdc_fill_sg(struct ata_queued_cmd *qc) ...@@ -649,7 +649,7 @@ static void pdc_fill_sg(struct ata_queued_cmd *qc)
prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT);
} }
static void pdc_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors pdc_qc_prep(struct ata_queued_cmd *qc)
{ {
struct pdc_port_priv *pp = qc->ap->private_data; struct pdc_port_priv *pp = qc->ap->private_data;
unsigned int i; unsigned int i;
...@@ -681,6 +681,8 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc) ...@@ -681,6 +681,8 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc)
default: default:
break; break;
} }
return AC_ERR_OK;
} }
static int pdc_is_sataii_tx4(unsigned long flags) static int pdc_is_sataii_tx4(unsigned long flags)
......
...@@ -116,7 +116,7 @@ static int qs_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); ...@@ -116,7 +116,7 @@ static int qs_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
static int qs_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); static int qs_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static int qs_port_start(struct ata_port *ap); static int qs_port_start(struct ata_port *ap);
static void qs_host_stop(struct ata_host *host); static void qs_host_stop(struct ata_host *host);
static void qs_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors qs_qc_prep(struct ata_queued_cmd *qc);
static unsigned int qs_qc_issue(struct ata_queued_cmd *qc); static unsigned int qs_qc_issue(struct ata_queued_cmd *qc);
static int qs_check_atapi_dma(struct ata_queued_cmd *qc); static int qs_check_atapi_dma(struct ata_queued_cmd *qc);
static void qs_freeze(struct ata_port *ap); static void qs_freeze(struct ata_port *ap);
...@@ -276,7 +276,7 @@ static unsigned int qs_fill_sg(struct ata_queued_cmd *qc) ...@@ -276,7 +276,7 @@ static unsigned int qs_fill_sg(struct ata_queued_cmd *qc)
return si; return si;
} }
static void qs_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors qs_qc_prep(struct ata_queued_cmd *qc)
{ {
struct qs_port_priv *pp = qc->ap->private_data; struct qs_port_priv *pp = qc->ap->private_data;
u8 dflags = QS_DF_PORD, *buf = pp->pkt; u8 dflags = QS_DF_PORD, *buf = pp->pkt;
...@@ -288,7 +288,7 @@ static void qs_qc_prep(struct ata_queued_cmd *qc) ...@@ -288,7 +288,7 @@ static void qs_qc_prep(struct ata_queued_cmd *qc)
qs_enter_reg_mode(qc->ap); qs_enter_reg_mode(qc->ap);
if (qc->tf.protocol != ATA_PROT_DMA) if (qc->tf.protocol != ATA_PROT_DMA)
return; return AC_ERR_OK;
nelem = qs_fill_sg(qc); nelem = qs_fill_sg(qc);
...@@ -311,6 +311,8 @@ static void qs_qc_prep(struct ata_queued_cmd *qc) ...@@ -311,6 +311,8 @@ static void qs_qc_prep(struct ata_queued_cmd *qc)
/* frame information structure (FIS) */ /* frame information structure (FIS) */
ata_tf_to_fis(&qc->tf, 0, 1, &buf[32]); ata_tf_to_fis(&qc->tf, 0, 1, &buf[32]);
return AC_ERR_OK;
} }
static inline void qs_packet_start(struct ata_queued_cmd *qc) static inline void qs_packet_start(struct ata_queued_cmd *qc)
......
...@@ -554,12 +554,14 @@ static void sata_rcar_bmdma_fill_sg(struct ata_queued_cmd *qc) ...@@ -554,12 +554,14 @@ static void sata_rcar_bmdma_fill_sg(struct ata_queued_cmd *qc)
prd[si - 1].addr |= cpu_to_le32(SATA_RCAR_DTEND); prd[si - 1].addr |= cpu_to_le32(SATA_RCAR_DTEND);
} }
static void sata_rcar_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors sata_rcar_qc_prep(struct ata_queued_cmd *qc)
{ {
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
sata_rcar_bmdma_fill_sg(qc); sata_rcar_bmdma_fill_sg(qc);
return AC_ERR_OK;
} }
static void sata_rcar_bmdma_setup(struct ata_queued_cmd *qc) static void sata_rcar_bmdma_setup(struct ata_queued_cmd *qc)
......
...@@ -119,7 +119,7 @@ static void sil_dev_config(struct ata_device *dev); ...@@ -119,7 +119,7 @@ static void sil_dev_config(struct ata_device *dev);
static int sil_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); static int sil_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
static int sil_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); static int sil_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
static int sil_set_mode(struct ata_link *link, struct ata_device **r_failed); static int sil_set_mode(struct ata_link *link, struct ata_device **r_failed);
static void sil_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors sil_qc_prep(struct ata_queued_cmd *qc);
static void sil_bmdma_setup(struct ata_queued_cmd *qc); static void sil_bmdma_setup(struct ata_queued_cmd *qc);
static void sil_bmdma_start(struct ata_queued_cmd *qc); static void sil_bmdma_start(struct ata_queued_cmd *qc);
static void sil_bmdma_stop(struct ata_queued_cmd *qc); static void sil_bmdma_stop(struct ata_queued_cmd *qc);
...@@ -333,12 +333,14 @@ static void sil_fill_sg(struct ata_queued_cmd *qc) ...@@ -333,12 +333,14 @@ static void sil_fill_sg(struct ata_queued_cmd *qc)
last_prd->flags_len |= cpu_to_le32(ATA_PRD_EOT); last_prd->flags_len |= cpu_to_le32(ATA_PRD_EOT);
} }
static void sil_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors sil_qc_prep(struct ata_queued_cmd *qc)
{ {
if (!(qc->flags & ATA_QCFLAG_DMAMAP)) if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return; return AC_ERR_OK;
sil_fill_sg(qc); sil_fill_sg(qc);
return AC_ERR_OK;
} }
static unsigned char sil_get_device_cache_line(struct pci_dev *pdev) static unsigned char sil_get_device_cache_line(struct pci_dev *pdev)
......
...@@ -336,7 +336,7 @@ static void sil24_dev_config(struct ata_device *dev); ...@@ -336,7 +336,7 @@ static void sil24_dev_config(struct ata_device *dev);
static int sil24_scr_read(struct ata_link *link, unsigned sc_reg, u32 *val); static int sil24_scr_read(struct ata_link *link, unsigned sc_reg, u32 *val);
static int sil24_scr_write(struct ata_link *link, unsigned sc_reg, u32 val); static int sil24_scr_write(struct ata_link *link, unsigned sc_reg, u32 val);
static int sil24_qc_defer(struct ata_queued_cmd *qc); static int sil24_qc_defer(struct ata_queued_cmd *qc);
static void sil24_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors sil24_qc_prep(struct ata_queued_cmd *qc);
static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc); static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc);
static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc); static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc);
static void sil24_pmp_attach(struct ata_port *ap); static void sil24_pmp_attach(struct ata_port *ap);
...@@ -840,7 +840,7 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc) ...@@ -840,7 +840,7 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc)
return ata_std_qc_defer(qc); return ata_std_qc_defer(qc);
} }
static void sil24_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors sil24_qc_prep(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct sil24_port_priv *pp = ap->private_data; struct sil24_port_priv *pp = ap->private_data;
...@@ -884,6 +884,8 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc) ...@@ -884,6 +884,8 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
if (qc->flags & ATA_QCFLAG_DMAMAP) if (qc->flags & ATA_QCFLAG_DMAMAP)
sil24_fill_sg(qc, sge); sil24_fill_sg(qc, sge);
return AC_ERR_OK;
} }
static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc) static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc)
......
...@@ -218,7 +218,7 @@ static void pdc_error_handler(struct ata_port *ap); ...@@ -218,7 +218,7 @@ static void pdc_error_handler(struct ata_port *ap);
static void pdc_freeze(struct ata_port *ap); static void pdc_freeze(struct ata_port *ap);
static void pdc_thaw(struct ata_port *ap); static void pdc_thaw(struct ata_port *ap);
static int pdc_port_start(struct ata_port *ap); static int pdc_port_start(struct ata_port *ap);
static void pdc20621_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors pdc20621_qc_prep(struct ata_queued_cmd *qc);
static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf); static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf); static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
static unsigned int pdc20621_dimm_init(struct ata_host *host); static unsigned int pdc20621_dimm_init(struct ata_host *host);
...@@ -546,7 +546,7 @@ static void pdc20621_nodata_prep(struct ata_queued_cmd *qc) ...@@ -546,7 +546,7 @@ static void pdc20621_nodata_prep(struct ata_queued_cmd *qc)
VPRINTK("ata pkt buf ofs %u, mmio copied\n", i); VPRINTK("ata pkt buf ofs %u, mmio copied\n", i);
} }
static void pdc20621_qc_prep(struct ata_queued_cmd *qc) static enum ata_completion_errors pdc20621_qc_prep(struct ata_queued_cmd *qc)
{ {
switch (qc->tf.protocol) { switch (qc->tf.protocol) {
case ATA_PROT_DMA: case ATA_PROT_DMA:
...@@ -558,6 +558,8 @@ static void pdc20621_qc_prep(struct ata_queued_cmd *qc) ...@@ -558,6 +558,8 @@ static void pdc20621_qc_prep(struct ata_queued_cmd *qc)
default: default:
break; break;
} }
return AC_ERR_OK;
} }
static void __pdc20621_push_hdma(struct ata_queued_cmd *qc, static void __pdc20621_push_hdma(struct ata_queued_cmd *qc,
......
...@@ -913,9 +913,9 @@ struct ata_port_operations { ...@@ -913,9 +913,9 @@ struct ata_port_operations {
/* /*
* Command execution * Command execution
*/ */
int (*qc_defer)(struct ata_queued_cmd *qc); int (*qc_defer)(struct ata_queued_cmd *qc);
int (*check_atapi_dma)(struct ata_queued_cmd *qc); int (*check_atapi_dma)(struct ata_queued_cmd *qc);
void (*qc_prep)(struct ata_queued_cmd *qc); enum ata_completion_errors (*qc_prep)(struct ata_queued_cmd *qc);
unsigned int (*qc_issue)(struct ata_queued_cmd *qc); unsigned int (*qc_issue)(struct ata_queued_cmd *qc);
bool (*qc_fill_rtf)(struct ata_queued_cmd *qc); bool (*qc_fill_rtf)(struct ata_queued_cmd *qc);
...@@ -1182,7 +1182,7 @@ extern int ata_xfer_mode2shift(unsigned long xfer_mode); ...@@ -1182,7 +1182,7 @@ extern int ata_xfer_mode2shift(unsigned long xfer_mode);
extern const char *ata_mode_string(unsigned long xfer_mask); extern const char *ata_mode_string(unsigned long xfer_mask);
extern unsigned long ata_id_xfermask(const u16 *id); extern unsigned long ata_id_xfermask(const u16 *id);
extern int ata_std_qc_defer(struct ata_queued_cmd *qc); extern int ata_std_qc_defer(struct ata_queued_cmd *qc);
extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); extern enum ata_completion_errors ata_noop_qc_prep(struct ata_queued_cmd *qc);
extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
unsigned int n_elem); unsigned int n_elem);
extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); extern unsigned int ata_dev_classify(const struct ata_taskfile *tf);
...@@ -1917,9 +1917,9 @@ extern const struct ata_port_operations ata_bmdma_port_ops; ...@@ -1917,9 +1917,9 @@ extern const struct ata_port_operations ata_bmdma_port_ops;
.sg_tablesize = LIBATA_MAX_PRD, \ .sg_tablesize = LIBATA_MAX_PRD, \
.dma_boundary = ATA_DMA_BOUNDARY .dma_boundary = ATA_DMA_BOUNDARY
extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc); extern enum ata_completion_errors ata_bmdma_qc_prep(struct ata_queued_cmd *qc);
extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc); extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc);
extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc); extern enum ata_completion_errors ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc);
extern unsigned int ata_bmdma_port_intr(struct ata_port *ap, extern unsigned int ata_bmdma_port_intr(struct ata_port *ap,
struct ata_queued_cmd *qc); struct ata_queued_cmd *qc);
extern irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance); extern irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance);
......
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