input: do not use tasklet_disable before tasklet_kill
Subsystems (6)
PATCH 1/3 input: do not use tasklet_disable before tasklet_kill
If tasklet_disable() is called before related tasklet handled, tasklet_kill will never be finished. tasklet_kill is enough.
--- drivers/input/keyboard/omap-keypad.c | 3 +-- drivers/input/serio/hil_mlc.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/input/keyboard/omap-keypad.c +1 -2
@@ -362,12 +362,11 @@ static int __devexit omap_kp_remove(struct platform_device *pdev)struct omap_kp *omap_kp =platform_get_drvdata (pdev);/* disable keypad interrupt handling */ -tasklet_disable (&kp_tasklet); +tasklet_kill (&kp_tasklet);omap_writew (1 ,OMAP1_MPUIO_BASE +OMAP_MPUIO_KBD_MASKIT );free_irq (omap_kp->irq, omap_kp);del_timer_sync (&omap_kp->timer); -tasklet_kill (&kp_tasklet);/* unregister everything */ input_unregister_device (omap_kp->input);
drivers/input/serio/hil_mlc.c +0 -1
@@ -1011,7 +1011,6 @@ static void __exit hil_mlc_exit(void) {del_timer_sync (&hil_mlcs_kicker); -tasklet_disable (&hil_mlcs_tasklet);tasklet_kill (&hil_mlcs_tasklet); }
Signature · 1 line
1.7.9.5
PATCH 2/3 usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill
If tasklet_disable() is called before related tasklet handled, tasklet_kill will never be finished. tasklet_kill is enough.
--- drivers/usb/gadget/fsl_qe_udc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/usb/gadget/fsl_qe_udc.c +1 -3
@@ -2661,7 +2661,7 @@ static int __devexit qe_udc_remove(struct platform_device *ofdev)usb_del_gadget_udc (&udc->gadget); udc->done = &done; -tasklet_disable (&udc->rx_tasklet); +tasklet_kill (&udc->rx_tasklet);if (udc->nullmap) { dma_unmap_single(udc->gadget.dev.parent,
@@ -2698,8 +2698,6 @@ static int __devexit qe_udc_remove(struct platform_device *ofdev)free_irq (udc->usb_irq, udc);irq_dispose_mapping (udc->usb_irq); -tasklet_kill (&udc->rx_tasklet); -iounmap (udc->usb_regs);device_unregister (&udc->gadget.dev);
Signature · 1 line
1.7.9.5
Re: [PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill
Quoted 2 lines · Xiaotian Feng
If
tasklet_disable()is called before related tasklet handled,tasklet_killwill never be finished.tasklet_killis enough.
how did you test this ? Why changing FSL driver instead of switching over to chipidea which is supposed to be shared by every licensee of the chipidea core ?
Quoted 35 lines
Signed-off-by Xiaotian Feng <[email protected]>Cc Li Yang <[email protected]>Cc Felipe Balbi <[email protected]>Cc Greg Kroah-Hartman <[email protected]>--- drivers/usb/gadget/fsl_qe_udc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/usb/gadget/fsl_qe_udc.c +1
-3@@ -2661,7 +2661,7 @@ static int __devexit qe_udc_remove(struct platform_device *ofdev)usb_del_gadget_udc (&udc->gadget); udc->done = &done; -tasklet_disable (&udc->rx_tasklet); +tasklet_kill (&udc->rx_tasklet);if (udc->nullmap) { dma_unmap_single(udc->gadget.dev.parent,@@ -2698,8 +2698,6 @@ static int __devexit qe_udc_remove(struct platform_device *ofdev)free_irq (udc->usb_irq, udc);irq_dispose_mapping (udc->usb_irq); -tasklet_kill (&udc->rx_tasklet); -iounmap (udc->usb_regs);device_unregister (&udc->gadget.dev);Signature · 1 line
1.7.9.5
Signature · 1 line
balbi
Re: [PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill
Quoted 7 lines · Felipe Balbi
Quoted 2 lines · Xiaotian Feng
If
tasklet_disable()is called before related tasklet handled,tasklet_killwill never be finished.tasklet_killis enough.how did you test this ? Why changing FSL driver instead of switching over to chipidea which is supposed to be shared by every licensee of the chipidea core ?
The QE UDC is an private controller that is not compatible with the Chipidea core.
- Leo
Re: [PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill
Hi,
Quoted 11 lines · Li Yang
Quoted 7 lines · Felipe Balbi
Quoted 2 lines · Xiaotian Feng
If
tasklet_disable()is called before related tasklet handled,tasklet_killwill never be finished.tasklet_killis enough.how did you test this ? Why changing FSL driver instead of switching over to chipidea which is supposed to be shared by every licensee of the chipidea core ?
The QE UDC is an private controller that is not compatible with the Chipidea core.
thanks for the clarification, but you still haven't answered how you tested this ;-)
Signature · 1 line
balbi
PATCH 3/3 tipc: do not use tasklet_disable before tasklet_kill
In reply to Xiaotian FengIf tasklet_disable() is called before related tasklet handled, tasklet_kill will never be finished. tasklet_kill is enough.
--- net/tipc/handler.c | 1 - 1 file changed, 1 deletion(-)
net/tipc/handler.c +0 -1
@@ -116,7 +116,6 @@ void tipc_handler_stop(void)return ; handler_enabled =0 ; -tasklet_disable (&tipc_tasklet);tasklet_kill (&tipc_tasklet);spin_lock_bh (&qitem_lock);
Signature · 1 line
1.7.9.5
Re: [PATCH 3/3] tipc: do not use tasklet_disable before tasklet_kill
From: Xiaotian Feng <[email protected]>
Date: Wed, 31 Oct 2012 16:06:01 +0800
Quoted 4 lines
If
tasklet_disable()is called before related tasklet handled,tasklet_killwill never be finished.tasklet_killis enough.Signed-off-by Xiaotian Feng <[email protected]>
Applied.
Dmitry Torokhov
maintainerHi Xiaotian,
Quoted 3 lines · Xiaotian Feng
If
tasklet_disable()is called before related tasklet handled,tasklet_killwill never be finished.tasklet_killis enough.
Could you please elaborate on this? Needing to disable tasket before killing it is quite often needed when dealing with self-rescheduling tasklets and so tasklet_disable() followed by tasklet_kill() must work. If it does not we need to take care of it in softirq code instead of individual drivers.
Quoted 17 lines
Signed-off-by Xiaotian Feng <[email protected]>Cc Dmitry Torokhov <[email protected]>Cc Tony Lindgren <[email protected]>Cc Sourav Poddar <[email protected]>Cc Josh <[email protected]>Cc Greg Kroah-Hartman <[email protected]>--- drivers/input/keyboard/omap-keypad.c | 3 +-- drivers/input/serio/hil_mlc.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)drivers/input/keyboard/omap-keypad.c +0
-0
drivers/input/keyboard/omap-keypad.c static int __devexit omap_kp_remove(struct platform_device *pdev) · line 370
Quoted 10 lines
drivers/input/keyboard/omap-keypad.c +1
-2@@ -362,12 +362,11 @@ static int __devexit omap_kp_remove(struct platform_device *pdev)struct omap_kp *omap_kp =platform_get_drvdata (pdev);/* disable keypad interrupt handling */ -tasklet_disable (&kp_tasklet); +tasklet_kill (&kp_tasklet);omap_writew (1 ,OMAP1_MPUIO_BASE +OMAP_MPUIO_KBD_MASKIT );free_irq (omap_kp->irq, omap_kp);del_timer_sync (&omap_kp->timer); -tasklet_kill (&kp_tasklet);
Exactly like here. If we do not disable tasklet before disabling IRQ and freeing timer we may get into scenario when timer schedules tasket and tasklet schedules timer again after we canceled it.
drivers/input/serio/hil_mlc.c static void __exit hil_mlc_exit(void) · line 1014
Quoted 13 lines
drivers/input/keyboard/omap-keypad.c +0
-0/* unregister everything */ input_unregister_device (omap_kp->input);drivers/input/serio/hil_mlc.c +0
-1@@ -1011,7 +1011,6 @@ static void __exit hil_mlc_exit(void) {del_timer_sync (&hil_mlcs_kicker); -tasklet_disable (&hil_mlcs_tasklet);tasklet_kill (&hil_mlcs_tasklet);
This seems like safe change.
Thanks.
Signature · 1 line
Dmitry