From: Long Cheng <long.cheng@mediatek.com>
To: Nicolas Boichat <drinkcat@chromium.org>
Cc: Vinod Koul <vkoul@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Ryder Lee <ryder.lee@mediatek.com>,
Sean Wang <sean.wang@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Dan Williams <dan.j.williams@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, Sean Wang <sean.wang@mediatek.com>,
dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
linux-mediatek@lists.infradead.org,
lkml <linux-kernel@vger.kernel.org>,
linux-serial@vger.kernel.org, srv_heupstream@mediatek.com,
Yingjoe Chen <yingjoe.chen@mediatek.com>,
YT Shen <yt.shen@mediatek.com>,
Z
Subject: Re: [PATCH v7 1/2] dmaengine: 8250_mtk_dma: add MediaTek uart DMA support
Date: Wed, 26 Dec 2018 18:18:54 +0800 [thread overview]
Message-ID: <1545819534.28871.93.camel@mhfsdcap03> (raw)
In-Reply-To: <CANMq1KDKqtKwSw1mJyR0TgBwY1YRfvY52vWyogqWweF3xAgiKA@mail.gmail.com>
On Wed, 2018-12-26 at 17:28 +0800, Nicolas Boichat wrote:
......
> > > > > > +static int mtk_uart_apdma_device_pause(struct dma_chan *chan)
> > > > > > +{
> > > > > > + /* just for check caps pass */
> > > > > > + return 0;
> > > > > > +}
> > > > > > +
> > > > > > +static int mtk_uart_apdma_device_resume(struct dma_chan *chan)
> > > > > > +{
> > > > > > + /* just for check caps pass */
> > > > > > + return 0;
> > > > > > +}
> > >
> > > Why do you need these? Seems wrong to advertise device_pause/resume
> > > (and the caps) if we don't actually support that?
> > >
> >
> > in serial 8250_dma.c file, when request DMA, will calll
> > 'dma_get_slave_caps' to get the caps. and the will check caps.cmd_pause.
> > the pause is device_pause. our device can't support the functions. but
> > to check pass, need add the fake function. or you can give better
> > comments. thanks.
>
> Well, then I guess this is a hack... I'm not too familiar with
> 8250_dma.c, but I guess that if it requires pause/resume to be
> implemented, then we should implement them, not just stub them out...
>
> Is this something that can be implemented with 8250_mtk DMA?
>
the HW can't support it.
> Also, I don't see where you need resume, so maybe implementing pause is enough?
>
yes. pause is enough. for symmetry, add resume function.
anyway, the pause function need to keep.
> > > > > > +
> > > > > > +static void mtk_uart_apdma_free(struct mtk_uart_apdmadev *mtkd)
> > > > > > +{
> > > > > > + while (list_empty(&mtkd->ddev.channels) == 0) {
> > > > > > + struct mtk_chan *c = list_first_entry(&mtkd->ddev.channels,
> > > > > > + struct mtk_chan, vc.chan.device_node);
> > > > > > +
> > > > > > + list_del(&c->vc.chan.device_node);
> > > > > > + tasklet_kill(&c->vc.task);
> > > > > > + }
> > > > > > +}
> > > > > > +
> > > > > > +static const struct of_device_id mtk_uart_apdma_match[] = {
> > > > > > + { .compatible = "mediatek,mt6577-uart-dma", },
> > > > > > + { /* sentinel */ },
> > > > > > +};
> > > > > > +MODULE_DEVICE_TABLE(of, mtk_uart_apdma_match);
> > > > > > +
> > > > > > +static int mtk_uart_apdma_probe(struct platform_device *pdev)
> > > > > > +{
> > > > > > + struct mtk_uart_apdmadev *mtkd;
> > > > > > + struct resource *res;
> > > > > > + struct mtk_chan *c;
> > > > > > + unsigned int i;
> > > > > > + int rc;
> > > > > > +
......
next prev parent reply other threads:[~2018-12-26 10:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-25 1:26 [PATCH v7 0/2] add uart DMA function Long Cheng
2018-12-25 1:26 ` [PATCH v7 1/2] dmaengine: 8250_mtk_dma: add MediaTek uart DMA support Long Cheng
2018-12-25 7:16 ` Nicolas Boichat
2018-12-25 12:06 ` Long Cheng
2018-12-26 0:05 ` Nicolas Boichat
2018-12-26 6:35 ` Long Cheng
2018-12-26 9:28 ` Nicolas Boichat
2018-12-26 10:18 ` Long Cheng [this message]
2018-12-25 1:26 ` [PATCH v7 2/2] arm: dts: mt2712: add uart APDMA to device tree Long Cheng
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=1545819534.28871.93.camel@mhfsdcap03 \
--to=long.cheng@mediatek.com \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=drinkcat@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=rdunlap@infradead.org \
--cc=robh+dt@kernel.org \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@kernel.org \
--cc=sean.wang@mediatek.com \
--cc=srv_heupstream@mediatek.com \
--cc=vkoul@kernel.org \
--cc=yingjoe.chen@mediatek.com \
--cc=yt.shen@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox