Commit 43c64015 authored by Viresh Kumar's avatar Viresh Kumar Committed by Grant Likely

spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

If pl022_dma_probe fails, we can try to transfer data in polling or interrupt
mode. Also, set platform_info->enable_dma to 0, so that no other code tries to
use dma.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent c6e7b8cb
...@@ -1060,7 +1060,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022) ...@@ -1060,7 +1060,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
pl022->master_info->dma_filter, pl022->master_info->dma_filter,
pl022->master_info->dma_rx_param); pl022->master_info->dma_rx_param);
if (!pl022->dma_rx_channel) { if (!pl022->dma_rx_channel) {
dev_err(&pl022->adev->dev, "no RX DMA channel!\n"); dev_dbg(&pl022->adev->dev, "no RX DMA channel!\n");
goto err_no_rxchan; goto err_no_rxchan;
} }
...@@ -1068,13 +1068,13 @@ static int __init pl022_dma_probe(struct pl022 *pl022) ...@@ -1068,13 +1068,13 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
pl022->master_info->dma_filter, pl022->master_info->dma_filter,
pl022->master_info->dma_tx_param); pl022->master_info->dma_tx_param);
if (!pl022->dma_tx_channel) { if (!pl022->dma_tx_channel) {
dev_err(&pl022->adev->dev, "no TX DMA channel!\n"); dev_dbg(&pl022->adev->dev, "no TX DMA channel!\n");
goto err_no_txchan; goto err_no_txchan;
} }
pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL); pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!pl022->dummypage) { if (!pl022->dummypage) {
dev_err(&pl022->adev->dev, "no DMA dummypage!\n"); dev_dbg(&pl022->adev->dev, "no DMA dummypage!\n");
goto err_no_dummypage; goto err_no_dummypage;
} }
...@@ -1090,6 +1090,8 @@ static int __init pl022_dma_probe(struct pl022 *pl022) ...@@ -1090,6 +1090,8 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
dma_release_channel(pl022->dma_rx_channel); dma_release_channel(pl022->dma_rx_channel);
pl022->dma_rx_channel = NULL; pl022->dma_rx_channel = NULL;
err_no_rxchan: err_no_rxchan:
dev_err(&pl022->adev->dev,
"Failed to work in dma mode, work without dma!\n");
return -ENODEV; return -ENODEV;
} }
...@@ -2115,7 +2117,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -2115,7 +2117,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
if (platform_info->enable_dma) { if (platform_info->enable_dma) {
status = pl022_dma_probe(pl022); status = pl022_dma_probe(pl022);
if (status != 0) if (status != 0)
goto err_no_dma; platform_info->enable_dma = 0;
} }
/* Initialize and start queue */ /* Initialize and start queue */
...@@ -2151,7 +2153,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -2151,7 +2153,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
err_init_queue: err_init_queue:
destroy_queue(pl022); destroy_queue(pl022);
pl022_dma_remove(pl022); pl022_dma_remove(pl022);
err_no_dma:
free_irq(adev->irq[0], pl022); free_irq(adev->irq[0], pl022);
err_no_irq: err_no_irq:
clk_put(pl022->clk); clk_put(pl022->clk);
......
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