Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1210167

Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support

From Vinod Koul <vinod.koul@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support
Date 2015-08-20 08:20 +0200
Message-ID <pZrmF-4VL-11@gated-at.bofh.it> (permalink)
References <pZr3k-4jD-7@gated-at.bofh.it> <pZrmF-4VL-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 06, 2015 at 08:49:33AM +0530, Punnaiah Choudary Kalluri wrote:

> +	list_for_each_entry_safe(desc, next, &chan->done_list, node) {
> +		dma_async_tx_callback callback;
> +		void *callback_param;
> +
> +		list_del(&desc->node);
> +
> +		callback = desc->async_tx.callback;
> +		callback_param = desc->async_tx.callback_param;
> +		if (callback) {
> +			if (in_interrupt())
> +				spin_unlock_bh(&chan->lock);
> +			else
> +				spin_unlock(&chan->lock);

This looks bad!
Why would callback be called from different context. It should only be
invoked from your tasklet

> +static int zynqmp_dma_device_terminate_all(struct dma_chan *dchan)
> +{
> +	struct zynqmp_dma_chan *chan = to_chan(dchan);
> +
> +	spin_lock_bh(&chan->lock);
> +	zynqmp_dma_reset(chan);
> +	spin_unlock_bh(&chan->lock);

No descriptor cleanup

> +static void zynqmp_dma_chan_remove(struct zynqmp_dma_chan *chan)
> +{
> +	if (!chan)
> +		return;
> +
> +	devm_free_irq(chan->zdev->dev, chan->irq, chan);
> +	tasklet_kill(&chan->tasklet);
> +	list_del(&chan->common.device_node);

not deregistering with dmaengine?

> +	zdev->chan = chan;
> +	tasklet_init(&chan->tasklet, zynqmp_dma_do_tasklet, (ulong)chan);
> +	spin_lock_init(&chan->lock);
> +	INIT_LIST_HEAD(&chan->active_list);
> +	INIT_LIST_HEAD(&chan->pending_list);
> +	INIT_LIST_HEAD(&chan->done_list);
> +	INIT_LIST_HEAD(&chan->free_list);

You can simmplify this by using vchan framework!

> +MODULE_AUTHOR("Xilinx, Inc.");
> +MODULE_DESCRIPTION("Xilinx ZynqMP DMA driver");
> +MODULE_LICENSE("GPL");
No alias, how did it get loaded?

-- 
~Vinod

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support Vinod Koul <vinod.koul@intel.com> - 2015-08-20 08:20 +0200
  Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support punnaiah choudary kalluri <punnaia@xilinx.com> - 2015-08-20 08:40 +0200
    Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support Vinod Koul <vinod.koul@intel.com> - 2015-08-23 16:10 +0200
      Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support punnaiah choudary kalluri <punnaia@xilinx.com> - 2015-08-23 17:00 +0200

csiph-web