lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 16 Oct 2011 13:31:33 +0530
From:	Vinod Koul <vinod.koul@...ux.intel.com>
To:	Mika Westerberg <mika.westerberg@....fi>
Cc:	dan.j.williams@...el.com, linux-kernel@...r.kernel.org,
	jaswinder.singh@...aro.org, 21cnbao@...il.com,
	rmk@....linux.org.uk, Grant Likely <grant.likely@...retlab.ca>,
	Alan Cox <alan@...ux.intel.com>
Subject: Re: [PATCH 07/10] spi, serial: move to dma_transfer_direction

On Sat, 2011-10-15 at 22:00 +0300, Mika Westerberg wrote:
> On Fri, Oct 14, 2011 at 11:08:22AM +0530, Vinod Koul wrote:
> 
> > diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> > index 1cf6454..8754a39 100644
> > --- a/drivers/spi/spi-ep93xx.c
> > +++ b/drivers/spi/spi-ep93xx.c
> > @@ -550,6 +550,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
> >  	struct dma_async_tx_descriptor *txd;
> >  	enum dma_slave_buswidth buswidth;
> >  	struct dma_slave_config conf;
> > +	enum dma_transfer_direction slave_dirn;
> >  	struct scatterlist *sg;
> >  	struct sg_table *sgt;
> >  	struct dma_chan *chan;
> > @@ -572,6 +573,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
> >  
> >  		conf.src_addr = espi->sspdr_phys;
> >  		conf.src_addr_width = buswidth;
> > +		slave_dirn = DEV_TO_MEM;
> >  	} else {
> >  		chan = espi->dma_tx;
> >  		buf = t->tx_buf;
> > @@ -579,6 +581,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
> >  
> >  		conf.dst_addr = espi->sspdr_phys;
> >  		conf.dst_addr_width = buswidth;
> > +		slave_dirn = MEM_TO_DEV;
> >  	}
> >  
> >  	ret = dmaengine_slave_config(chan, &conf);
> > @@ -630,7 +633,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
> >  		return ERR_PTR(-ENOMEM);
> >  
> >  	txd = chan->device->device_prep_slave_sg(chan, sgt->sgl, nents,
> > -						 dir, DMA_CTRL_ACK);
> > +						 slave_dirn, DMA_CTRL_ACK);
> >  	if (!txd) {
> >  		dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
> >  		return ERR_PTR(-ENOMEM);
> 
> Can you also change the ep93xx_spi_setup_dma() function to use these new
> values? Like the patch below.
> 
> Otherwise,
> 
> Acked-by: Mika Westerberg <mika.westerberg@....fi>
Thanks, I will add the below patche as well.

> 
> diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> index 66c3d9b..d97583f 100644
> --- a/drivers/spi/spi-ep93xx.c
> +++ b/drivers/spi/spi-ep93xx.c
> @@ -982,7 +982,7 @@ static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
>  	dma_cap_set(DMA_SLAVE, mask);
>  
>  	espi->dma_rx_data.port = EP93XX_DMA_SSP;
> -	espi->dma_rx_data.direction = DMA_FROM_DEVICE;
> +	espi->dma_rx_data.direction = DEV_TO_MEM;
>  	espi->dma_rx_data.name = "ep93xx-spi-rx";
>  
>  	espi->dma_rx = dma_request_channel(mask, ep93xx_spi_dma_filter,
> @@ -993,7 +993,7 @@ static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
>  	}
>  
>  	espi->dma_tx_data.port = EP93XX_DMA_SSP;
> -	espi->dma_tx_data.direction = DMA_TO_DEVICE;
> +	espi->dma_tx_data.direction = MEM_TO_DEV;
>  	espi->dma_tx_data.name = "ep93xx-spi-tx";
>  
>  	espi->dma_tx = dma_request_channel(mask, ep93xx_spi_dma_filter,


-- 
~Vinod

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ