Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-15 Thread kernel
> On 12.04.2019, at 13:16, Lukas Wunner wrote: > > On Fri, Apr 12, 2019 at 12:09:34PM +0100, Mark Brown wrote: >> On Fri, Apr 12, 2019 at 12:54:48PM +0200, Lukas Wunner wrote: >>> On Fri, Apr 12, 2019 at 10:47:21AM +0100, Mark Brown wrote: I *think* we managed to fix all the architectures t

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-15 Thread kernel
> On 12.04.2019, at 11:47, Mark Brown wrote: > > >> In a previous version of this I suggested to Meghana to put this in the >> driver, but Mark wanted it in the core. > > If we want to do this at a lower level the DMA code could hide this > limitation from the upper layers; presumably the SPI

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Mark Brown
On Fri, Apr 12, 2019 at 12:46:44PM +0200, Lukas Wunner wrote: > On Thu, Apr 11, 2019 at 11:02:26PM +0200, Noralf Trønnes wrote: > > Den 11.04.2019 20.18, skrev Lukas Wunner: > > > Note that spi_map_buf() already splits every transfer's sglist into > > > segments that are smaller than ctlr->max_dma

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Mark Brown
On Fri, Apr 12, 2019 at 01:16:15PM +0200, Lukas Wunner wrote: > On Fri, Apr 12, 2019 at 12:09:34PM +0100, Mark Brown wrote: > > On Fri, Apr 12, 2019 at 12:54:48PM +0200, Lukas Wunner wrote: > > > My point was that the call to spi_split_transfers_maxsize() shouldn't > > > be called on non-DMA-capab

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Lukas Wunner
On Fri, Apr 12, 2019 at 12:09:34PM +0100, Mark Brown wrote: > On Fri, Apr 12, 2019 at 12:54:48PM +0200, Lukas Wunner wrote: > > On Fri, Apr 12, 2019 at 10:47:21AM +0100, Mark Brown wrote: > > > I *think* we managed to fix all the architectures to at least stub out > > > the DMA interfaces, it's suc

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Mark Brown
On Fri, Apr 12, 2019 at 12:54:48PM +0200, Lukas Wunner wrote: > On Fri, Apr 12, 2019 at 10:47:21AM +0100, Mark Brown wrote: > > I *think* we managed to fix all the architectures to at least stub out > > the DMA interfaces, it's such a pointless thing to have conditional - > > it really only makes

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Lukas Wunner
On Fri, Apr 12, 2019 at 10:47:21AM +0100, Mark Brown wrote: > On Thu, Apr 11, 2019 at 11:02:26PM +0200, Noralf Trønnes wrote: > > Den 11.04.2019 20.18, skrev Lukas Wunner: > > > On Thu, Apr 11, 2019 at 06:42:33PM +0200, Noralf Trønnes wrote: > > > > @@ -1299,6 +1299,11 @@ static void __spi_pump_mes

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Lukas Wunner
On Thu, Apr 11, 2019 at 11:02:26PM +0200, Noralf Trønnes wrote: > Den 11.04.2019 20.18, skrev Lukas Wunner: > > On Thu, Apr 11, 2019 at 06:42:33PM +0200, Noralf Trønnes wrote: > >> @@ -1299,6 +1299,11 @@ static void __spi_pump_messages(struct > >> spi_controller *ctlr, bool in_kthread) > >> > >>

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Mark Brown
On Fri, Apr 12, 2019 at 12:03:35PM +0200, ker...@martin.sperl.org wrote: > > On 12.04.2019, at 11:47, Mark Brown wrote: > >> In a previous version of this I suggested to Meghana to put this in the > >> driver, but Mark wanted it in the core. > > If we want to do this at a lower level the DMA cod

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Mark Brown
On Thu, Apr 11, 2019 at 06:42:33PM +0200, Noralf Trønnes wrote: > +++ b/drivers/spi/spi.c > @@ -1299,6 +1299,11 @@ static void __spi_pump_messages(struct spi_controller > *ctlr, bool in_kthread) > > trace_spi_message_start(ctlr->cur_msg); > > + ret = spi_split_transfers_maxsize(ctlr

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-12 Thread Mark Brown
On Thu, Apr 11, 2019 at 11:02:26PM +0200, Noralf Trønnes wrote: > Den 11.04.2019 20.18, skrev Lukas Wunner: > > On Thu, Apr 11, 2019 at 06:42:33PM +0200, Noralf Trønnes wrote: > >> @@ -1299,6 +1299,11 @@ static void __spi_pump_messages(struct > >> spi_controller *ctlr, bool in_kthread) > >>tr

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-11 Thread Noralf Trønnes
Den 11.04.2019 20.18, skrev Lukas Wunner: > On Thu, Apr 11, 2019 at 06:42:33PM +0200, Noralf Trønnes wrote: >> @@ -1299,6 +1299,11 @@ static void __spi_pump_messages(struct spi_controller >> *ctlr, bool in_kthread) >> >> trace_spi_message_start(ctlr->cur_msg); >> >> +ret = spi_split

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-11 Thread Noralf Trønnes
Den 11.04.2019 18.42, skrev Noralf Trønnes: > From: Meghana Madhyastha > > Some drivers like spi_bcm2835 have a max size on DMA transfers. Work > around this by splitting up the transfer if necessary. > > ->max_transfer_size is MAX_INT if the driver doesn't set it, so this change > will only a

Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-11 Thread Lukas Wunner
On Thu, Apr 11, 2019 at 06:42:33PM +0200, Noralf Trønnes wrote: > @@ -1299,6 +1299,11 @@ static void __spi_pump_messages(struct spi_controller > *ctlr, bool in_kthread) > > trace_spi_message_start(ctlr->cur_msg); > > + ret = spi_split_transfers_maxsize(ctlr, ctlr->cur_msg, > ctlr->m

[PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks

2019-04-11 Thread Noralf Trønnes
From: Meghana Madhyastha Some drivers like spi_bcm2835 have a max size on DMA transfers. Work around this by splitting up the transfer if necessary. ->max_transfer_size is MAX_INT if the driver doesn't set it, so this change will only affect drivers that set the value. Signed-off-by: Meghana Ma