From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] dmaengine: at_xdmac: fix spurious flag status for mem2mem transfers
Date: Mon, 23 Nov 2015 15:42:21 +0100 [thread overview]
Message-ID: <565325CD.30608@atmel.com> (raw)
In-Reply-To: <1448284184-15171-2-git-send-email-ludovic.desroches@atmel.com>
Le 23/11/2015 14:09, Ludovic Desroches a ?crit :
> When setting the channel configuration register, the perid field is not
> set to 0 since it is useless for mem2mem transfers. Unfortunately, a
> device has 0 as perid. It could cause spurious flags status because
> the controller could mix some events from the two channels.
> For that reason, use the highest perid value for mem2mem transfers since it
> doesn't match the perid of other devices.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Indeed: thanks Ludovic:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> drivers/dma/at_xdmac.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index d09277f..b90e62f 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -863,8 +863,12 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan,
> * access. Hopefully we can access DDR through both ports (at least on
> * SAMA5D4x), so we can use the same interface for source and dest,
> * that solves the fact we don't know the direction.
> + * ERRATA: Even if useless for memory transfers, the PERID has to not
> + * match the one of another channel. If not, it could lead to spurious
> + * flag status.
> */
> - u32 chan_cc = AT_XDMAC_CC_DIF(0)
> + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
> + | AT_XDMAC_CC_DIF(0)
> | AT_XDMAC_CC_SIF(0)
> | AT_XDMAC_CC_MBSIZE_SIXTEEN
> | AT_XDMAC_CC_TYPE_MEM_TRAN;
> @@ -1039,8 +1043,12 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
> * access DDR through both ports (at least on SAMA5D4x), so we can use
> * the same interface for source and dest, that solves the fact we
> * don't know the direction.
> + * ERRATA: Even if useless for memory transfers, the PERID has to not
> + * match the one of another channel. If not, it could lead to spurious
> + * flag status.
> */
> - u32 chan_cc = AT_XDMAC_CC_DAM_INCREMENTED_AM
> + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
> + | AT_XDMAC_CC_DAM_INCREMENTED_AM
> | AT_XDMAC_CC_SAM_INCREMENTED_AM
> | AT_XDMAC_CC_DIF(0)
> | AT_XDMAC_CC_SIF(0)
> @@ -1140,8 +1148,12 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan,
> * access. Hopefully we can access DDR through both ports (at least on
> * SAMA5D4x), so we can use the same interface for source and dest,
> * that solves the fact we don't know the direction.
> + * ERRATA: Even if useless for memory transfers, the PERID has to not
> + * match the one of another channel. If not, it could lead to spurious
> + * flag status.
> */
> - u32 chan_cc = AT_XDMAC_CC_DAM_UBS_AM
> + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
> + | AT_XDMAC_CC_DAM_UBS_AM
> | AT_XDMAC_CC_SAM_INCREMENTED_AM
> | AT_XDMAC_CC_DIF(0)
> | AT_XDMAC_CC_SIF(0)
>
--
Nicolas Ferre
WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Ludovic Desroches <ludovic.desroches@atmel.com>, <vinod.koul@intel.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
<dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] dmaengine: at_xdmac: fix spurious flag status for mem2mem transfers
Date: Mon, 23 Nov 2015 15:42:21 +0100 [thread overview]
Message-ID: <565325CD.30608@atmel.com> (raw)
In-Reply-To: <1448284184-15171-2-git-send-email-ludovic.desroches@atmel.com>
Le 23/11/2015 14:09, Ludovic Desroches a écrit :
> When setting the channel configuration register, the perid field is not
> set to 0 since it is useless for mem2mem transfers. Unfortunately, a
> device has 0 as perid. It could cause spurious flags status because
> the controller could mix some events from the two channels.
> For that reason, use the highest perid value for mem2mem transfers since it
> doesn't match the perid of other devices.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Indeed: thanks Ludovic:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> drivers/dma/at_xdmac.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index d09277f..b90e62f 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -863,8 +863,12 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan,
> * access. Hopefully we can access DDR through both ports (at least on
> * SAMA5D4x), so we can use the same interface for source and dest,
> * that solves the fact we don't know the direction.
> + * ERRATA: Even if useless for memory transfers, the PERID has to not
> + * match the one of another channel. If not, it could lead to spurious
> + * flag status.
> */
> - u32 chan_cc = AT_XDMAC_CC_DIF(0)
> + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
> + | AT_XDMAC_CC_DIF(0)
> | AT_XDMAC_CC_SIF(0)
> | AT_XDMAC_CC_MBSIZE_SIXTEEN
> | AT_XDMAC_CC_TYPE_MEM_TRAN;
> @@ -1039,8 +1043,12 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
> * access DDR through both ports (at least on SAMA5D4x), so we can use
> * the same interface for source and dest, that solves the fact we
> * don't know the direction.
> + * ERRATA: Even if useless for memory transfers, the PERID has to not
> + * match the one of another channel. If not, it could lead to spurious
> + * flag status.
> */
> - u32 chan_cc = AT_XDMAC_CC_DAM_INCREMENTED_AM
> + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
> + | AT_XDMAC_CC_DAM_INCREMENTED_AM
> | AT_XDMAC_CC_SAM_INCREMENTED_AM
> | AT_XDMAC_CC_DIF(0)
> | AT_XDMAC_CC_SIF(0)
> @@ -1140,8 +1148,12 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan,
> * access. Hopefully we can access DDR through both ports (at least on
> * SAMA5D4x), so we can use the same interface for source and dest,
> * that solves the fact we don't know the direction.
> + * ERRATA: Even if useless for memory transfers, the PERID has to not
> + * match the one of another channel. If not, it could lead to spurious
> + * flag status.
> */
> - u32 chan_cc = AT_XDMAC_CC_DAM_UBS_AM
> + u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
> + | AT_XDMAC_CC_DAM_UBS_AM
> | AT_XDMAC_CC_SAM_INCREMENTED_AM
> | AT_XDMAC_CC_DIF(0)
> | AT_XDMAC_CC_SIF(0)
>
--
Nicolas Ferre
next prev parent reply other threads:[~2015-11-23 14:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 13:09 [PATCH 1/2] dmaengine: at_xdmac: fix macro typo Ludovic Desroches
2015-11-23 13:09 ` Ludovic Desroches
2015-11-23 13:09 ` [PATCH 2/2] dmaengine: at_xdmac: fix spurious flag status for mem2mem transfers Ludovic Desroches
2015-11-23 13:09 ` Ludovic Desroches
2015-11-23 14:42 ` Nicolas Ferre [this message]
2015-11-23 14:42 ` Nicolas Ferre
2015-11-23 14:41 ` [PATCH 1/2] dmaengine: at_xdmac: fix macro typo Nicolas Ferre
2015-11-23 14:41 ` Nicolas Ferre
2015-12-05 8:18 ` Vinod Koul
2015-12-05 8:18 ` Vinod Koul
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=565325CD.30608@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=linux-arm-kernel@lists.infradead.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 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.