[PATCH v8 05/18] dmaengine: st_fdma: Add STMicroelectronics FDMA engine driver support

Peter Griffin peter.griffin at linaro.org
Thu Sep 1 03:06:19 PDT 2016


Hi Vinod,

Thanks for reviewing.

On Tue, 30 Aug 2016, Vinod Koul wrote:

> On Fri, Aug 26, 2016 at 03:56:40PM +0100, Peter Griffin wrote:
> 
> >  config STM32_DMA
> >  	bool "STMicroelectronics STM32 DMA support"
> >  	depends on ARCH_STM32
> > @@ -567,7 +580,6 @@ config ZX_DMA
> >  	help
> >  	  Support the DMA engine for ZTE ZX296702 platform devices.
> >  
> > -
> 
> unrelated change?

OK will remove and send a separate patch.
> 
> > +	fdev->chans = devm_kzalloc(&pdev->dev,
> > +				   fdev->nr_channels
> > +				   * sizeof(struct st_fdma_chan), GFP_KERNEL);
> 
> devm_kcalloc()

Will fix in next version.

> 
> > +	if (!fdev->chans)
> > +		return -ENOMEM;
> > +
> > +	fdev->dev = &pdev->dev;
> > +	fdev->drvdata = drvdata;
> > +	platform_set_drvdata(pdev, fdev);
> > +
> > +	fdev->irq = platform_get_irq(pdev, 0);
> > +	if (fdev->irq < 0) {
> > +		dev_err(&pdev->dev, "Failed to get irq resource\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	ret = devm_request_irq(&pdev->dev, fdev->irq, st_fdma_irq_handler, 0,
> > +			       dev_name(&pdev->dev), fdev);
> > +	if (ret) {
> > +		dev_err(&pdev->dev, "Failed to request irq (%d)\n", ret);
> > +		goto err;
> > +	}
> > +
> > +	fdev->slim_rproc = st_slim_rproc_alloc(pdev, fdev->fw_name);
> > +	if (!fdev->slim_rproc) {
> > +		ret = PTR_ERR(fdev->slim_rproc);
> > +		dev_err(&pdev->dev, "slim_rproc_alloc failed (%d)\n", ret);
> > +		goto err;
> > +	}
> > +
> > +	/* Initialise list of FDMA channels */
> > +	INIT_LIST_HEAD(&fdev->dma_device.channels);
> > +	for (i = 0; i < fdev->nr_channels; i++) {
> > +		struct st_fdma_chan *fchan = &fdev->chans[i];
> > +
> > +		fchan->fdev = fdev;
> > +		fchan->vchan.desc_free = st_fdma_free_desc;
> > +		vchan_init(&fchan->vchan, &fdev->dma_device);
> 
> this initialized a tasklet
> 
> > +static int st_fdma_remove(struct platform_device *pdev)
> > +{
> > +	struct st_fdma_dev *fdev = platform_get_drvdata(pdev);
> > +
> > +	devm_free_irq(&pdev->dev, fdev->irq, fdev);
> > +	st_slim_rproc_put(fdev->slim_rproc);
> > +	of_dma_controller_free(pdev->dev.of_node);
> > +	dma_async_device_unregister(&fdev->dma_device);
> 
> and that vchan tasklet is not quisced here :(

Eeek, good spot. Will fix in next version.

> 
> > +MODULE_LICENSE("GPL v2");
> > +MODULE_DESCRIPTION("STMicroelectronics FDMA engine driver");
> > +MODULE_AUTHOR("Ludovic.barre <Ludovic.barre at st.com>");
> > +MODULE_AUTHOR("Peter Griffin <peter.griffin at linaro.org>");
> 
> No MODULE_ALIAS?

Will add in next version.

regards,

Peter. 



More information about the linux-arm-kernel mailing list