* [PATCH 0/2] dma: imx-sdma: Modify SDMA's remove operation
@ 2014-07-30 13:11 Vignesh Raman
2014-07-30 13:11 ` [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver Vignesh Raman
2014-07-30 13:11 ` [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function Vignesh Raman
0 siblings, 2 replies; 11+ messages in thread
From: Vignesh Raman @ 2014-07-30 13:11 UTC (permalink / raw)
To: vinod.koul, dan.j.williams, dmaengine, linux-kernel; +Cc: Jiada_Wang
This is a patch set which contains two patches which modify's sdma_remove
operation and add tasklet_kill in sdma_remove function.
Vignesh Raman (2):
dma: imx-sdma: use module_platform_driver for SDMA driver
dma: imx-sdma: Adding tasklet_kill() in sdma_remove function.
drivers/dma/imx-sdma.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver
2014-07-30 13:11 [PATCH 0/2] dma: imx-sdma: Modify SDMA's remove operation Vignesh Raman
@ 2014-07-30 13:11 ` Vignesh Raman
2014-07-31 12:00 ` Vinod Koul
2014-07-30 13:11 ` [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function Vignesh Raman
1 sibling, 1 reply; 11+ messages in thread
From: Vignesh Raman @ 2014-07-30 13:11 UTC (permalink / raw)
To: vinod.koul, dan.j.williams, dmaengine, linux-kernel; +Cc: Jiada_Wang
Currently there is no module_exit declared in SDMA driver, so that once
sdma module is inserted, it's shown with permanent attribute by lsmod,
and it can't be removed.
Use module_platform_driver to register/unregister SDMA driver and modify
SDMA's remove operation, to make SDMA driver possible to be removed.
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
---
drivers/dma/imx-sdma.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 14867e3..1360b9d 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1633,7 +1633,21 @@ err_irq:
static int sdma_remove(struct platform_device *pdev)
{
- return -EBUSY;
+ struct sdma_engine *sdma = platform_get_drvdata(pdev);
+ struct resource *iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ int irq = platform_get_irq(pdev, 0);
+
+ dma_async_device_unregister(&sdma->dma_device);
+ kfree(sdma->script_addrs);
+ free_irq(irq, sdma);
+ iounmap(sdma->regs);
+ release_mem_region(iores->start, resource_size(iores));
+ kfree(sdma);
+
+ platform_set_drvdata(pdev, NULL);
+
+ dev_info(&pdev->dev, "Removed...\n");
+ return 0;
}
static struct platform_driver sdma_driver = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function.
2014-07-30 13:11 [PATCH 0/2] dma: imx-sdma: Modify SDMA's remove operation Vignesh Raman
2014-07-30 13:11 ` [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver Vignesh Raman
@ 2014-07-30 13:11 ` Vignesh Raman
2014-07-31 12:02 ` Vinod Koul
1 sibling, 1 reply; 11+ messages in thread
From: Vignesh Raman @ 2014-07-30 13:11 UTC (permalink / raw)
To: vinod.koul, dan.j.williams, dmaengine, linux-kernel; +Cc: Jiada_Wang
Several dma drivers calls tasklet_kill() in remove function. This is missing in
imx driver, so adding tasklet_kill() in sdma_remove function.
Signed-off-by: Vignesh Raman <Vignesh_Raman@mentor.com>
---
drivers/dma/imx-sdma.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 1360b9d..974337f 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1636,12 +1636,19 @@ static int sdma_remove(struct platform_device *pdev)
struct sdma_engine *sdma = platform_get_drvdata(pdev);
struct resource *iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
int irq = platform_get_irq(pdev, 0);
+ int i;
dma_async_device_unregister(&sdma->dma_device);
kfree(sdma->script_addrs);
free_irq(irq, sdma);
iounmap(sdma->regs);
release_mem_region(iores->start, resource_size(iores));
+ /* Kill the tasklet */
+ for (i = 0; i < MAX_DMA_CHANNELS; i++) {
+ struct sdma_channel *sdmac = &sdma->channel[i];
+
+ tasklet_kill(&sdmac->tasklet);
+ }
kfree(sdma);
platform_set_drvdata(pdev, NULL);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver
2014-07-30 13:11 ` [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver Vignesh Raman
@ 2014-07-31 12:00 ` Vinod Koul
2014-08-04 8:41 ` Vignesh Raman
0 siblings, 1 reply; 11+ messages in thread
From: Vinod Koul @ 2014-07-31 12:00 UTC (permalink / raw)
To: Vignesh Raman; +Cc: dan.j.williams, dmaengine, linux-kernel, Jiada_Wang
On Wed, Jul 30, 2014 at 06:41:14PM +0530, Vignesh Raman wrote:
> Currently there is no module_exit declared in SDMA driver, so that once
> sdma module is inserted, it's shown with permanent attribute by lsmod,
> and it can't be removed.
> Use module_platform_driver to register/unregister SDMA driver and modify
> SDMA's remove operation, to make SDMA driver possible to be removed.
where is this bit below?
--
~Vinod
>
> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> ---
> drivers/dma/imx-sdma.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 14867e3..1360b9d 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1633,7 +1633,21 @@ err_irq:
>
> static int sdma_remove(struct platform_device *pdev)
> {
> - return -EBUSY;
> + struct sdma_engine *sdma = platform_get_drvdata(pdev);
> + struct resource *iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + int irq = platform_get_irq(pdev, 0);
> +
> + dma_async_device_unregister(&sdma->dma_device);
> + kfree(sdma->script_addrs);
> + free_irq(irq, sdma);
> + iounmap(sdma->regs);
> + release_mem_region(iores->start, resource_size(iores));
> + kfree(sdma);
> +
> + platform_set_drvdata(pdev, NULL);
> +
> + dev_info(&pdev->dev, "Removed...\n");
> + return 0;
> }
>
> static struct platform_driver sdma_driver = {
> --
> 1.7.9.5
>
--
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function.
2014-07-30 13:11 ` [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function Vignesh Raman
@ 2014-07-31 12:02 ` Vinod Koul
2014-08-01 14:06 ` Vignesh Raman
0 siblings, 1 reply; 11+ messages in thread
From: Vinod Koul @ 2014-07-31 12:02 UTC (permalink / raw)
To: Vignesh Raman; +Cc: dan.j.williams, dmaengine, linux-kernel, Jiada_Wang
On Wed, Jul 30, 2014 at 06:41:15PM +0530, Vignesh Raman wrote:
> Several dma drivers calls tasklet_kill() in remove function. This is missing in
> imx driver, so adding tasklet_kill() in sdma_remove function.
And why should we do that ?
--
~Vinod
>
> Signed-off-by: Vignesh Raman <Vignesh_Raman@mentor.com>
> ---
> drivers/dma/imx-sdma.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 1360b9d..974337f 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1636,12 +1636,19 @@ static int sdma_remove(struct platform_device *pdev)
> struct sdma_engine *sdma = platform_get_drvdata(pdev);
> struct resource *iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> int irq = platform_get_irq(pdev, 0);
> + int i;
>
> dma_async_device_unregister(&sdma->dma_device);
> kfree(sdma->script_addrs);
> free_irq(irq, sdma);
> iounmap(sdma->regs);
> release_mem_region(iores->start, resource_size(iores));
> + /* Kill the tasklet */
> + for (i = 0; i < MAX_DMA_CHANNELS; i++) {
> + struct sdma_channel *sdmac = &sdma->channel[i];
> +
> + tasklet_kill(&sdmac->tasklet);
> + }
> kfree(sdma);
>
> platform_set_drvdata(pdev, NULL);
> --
> 1.7.9.5
>
--
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function.
2014-07-31 12:02 ` Vinod Koul
@ 2014-08-01 14:06 ` Vignesh Raman
2014-08-01 16:45 ` Vinod Koul
0 siblings, 1 reply; 11+ messages in thread
From: Vignesh Raman @ 2014-08-01 14:06 UTC (permalink / raw)
To: Vinod Koul; +Cc: dan.j.williams, dmaengine, linux-kernel, Jiada_Wang
On Thursday 31 July 2014 05:32 PM, Vinod Koul wrote:
> On Wed, Jul 30, 2014 at 06:41:15PM +0530, Vignesh Raman wrote:
>> Several dma drivers calls tasklet_kill() in remove function. This is missing in
>> imx driver, so adding tasklet_kill() in sdma_remove function.
> And why should we do that ?
>
This is done because all running tasklets should be killed on remove.
Regards,
Vignesh.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function.
2014-08-01 14:06 ` Vignesh Raman
@ 2014-08-01 16:45 ` Vinod Koul
2014-08-04 8:34 ` Vignesh Raman
0 siblings, 1 reply; 11+ messages in thread
From: Vinod Koul @ 2014-08-01 16:45 UTC (permalink / raw)
To: Vignesh Raman; +Cc: dan.j.williams, dmaengine, linux-kernel, Jiada_Wang
On Fri, Aug 01, 2014 at 07:36:53PM +0530, Vignesh Raman wrote:
> On Thursday 31 July 2014 05:32 PM, Vinod Koul wrote:
> > On Wed, Jul 30, 2014 at 06:41:15PM +0530, Vignesh Raman wrote:
> >> Several dma drivers calls tasklet_kill() in remove function. This is missing in
> >> imx driver, so adding tasklet_kill() in sdma_remove function.
> > And why should we do that ?
> >
> This is done because all running tasklets should be killed on remove.
And what prevents is from mentioning this in changelog!
--
~Vinod
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function.
2014-08-01 16:45 ` Vinod Koul
@ 2014-08-04 8:34 ` Vignesh Raman
0 siblings, 0 replies; 11+ messages in thread
From: Vignesh Raman @ 2014-08-04 8:34 UTC (permalink / raw)
To: Vinod Koul; +Cc: dan.j.williams, dmaengine, linux-kernel, Jiada_Wang
On Friday 01 August 2014 10:15 PM, Vinod Koul wrote:
> On Fri, Aug 01, 2014 at 07:36:53PM +0530, Vignesh Raman wrote:
>> On Thursday 31 July 2014 05:32 PM, Vinod Koul wrote:
>>> On Wed, Jul 30, 2014 at 06:41:15PM +0530, Vignesh Raman wrote:
>>>> Several dma drivers calls tasklet_kill() in remove function. This is missing in
>>>> imx driver, so adding tasklet_kill() in sdma_remove function.
>>> And why should we do that ?
>>>
>> This is done because all running tasklets should be killed on remove.
>
> And what prevents is from mentioning this in changelog!
>
I should have mentioned in the Changelog but missed it, sorry about
that. I will add it and send updated version.
Regards,
Vignesh.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver
2014-08-04 8:41 ` Vignesh Raman
@ 2014-08-04 8:38 ` Vinod Koul
2014-08-05 6:27 ` Vignesh Raman
0 siblings, 1 reply; 11+ messages in thread
From: Vinod Koul @ 2014-08-04 8:38 UTC (permalink / raw)
To: Vignesh Raman; +Cc: dan.j.williams, dmaengine, linux-kernel, Jiada_Wang
On Mon, Aug 04, 2014 at 02:11:01PM +0530, Vignesh Raman wrote:
> On Thursday 31 July 2014 05:30 PM, Vinod Koul wrote:
> > On Wed, Jul 30, 2014 at 06:41:14PM +0530, Vignesh Raman wrote:
> >> Currently there is no module_exit declared in SDMA driver, so that once
> >> sdma module is inserted, it's shown with permanent attribute by lsmod,
> >> and it can't be removed.
> >> Use module_platform_driver to register/unregister SDMA driver and modify
> >> SDMA's remove operation, to make SDMA driver possible to be removed.
> > where is this bit below?
> >
> I'm not clear with your question. Are you asking about the unregister
> SDMA driver function? It is done by dma_async_device_unregister.
Driver already uses module_platform_driver, so I dont see what information
the last two lines are trying to convey.
Patch needs to talk about what is done in current patch
--
~Vinod
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver
2014-07-31 12:00 ` Vinod Koul
@ 2014-08-04 8:41 ` Vignesh Raman
2014-08-04 8:38 ` Vinod Koul
0 siblings, 1 reply; 11+ messages in thread
From: Vignesh Raman @ 2014-08-04 8:41 UTC (permalink / raw)
To: Vinod Koul; +Cc: dan.j.williams, dmaengine, linux-kernel, Jiada_Wang
On Thursday 31 July 2014 05:30 PM, Vinod Koul wrote:
> On Wed, Jul 30, 2014 at 06:41:14PM +0530, Vignesh Raman wrote:
>> Currently there is no module_exit declared in SDMA driver, so that once
>> sdma module is inserted, it's shown with permanent attribute by lsmod,
>> and it can't be removed.
>> Use module_platform_driver to register/unregister SDMA driver and modify
>> SDMA's remove operation, to make SDMA driver possible to be removed.
> where is this bit below?
>
I'm not clear with your question. Are you asking about the unregister
SDMA driver function? It is done by dma_async_device_unregister.
Regards,
Vignesh.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver
2014-08-04 8:38 ` Vinod Koul
@ 2014-08-05 6:27 ` Vignesh Raman
0 siblings, 0 replies; 11+ messages in thread
From: Vignesh Raman @ 2014-08-05 6:27 UTC (permalink / raw)
To: Vinod Koul; +Cc: dan.j.williams, dmaengine, linux-kernel, Jiada_Wang
On Monday 04 August 2014 02:08 PM, Vinod Koul wrote:
> On Mon, Aug 04, 2014 at 02:11:01PM +0530, Vignesh Raman wrote:
>> On Thursday 31 July 2014 05:30 PM, Vinod Koul wrote:
>>> On Wed, Jul 30, 2014 at 06:41:14PM +0530, Vignesh Raman wrote:
>>>> Currently there is no module_exit declared in SDMA driver, so that once
>>>> sdma module is inserted, it's shown with permanent attribute by lsmod,
>>>> and it can't be removed.
>>>> Use module_platform_driver to register/unregister SDMA driver and modify
>>>> SDMA's remove operation, to make SDMA driver possible to be removed.
>>> where is this bit below?
>>>
>> I'm not clear with your question. Are you asking about the unregister
>> SDMA driver function? It is done by dma_async_device_unregister.
> Driver already uses module_platform_driver, so I dont see what information
> the last two lines are trying to convey.
>
> Patch needs to talk about what is done in current patch
>
I missed some changes in Jiada's patch while merging to mainline kernel.
I will update and send the latest version.
Thanks,
Vignesh.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-08-05 6:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-30 13:11 [PATCH 0/2] dma: imx-sdma: Modify SDMA's remove operation Vignesh Raman
2014-07-30 13:11 ` [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA driver Vignesh Raman
2014-07-31 12:00 ` Vinod Koul
2014-08-04 8:41 ` Vignesh Raman
2014-08-04 8:38 ` Vinod Koul
2014-08-05 6:27 ` Vignesh Raman
2014-07-30 13:11 ` [PATCH 2/2] dma: imx-sdma: Adding tasklet_kill() in sdma_remove function Vignesh Raman
2014-07-31 12:02 ` Vinod Koul
2014-08-01 14:06 ` Vignesh Raman
2014-08-01 16:45 ` Vinod Koul
2014-08-04 8:34 ` Vignesh Raman
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.