public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: "Stefan Brüns" <stefan.bruens@rwth-aachen.de>,
	"Peter Ujfalusi" <peter.ujfalusi@ti.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH] dmaengine: edma: Reject slave configs using a buswidth of 8 and larger
Date: Thu, 21 Sep 2017 22:47:43 +0530	[thread overview]
Message-ID: <20170921171743.GI30097@localhost> (raw)
In-Reply-To: <20170917142510.3111-1-stefan.bruens@rwth-aachen.de>

On Sun, Sep 17, 2017 at 04:25:10PM +0200, Stefan Brüns wrote:
> The driver would happily accept buswidth of 16/32/64 bytes and program
> garbage to its registers.

Peter?

> 
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> ---
>  drivers/dma/edma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 3879f80a4815..c944ea339425 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -887,8 +887,8 @@ static int edma_slave_config(struct dma_chan *chan,
>  {
>  	struct edma_chan *echan = to_edma_chan(chan);
>  
> -	if (cfg->src_addr_width == DMA_SLAVE_BUSWIDTH_8_BYTES ||
> -	    cfg->dst_addr_width == DMA_SLAVE_BUSWIDTH_8_BYTES)
> +	if (cfg->src_addr_width >= DMA_SLAVE_BUSWIDTH_8_BYTES ||
> +	    cfg->dst_addr_width >= DMA_SLAVE_BUSWIDTH_8_BYTES)
>  		return -EINVAL;
>  
>  	memcpy(&echan->cfg, cfg, sizeof(echan->cfg));
> -- 
> 2.14.1
> 

-- 
~Vinod

  reply	other threads:[~2017-09-21 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-17 14:25 [PATCH] dmaengine: edma: Reject slave configs using a buswidth of 8 and larger Stefan Brüns
2017-09-21 17:17 ` Vinod Koul [this message]
2017-09-21 18:29   ` Peter Ujfalusi
2017-09-22  6:16     ` Peter Ujfalusi
2017-09-22  8:43       ` 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=20170921171743.GI30097@localhost \
    --to=vinod.koul@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=stefan.bruens@rwth-aachen.de \
    /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