The following series has some i.MX SDMA fixes. The first two
should go into -rc, the third either in -rc or next. It fixes
that the driver blocks in probe() when the driver is compiled
into the kernel but the firmware is not. From this point of
view it should go in -rc, but on the other hand it's no straight
forward fix.
Sascha
Sascha Hauer (3):
dmaengine i.MX SDMA: lock channel 0
dmaengine i.MX SDMA: set firmware scripts addresses to negative value initially
dmaengine i.MX SDMA: use request_firmware_nowait
drivers/dma/imx-sdma.c | 47 ++++++++++++++++++++++++++++++++++++++---------
1 files changed, 38 insertions(+), 9 deletions(-)
channel0 of the sdma engine is the configuration channel. It
is a shared resource and thus must be protected by a mutex.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/dma/imx-sdma.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
If we do not have a firmare script for a given transfer,
the setup of this channel must fail. For this the script
addresses have to be < 0 initially, not 0.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/dma/imx-sdma.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
@@ -1281,6 +1281,7 @@ static int __init sdma_probe(struct platform_device *pdev)structsdma_platform_data*pdata=pdev->dev.platform_data;inti;structsdma_engine*sdma;+s32*saddr_arr;sdma=kzalloc(sizeof(*sdma),GFP_KERNEL);if(!sdma)
@@ -1324,6 +1325,11 @@ static int __init sdma_probe(struct platform_device *pdev)gotoerr_alloc;}+/* initially no scripts available */+saddr_arr=(s32*)sdma->script_addrs;+for(i=0;i<SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1;i++)+saddr_arr[i]=-EINVAL;+if(of_id)pdev->id_entry=of_id->data;sdma->devtype=pdev->id_entry->driver_data;
The firmware blob may not be available when the driver
probes. Instead of blocking the whole kernel use
request_firmware_nowait() and continue without firmware.
The ROM scripts can already be used then if available.
For the devicetree case the ROM scripts are not available,
still the probe function should not block. The driver
will be unusable in this case, but we have no way of
detecting this properly. The configuration of the dma
channels will fail, so nothing bad should happen.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/dma/imx-sdma.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
On Thu, 2011-08-25 at 11:03 +0200, Sascha Hauer wrote:
The firmware blob may not be available when the driver
probes. Instead of blocking the whole kernel use
request_firmware_nowait() and continue without firmware.
The ROM scripts can already be used then if available.
For the devicetree case the ROM scripts are not available,
still the probe function should not block. The driver
will be unusable in this case, but we have no way of
detecting this properly. The configuration of the dma
channels will fail, so nothing bad should happen.
Shouldn't you track if firmware is loaded properly and in the case it is
not return error in your prepare functions?
--
~Vinod
On Thu, Aug 25, 2011 at 11:31:57PM +0530, Koul, Vinod wrote:
On Thu, 2011-08-25 at 11:03 +0200, Sascha Hauer wrote:
quoted
The firmware blob may not be available when the driver
probes. Instead of blocking the whole kernel use
request_firmware_nowait() and continue without firmware.
The ROM scripts can already be used then if available.
For the devicetree case the ROM scripts are not available,
still the probe function should not block. The driver
will be unusable in this case, but we have no way of
detecting this properly. The configuration of the dma
channels will fail, so nothing bad should happen.
Shouldn't you track if firmware is loaded properly and in the case it is
not return error in your prepare functions?
Parts of the firmware is in ROM, enough to handle many transfer
types. The RAM firmware only offers additional transfer types.
Which transfer types are available is tracked in sdma->script_addrs.
The firmware loader just adds values here. The DMA_SLAVE_CONFIG
call will fail if a needed piece of firmware is missing.
Sascha
On Thu, 2011-08-25 at 11:03 +0200, Sascha Hauer wrote:
The following series has some i.MX SDMA fixes. The first two
should go into -rc, the third either in -rc or next. It fixes
that the driver blocks in probe() when the driver is compiled
into the kernel but the firmware is not. From this point of
view it should go in -rc, but on the other hand it's no straight
forward fix.
Sascha
Sascha Hauer (3):
dmaengine i.MX SDMA: lock channel 0
dmaengine i.MX SDMA: set firmware scripts addresses to negative value initially
dmaengine i.MX SDMA: use request_firmware_nowait
drivers/dma/imx-sdma.c | 47 ++++++++++++++++++++++++++++++++++++++---------
1 files changed, 38 insertions(+), 9 deletions(-)