RE: dmaengine : xilinx_dma two issues
> -Original Message- > From: Paul Thomas > Sent: Saturday, January 16, 2021 1:00 AM > To: Radhey Shyam Pandey > Cc: Dan Williams ; Vinod Koul > ; Michal Simek ; Matthew Murrian > ; Romain Perier > ; Krzysztof Kozlowski ; Marc > Ferland ; Sebastian von Ohr > ; dmaeng...@vger.kernel.org; Linux ARM arm-ker...@lists.infradead.org>; linux-kernel ker...@vger.kernel.org>; dave.ji...@intel.com; Shravya Kumbham > ; git > Subject: Re: dmaengine : xilinx_dma two issues > > On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey > wrote: > > > > > -Original Message- > > > From: Radhey Shyam Pandey > > > Sent: Monday, January 4, 2021 10:50 AM > > > To: Paul Thomas ; Dan Williams > > > ; Vinod Koul ; Michal > Simek > > > ; Matthew Murrian > ; > > > Romain Perier ; Krzysztof Kozlowski > > > ; Marc Ferland ; Sebastian von > Ohr > > > ; dmaeng...@vger.kernel.org; Linux ARM > > arm-ker...@lists.infradead.org>; linux-kernel > > ker...@vger.kernel.org>; Shravya Kumbham ; git > > > > > > Subject: RE: dmaengine : xilinx_dma two issues > > > > > > > -Original Message- > > > > From: Paul Thomas > > > > Sent: Monday, December 28, 2020 10:14 AM > > > > To: Dan Williams ; Vinod Koul > > > > ; Michal Simek ; Radhey > Shyam > > > > Pandey ; Matthew Murrian > > > > ; Romain Perier > > > ; > > > > Krzysztof Kozlowski ; Marc Ferland > > > > ; Sebastian von Ohr ; > > > > dmaeng...@vger.kernel.org; Linux ARM > > > arm-ker...@lists.infradead.org>; linux-kernel > > > ker...@vger.kernel.org> > > > > Subject: dmaengine : xilinx_dma two issues > > > > > > > > Hello, > > > > > > > > I'm trying to get the 5.10 kernel up and running for our system, and > > > > I'm running into a couple of issues with xilinx_dma. > > > + (Xilinx mailing list) > > > > > > Thanks for bringing the issues to our notice. Replies inline. > > > > > > > > > > > First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel > > > > probe fix node order dependency' breaks our usage. Before this > commit a > > > call to: > > > > dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but > > > > after that commit it returns -19. The reason for this seems to be that > > > > the only channel that is setup is channel 1 (chan->id is 1 in > > > xilinx_dma_chan_probe()). > > > > However in > > > > of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = > > > > dma_spec- > > > > >args[0];), which causes the: > > > > !xdev->chan[chan_id] > > > > test to fail in of_dma_xilinx_xlate() > > > > > > What is the channel number passed in > > > dmaclient DT? > > > > Any update on this issue? > > > > > > > > dmas = <& axi_dma_0 1> > > > dma-names = "axi_dma_0" > > > > > > > > > > > Our device-tree entry looks like this: > > > > axi_dma_0: dma@80002000 { > > > > status = "okay"; > > > > #dma-cells = <1>; > > > > compatible = "xlnx,axi-dma-1.00.a"; > > > > interrupt-parent = <>; > > > > interrupts = <0 89 4>; > > > > reg = <0x0 0x80002000 0x0 0x1000>; > > > > xlnx,addrwidth = <0x20>; > > > > clocks = <_clk LPD_LSBUS>, <_clk LPD_LSBUS>, > > > > <_clk LPD_LSBUS>, <_clk LPD_LSBUS>; > > > > clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", > > > > "m_axi_mm2s_aclk", "m_axi_s2mm_aclk"; > > > > dma-channel@80002030 { > > > > compatible = "xlnx,axi-dma-s2mm-channel"; > > > > dma-channels = <0x1>; > > > > interrupts = <0 89 4>; > > > > xlnx,datawidth = <0x20>; > > > > xlnx,device-id = <0x0>; > > > > }; > > > > }; > > > > > > > > This is on a 5.10.1 kernel on arm64 zynqmp hardware. > > > > > > > > The second issue goes a little further back to commit e81274cd6b526 > > > > 'dmaengine: add support to dynamic re
Re: dmaengine : xilinx_dma two issues
On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey wrote: > > > -Original Message- > > From: Radhey Shyam Pandey > > Sent: Monday, January 4, 2021 10:50 AM > > To: Paul Thomas ; Dan Williams > > ; Vinod Koul ; Michal Simek > > ; Matthew Murrian ; > > Romain Perier ; Krzysztof Kozlowski > > ; Marc Ferland ; Sebastian von Ohr > > ; dmaeng...@vger.kernel.org; Linux ARM > arm-ker...@lists.infradead.org>; linux-kernel > ker...@vger.kernel.org>; Shravya Kumbham ; git > > > > Subject: RE: dmaengine : xilinx_dma two issues > > > > > -Original Message- > > > From: Paul Thomas > > > Sent: Monday, December 28, 2020 10:14 AM > > > To: Dan Williams ; Vinod Koul > > > ; Michal Simek ; Radhey Shyam > > > Pandey ; Matthew Murrian > > > ; Romain Perier > > ; > > > Krzysztof Kozlowski ; Marc Ferland > > > ; Sebastian von Ohr ; > > > dmaeng...@vger.kernel.org; Linux ARM > > arm-ker...@lists.infradead.org>; linux-kernel > > ker...@vger.kernel.org> > > > Subject: dmaengine : xilinx_dma two issues > > > > > > Hello, > > > > > > I'm trying to get the 5.10 kernel up and running for our system, and > > > I'm running into a couple of issues with xilinx_dma. > > + (Xilinx mailing list) > > > > Thanks for bringing the issues to our notice. Replies inline. > > > > > > > > First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel > > > probe fix node order dependency' breaks our usage. Before this commit a > > call to: > > > dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but > > > after that commit it returns -19. The reason for this seems to be that > > > the only channel that is setup is channel 1 (chan->id is 1 in > > xilinx_dma_chan_probe()). > > > However in > > > of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = > > > dma_spec- > > > >args[0];), which causes the: > > > !xdev->chan[chan_id] > > > test to fail in of_dma_xilinx_xlate() > > > > What is the channel number passed in > > dmaclient DT? > > Any update on this issue? > > > > > dmas = <& axi_dma_0 1> > > dma-names = "axi_dma_0" > > > > > > > > Our device-tree entry looks like this: > > > axi_dma_0: dma@80002000 { > > > status = "okay"; > > > #dma-cells = <1>; > > > compatible = "xlnx,axi-dma-1.00.a"; > > > interrupt-parent = <>; > > > interrupts = <0 89 4>; > > > reg = <0x0 0x80002000 0x0 0x1000>; > > > xlnx,addrwidth = <0x20>; > > > clocks = <_clk LPD_LSBUS>, <_clk LPD_LSBUS>, > > > <_clk LPD_LSBUS>, <_clk LPD_LSBUS>; > > > clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", > > > "m_axi_mm2s_aclk", "m_axi_s2mm_aclk"; > > > dma-channel@80002030 { > > > compatible = "xlnx,axi-dma-s2mm-channel"; > > > dma-channels = <0x1>; > > > interrupts = <0 89 4>; > > > xlnx,datawidth = <0x20>; > > > xlnx,device-id = <0x0>; > > > }; > > > }; > > > > > > This is on a 5.10.1 kernel on arm64 zynqmp hardware. > > > > > > The second issue goes a little further back to commit e81274cd6b526 > > > 'dmaengine: add support to dynamic register/unregister of channels'. > > > After this commit even just removing the module 'rmmod xilinx_dma', > > > without ever using it, results in a kernel oops like this: > > > [ 37.214568] xilinx-vdma 80002000.dma: ch 0: SG disabled > > > [ 37.219807] xilinx-vdma 80002000.dma: WARN: Device release is not > > > defined so it is not safe to unbind this driver while in use > > > [ 37.231299] xilinx-vdma 80002000.dma: Xilinx AXI DMA Engine Driver > > > Probed!! > > > [ 42.100660] Unable to handle kernel paging request at virtual > > > address dead0108 > > > [ 42.108598] Mem abort info: > > > [ 42.111393] ESR = 0x9644 > > > [ 42.114443] EC = 0x25: DABT (current EL), IL = 32 bits > > > [ 42.119744] SET = 0, FnV = 0 > > > [ 42.122794] EA = 0, S1PTW = 0 > > > [ 42.125918] Data abort info: > > > [ 42.128789]
Re: dmaengine : xilinx_dma two issues
On 11. 01. 21 16:33, Lars-Peter Clausen wrote: > On 1/11/21 10:32 AM, Michal Simek wrote: >> Hi Lars, >> >> On 10. 01. 21 16:43, Lars-Peter Clausen wrote: >>> On 1/10/21 4:16 PM, Paul Thomas wrote: >>>> On Fri, Jan 8, 2021 at 1:36 PM Radhey Shyam Pandey >>>> wrote: >>>>>> -Original Message- >>>>>> From: Paul Thomas >>>>>> Sent: Friday, January 8, 2021 9:27 PM >>>>>> To: Radhey Shyam Pandey >>>>>> Cc: Dan Williams ; Vinod Koul >>>>>> ; Michal Simek ; Matthew >>>>>> Murrian >>>>>> ; Romain Perier >>>>>> ; Krzysztof Kozlowski ; >>>>>> Marc >>>>>> Ferland ; Sebastian von Ohr >>>>>> ; dmaeng...@vger.kernel.org; Linux ARM >>>>> arm-ker...@lists.infradead.org>; linux-kernel >>>>> ker...@vger.kernel.org>; dave.ji...@intel.com; Shravya Kumbham >>>>>> ; git >>>>>> Subject: Re: dmaengine : xilinx_dma two issues >>>>>> >>>>>> Hi All, >>>>>> >>>>>> On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey >>>>>> >>>>>> wrote: >>>>>>>> -Original Message- >>>>>>>> From: Radhey Shyam Pandey >>>>>>>> Sent: Monday, January 4, 2021 10:50 AM >>>>>>>> To: Paul Thomas ; Dan Williams >>>>>>>> ; Vinod Koul ; Michal >>>>>>>> Simek ; Matthew Murrian >>>>>>>> ; Romain Perier >>>>>>>> ; Krzysztof Kozlowski ; >>>>>>>> Marc Ferland ; Sebastian von Ohr >>>>>>>> ; dmaeng...@vger.kernel.org; Linux ARM >>>>>>> arm-ker...@lists.infradead.org>; linux-kernel >>>>>>> ker...@vger.kernel.org>; Shravya Kumbham ; git >>>>>>>> >>>>>>>> Subject: RE: dmaengine : xilinx_dma two issues >>>>>>>> >>>>>>>>> -Original Message- >>>>>>>>> From: Paul Thomas >>>>>>>>> Sent: Monday, December 28, 2020 10:14 AM >>>>>>>>> To: Dan Williams ; Vinod Koul >>>>>>>>> ; Michal Simek ; Radhey >>>>>>>>> Shyam Pandey ; Matthew Murrian >>>>>>>>> ; Romain Perier >>>>>>>> ; >>>>>>>>> Krzysztof Kozlowski ; Marc Ferland >>>>>>>>> ; Sebastian von Ohr ; >>>>>>>>> dmaeng...@vger.kernel.org; Linux ARM >>>>>>>> arm-ker...@lists.infradead.org>; linux-kernel >>>>>>>> ker...@vger.kernel.org> >>>>>>>>> Subject: dmaengine : xilinx_dma two issues >>>>>>>>> >>>>>>>>> Hello, >>>>>>>>> >>>>>>>>> I'm trying to get the 5.10 kernel up and running for our system, >>>>>>>>> and I'm running into a couple of issues with xilinx_dma. >>>>>>>> + (Xilinx mailing list) >>>>>>>> >>>>>>>> Thanks for bringing the issues to our notice. Replies inline. >>>>>>>> >>>>>>>>> First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel >>>>>>>>> probe fix node order dependency' breaks our usage. Before this >>>>>>>>> commit a >>>>>>>> call to: >>>>>>>>> dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but >>>>>>>>> after that commit it returns -19. The reason for this seems to be >>>>>>>>> that the only channel that is setup is channel 1 (chan->id is 1 in >>>>>>>> xilinx_dma_chan_probe()). >>>>>>>>> However in >>>>>>>>> of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = >>>>>>>>> dma_spec- >>>>>>>>>> args[0];), which causes the: >>>>>>>>> !xdev->chan[chan_id] >>>>>>>>> test to fail in of_dma_xilinx_xlate() >>>>>>>> What is the channel number passed in dmaclient DT? >>>>>> Is this a question for me? >>>>> Yes, please also share th
Re: dmaengine : xilinx_dma two issues
On 1/11/21 10:32 AM, Michal Simek wrote: Hi Lars, On 10. 01. 21 16:43, Lars-Peter Clausen wrote: On 1/10/21 4:16 PM, Paul Thomas wrote: On Fri, Jan 8, 2021 at 1:36 PM Radhey Shyam Pandey wrote: -Original Message- From: Paul Thomas Sent: Friday, January 8, 2021 9:27 PM To: Radhey Shyam Pandey Cc: Dan Williams ; Vinod Koul ; Michal Simek ; Matthew Murrian ; Romain Perier ; Krzysztof Kozlowski ; Marc Ferland ; Sebastian von Ohr ; dmaeng...@vger.kernel.org; Linux ARM ; linux-kernel ; dave.ji...@intel.com; Shravya Kumbham ; git Subject: Re: dmaengine : xilinx_dma two issues Hi All, On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey wrote: -Original Message- From: Radhey Shyam Pandey Sent: Monday, January 4, 2021 10:50 AM To: Paul Thomas ; Dan Williams ; Vinod Koul ; Michal Simek ; Matthew Murrian ; Romain Perier ; Krzysztof Kozlowski ; Marc Ferland ; Sebastian von Ohr ; dmaeng...@vger.kernel.org; Linux ARM ; linux-kernel ; Shravya Kumbham ; git Subject: RE: dmaengine : xilinx_dma two issues -Original Message- From: Paul Thomas Sent: Monday, December 28, 2020 10:14 AM To: Dan Williams ; Vinod Koul ; Michal Simek ; Radhey Shyam Pandey ; Matthew Murrian ; Romain Perier ; Krzysztof Kozlowski ; Marc Ferland ; Sebastian von Ohr ; dmaeng...@vger.kernel.org; Linux ARM ; linux-kernel Subject: dmaengine : xilinx_dma two issues Hello, I'm trying to get the 5.10 kernel up and running for our system, and I'm running into a couple of issues with xilinx_dma. + (Xilinx mailing list) Thanks for bringing the issues to our notice. Replies inline. First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel probe fix node order dependency' breaks our usage. Before this commit a call to: dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but after that commit it returns -19. The reason for this seems to be that the only channel that is setup is channel 1 (chan->id is 1 in xilinx_dma_chan_probe()). However in of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = dma_spec- args[0];), which causes the: !xdev->chan[chan_id] test to fail in of_dma_xilinx_xlate() What is the channel number passed in dmaclient DT? Is this a question for me? Yes, please also share the dmaclient DT client node. Need to see channel number passed to dmas property. Something like below- dmas = <& axi_dma_0 1> dma-names = "axi_dma_0" OK, I think I need to revisit this and clean it up some. Currently In the driver (a custom iio adc driver) it is hard coded: dma_request_chan(_dev->dev, "axi_dma_0"); However, the DT also has the entries (currently unused by the driver): dmas = <_dma_0 0>; dma-names = "axi_dma_0"; I'll go back and clean up our driver to do something like adi-axi-adc.c does: if (!device_property_present(dev, "dmas")) return 0; if (device_property_read_string(dev, "dma-names", _name)) dma_name = "axi_dma_0"; Should the dmas node get used by the driver? I see the second argument is: '0' for write/tx and '1' for read/rx channel. So I should be setting this to 1 like this? dmas = <_dma_0 1>; dma-names = "axi_dma_0"; But where does that field get used? This got broken in "dmaengine: xilinx_dma: In dma channel probe fix node order dependency" <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=14ccf0aab46e1888e2f45b6e995c621c70b32651>. Before if there was only one channel that channel was always at index 0. Regardless of whether the channel was RX or TX. But after that change the RX channel is always at offset 1, regardless of whether the DMA has one or two channels. This is a breakage in ABI. If you have the choice I'd recommend to not use the Xilinx DMA, it gets broken pretty much every other release. I expect that you are talking about Xilinx releases and I hope that this has changed over times when most of changes are upstreamed already. The patch above you are referencing has been applied by Vinod and he is checking patches a lot. If there is a problem and any breakage it needs to be fixed. And bugs happen all the time and we have a way how to work with it. I don't know if it has gotten better. When I upgrade to a new release what takes up most of the time is figuring out why the Xilinx DMA doesn't work anymore. Its been like this for years. If you see there any issue please report them and let's fix them and continue on this topic from technical point of view. In connection to this problem what are you suggesting? Just revert this patch or fix ordering differently? Would be good to provide your suggestion and fix it. Reverting would re-introduce the issue the patch was supposed to fix. The would have been to use index 0 for the channel if there is only one channel. If there are two channels use 0 for T
Re: dmaengine : xilinx_dma two issues
On Sun, Jan 10, 2021 at 10:16 AM Paul Thomas wrote: > > On Fri, Jan 8, 2021 at 1:36 PM Radhey Shyam Pandey wrote: > > > > > -Original Message- > > > From: Paul Thomas > > > Sent: Friday, January 8, 2021 9:27 PM > > > To: Radhey Shyam Pandey > > > Cc: Dan Williams ; Vinod Koul > > > ; Michal Simek ; Matthew Murrian > > > ; Romain Perier > > > ; Krzysztof Kozlowski ; Marc > > > Ferland ; Sebastian von Ohr > > > ; dmaeng...@vger.kernel.org; Linux ARM > > arm-ker...@lists.infradead.org>; linux-kernel > > ker...@vger.kernel.org>; dave.ji...@intel.com; Shravya Kumbham > > > ; git > > > Subject: Re: dmaengine : xilinx_dma two issues > > > > > > Hi All, > > > > > > On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey > > > wrote: > > > > > > > > > -Original Message- > > > > > From: Radhey Shyam Pandey > > > > > Sent: Monday, January 4, 2021 10:50 AM > > > > > To: Paul Thomas ; Dan Williams > > > > > ; Vinod Koul ; Michal > > > > > Simek ; Matthew Murrian > > > > > ; Romain Perier > > > > > ; Krzysztof Kozlowski ; > > > > > Marc Ferland ; Sebastian von Ohr > > > > > ; dmaeng...@vger.kernel.org; Linux ARM > > > > arm-ker...@lists.infradead.org>; linux-kernel > > > > ker...@vger.kernel.org>; Shravya Kumbham ; git > > > > > > > > > > Subject: RE: dmaengine : xilinx_dma two issues > > > > > > > > > > > -Original Message- > > > > > > From: Paul Thomas > > > > > > Sent: Monday, December 28, 2020 10:14 AM > > > > > > To: Dan Williams ; Vinod Koul > > > > > > ; Michal Simek ; Radhey > > > > > > Shyam Pandey ; Matthew Murrian > > > > > > ; Romain Perier > > > > > ; > > > > > > Krzysztof Kozlowski ; Marc Ferland > > > > > > ; Sebastian von Ohr ; > > > > > > dmaeng...@vger.kernel.org; Linux ARM > > > > > arm-ker...@lists.infradead.org>; linux-kernel > > > > > ker...@vger.kernel.org> > > > > > > Subject: dmaengine : xilinx_dma two issues > > > > > > > > > > > > Hello, > > > > > > > > > > > > I'm trying to get the 5.10 kernel up and running for our system, > > > > > > and I'm running into a couple of issues with xilinx_dma. > > > > > + (Xilinx mailing list) > > > > > > > > > > Thanks for bringing the issues to our notice. Replies inline. > > > > > > > > > > > > > > > > > First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel > > > > > > probe fix node order dependency' breaks our usage. Before this > > > > > > commit a > > > > > call to: > > > > > > dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but > > > > > > after that commit it returns -19. The reason for this seems to be > > > > > > that the only channel that is setup is channel 1 (chan->id is 1 in > > > > > xilinx_dma_chan_probe()). > > > > > > However in > > > > > > of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = > > > > > > dma_spec- > > > > > > >args[0];), which causes the: > > > > > > !xdev->chan[chan_id] > > > > > > test to fail in of_dma_xilinx_xlate() > > > > > > > > > > What is the channel number passed in dmaclient DT? > > > Is this a question for me? > > > > Yes, please also share the dmaclient DT client node. Need to see > > channel number passed to dmas property. Something like below- > > > > dmas = <& axi_dma_0 1> > > dma-names = "axi_dma_0" > OK, I think I need to revisit this and clean it up some. Currently In > the driver (a custom iio adc driver) it is hard coded: > dma_request_chan(_dev->dev, "axi_dma_0"); > > However, the DT also has the entries (currently unused by the driver): > dmas = <_dma_0 0>; > dma-names = "axi_dma_0"; > > I'll go back and clean up our driver to do something like adi-axi-adc.c does: > > if (!device_property_present(dev, "dmas")) > return 0; > >
Re: dmaengine : xilinx_dma two issues
Hi Lars, On 10. 01. 21 16:43, Lars-Peter Clausen wrote: > On 1/10/21 4:16 PM, Paul Thomas wrote: >> On Fri, Jan 8, 2021 at 1:36 PM Radhey Shyam Pandey >> wrote: >>>> -Original Message- >>>> From: Paul Thomas >>>> Sent: Friday, January 8, 2021 9:27 PM >>>> To: Radhey Shyam Pandey >>>> Cc: Dan Williams ; Vinod Koul >>>> ; Michal Simek ; Matthew Murrian >>>> ; Romain Perier >>>> ; Krzysztof Kozlowski ; Marc >>>> Ferland ; Sebastian von Ohr >>>> ; dmaeng...@vger.kernel.org; Linux ARM >>> arm-ker...@lists.infradead.org>; linux-kernel >>> ker...@vger.kernel.org>; dave.ji...@intel.com; Shravya Kumbham >>>> ; git >>>> Subject: Re: dmaengine : xilinx_dma two issues >>>> >>>> Hi All, >>>> >>>> On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey >>>> wrote: >>>>>> -Original Message- >>>>>> From: Radhey Shyam Pandey >>>>>> Sent: Monday, January 4, 2021 10:50 AM >>>>>> To: Paul Thomas ; Dan Williams >>>>>> ; Vinod Koul ; Michal >>>>>> Simek ; Matthew Murrian >>>>>> ; Romain Perier >>>>>> ; Krzysztof Kozlowski ; >>>>>> Marc Ferland ; Sebastian von Ohr >>>>>> ; dmaeng...@vger.kernel.org; Linux ARM >>>>> arm-ker...@lists.infradead.org>; linux-kernel >>>>> ker...@vger.kernel.org>; Shravya Kumbham ; git >>>>>> >>>>>> Subject: RE: dmaengine : xilinx_dma two issues >>>>>> >>>>>>> -Original Message- >>>>>>> From: Paul Thomas >>>>>>> Sent: Monday, December 28, 2020 10:14 AM >>>>>>> To: Dan Williams ; Vinod Koul >>>>>>> ; Michal Simek ; Radhey >>>>>>> Shyam Pandey ; Matthew Murrian >>>>>>> ; Romain Perier >>>>>> ; >>>>>>> Krzysztof Kozlowski ; Marc Ferland >>>>>>> ; Sebastian von Ohr ; >>>>>>> dmaeng...@vger.kernel.org; Linux ARM >>>>>> arm-ker...@lists.infradead.org>; linux-kernel >>>>>> ker...@vger.kernel.org> >>>>>>> Subject: dmaengine : xilinx_dma two issues >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I'm trying to get the 5.10 kernel up and running for our system, >>>>>>> and I'm running into a couple of issues with xilinx_dma. >>>>>> + (Xilinx mailing list) >>>>>> >>>>>> Thanks for bringing the issues to our notice. Replies inline. >>>>>> >>>>>>> First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel >>>>>>> probe fix node order dependency' breaks our usage. Before this >>>>>>> commit a >>>>>> call to: >>>>>>> dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but >>>>>>> after that commit it returns -19. The reason for this seems to be >>>>>>> that the only channel that is setup is channel 1 (chan->id is 1 in >>>>>> xilinx_dma_chan_probe()). >>>>>>> However in >>>>>>> of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = >>>>>>> dma_spec- >>>>>>>> args[0];), which causes the: >>>>>>> !xdev->chan[chan_id] >>>>>>> test to fail in of_dma_xilinx_xlate() >>>>>> What is the channel number passed in dmaclient DT? >>>> Is this a question for me? >>> Yes, please also share the dmaclient DT client node. Need to see >>> channel number passed to dmas property. Something like below- >>> >>> dmas = <& axi_dma_0 1> >>> dma-names = "axi_dma_0" >> OK, I think I need to revisit this and clean it up some. Currently In >> the driver (a custom iio adc driver) it is hard coded: >> dma_request_chan(_dev->dev, "axi_dma_0"); >> >> However, the DT also has the entries (currently unused by the driver): >> dmas = <_dma_0 0>; >> dma-names = "axi_dma_0"; >> >> I'll go back and clean up our driver to do something like >> adi-axi-adc.c does: >> >> if (!device_property_present(dev, "dmas")) >>
Re: dmaengine : xilinx_dma two issues
On 1/10/21 4:16 PM, Paul Thomas wrote: On Fri, Jan 8, 2021 at 1:36 PM Radhey Shyam Pandey wrote: -Original Message- From: Paul Thomas Sent: Friday, January 8, 2021 9:27 PM To: Radhey Shyam Pandey Cc: Dan Williams ; Vinod Koul ; Michal Simek ; Matthew Murrian ; Romain Perier ; Krzysztof Kozlowski ; Marc Ferland ; Sebastian von Ohr ; dmaeng...@vger.kernel.org; Linux ARM ; linux-kernel ; dave.ji...@intel.com; Shravya Kumbham ; git Subject: Re: dmaengine : xilinx_dma two issues Hi All, On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey wrote: -Original Message- From: Radhey Shyam Pandey Sent: Monday, January 4, 2021 10:50 AM To: Paul Thomas ; Dan Williams ; Vinod Koul ; Michal Simek ; Matthew Murrian ; Romain Perier ; Krzysztof Kozlowski ; Marc Ferland ; Sebastian von Ohr ; dmaeng...@vger.kernel.org; Linux ARM ; linux-kernel ; Shravya Kumbham ; git Subject: RE: dmaengine : xilinx_dma two issues -Original Message- From: Paul Thomas Sent: Monday, December 28, 2020 10:14 AM To: Dan Williams ; Vinod Koul ; Michal Simek ; Radhey Shyam Pandey ; Matthew Murrian ; Romain Perier ; Krzysztof Kozlowski ; Marc Ferland ; Sebastian von Ohr ; dmaeng...@vger.kernel.org; Linux ARM ; linux-kernel Subject: dmaengine : xilinx_dma two issues Hello, I'm trying to get the 5.10 kernel up and running for our system, and I'm running into a couple of issues with xilinx_dma. + (Xilinx mailing list) Thanks for bringing the issues to our notice. Replies inline. First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel probe fix node order dependency' breaks our usage. Before this commit a call to: dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but after that commit it returns -19. The reason for this seems to be that the only channel that is setup is channel 1 (chan->id is 1 in xilinx_dma_chan_probe()). However in of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = dma_spec- args[0];), which causes the: !xdev->chan[chan_id] test to fail in of_dma_xilinx_xlate() What is the channel number passed in dmaclient DT? Is this a question for me? Yes, please also share the dmaclient DT client node. Need to see channel number passed to dmas property. Something like below- dmas = <& axi_dma_0 1> dma-names = "axi_dma_0" OK, I think I need to revisit this and clean it up some. Currently In the driver (a custom iio adc driver) it is hard coded: dma_request_chan(_dev->dev, "axi_dma_0"); However, the DT also has the entries (currently unused by the driver): dmas = <_dma_0 0>; dma-names = "axi_dma_0"; I'll go back and clean up our driver to do something like adi-axi-adc.c does: if (!device_property_present(dev, "dmas")) return 0; if (device_property_read_string(dev, "dma-names", _name)) dma_name = "axi_dma_0"; Should the dmas node get used by the driver? I see the second argument is: '0' for write/tx and '1' for read/rx channel. So I should be setting this to 1 like this? dmas = <_dma_0 1>; dma-names = "axi_dma_0"; But where does that field get used? This got broken in "dmaengine: xilinx_dma: In dma channel probe fix node order dependency" <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=14ccf0aab46e1888e2f45b6e995c621c70b32651>. Before if there was only one channel that channel was always at index 0. Regardless of whether the channel was RX or TX. But after that change the RX channel is always at offset 1, regardless of whether the DMA has one or two channels. This is a breakage in ABI. If you have the choice I'd recommend to not use the Xilinx DMA, it gets broken pretty much every other release. - Lars
Re: dmaengine : xilinx_dma two issues
On Fri, Jan 8, 2021 at 1:36 PM Radhey Shyam Pandey wrote: > > > -Original Message- > > From: Paul Thomas > > Sent: Friday, January 8, 2021 9:27 PM > > To: Radhey Shyam Pandey > > Cc: Dan Williams ; Vinod Koul > > ; Michal Simek ; Matthew Murrian > > ; Romain Perier > > ; Krzysztof Kozlowski ; Marc > > Ferland ; Sebastian von Ohr > > ; dmaeng...@vger.kernel.org; Linux ARM > arm-ker...@lists.infradead.org>; linux-kernel > ker...@vger.kernel.org>; dave.ji...@intel.com; Shravya Kumbham > > ; git > > Subject: Re: dmaengine : xilinx_dma two issues > > > > Hi All, > > > > On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey > > wrote: > > > > > > > -Original Message- > > > > From: Radhey Shyam Pandey > > > > Sent: Monday, January 4, 2021 10:50 AM > > > > To: Paul Thomas ; Dan Williams > > > > ; Vinod Koul ; Michal > > > > Simek ; Matthew Murrian > > > > ; Romain Perier > > > > ; Krzysztof Kozlowski ; > > > > Marc Ferland ; Sebastian von Ohr > > > > ; dmaeng...@vger.kernel.org; Linux ARM > > > arm-ker...@lists.infradead.org>; linux-kernel > > > ker...@vger.kernel.org>; Shravya Kumbham ; git > > > > > > > > Subject: RE: dmaengine : xilinx_dma two issues > > > > > > > > > -Original Message- > > > > > From: Paul Thomas > > > > > Sent: Monday, December 28, 2020 10:14 AM > > > > > To: Dan Williams ; Vinod Koul > > > > > ; Michal Simek ; Radhey > > > > > Shyam Pandey ; Matthew Murrian > > > > > ; Romain Perier > > > > ; > > > > > Krzysztof Kozlowski ; Marc Ferland > > > > > ; Sebastian von Ohr ; > > > > > dmaeng...@vger.kernel.org; Linux ARM > > > > arm-ker...@lists.infradead.org>; linux-kernel > > > > ker...@vger.kernel.org> > > > > > Subject: dmaengine : xilinx_dma two issues > > > > > > > > > > Hello, > > > > > > > > > > I'm trying to get the 5.10 kernel up and running for our system, > > > > > and I'm running into a couple of issues with xilinx_dma. > > > > + (Xilinx mailing list) > > > > > > > > Thanks for bringing the issues to our notice. Replies inline. > > > > > > > > > > > > > > First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel > > > > > probe fix node order dependency' breaks our usage. Before this > > > > > commit a > > > > call to: > > > > > dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but > > > > > after that commit it returns -19. The reason for this seems to be > > > > > that the only channel that is setup is channel 1 (chan->id is 1 in > > > > xilinx_dma_chan_probe()). > > > > > However in > > > > > of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = > > > > > dma_spec- > > > > > >args[0];), which causes the: > > > > > !xdev->chan[chan_id] > > > > > test to fail in of_dma_xilinx_xlate() > > > > > > > > What is the channel number passed in dmaclient DT? > > Is this a question for me? > > Yes, please also share the dmaclient DT client node. Need to see > channel number passed to dmas property. Something like below- > > dmas = <& axi_dma_0 1> > dma-names = "axi_dma_0" OK, I think I need to revisit this and clean it up some. Currently In the driver (a custom iio adc driver) it is hard coded: dma_request_chan(_dev->dev, "axi_dma_0"); However, the DT also has the entries (currently unused by the driver): dmas = <_dma_0 0>; dma-names = "axi_dma_0"; I'll go back and clean up our driver to do something like adi-axi-adc.c does: if (!device_property_present(dev, "dmas")) return 0; if (device_property_read_string(dev, "dma-names", _name)) dma_name = "axi_dma_0"; Should the dmas node get used by the driver? I see the second argument is: '0' for write/tx and '1' for read/rx channel. So I should be setting this to 1 like this? dmas = <_dma_0 1>; dma-names = "axi_dma_0"; But where does that field get used? thanks, Paul > > > > > > > > > Any update on this issue? > > > > > > > > > > > > >
RE: dmaengine : xilinx_dma two issues
> -Original Message- > From: Paul Thomas > Sent: Friday, January 8, 2021 9:27 PM > To: Radhey Shyam Pandey > Cc: Dan Williams ; Vinod Koul > ; Michal Simek ; Matthew Murrian > ; Romain Perier > ; Krzysztof Kozlowski ; Marc > Ferland ; Sebastian von Ohr > ; dmaeng...@vger.kernel.org; Linux ARM arm-ker...@lists.infradead.org>; linux-kernel ker...@vger.kernel.org>; dave.ji...@intel.com; Shravya Kumbham > ; git > Subject: Re: dmaengine : xilinx_dma two issues > > Hi All, > > On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey > wrote: > > > > > -Original Message- > > > From: Radhey Shyam Pandey > > > Sent: Monday, January 4, 2021 10:50 AM > > > To: Paul Thomas ; Dan Williams > > > ; Vinod Koul ; Michal > > > Simek ; Matthew Murrian > > > ; Romain Perier > > > ; Krzysztof Kozlowski ; > > > Marc Ferland ; Sebastian von Ohr > > > ; dmaeng...@vger.kernel.org; Linux ARM > > arm-ker...@lists.infradead.org>; linux-kernel > > ker...@vger.kernel.org>; Shravya Kumbham ; git > > > > > > Subject: RE: dmaengine : xilinx_dma two issues > > > > > > > -Original Message- > > > > From: Paul Thomas > > > > Sent: Monday, December 28, 2020 10:14 AM > > > > To: Dan Williams ; Vinod Koul > > > > ; Michal Simek ; Radhey > > > > Shyam Pandey ; Matthew Murrian > > > > ; Romain Perier > > > ; > > > > Krzysztof Kozlowski ; Marc Ferland > > > > ; Sebastian von Ohr ; > > > > dmaeng...@vger.kernel.org; Linux ARM > > > arm-ker...@lists.infradead.org>; linux-kernel > > > ker...@vger.kernel.org> > > > > Subject: dmaengine : xilinx_dma two issues > > > > > > > > Hello, > > > > > > > > I'm trying to get the 5.10 kernel up and running for our system, > > > > and I'm running into a couple of issues with xilinx_dma. > > > + (Xilinx mailing list) > > > > > > Thanks for bringing the issues to our notice. Replies inline. > > > > > > > > > > > First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel > > > > probe fix node order dependency' breaks our usage. Before this > > > > commit a > > > call to: > > > > dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but > > > > after that commit it returns -19. The reason for this seems to be > > > > that the only channel that is setup is channel 1 (chan->id is 1 in > > > xilinx_dma_chan_probe()). > > > > However in > > > > of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = > > > > dma_spec- > > > > >args[0];), which causes the: > > > > !xdev->chan[chan_id] > > > > test to fail in of_dma_xilinx_xlate() > > > > > > What is the channel number passed in dmaclient DT? > Is this a question for me? Yes, please also share the dmaclient DT client node. Need to see channel number passed to dmas property. Something like below- dmas = <& axi_dma_0 1> dma-names = "axi_dma_0" > > > > > Any update on this issue? > > > > > > > > > dmas = <& axi_dma_0 1> > > > dma-names = "axi_dma_0" > > > > > > > > > > > Our device-tree entry looks like this: > > > > axi_dma_0: dma@80002000 { > > > > status = "okay"; > > > > #dma-cells = <1>; > > > > compatible = "xlnx,axi-dma-1.00.a"; > > > > interrupt-parent = <>; > > > > interrupts = <0 89 4>; > > > > reg = <0x0 0x80002000 0x0 0x1000>; > > > > xlnx,addrwidth = <0x20>; > > > > clocks = <_clk LPD_LSBUS>, <_clk LPD_LSBUS>, > > > > <_clk LPD_LSBUS>, <_clk LPD_LSBUS>; > > > > clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", > > > > "m_axi_mm2s_aclk", "m_axi_s2mm_aclk"; > > > > dma-channel@80002030 { > > > > compatible = "xlnx,axi-dma-s2mm-channel"; > > > > dma-channels = <0x1>; > > > > interrupts = <0 89 4>; > > > > xlnx,datawidth = <0x20>; > > > > xlnx,device-id = <0x0>; > > > > }; > > > > }; > > >
Re: dmaengine : xilinx_dma two issues
Hi All, On Fri, Jan 8, 2021 at 2:13 AM Radhey Shyam Pandey wrote: > > > -Original Message- > > From: Radhey Shyam Pandey > > Sent: Monday, January 4, 2021 10:50 AM > > To: Paul Thomas ; Dan Williams > > ; Vinod Koul ; Michal Simek > > ; Matthew Murrian ; > > Romain Perier ; Krzysztof Kozlowski > > ; Marc Ferland ; Sebastian von Ohr > > ; dmaeng...@vger.kernel.org; Linux ARM > arm-ker...@lists.infradead.org>; linux-kernel > ker...@vger.kernel.org>; Shravya Kumbham ; git > > > > Subject: RE: dmaengine : xilinx_dma two issues > > > > > -Original Message- > > > From: Paul Thomas > > > Sent: Monday, December 28, 2020 10:14 AM > > > To: Dan Williams ; Vinod Koul > > > ; Michal Simek ; Radhey Shyam > > > Pandey ; Matthew Murrian > > > ; Romain Perier > > ; > > > Krzysztof Kozlowski ; Marc Ferland > > > ; Sebastian von Ohr ; > > > dmaeng...@vger.kernel.org; Linux ARM > > arm-ker...@lists.infradead.org>; linux-kernel > > ker...@vger.kernel.org> > > > Subject: dmaengine : xilinx_dma two issues > > > > > > Hello, > > > > > > I'm trying to get the 5.10 kernel up and running for our system, and > > > I'm running into a couple of issues with xilinx_dma. > > + (Xilinx mailing list) > > > > Thanks for bringing the issues to our notice. Replies inline. > > > > > > > > First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel > > > probe fix node order dependency' breaks our usage. Before this commit a > > call to: > > > dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but > > > after that commit it returns -19. The reason for this seems to be that > > > the only channel that is setup is channel 1 (chan->id is 1 in > > xilinx_dma_chan_probe()). > > > However in > > > of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = > > > dma_spec- > > > >args[0];), which causes the: > > > !xdev->chan[chan_id] > > > test to fail in of_dma_xilinx_xlate() > > > > What is the channel number passed in > > dmaclient DT? Is this a question for me? > > Any update on this issue? > > > > > dmas = <& axi_dma_0 1> > > dma-names = "axi_dma_0" > > > > > > > > Our device-tree entry looks like this: > > > axi_dma_0: dma@80002000 { > > > status = "okay"; > > > #dma-cells = <1>; > > > compatible = "xlnx,axi-dma-1.00.a"; > > > interrupt-parent = <>; > > > interrupts = <0 89 4>; > > > reg = <0x0 0x80002000 0x0 0x1000>; > > > xlnx,addrwidth = <0x20>; > > > clocks = <_clk LPD_LSBUS>, <_clk LPD_LSBUS>, > > > <_clk LPD_LSBUS>, <_clk LPD_LSBUS>; > > > clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", > > > "m_axi_mm2s_aclk", "m_axi_s2mm_aclk"; > > > dma-channel@80002030 { > > > compatible = "xlnx,axi-dma-s2mm-channel"; > > > dma-channels = <0x1>; > > > interrupts = <0 89 4>; > > > xlnx,datawidth = <0x20>; > > > xlnx,device-id = <0x0>; > > > }; > > > }; > > > > > > This is on a 5.10.1 kernel on arm64 zynqmp hardware. > > > > > > The second issue goes a little further back to commit e81274cd6b526 > > > 'dmaengine: add support to dynamic register/unregister of channels'. > > > After this commit even just removing the module 'rmmod xilinx_dma', > > > without ever using it, results in a kernel oops like this: > > > [ 37.214568] xilinx-vdma 80002000.dma: ch 0: SG disabled > > > [ 37.219807] xilinx-vdma 80002000.dma: WARN: Device release is not > > > defined so it is not safe to unbind this driver while in use > > > [ 37.231299] xilinx-vdma 80002000.dma: Xilinx AXI DMA Engine Driver > > > Probed!! > > > [ 42.100660] Unable to handle kernel paging request at virtual > > > address dead0108 > > > [ 42.108598] Mem abort info: > > > [ 42.111393] ESR = 0x9644 > > > [ 42.114443] EC = 0x25: DABT (current EL), IL = 32 bits > > > [ 42.119744] SET = 0, FnV = 0 > > > [ 42.122794] EA = 0, S1PTW = 0 > > > [ 42.125918] Data abort info: > &
RE: dmaengine : xilinx_dma two issues
> -Original Message- > From: Radhey Shyam Pandey > Sent: Monday, January 4, 2021 10:50 AM > To: Paul Thomas ; Dan Williams > ; Vinod Koul ; Michal Simek > ; Matthew Murrian ; > Romain Perier ; Krzysztof Kozlowski > ; Marc Ferland ; Sebastian von Ohr > ; dmaeng...@vger.kernel.org; Linux ARM arm-ker...@lists.infradead.org>; linux-kernel ker...@vger.kernel.org>; Shravya Kumbham ; git > > Subject: RE: dmaengine : xilinx_dma two issues > > > -Original Message- > > From: Paul Thomas > > Sent: Monday, December 28, 2020 10:14 AM > > To: Dan Williams ; Vinod Koul > > ; Michal Simek ; Radhey Shyam > > Pandey ; Matthew Murrian > > ; Romain Perier > ; > > Krzysztof Kozlowski ; Marc Ferland > > ; Sebastian von Ohr ; > > dmaeng...@vger.kernel.org; Linux ARM > arm-ker...@lists.infradead.org>; linux-kernel > ker...@vger.kernel.org> > > Subject: dmaengine : xilinx_dma two issues > > > > Hello, > > > > I'm trying to get the 5.10 kernel up and running for our system, and > > I'm running into a couple of issues with xilinx_dma. > + (Xilinx mailing list) > > Thanks for bringing the issues to our notice. Replies inline. > > > > > First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel > > probe fix node order dependency' breaks our usage. Before this commit a > call to: > > dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but > > after that commit it returns -19. The reason for this seems to be that > > the only channel that is setup is channel 1 (chan->id is 1 in > xilinx_dma_chan_probe()). > > However in > > of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = > > dma_spec- > > >args[0];), which causes the: > > !xdev->chan[chan_id] > > test to fail in of_dma_xilinx_xlate() > > What is the channel number passed in > dmaclient DT? Any update on this issue? > > dmas = <& axi_dma_0 1> > dma-names = "axi_dma_0" > > > > > Our device-tree entry looks like this: > > axi_dma_0: dma@80002000 { > > status = "okay"; > > #dma-cells = <1>; > > compatible = "xlnx,axi-dma-1.00.a"; > > interrupt-parent = <>; > > interrupts = <0 89 4>; > > reg = <0x0 0x80002000 0x0 0x1000>; > > xlnx,addrwidth = <0x20>; > > clocks = <_clk LPD_LSBUS>, <_clk LPD_LSBUS>, > > <_clk LPD_LSBUS>, <_clk LPD_LSBUS>; > > clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", > > "m_axi_mm2s_aclk", "m_axi_s2mm_aclk"; > > dma-channel@80002030 { > > compatible = "xlnx,axi-dma-s2mm-channel"; > > dma-channels = <0x1>; > > interrupts = <0 89 4>; > > xlnx,datawidth = <0x20>; > > xlnx,device-id = <0x0>; > > }; > > }; > > > > This is on a 5.10.1 kernel on arm64 zynqmp hardware. > > > > The second issue goes a little further back to commit e81274cd6b526 > > 'dmaengine: add support to dynamic register/unregister of channels'. > > After this commit even just removing the module 'rmmod xilinx_dma', > > without ever using it, results in a kernel oops like this: > > [ 37.214568] xilinx-vdma 80002000.dma: ch 0: SG disabled > > [ 37.219807] xilinx-vdma 80002000.dma: WARN: Device release is not > > defined so it is not safe to unbind this driver while in use > > [ 37.231299] xilinx-vdma 80002000.dma: Xilinx AXI DMA Engine Driver > > Probed!! > > [ 42.100660] Unable to handle kernel paging request at virtual > > address dead0108 > > [ 42.108598] Mem abort info: > > [ 42.111393] ESR = 0x9644 > > [ 42.114443] EC = 0x25: DABT (current EL), IL = 32 bits > > [ 42.119744] SET = 0, FnV = 0 > > [ 42.122794] EA = 0, S1PTW = 0 > > [ 42.125918] Data abort info: > > [ 42.128789] ISV = 0, ISS = 0x0044 > > [ 42.132617] CM = 0, WnR = 1 > > [ 42.135577] [dead0108] address between user and kernel > > address ranges > > [ 42.142705] Internal error: Oops: 9644 [#1] SMP > > [ 42.147566] Modules linked in: xilinx_dma(-) clk_xlnx_clock_wizard > > uio_pdrv_genirq > > [ 42.155139] CPU: 1 PID: 2075 Comm: rmmod Not tainted > > 5.10.1-00026-g3a2e6dd7a05-dirty #192 > > [ 42.163302] Hardware name: Enclustra XU5 SOM (DT) > > [ 42.167992] pstate: 4005 (nZcv daif -PAN -UAO -TCO BTY
RE: dmaengine : xilinx_dma two issues
> -Original Message- > From: Paul Thomas > Sent: Monday, December 28, 2020 10:14 AM > To: Dan Williams ; Vinod Koul > ; Michal Simek ; Radhey Shyam > Pandey ; Matthew Murrian > ; Romain Perier > ; Krzysztof Kozlowski ; Marc > Ferland ; Sebastian von Ohr > ; dmaeng...@vger.kernel.org; Linux ARM arm-ker...@lists.infradead.org>; linux-kernel ker...@vger.kernel.org> > Subject: dmaengine : xilinx_dma two issues > > Hello, > > I'm trying to get the 5.10 kernel up and running for our system, and I'm > running into a couple of issues with xilinx_dma. + (Xilinx mailing list) Thanks for bringing the issues to our notice. Replies inline. > > First, commit 14ccf0aab46e 'dmaengine: xilinx_dma: In dma channel probe > fix node order dependency' breaks our usage. Before this commit a call to: > dma_request_chan(_dev->dev, "axi_dma_0"); returns fine, but after > that commit it returns -19. The reason for this seems to be that the only > channel that is setup is channel 1 (chan->id is 1 in xilinx_dma_chan_probe()). > However in > of_dma_xilinx_xlate() chan_id is gets set to 0 (int chan_id = dma_spec- > >args[0];), which causes the: > !xdev->chan[chan_id] > test to fail in of_dma_xilinx_xlate() What is the channel number passed in dmaclient DT? dmas = <& axi_dma_0 1> dma-names = "axi_dma_0" > > Our device-tree entry looks like this: > axi_dma_0: dma@80002000 { > status = "okay"; > #dma-cells = <1>; > compatible = "xlnx,axi-dma-1.00.a"; > interrupt-parent = <>; > interrupts = <0 89 4>; > reg = <0x0 0x80002000 0x0 0x1000>; > xlnx,addrwidth = <0x20>; > clocks = <_clk LPD_LSBUS>, <_clk LPD_LSBUS>, > <_clk LPD_LSBUS>, <_clk LPD_LSBUS>; > clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", "m_axi_mm2s_aclk", > "m_axi_s2mm_aclk"; > dma-channel@80002030 { > compatible = "xlnx,axi-dma-s2mm-channel"; > dma-channels = <0x1>; > interrupts = <0 89 4>; > xlnx,datawidth = <0x20>; > xlnx,device-id = <0x0>; > }; > }; > > This is on a 5.10.1 kernel on arm64 zynqmp hardware. > > The second issue goes a little further back to commit e81274cd6b526 > 'dmaengine: add support to dynamic register/unregister of channels'. > After this commit even just removing the module 'rmmod xilinx_dma', > without ever using it, results in a kernel oops like this: > [ 37.214568] xilinx-vdma 80002000.dma: ch 0: SG disabled > [ 37.219807] xilinx-vdma 80002000.dma: WARN: Device release is not > defined so it is not safe to unbind this driver while in use > [ 37.231299] xilinx-vdma 80002000.dma: Xilinx AXI DMA Engine Driver > Probed!! > [ 42.100660] Unable to handle kernel paging request at virtual > address dead0108 > [ 42.108598] Mem abort info: > [ 42.111393] ESR = 0x9644 > [ 42.114443] EC = 0x25: DABT (current EL), IL = 32 bits > [ 42.119744] SET = 0, FnV = 0 > [ 42.122794] EA = 0, S1PTW = 0 > [ 42.125918] Data abort info: > [ 42.128789] ISV = 0, ISS = 0x0044 > [ 42.132617] CM = 0, WnR = 1 > [ 42.135577] [dead0108] address between user and kernel > address ranges > [ 42.142705] Internal error: Oops: 9644 [#1] SMP > [ 42.147566] Modules linked in: xilinx_dma(-) clk_xlnx_clock_wizard > uio_pdrv_genirq > [ 42.155139] CPU: 1 PID: 2075 Comm: rmmod Not tainted > 5.10.1-00026-g3a2e6dd7a05-dirty #192 > [ 42.163302] Hardware name: Enclustra XU5 SOM (DT) > [ 42.167992] pstate: 4005 (nZcv daif -PAN -UAO -TCO BTYPE=--) > [ 42.173996] pc : xilinx_dma_chan_remove+0x74/0xa0 [xilinx_dma] > [ 42.179815] lr : xilinx_dma_chan_remove+0x70/0xa0 [xilinx_dma] > [ 42.185636] sp : ffc01112bca0 > [ 42.188935] x29: ffc01112bca0 x28: ff80402ea640 > [ 42.194238] x27: x26: > [ 42.199542] x25: x24: > [ 42.204845] x23: x22: > [ 42.210149] x21: ffc0088a2028 x20: ff8040c08410 > [ 42.215452] x19: ff80423fa480 x18: > [ 42.220756] x17: x16: > [ 42.226059] x15: ffc010ce88c8 x14: 0040 > [ 42.231363] x13: ff00 x12: > [ 42.236667] x11: 0028 x10: 7fff > [ 42.241970] x9 : 00f0dfe0 x8 : > [ 42.247273] x7 : ffc010da4000 x6 : > [ 42.252577] x5 : 00210d00 x4 : ffc010da4da0 > [ 42.257881] x3 : ff80423fa578 x2 : > [ 42.263184] x1 : dead0100 x0 : dead0122 > [ 42.268488] Call trace: > [ 42.270923] xilinx_dma_chan_remove+0x74/0xa0 [xilinx_dma] > [ 42.276399] xilinx_dma_remove+0x3c/0x70 [xilinx_dma] > [ 42.281446] platform_drv_remove+0x24/0x38 > [ 42.285530] device_release_driver_internal+0xec/0x1a8 > [ 42.290659] driver_detach+0x64/0xd8 > [ 42.294226]