From: Dave Jiang <dave.jiang@intel.com>
To: Radhey Shyam Pandey <radheys@xilinx.com>,
Vinod Koul <vkoul@kernel.org>,
Paul Thomas <pthomas8589@gmail.com>
Cc: "dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>
Subject: Re: Query on dmaengine: add support to dynamic register/unregister of channels patch
Date: Mon, 18 Jan 2021 10:01:13 -0700 [thread overview]
Message-ID: <bee9cd1c-c320-28ff-77ca-dfbf73f5a631@intel.com> (raw)
In-Reply-To: <BY5PR02MB6520E4FECB26ACD6DB836728C7A40@BY5PR02MB6520.namprd02.prod.outlook.com>
On 1/18/2021 12:54 AM, Radhey Shyam Pandey wrote:
> Hi Dave,
>
> I have a query on below patch (commit-e81274cd6b52). It causes regression
> in xilinx_dma driver and there is a reported kernel crash on rmmod.
>
> commit e81274cd6b5264809384066e09a5253708822522
> Author: Dave Jiang <dave.jiang@intel.com>
> Date: Tue Jan 21 16:43:53 2020 -0700
>
> dmaengine: add support to dynamic register/unregister of channels
>
> With the channel registration routines broken out, now add support code to
> allow independent registering and unregistering of channels in a hotplug
> fashion.
>
> Crash on the unloading xilinx_dma module is reproducible after e81274cd6b526
> mainline commit is added in the 5.6 kernel.
>
> [ 42.142705] Internal error: Oops: 96000044 [#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: 40000005 (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 : ffffffc01112bca0
> [ 42.188935] x29: ffffffc01112bca0 x28: ffffff80402ea640
>
>
> xilinx_dma_chan_remove+0x74/0xa0:
> __list_del at ./include/linux/list.h:112 (inlined by)
> __list_del_entry at./include/linux/list.h:135 (inlined by)
> list_del at ./include/linux/list.h:146 (inlined by)
> xilinx_dma_chan_remove at drivers/dma/xilinx/xilinx_dma.c:2546
>
> Looking into e81274cd6b526 commit - It deletes channel device_node entry.
> Same channel device_node entry is also deleted in
> xilinx_dma_chan_remove as a result we see this crash.
>
> @@ -993,12 +1007,22 @@ static
> void __dma_async_device_channel_unregister(struct dma_device *device,
> "%s called while %d clients hold a reference\n",
> __func__, chan->client_count);
> mutex_lock(&dma_list_mutex);
> + list_del(&chan->device_node);
> + device->chancnt--;
>
> I want to know some background for this change. In dmaengine driver -
> we are adding channel device node entry so deleting it in the exit
> the path should be done in dmaengine driver and not in _channel_unregister?
Yes you are correct. It seems we need to remove that and push the
management to the driver as that seems to be the way. The chancnt will
continue to be managed by dmaengine. I'll create a fix.
>
> NOTE: This issue is reported in https://www.spinics.net/lists/dmaengine/msg24923.html
>
> Thanks,
> Radhey
prev parent reply other threads:[~2021-01-18 17:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-18 7:54 Query on dmaengine: add support to dynamic register/unregister of channels patch Radhey Shyam Pandey
2021-01-18 17:01 ` Dave Jiang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bee9cd1c-c320-28ff-77ca-dfbf73f5a631@intel.com \
--to=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=pthomas8589@gmail.com \
--cc=radheys@xilinx.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.