All of lore.kernel.org
 help / color / mirror / Atom feed
From: punnaiah choudary kalluri <punnaia@xilinx.com>
To: Vinod Koul <vinod.koul@intel.com>
Cc: Punnaiah Choudary Kalluri <punnaiah.choudary.kalluri@xilinx.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"pawel.moll@arm.com" <pawel.moll@arm.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	"michal.simek@xilinx.com" <michal.simek@xilinx.com>,
	dan.j.williams@intel.com, dmaengine@vger.kernel.org,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Punnaiah Choudary <kpc528@gmail.com>
Subject: Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support
Date: Thu, 20 Aug 2015 12:01:27 +0530	[thread overview]
Message-ID: <CAGnW=BaU__+B2uAK=qpV3QP60SqSUxx-kgJVs0t42K0fqTxL0g@mail.gmail.com> (raw)
In-Reply-To: <20150820061312.GA13546@localhost>

On Thu, Aug 20, 2015 at 11:43 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> 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

During the terminate call, driver need to clean up the existing BDs so that time
this function will be called from the thread or process context in
addition to the
tasklet context.

DO you have any suggestion here ?


>
>> +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

zynqmp_dma_reset will do the 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?

This i am doing it in zynqmp_dma_remove function. Each channel will be
a standalone dma device for ZynqMP DMA case

>
>> +     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!

I got your point . but i have already said my reasons why i am
reluctant to use vchan framework in v3 review.

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

I will fix this. thanks.

Regards,
Punnaiah
>
> --
> ~Vinod
>

WARNING: multiple messages have this Message-ID (diff)
From: punnaiah choudary kalluri <punnaia-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
To: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Punnaiah Choudary Kalluri
	<punnaiah.choudary.kalluri-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>,
	"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"pawel.moll-5wv7dgnIgG8@public.gmane.org"
	<pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	"mark.rutland-5wv7dgnIgG8@public.gmane.org"
	<mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org"
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org"
	<michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Punnaiah Choudary
	<kpc528-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support
Date: Thu, 20 Aug 2015 12:01:27 +0530	[thread overview]
Message-ID: <CAGnW=BaU__+B2uAK=qpV3QP60SqSUxx-kgJVs0t42K0fqTxL0g@mail.gmail.com> (raw)
In-Reply-To: <20150820061312.GA13546@localhost>

On Thu, Aug 20, 2015 at 11:43 AM, Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> 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

During the terminate call, driver need to clean up the existing BDs so that time
this function will be called from the thread or process context in
addition to the
tasklet context.

DO you have any suggestion here ?


>
>> +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

zynqmp_dma_reset will do the 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?

This i am doing it in zynqmp_dma_remove function. Each channel will be
a standalone dma device for ZynqMP DMA case

>
>> +     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!

I got your point . but i have already said my reasons why i am
reluctant to use vchan framework in v3 review.

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

I will fix this. thanks.

Regards,
Punnaiah
>
> --
> ~Vinod
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: punnaia@xilinx.com (punnaiah choudary kalluri)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support
Date: Thu, 20 Aug 2015 12:01:27 +0530	[thread overview]
Message-ID: <CAGnW=BaU__+B2uAK=qpV3QP60SqSUxx-kgJVs0t42K0fqTxL0g@mail.gmail.com> (raw)
In-Reply-To: <20150820061312.GA13546@localhost>

On Thu, Aug 20, 2015 at 11:43 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> 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

During the terminate call, driver need to clean up the existing BDs so that time
this function will be called from the thread or process context in
addition to the
tasklet context.

DO you have any suggestion here ?


>
>> +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

zynqmp_dma_reset will do the 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?

This i am doing it in zynqmp_dma_remove function. Each channel will be
a standalone dma device for ZynqMP DMA case

>
>> +     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!

I got your point . but i have already said my reasons why i am
reluctant to use vchan framework in v3 review.

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

I will fix this. thanks.

Regards,
Punnaiah
>
> --
> ~Vinod
>

  reply	other threads:[~2015-08-20  6:31 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06  3:19 [PATCH v4 1/2] Documentation: dt: Add Xilinx zynqmp dma device tree binding documentation Punnaiah Choudary Kalluri
2015-08-06  3:19 ` Punnaiah Choudary Kalluri
2015-08-06  3:19 ` Punnaiah Choudary Kalluri
2015-08-06  3:19 ` [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support Punnaiah Choudary Kalluri
2015-08-06  3:19   ` Punnaiah Choudary Kalluri
2015-08-06  3:19   ` Punnaiah Choudary Kalluri
2015-08-20  6:13   ` Vinod Koul
2015-08-20  6:13     ` Vinod Koul
2015-08-20  6:31     ` punnaiah choudary kalluri [this message]
2015-08-20  6:31       ` punnaiah choudary kalluri
2015-08-20  6:31       ` punnaiah choudary kalluri
2015-08-23 14:08       ` Vinod Koul
2015-08-23 14:08         ` Vinod Koul
2015-08-23 14:08         ` Vinod Koul
2015-08-23 14:54         ` punnaiah choudary kalluri
2015-08-23 14:54           ` punnaiah choudary kalluri
2015-08-20  5:52 ` [PATCH v4 1/2] Documentation: dt: Add Xilinx zynqmp dma device tree binding documentation Vinod Koul
2015-08-20  5:52   ` Vinod Koul
2015-08-20  5:52   ` Vinod Koul
2015-08-20  6:11   ` punnaiah choudary kalluri
2015-08-20  6:11     ` punnaiah choudary kalluri
2015-08-20  6:18     ` Vinod Koul
2015-08-20  6:18       ` Vinod Koul
2015-08-20  6:18       ` Vinod Koul
2015-08-20  6:20       ` Michal Simek
2015-08-20  6:20         ` Michal Simek
2015-08-20  6:20         ` Michal Simek
2015-08-21  8:29 ` Moritz Fischer
2015-08-21 16:42 ` Moritz Fischer
2015-08-21 16:42   ` Moritz Fischer
2015-08-21 16:42   ` Moritz Fischer
2015-08-22 10:47   ` punnaiah choudary kalluri
2015-08-22 10:47     ` punnaiah choudary kalluri
2015-08-22 10:47     ` punnaiah choudary kalluri
2015-08-24 13:47 ` Lars-Peter Clausen
2015-08-24 13:47   ` Lars-Peter Clausen
2015-08-24 13:47   ` Lars-Peter Clausen
2015-08-24 18:39   ` punnaiah choudary kalluri
2015-08-24 18:39     ` punnaiah choudary kalluri
2015-08-24 18:39     ` punnaiah choudary kalluri
2015-08-24 18:53 ` Rob Herring
2015-08-24 18:53   ` Rob Herring
2015-08-24 18:53   ` Rob Herring
2015-08-25  6:46   ` punnaiah choudary kalluri
2015-08-25  6:46     ` punnaiah choudary kalluri
2015-08-25  6:46     ` punnaiah choudary kalluri
2015-08-31  3:37     ` punnaiah choudary kalluri
2015-08-31  3:37       ` punnaiah choudary kalluri
2015-08-31  3:37       ` punnaiah choudary kalluri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGnW=BaU__+B2uAK=qpV3QP60SqSUxx-kgJVs0t42K0fqTxL0g@mail.gmail.com' \
    --to=punnaia@xilinx.com \
    --cc=dan.j.williams@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kpc528@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=michal.simek@xilinx.com \
    --cc=pawel.moll@arm.com \
    --cc=punnaiah.choudary.kalluri@xilinx.com \
    --cc=robh+dt@kernel.org \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.