Re: [PATCH v6 0/9] i2c: document DMA handling and add helpers for it

2017-12-05 Thread Jonathan Cameron
On Mon, 4 Dec 2017 22:05:41 + Mark Brown wrote: > On Sun, Dec 03, 2017 at 08:43:47PM +0100, Wolfram Sang wrote: > > > > It's a bit different in that it's much more likely that a SPI controller > > > will actually do DMA than an I2C one since the speeds are higher and > > > there's frequent a

Re: [PATCH v6 0/9] i2c: document DMA handling and add helpers for it

2017-12-04 Thread Mark Brown
On Sun, Dec 03, 2017 at 08:43:47PM +0100, Wolfram Sang wrote: > > It's a bit different in that it's much more likely that a SPI controller > > will actually do DMA than an I2C one since the speeds are higher and > > there's frequent applications that do large transfers so it's more > > likely that

Re: [PATCH v6 0/9] i2c: document DMA handling and add helpers for it

2017-12-04 Thread Wolfram Sang
On Sat, Nov 04, 2017 at 09:20:00PM +0100, Wolfram Sang wrote: > So, after revisiting old mail threads, taking part in a similar discussion on > the USB list, and implementing a not-convincing solution before, here is what > I > cooked up to document and ease DMA handling for I2C within Linux. Plea

Re: [PATCH v6 0/9] i2c: document DMA handling and add helpers for it

2017-12-03 Thread Wolfram Sang
> > > We pretty much assume everything is DMA safe already, the majority of > > > transfers go to/from kmalloc()ed scratch buffers so actually are DMA > > > safe but for bulk transfers we use the caller buffer and there might be > > > some problem users. > > > So, pretty much the situation I2C wa

Re: [PATCH v6 0/9] i2c: document DMA handling and add helpers for it

2017-11-28 Thread Mark Brown
On Mon, Nov 27, 2017 at 07:51:16PM +0100, Wolfram Sang wrote: > On Wed, Nov 08, 2017 at 10:50:37PM +, Mark Brown wrote: > > We pretty much assume everything is DMA safe already, the majority of > > transfers go to/from kmalloc()ed scratch buffers so actually are DMA > > safe but for bulk trans

Re: [PATCH v6 0/9] i2c: document DMA handling and add helpers for it

2017-11-27 Thread Wolfram Sang
On Wed, Nov 08, 2017 at 10:50:37PM +, Mark Brown wrote: > On Sat, Nov 04, 2017 at 09:20:00PM +0100, Wolfram Sang wrote: > > > While previous versions until v3 tried to magically apply bounce buffers > > when > > needed, it became clear that detecting DMA safe buffers is too fragile. This > >

Re: [PATCH v6 0/9] i2c: document DMA handling and add helpers for it

2017-11-08 Thread Mark Brown
On Sat, Nov 04, 2017 at 09:20:00PM +0100, Wolfram Sang wrote: > While previous versions until v3 tried to magically apply bounce buffers when > needed, it became clear that detecting DMA safe buffers is too fragile. This > approach is now opt-in, a DMA_SAFE flag needs to be set on an i2c_msg. The

[PATCH v6 0/9] i2c: document DMA handling and add helpers for it

2017-11-04 Thread Wolfram Sang
So, after revisiting old mail threads, taking part in a similar discussion on the USB list, and implementing a not-convincing solution before, here is what I cooked up to document and ease DMA handling for I2C within Linux. Please have a look at the documentation introduced in patch 7 for details.