Hi Linus, On 26 March 2016 at 00:51, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote: > The current OF translation of channels can never work with > any DMA client using the DMA channels directly: the only way > to get the channels initialized properly is in the > dma_async_device_register() call, where chan->dev etc is > allocated and initialized. > > Allocate and initialize all possible DMA channels and > only augment a target channel with the periph_buses at > of_xlate(). Remove some const settings to make things work. > > Cc: Maxime Ripard <maxime.ripard@xxxxxxxxxxxxxxxxxx> > Cc: Joachim Eastwood <manabian@xxxxxxxxx> > Cc: Johannes Stezenbach <js@xxxxxxxxx> > Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> > --- > ChangeLog v1->v2: > - Rely on the number of signals for the variant coming in > from vendor data. > > Joachim: Can you please help to try to figure out if this > still crashes with LPC, it must be something with the mux > layer thing. This is doing the right thing and is needed > for atleast 2 platforms to use this driver. First of all; sorry about the screw up with the attempt to do dynamic channel allocation in the xlate. As Linus noted in [1] the dmaengine framework doesn't support this as channels are not initialized properly and it only seemed to work properly because of the mux. Sorry about all this! Note the LPC18xx didn't really crash with this patch. It was only unable to find the dma channels [2]. When the initial patches was posted I didn't have the time to debug it properly and I have since forgotten about it. The reason for this, as discovered by Johannes [3], is that chan->signal is not properly setup. This variable is set to -1 in pl08x_dma_init_virtual_channels() and when pl08x_find_chan_id() is called from xlate it doesn't find any channels because the chan->id is still -1 (I have verified this with debug prints). Setting chan->id make the channel assignment work on LPC18xx again. Linus: Could you send an updated version that sets the chan->id variable in pl08x_dma_init_virtual_channels()? Maybe it would make sense to reorder the patches since this patch is a fix. Thanks to both Linus and Johannes for figuring out the issues and fixing it. Sorry about the mess from my side! regards, Joachim Eastwood [1] http://www.spinics.net/lists/arm-kernel/msg492763.html [2] http://slexy.org/raw/s20nJ4Gpyx [3] http://www.spinics.net/lists/arm-kernel/msg492285.html -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html