* [PATCH v2] dmaengine: tegra-apb: Support non-flow controlled slave configuration
@ 2017-10-19 22:13 Dmitry Osipenko
[not found] ` <20171019221308.18707-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Osipenko @ 2017-10-19 22:13 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Vinod Koul, Laxman Dewangan
Cc: dmaengine-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
This allows DMA client to issue a non-flow controlled TX. In particular
it is needed for the fuse driver that reads fuse registers using APBDMA
to workaround a HW bug that results in hang when CPU and DMA perform
simultaneous access to fuse peripheral.
Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
Change log:
v2:
- Removed trailing whitespace reported by checkpatch
drivers/dma/tegra20-apb-dma.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index b9d75a54c896..9a558e30c461 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -353,7 +353,8 @@ static int tegra_dma_slave_config(struct dma_chan *dc,
}
memcpy(&tdc->dma_sconfig, sconfig, sizeof(*sconfig));
- if (tdc->slave_id == TEGRA_APBDMA_SLAVE_ID_INVALID) {
+ if (tdc->slave_id == TEGRA_APBDMA_SLAVE_ID_INVALID &&
+ sconfig->device_fc) {
if (sconfig->slave_id > TEGRA_APBDMA_CSR_REQ_SEL_MASK)
return -EINVAL;
tdc->slave_id = sconfig->slave_id;
@@ -970,8 +971,13 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
TEGRA_APBDMA_AHBSEQ_WRAP_SHIFT;
ahb_seq |= TEGRA_APBDMA_AHBSEQ_BUS_WIDTH_32;
- csr |= TEGRA_APBDMA_CSR_ONCE | TEGRA_APBDMA_CSR_FLOW;
- csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
+ csr |= TEGRA_APBDMA_CSR_ONCE;
+
+ if (tdc->slave_id != TEGRA_APBDMA_SLAVE_ID_INVALID) {
+ csr |= TEGRA_APBDMA_CSR_FLOW;
+ csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
+ }
+
if (flags & DMA_PREP_INTERRUPT)
csr |= TEGRA_APBDMA_CSR_IE_EOC;
@@ -1110,10 +1116,13 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
TEGRA_APBDMA_AHBSEQ_WRAP_SHIFT;
ahb_seq |= TEGRA_APBDMA_AHBSEQ_BUS_WIDTH_32;
- csr |= TEGRA_APBDMA_CSR_FLOW;
+ if (tdc->slave_id != TEGRA_APBDMA_SLAVE_ID_INVALID) {
+ csr |= TEGRA_APBDMA_CSR_FLOW;
+ csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
+ }
+
if (flags & DMA_PREP_INTERRUPT)
csr |= TEGRA_APBDMA_CSR_IE_EOC;
- csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;
--
2.14.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] dmaengine: tegra-apb: Support non-flow controlled slave configuration
[not found] ` <20171019221308.18707-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-11-14 11:23 ` Dmitry Osipenko
[not found] ` <57ef35f0-d8fa-5238-901e-11cd9d001e02-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Osipenko @ 2017-11-14 11:23 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Vinod Koul, Laxman Dewangan
Cc: dmaengine-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 20.10.2017 01:13, Dmitry Osipenko wrote:
> This allows DMA client to issue a non-flow controlled TX. In particular
> it is needed for the fuse driver that reads fuse registers using APBDMA
> to workaround a HW bug that results in hang when CPU and DMA perform
> simultaneous access to fuse peripheral.
>
> Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Vinod, are you going to apply this patch for 4.15?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] dmaengine: tegra-apb: Support non-flow controlled slave configuration
[not found] ` <57ef35f0-d8fa-5238-901e-11cd9d001e02-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-11-15 15:54 ` Vinod Koul
2017-11-16 17:16 ` Dmitry Osipenko
0 siblings, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2017-11-15 15:54 UTC (permalink / raw)
To: Dmitry Osipenko
Cc: Thierry Reding, Jonathan Hunter, Laxman Dewangan,
dmaengine-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On Tue, Nov 14, 2017 at 02:23:07PM +0300, Dmitry Osipenko wrote:
> On 20.10.2017 01:13, Dmitry Osipenko wrote:
> > This allows DMA client to issue a non-flow controlled TX. In particular
> > it is needed for the fuse driver that reads fuse registers using APBDMA
> > to workaround a HW bug that results in hang when CPU and DMA perform
> > simultaneous access to fuse peripheral.
> >
> > Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > Reviewed-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> Vinod, are you going to apply this patch for 4.15?
Sorry I dont seem to have this one in my queue and dont see it applied, not
sure why. Can you guys resend please
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] dmaengine: tegra-apb: Support non-flow controlled slave configuration
2017-11-15 15:54 ` Vinod Koul
@ 2017-11-16 17:16 ` Dmitry Osipenko
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Osipenko @ 2017-11-16 17:16 UTC (permalink / raw)
To: Vinod Koul
Cc: Thierry Reding, Jonathan Hunter, Laxman Dewangan,
dmaengine-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 15.11.2017 18:54, Vinod Koul wrote:
> On Tue, Nov 14, 2017 at 02:23:07PM +0300, Dmitry Osipenko wrote:
>> On 20.10.2017 01:13, Dmitry Osipenko wrote:
>>> This allows DMA client to issue a non-flow controlled TX. In particular
>>> it is needed for the fuse driver that reads fuse registers using APBDMA
>>> to workaround a HW bug that results in hang when CPU and DMA perform
>>> simultaneous access to fuse peripheral.
>>>
>>> Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>> Reviewed-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> Vinod, are you going to apply this patch for 4.15?
>
> Sorry I dont seem to have this one in my queue and dont see it applied, not
> sure why. Can you guys resend please
>
No problem, re-sent.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-16 17:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-19 22:13 [PATCH v2] dmaengine: tegra-apb: Support non-flow controlled slave configuration Dmitry Osipenko
[not found] ` <20171019221308.18707-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-14 11:23 ` Dmitry Osipenko
[not found] ` <57ef35f0-d8fa-5238-901e-11cd9d001e02-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-15 15:54 ` Vinod Koul
2017-11-16 17:16 ` Dmitry Osipenko
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).