@@ -134,7 +134,7 @@ static int altera_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
/* send the first byte */
writel(hw_txbyte(hw, 0), hw->base + ALTERA_SPI_TXDATA);
- wait_for_completion(&hw->done);
+ wait_for_completion_io(&hw->done);
/* disable receive interrupt */
hw->imr &= ~ALTERA_SPI_CONTROL_IRRDY_MSK;
writel(hw->imr, hw->base + ALTERA_SPI_CONTROL);
@@ -1114,7 +1114,7 @@ static int atmel_spi_one_transfer(struct spi_master *master,
/* interrupts are disabled, so free the lock for schedule */
atmel_spi_unlock(as);
- ret = wait_for_completion_timeout(&as->xfer_completion,
+ ret = wait_for_completion_io_timeout(&as->xfer_completion,
SPI_DMA_TIMEOUT);
atmel_spi_lock(as);
if (WARN_ON(ret == 0)) {
@@ -402,7 +402,7 @@ static int au1550_spi_dma_txrxb(struct spi_device *spi, struct spi_transfer *t)
hw->regs->psc_spipcr = PSC_SPIPCR_MS;
wmb(); /* drain writebuffer */
- wait_for_completion(&hw->master_done);
+ wait_for_completion_io(&hw->master_done);
au1xxx_dbdma_stop(hw->dma_tx_ch);
au1xxx_dbdma_stop(hw->dma_rx_ch);
@@ -552,7 +552,7 @@ static int au1550_spi_pio_txrxb(struct spi_device *spi, struct spi_transfer *t)
hw->regs->psc_spipcr = PSC_SPIPCR_MS;
wmb(); /* drain writebuffer */
- wait_for_completion(&hw->master_done);
+ wait_for_completion_io(&hw->master_done);
return hw->rx_count < hw->tx_count ? hw->rx_count : hw->tx_count;
}
@@ -271,7 +271,7 @@ static int bcm2835_spi_transfer_one(struct spi_master *master,
if (err)
goto out;
- timeout = wait_for_completion_timeout(&bs->done,
+ timeout = wait_for_completion_io_timeout(&bs->done,
msecs_to_jiffies(BCM2835_SPI_TIMEOUT_MS));
if (!timeout) {
err = -ETIMEDOUT;
@@ -197,7 +197,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t)
PINGPONG_COMMAND_START_NOW,
bs->regs + HSSPI_PINGPONG_COMMAND_REG(0));
- if (wait_for_completion_timeout(&bs->done, HZ) == 0) {
+ if (wait_for_completion_io_timeout(&bs->done, HZ) == 0) {
dev_err(&bs->pdev->dev, "transfer timed out!\n");
return -ETIMEDOUT;
}
@@ -195,7 +195,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,
/* Enable the CMD_DONE interrupt */
bcm_spi_writeb(bs, SPI_INTR_CMD_DONE, SPI_INT_MASK);
- timeout = wait_for_completion_timeout(&bs->done, HZ);
+ timeout = wait_for_completion_io_timeout(&bs->done, HZ);
if (!timeout)
return -ETIMEDOUT;
@@ -204,7 +204,7 @@ static int efm32_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
spin_unlock_irq(&ddata->lock);
- wait_for_completion(&ddata->done);
+ wait_for_completion_io(&ddata->done);
spin_lock_irq(&ddata->lock);
@@ -415,7 +415,7 @@ static void ep93xx_spi_pio_transfer(struct ep93xx_spi *espi)
*/
if (ep93xx_spi_read_write(espi)) {
ep93xx_spi_enable_interrupts(espi);
- wait_for_completion(&espi->wait);
+ wait_for_completion_io(&espi->wait);
}
}
@@ -583,7 +583,7 @@ static void ep93xx_spi_dma_transfer(struct ep93xx_spi *espi)
dma_async_issue_pending(espi->dma_rx);
dma_async_issue_pending(espi->dma_tx);
- wait_for_completion(&espi->wait);
+ wait_for_completion_io(&espi->wait);
ep93xx_spi_dma_finish(espi, DMA_MEM_TO_DEV);
ep93xx_spi_dma_finish(espi, DMA_DEV_TO_MEM);
@@ -242,7 +242,7 @@ static int fsl_espi_bufs(struct spi_device *spi, struct spi_transfer *t)
if (ret)
return ret;
- wait_for_completion(&mpc8xxx_spi->done);
+ wait_for_completion_io(&mpc8xxx_spi->done);
/* disable rx ints */
mpc8xxx_spi_write_reg(®_base->mask, 0);
@@ -342,7 +342,7 @@ static int fsl_spi_bufs(struct spi_device *spi, struct spi_transfer *t,
if (ret)
return ret;
- wait_for_completion(&mpc8xxx_spi->done);
+ wait_for_completion_io(&mpc8xxx_spi->done);
/* disable rx ints */
mpc8xxx_spi_write_reg(®_base->mask, 0);
@@ -939,7 +939,7 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
dma_async_issue_pending(master->dma_tx);
dma_async_issue_pending(master->dma_rx);
/* Wait SDMA to finish the data transfer.*/
- ret = wait_for_completion_timeout(&spi_imx->dma_tx_completion,
+ ret = wait_for_completion_io_timeout(&spi_imx->dma_tx_completion,
IMX_DMA_TIMEOUT);
if (!ret) {
pr_warn("%s %s: I/O Error in DMA TX\n",
@@ -947,7 +947,7 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
dev_name(&master->dev));
dmaengine_terminate_all(master->dma_tx);
} else {
- ret = wait_for_completion_timeout(&spi_imx->dma_rx_completion,
+ ret = wait_for_completion_io_timeout(&spi_imx->dma_rx_completion,
IMX_DMA_TIMEOUT);
if (!ret) {
pr_warn("%s %s: I/O Error in DMA RX\n",
@@ -994,7 +994,7 @@ static int spi_imx_pio_transfer(struct spi_device *spi,
spi_imx->devtype_data->intctrl(spi_imx, MXC_INT_TE);
- wait_for_completion(&spi_imx->xfer_done);
+ wait_for_completion_io(&spi_imx->xfer_done);
return transfer->len;
}
@@ -170,7 +170,7 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
reinit_completion(&mps->txisrdone);
out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY);
out_be32(&fifo->tximr, MPC512x_PSC_FIFO_EMPTY);
- wait_for_completion(&mps->txisrdone);
+ wait_for_completion_io(&mps->txisrdone);
}
/*
@@ -183,7 +183,7 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
out_be16(&fifo->rfalarm, rfalarm);
}
out_be16(&psc->mpc52xx_psc_imr, MPC52xx_PSC_IMR_RXRDY);
- wait_for_completion(&mps->done);
+ wait_for_completion_io(&mps->done);
recv_at_once = in_be16(&fifo->rfnum);
dev_dbg(&spi->dev, "%d bytes received\n", recv_at_once);
@@ -282,7 +282,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi,
dmaengine_submit(desc);
dma_async_issue_pending(ssp->dmach);
- ret = wait_for_completion_timeout(&spi->c,
+ ret = wait_for_completion_io_timeout(&spi->c,
msecs_to_jiffies(SSP_TIMEOUT));
if (!ret) {
dev_err(ssp->dev, "DMA transfer timeout\n");
@@ -185,7 +185,7 @@ static int nuc900_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
nuc900_spi_gobusy(hw);
- wait_for_completion(&hw->done);
+ wait_for_completion_io(&hw->done);
return hw->count;
}
@@ -151,7 +151,7 @@ static int tiny_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
writeb(TINY_SPI_STATUS_TXE, hw->base + TINY_SPI_STATUS);
}
- wait_for_completion(&hw->done);
+ wait_for_completion_io(&hw->done);
} else {
/* we need to tighten the transfer loop */
writeb(txp ? *txp++ : 0, hw->base + TINY_SPI_TXDATA);
@@ -487,7 +487,7 @@ omap2_mcspi_rx_dma(struct spi_device *spi, struct spi_transfer *xfer,
dma_async_issue_pending(mcspi_dma->dma_rx);
omap2_mcspi_set_dma_req(spi, 1, 1);
- wait_for_completion(&mcspi_dma->dma_rx_completion);
+ wait_for_completion_io(&mcspi_dma->dma_rx_completion);
dma_unmap_single(mcspi->dev, xfer->rx_dma, count,
DMA_FROM_DEVICE);
@@ -601,7 +601,7 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer)
count = omap2_mcspi_rx_dma(spi, xfer, cfg, es);
if (tx != NULL) {
- wait_for_completion(&mcspi_dma->dma_tx_completion);
+ wait_for_completion_io(&mcspi_dma->dma_tx_completion);
dma_unmap_single(mcspi->dev, xfer->tx_dma, xfer->len,
DMA_TO_DEVICE);
@@ -161,7 +161,7 @@ static int spi_ppc4xx_txrx(struct spi_device *spi, struct spi_transfer *t)
data = hw->tx ? hw->tx[0] : 0;
out_8(&hw->regs->txd, data);
out_8(&hw->regs->cr, SPI_PPC4XX_CR_STR);
- wait_for_completion(&hw->done);
+ wait_for_completion_io(&hw->done);
return hw->count;
}
@@ -469,7 +469,7 @@ static int spi_qup_transfer_one(struct spi_master *master,
goto exit;
}
- if (!wait_for_completion_timeout(&controller->done, timeout))
+ if (!wait_for_completion_io_timeout(&controller->done, timeout))
ret = -ETIMEDOUT;
exit:
spi_qup_set_state(controller, QUP_STATE_RESET);
@@ -417,7 +417,7 @@ static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
/* send the first byte */
writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
- wait_for_completion(&hw->done);
+ wait_for_completion_io(&hw->done);
return hw->count;
}
@@ -488,7 +488,7 @@ static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
ms += 10; /* some tolerance */
val = msecs_to_jiffies(ms) + 10;
- val = wait_for_completion_timeout(&sdd->xfer_completion, val);
+ val = wait_for_completion_io_timeout(&sdd->xfer_completion, val);
/*
* If the previous xfer was completed within timeout, then
@@ -590,7 +590,7 @@ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
}
/* wait for tx fifo to be emptied / rx fifo to be filled */
- ret = wait_for_completion_timeout(&p->done, HZ);
+ ret = wait_for_completion_io_timeout(&p->done, HZ);
if (!ret) {
dev_err(&p->pdev->dev, "PIO timeout\n");
ret = -ETIMEDOUT;
@@ -701,7 +701,7 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx,
}
/* wait for tx fifo to be emptied / rx fifo to be filled */
- ret = wait_for_completion_timeout(&p->done, HZ);
+ ret = wait_for_completion_io_timeout(&p->done, HZ);
if (!ret) {
dev_err(&p->pdev->dev, "DMA timeout\n");
ret = -ETIMEDOUT;
@@ -325,7 +325,7 @@ static void spi_sirfsoc_cmd_transfer(struct spi_device *spi,
sspi->base + SIRFSOC_SPI_INT_EN);
writel(SIRFSOC_SPI_CMD_TX_EN,
sspi->base + SIRFSOC_SPI_TX_RX_EN);
- if (wait_for_completion_timeout(&sspi->tx_done, timeout) == 0) {
+ if (wait_for_completion_io_timeout(&sspi->tx_done, timeout) == 0) {
dev_err(&spi->dev, "cmd transfer timeout\n");
return;
}
@@ -384,7 +384,7 @@ static void spi_sirfsoc_dma_transfer(struct spi_device *spi,
dma_async_issue_pending(sspi->rx_chan);
writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN,
sspi->base + SIRFSOC_SPI_TX_RX_EN);
- if (wait_for_completion_timeout(&sspi->rx_done, timeout) == 0) {
+ if (wait_for_completion_io_timeout(&sspi->rx_done, timeout) == 0) {
dev_err(&spi->dev, "transfer timeout\n");
dmaengine_terminate_all(sspi->rx_chan);
} else
@@ -394,7 +394,7 @@ static void spi_sirfsoc_dma_transfer(struct spi_device *spi,
* we get rx data by writing tx data, so if rx is done, tx has
* done earlier
*/
- if (wait_for_completion_timeout(&sspi->tx_done, timeout) == 0) {
+ if (wait_for_completion_io_timeout(&sspi->tx_done, timeout) == 0) {
dev_err(&spi->dev, "transfer timeout\n");
dmaengine_terminate_all(sspi->tx_chan);
}
@@ -443,8 +443,8 @@ static void spi_sirfsoc_pio_transfer(struct spi_device *spi,
sspi->base + SIRFSOC_SPI_INT_EN);
writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN,
sspi->base + SIRFSOC_SPI_TX_RX_EN);
- if (!wait_for_completion_timeout(&sspi->tx_done, timeout) ||
- !wait_for_completion_timeout(&sspi->rx_done, timeout)) {
+ if (!wait_for_completion_io_timeout(&sspi->tx_done, timeout) ||
+ !wait_for_completion_io_timeout(&sspi->rx_done, timeout)) {
dev_err(&spi->dev, "transfer timeout\n");
break;
}
@@ -279,7 +279,7 @@ static int sun4i_spi_transfer_one(struct spi_master *master,
reg = sun4i_spi_read(sspi, SUN4I_CTL_REG);
sun4i_spi_write(sspi, SUN4I_CTL_REG, reg | SUN4I_CTL_XCH);
- timeout = wait_for_completion_timeout(&sspi->done,
+ timeout = wait_for_completion_io_timeout(&sspi->done,
msecs_to_jiffies(1000));
if (!timeout) {
ret = -ETIMEDOUT;
@@ -269,7 +269,7 @@ static int sun6i_spi_transfer_one(struct spi_master *master,
reg = sun6i_spi_read(sspi, SUN6I_TFR_CTL_REG);
sun6i_spi_write(sspi, SUN6I_TFR_CTL_REG, reg | SUN6I_TFR_CTL_XCH);
- timeout = wait_for_completion_timeout(&sspi->done,
+ timeout = wait_for_completion_io_timeout(&sspi->done,
msecs_to_jiffies(1000));
if (!timeout) {
ret = -ETIMEDOUT;
@@ -833,7 +833,7 @@ static int tegra_spi_transfer_one_message(struct spi_master *master,
}
is_first_msg = false;
- ret = wait_for_completion_timeout(&tspi->xfer_completion,
+ ret = wait_for_completion_io_timeout(&tspi->xfer_completion,
SPI_DMA_TIMEOUT);
if (WARN_ON(ret == 0)) {
dev_err(tspi->dev,
@@ -337,7 +337,7 @@ static int tegra_sflash_transfer_one_message(struct spi_master *master,
goto exit;
}
is_first_msg = false;
- ret = wait_for_completion_timeout(&tsd->xfer_completion,
+ ret = wait_for_completion_io_timeout(&tsd->xfer_completion,
SPI_DMA_TIMEOUT);
if (WARN_ON(ret == 0)) {
dev_err(tsd->dev,
@@ -820,7 +820,7 @@ static int tegra_slink_transfer_one(struct spi_master *master,
return ret;
}
- ret = wait_for_completion_timeout(&tspi->xfer_completion,
+ ret = wait_for_completion_io_timeout(&tspi->xfer_completion,
SLINK_DMA_TIMEOUT);
if (WARN_ON(ret == 0)) {
dev_err(tspi->dev,
@@ -230,7 +230,7 @@ static int qspi_write_msg(struct ti_qspi *qspi, struct spi_transfer *t)
}
ti_qspi_write(qspi, cmd, QSPI_SPI_CMD_REG);
- ret = wait_for_completion_timeout(&qspi->transfer_complete,
+ ret = wait_for_completion_io_timeout(&qspi->transfer_complete,
QSPI_COMPLETION_TIMEOUT);
if (ret == 0) {
dev_err(qspi->dev, "write timed out\n");
@@ -268,7 +268,7 @@ static int qspi_read_msg(struct ti_qspi *qspi, struct spi_transfer *t)
while (count) {
dev_dbg(qspi->dev, "rx cmd %08x dc %08x\n", cmd, qspi->dc);
ti_qspi_write(qspi, cmd, QSPI_SPI_CMD_REG);
- ret = wait_for_completion_timeout(&qspi->transfer_complete,
+ ret = wait_for_completion_io_timeout(&qspi->transfer_complete,
QSPI_COMPLETION_TIMEOUT);
if (ret == 0) {
dev_err(qspi->dev, "read timed out\n");
@@ -265,7 +265,7 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
~XSPI_CR_TRANS_INHIBIT;
xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET);
- wait_for_completion(&xspi->done);
+ wait_for_completion_io(&xspi->done);
/* A transmit has just completed. Process received data and
* check for more data to transmit. Always inhibit the
@@ -810,7 +810,7 @@ static int spi_transfer_one_message(struct spi_master *master,
ms = xfer->len * 8 * 1000 / xfer->speed_hz;
ms += ms + 100; /* some tolerance */
- ms = wait_for_completion_timeout(&master->xfer_completion,
+ ms = wait_for_completion_io_timeout(&master->xfer_completion,
msecs_to_jiffies(ms));
}
@@ -2113,7 +2113,7 @@ static int __spi_sync(struct spi_device *spi, struct spi_message *message,
mutex_unlock(&master->bus_lock_mutex);
if (status == 0) {
- wait_for_completion(&done);
+ wait_for_completion_io(&done);
status = message->status;
}
message->context = NULL;
@@ -123,7 +123,7 @@ spidev_sync(struct spidev_data *spidev, struct spi_message *message)
spin_unlock_irq(&spidev->spi_lock);
if (status == 0) {
- wait_for_completion(&done);
+ wait_for_completion_io(&done);
status = message->status;
if (status == 0)
status = message->actual_length;
We are waiting for IO, so it should be accounted as such. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> --- drivers/spi/spi-altera.c | 2 +- drivers/spi/spi-atmel.c | 2 +- drivers/spi/spi-au1550.c | 4 ++-- drivers/spi/spi-bcm2835.c | 2 +- drivers/spi/spi-bcm63xx-hsspi.c | 2 +- drivers/spi/spi-bcm63xx.c | 2 +- drivers/spi/spi-efm32.c | 2 +- drivers/spi/spi-ep93xx.c | 4 ++-- drivers/spi/spi-fsl-espi.c | 2 +- drivers/spi/spi-fsl-spi.c | 2 +- drivers/spi/spi-imx.c | 6 +++--- drivers/spi/spi-mpc512x-psc.c | 2 +- drivers/spi/spi-mpc52xx-psc.c | 2 +- drivers/spi/spi-mxs.c | 2 +- drivers/spi/spi-nuc900.c | 2 +- drivers/spi/spi-oc-tiny.c | 2 +- drivers/spi/spi-omap2-mcspi.c | 4 ++-- drivers/spi/spi-ppc4xx.c | 2 +- drivers/spi/spi-qup.c | 2 +- drivers/spi/spi-s3c24xx.c | 2 +- drivers/spi/spi-s3c64xx.c | 2 +- drivers/spi/spi-sh-msiof.c | 4 ++-- drivers/spi/spi-sirf.c | 10 +++++----- drivers/spi/spi-sun4i.c | 2 +- drivers/spi/spi-sun6i.c | 2 +- drivers/spi/spi-tegra114.c | 2 +- drivers/spi/spi-tegra20-sflash.c | 2 +- drivers/spi/spi-tegra20-slink.c | 2 +- drivers/spi/spi-ti-qspi.c | 4 ++-- drivers/spi/spi-xilinx.c | 2 +- drivers/spi/spi.c | 4 ++-- drivers/spi/spidev.c | 2 +- 32 files changed, 44 insertions(+), 44 deletions(-)