From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com>,
<dmaengine@vger.kernel.org>, <vkoul@kernel.org>,
<devicetree@vger.kernel.org>, <robh+dt@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <andriy.shevchenko@intel.com>,
<cheol.yong.kim@intel.com>, <qi-ming.wu@intel.com>,
<chuanhua.lei@linux.intel.com>, <malliamireddy009@gmail.com>
Subject: Re: [PATCH v5 2/2] Add Intel LGM soc DMA support.
Date: Tue, 18 Aug 2020 13:29:12 +0300 [thread overview]
Message-ID: <70848117-ec29-d293-6603-cbf47dec35d4@ti.com> (raw)
In-Reply-To: <fbc98cdb-3b50-cbcc-0e90-c9d6116566d1@ti.com>
On 18/08/2020 13.16, Peter Ujfalusi wrote:
...
>> +static void dma_issue_pending(struct dma_chan *chan)
>> +{
>> + struct ldma_chan *c = to_ldma_chan(chan);
>> + struct ldma_dev *d = to_ldma_dev(c->vchan.chan.device);
>> + unsigned long flags;
>> +
>> + if (d->ver == DMA_VER22) {
>> + spin_lock_irqsave(&c->vchan.lock, flags);
>> + if (vchan_issue_pending(&c->vchan)) {
>> + struct virt_dma_desc *vdesc;
>> +
>> + /* Get the next descriptor */
>> + vdesc = vchan_next_desc(&c->vchan);
>> + if (!vdesc) {
>> + c->ds = NULL;
>> + return;
>> + }
>> + list_del(&vdesc->node);
>> + c->ds = to_lgm_dma_desc(vdesc);
>
> you have set c->ds in dma_prep_slave_sg and the only way I can see that
> you will not leak memory is that the client must terminate_sync() after
> each transfer so that the synchronize callback is invoked between each
> prep_sg/issue_pending/competion.
>
>> + spin_unlock_irqrestore(&c->vchan.lock, flags);
>> + ldma_chan_desc_hw_cfg(c, c->ds->desc_phys, c->ds->desc_cnt);
>> + ldma_chan_irq_en(c);
>> + }
>
> If there is nothing pending, you will leave the spinlock wide open...
you leave it locked...
>
>> + }
>> + ldma_chan_on(c);
>> +}
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
next prev parent reply other threads:[~2020-08-18 10:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-14 5:26 [PATCH v5 0/2] Add Intel LGM soc DMA support Amireddy Mallikarjuna reddy
2020-08-14 5:26 ` [PATCH v5 1/2] dt-bindings: dma: Add bindings for intel LGM SOC Amireddy Mallikarjuna reddy
2020-08-14 20:32 ` Rob Herring
2020-08-18 7:00 ` Reddy, MallikarjunaX
2020-08-25 11:21 ` Vinod Koul
2020-08-27 9:54 ` Reddy, MallikarjunaX
2020-08-28 10:45 ` Vinod Koul
2020-08-31 8:06 ` Reddy, MallikarjunaX
2020-08-31 11:00 ` Vinod Koul
2020-09-01 15:03 ` Reddy, MallikarjunaX
2020-09-04 6:31 ` Peter Ujfalusi
2020-09-07 7:25 ` Reddy, MallikarjunaX
2020-08-14 5:26 ` [PATCH v5 2/2] Add Intel LGM soc DMA support Amireddy Mallikarjuna reddy
2020-08-14 8:47 ` kernel test robot
2020-08-18 10:16 ` Peter Ujfalusi
2020-08-18 10:29 ` Peter Ujfalusi [this message]
2020-08-24 2:30 ` Reddy, MallikarjunaX
2020-08-24 11:24 ` Peter Ujfalusi
2020-08-27 14:41 ` Reddy, MallikarjunaX
2020-08-28 11:17 ` Peter Ujfalusi
2020-08-31 8:07 ` Reddy, MallikarjunaX
2020-09-04 6:31 ` Peter Ujfalusi
2020-09-07 7:32 ` Reddy, MallikarjunaX
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=70848117-ec29-d293-6603-cbf47dec35d4@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=andriy.shevchenko@intel.com \
--cc=cheol.yong.kim@intel.com \
--cc=chuanhua.lei@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=malliamireddy009@gmail.com \
--cc=mallikarjunax.reddy@linux.intel.com \
--cc=qi-ming.wu@intel.com \
--cc=robh+dt@kernel.org \
--cc=vkoul@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).