All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Robin Gong <yibin.gong@nxp.com>
Cc: "robh@kernel.org" <robh@kernel.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"plyatov@gmail.com" <plyatov@gmail.com>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: Re: [PATCH v3 11/14] dmaengine: imx-sdma: fix ecspi1 rx dma not work on i.mx8mm
Date: Tue, 21 May 2019 09:48:28 +0530	[thread overview]
Message-ID: <20190521041828.GG15118@vkoul-mobl> (raw)
In-Reply-To: <1557249513-4903-12-git-send-email-yibin.gong@nxp.com>

On 07-05-19, 09:16, Robin Gong wrote:
> Because the number of ecspi1 rx event on i.mx8mm is 0, the condition
> check ignore such special case without dma channel enabled, which caused
> ecspi1 rx works failed. Actually, no need to check event_id0, checking
> event_id1 is enough for DEV_2_DEV case because it's so lucky that event_id1
> never be 0.

Well is that by chance or design that event_id1 will be never 0?

> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> ---
>  drivers/dma/imx-sdma.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index a495c7f..86594fc 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1370,8 +1370,8 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
>  
>  	sdma_channel_synchronize(chan);
>  
> -	if (sdmac->event_id0)
> -		sdma_event_disable(sdmac, sdmac->event_id0);
> +	sdma_event_disable(sdmac, sdmac->event_id0);
> +
>  	if (sdmac->event_id1)
>  		sdma_event_disable(sdmac, sdmac->event_id1);
>  
> @@ -1670,11 +1670,9 @@ static int sdma_config(struct dma_chan *chan,
>  	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
>  
>  	/* Set ENBLn earlier to make sure dma request triggered after that */
> -	if (sdmac->event_id0) {
> -		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
> -			return -EINVAL;
> -		sdma_event_enable(sdmac, sdmac->event_id0);
> -	}
> +	if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
> +		return -EINVAL;
> +	sdma_event_enable(sdmac, sdmac->event_id0);
>  
>  	if (sdmac->event_id1) {
>  		if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events)
> -- 
> 2.7.4
> 

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Robin Gong <yibin.gong@nxp.com>
Cc: "robh@kernel.org" <robh@kernel.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"plyatov@gmail.com" <plyatov@gmail.com>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>, linux-kernel@vger.
Subject: Re: [PATCH v3 11/14] dmaengine: imx-sdma: fix ecspi1 rx dma not work on i.mx8mm
Date: Tue, 21 May 2019 09:48:28 +0530	[thread overview]
Message-ID: <20190521041828.GG15118@vkoul-mobl> (raw)
In-Reply-To: <1557249513-4903-12-git-send-email-yibin.gong@nxp.com>

On 07-05-19, 09:16, Robin Gong wrote:
> Because the number of ecspi1 rx event on i.mx8mm is 0, the condition
> check ignore such special case without dma channel enabled, which caused
> ecspi1 rx works failed. Actually, no need to check event_id0, checking
> event_id1 is enough for DEV_2_DEV case because it's so lucky that event_id1
> never be 0.

Well is that by chance or design that event_id1 will be never 0?

> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> ---
>  drivers/dma/imx-sdma.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index a495c7f..86594fc 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1370,8 +1370,8 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
>  
>  	sdma_channel_synchronize(chan);
>  
> -	if (sdmac->event_id0)
> -		sdma_event_disable(sdmac, sdmac->event_id0);
> +	sdma_event_disable(sdmac, sdmac->event_id0);
> +
>  	if (sdmac->event_id1)
>  		sdma_event_disable(sdmac, sdmac->event_id1);
>  
> @@ -1670,11 +1670,9 @@ static int sdma_config(struct dma_chan *chan,
>  	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
>  
>  	/* Set ENBLn earlier to make sure dma request triggered after that */
> -	if (sdmac->event_id0) {
> -		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
> -			return -EINVAL;
> -		sdma_event_enable(sdmac, sdmac->event_id0);
> -	}
> +	if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
> +		return -EINVAL;
> +	sdma_event_enable(sdmac, sdmac->event_id0);
>  
>  	if (sdmac->event_id1) {
>  		if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events)
> -- 
> 2.7.4
> 

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Robin Gong <yibin.gong@nxp.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"plyatov@gmail.com" <plyatov@gmail.com>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>
Subject: Re: [PATCH v3 11/14] dmaengine: imx-sdma: fix ecspi1 rx dma not work on i.mx8mm
Date: Tue, 21 May 2019 09:48:28 +0530	[thread overview]
Message-ID: <20190521041828.GG15118@vkoul-mobl> (raw)
In-Reply-To: <1557249513-4903-12-git-send-email-yibin.gong@nxp.com>

On 07-05-19, 09:16, Robin Gong wrote:
> Because the number of ecspi1 rx event on i.mx8mm is 0, the condition
> check ignore such special case without dma channel enabled, which caused
> ecspi1 rx works failed. Actually, no need to check event_id0, checking
> event_id1 is enough for DEV_2_DEV case because it's so lucky that event_id1
> never be 0.

Well is that by chance or design that event_id1 will be never 0?

> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> ---
>  drivers/dma/imx-sdma.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index a495c7f..86594fc 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1370,8 +1370,8 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
>  
>  	sdma_channel_synchronize(chan);
>  
> -	if (sdmac->event_id0)
> -		sdma_event_disable(sdmac, sdmac->event_id0);
> +	sdma_event_disable(sdmac, sdmac->event_id0);
> +
>  	if (sdmac->event_id1)
>  		sdma_event_disable(sdmac, sdmac->event_id1);
>  
> @@ -1670,11 +1670,9 @@ static int sdma_config(struct dma_chan *chan,
>  	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
>  
>  	/* Set ENBLn earlier to make sure dma request triggered after that */
> -	if (sdmac->event_id0) {
> -		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
> -			return -EINVAL;
> -		sdma_event_enable(sdmac, sdmac->event_id0);
> -	}
> +	if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
> +		return -EINVAL;
> +	sdma_event_enable(sdmac, sdmac->event_id0);
>  
>  	if (sdmac->event_id1) {
>  		if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events)
> -- 
> 2.7.4
> 

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-05-21  4:18 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  9:15 [PATCH v3 00/14] add ecspi ERR009165 for i.mx6/7 soc family Robin Gong
2019-05-07  9:15 ` Robin Gong
2019-05-07  9:15 ` Robin Gong
2019-05-07  9:15 ` [PATCH v3 01/14] Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Robin Gong
2019-05-07  9:15   ` Robin Gong
2019-05-07  9:15   ` Robin Gong
2019-05-07  9:15 ` [PATCH v3 02/14] Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" Robin Gong
2019-05-07  9:15   ` Robin Gong
2019-05-07  9:15   ` Robin Gong
2019-05-07  9:15 ` [PATCH v3 03/14] Revert "dmaengine: imx-sdma: refine to load context only once" Robin Gong
2019-05-07  9:15   ` Robin Gong
2019-05-07  9:15   ` Robin Gong
2019-05-07  9:16 ` [PATCH v3 04/14] dmaengine: imx-sdma: remove dupilicated sdma_load_context Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-21  4:15   ` Vinod Koul
2019-05-21  4:15     ` Vinod Koul
2019-05-21  4:15     ` Vinod Koul
2019-05-07  9:16 ` [PATCH v3 05/14] dmaengine: imx-sdma: add mcu_2_ecspi script Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-21  4:16   ` Vinod Koul
2019-05-21  4:16     ` Vinod Koul
2019-05-21  4:16     ` Vinod Koul
2019-05-07  9:16 ` [PATCH v3 06/14] spi: imx: fix ERR009165 Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-12  9:16   ` Mark Brown
2019-05-12  9:16     ` Mark Brown
2019-05-12  9:16     ` Mark Brown
2019-05-07  9:16 ` [PATCH v3 07/14] spi: imx: remove ERR009165 workaround on i.mx6ul Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-12  9:17   ` Mark Brown
2019-05-12  9:17     ` Mark Brown
2019-05-12  9:17     ` Mark Brown
2019-05-07  9:16 ` [PATCH v3 08/14] dt-bindings: spi: imx: add new i.mx6ul compatible name Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-12  9:17   ` Mark Brown
2019-05-12  9:17     ` Mark Brown
2019-05-12  9:17     ` Mark Brown
2019-05-13 17:26   ` Rob Herring
2019-05-13 17:26     ` Rob Herring
2019-05-13 17:26     ` Rob Herring
2019-05-13 17:26     ` Rob Herring
2019-05-07  9:16 ` [PATCH v3 09/14] dmaengine: imx-sdma: remove ERR009165 on i.mx6ul Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-21  4:17   ` Vinod Koul
2019-05-21  4:17     ` Vinod Koul
2019-05-21  4:17     ` Vinod Koul
2019-05-07  9:16 ` [PATCH v3 10/14] dt-bindings: dma: imx-sdma: add i.mx6ul/6sx compatible name Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07 16:56   ` Rob Herring
2019-05-07 16:56     ` Rob Herring
2019-05-07 16:56     ` Rob Herring
2019-05-07 16:56     ` Rob Herring
2019-05-08  9:47     ` [EXT] " Robin Gong
2019-05-08  9:47       ` Robin Gong
2019-05-08  9:47       ` Robin Gong
2019-05-07  9:16 ` [PATCH v3 11/14] dmaengine: imx-sdma: fix ecspi1 rx dma not work on i.mx8mm Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-21  4:18   ` Vinod Koul [this message]
2019-05-21  4:18     ` Vinod Koul
2019-05-21  4:18     ` Vinod Koul
2019-05-07  9:16 ` [PATCH v3 12/14] ARM: dts: imx6ul: add dma support on ecspi Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16 ` [PATCH v3 13/14] ARM: dts: imx6sll: correct sdma compatible Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:16   ` Robin Gong
2019-05-07  9:17 ` [PATCH v3 14/14] arm64: defconfig: Enable SDMA on i.mx8mq/8mm Robin Gong
2019-05-07  9:17   ` Robin Gong
2019-05-07  9:17   ` Robin Gong
2019-05-13  9:31 ` [PATCH v3 00/14] add ecspi ERR009165 for i.mx6/7 soc family Lucas Stach
2019-05-13  9:31   ` Lucas Stach
2019-05-13  9:31   ` Lucas Stach
2019-05-17  9:54   ` [EXT] " Robin Gong
2019-05-17  9:54     ` Robin Gong
2019-05-17  9:54     ` Robin Gong

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=20190521041828.GG15118@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=dan.j.williams@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=plyatov@gmail.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=will.deacon@arm.com \
    --cc=yibin.gong@nxp.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.