Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1248465 > unrolled thread

[PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal

Started byJon Hunter <jonathanh@nvidia.com>
First post2015-10-16 10:30 +0200
Last post2015-10-16 13:00 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal Jon Hunter <jonathanh@nvidia.com> - 2015-10-16 10:30 +0200
    Re: [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal Lars-Peter Clausen <lars@metafoo.de> - 2015-10-16 11:00 +0200
      Re: [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal Jon Hunter <jonathanh@nvidia.com> - 2015-10-16 11:30 +0200
        Re: [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal Lars-Peter Clausen <lars@metafoo.de> - 2015-10-16 12:50 +0200
          Re: [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal Jon Hunter <jonathanh@nvidia.com> - 2015-10-16 13:00 +0200

#1248465 — [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal

FromJon Hunter <jonathanh@nvidia.com>
Date2015-10-16 10:30 +0200
Subject[PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal
Message-ID<qk8yL-FP-21@gated-at.bofh.it>
On driver removal, before killing any tasklets, ensure that the channel
interrupts are disabled so that the tasklet will not try to run during
or after the removal of the driver.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/dma/tegra20-apb-dma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 2bfab8d28b53..0dd6e7deaa8e 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1492,6 +1492,7 @@ static int tegra_dma_remove(struct platform_device *pdev)
 
 	for (i = 0; i < tdma->chip_data->nr_channels; ++i) {
 		tdc = &tdma->channels[i];
+		disable_irq(tdc->irq);
 		tasklet_kill(&tdc->tasklet);
 	}
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1248492

FromLars-Peter Clausen <lars@metafoo.de>
Date2015-10-16 11:00 +0200
Message-ID<qk91N-1e0-27@gated-at.bofh.it>
In reply to#1248465
On 10/16/2015 10:25 AM, Jon Hunter wrote:
> On driver removal, before killing any tasklets, ensure that the channel
> interrupts are disabled so that the tasklet will not try to run during
> or after the removal of the driver.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/dma/tegra20-apb-dma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index 2bfab8d28b53..0dd6e7deaa8e 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -1492,6 +1492,7 @@ static int tegra_dma_remove(struct platform_device *pdev)
>  
>  	for (i = 0; i < tdma->chip_data->nr_channels; ++i) {
>  		tdc = &tdma->channels[i];
> +		disable_irq(tdc->irq);

How about just calling free_irq()? That's how you'd typically handle this.

>  		tasklet_kill(&tdc->tasklet);
>  	}
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1248514

FromJon Hunter <jonathanh@nvidia.com>
Date2015-10-16 11:30 +0200
Message-ID<qk9uP-22l-21@gated-at.bofh.it>
In reply to#1248492
On 16/10/15 09:53, Lars-Peter Clausen wrote:
> On 10/16/2015 10:25 AM, Jon Hunter wrote:
>> On driver removal, before killing any tasklets, ensure that the channel
>> interrupts are disabled so that the tasklet will not try to run during
>> or after the removal of the driver.
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>> ---
>>  drivers/dma/tegra20-apb-dma.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
>> index 2bfab8d28b53..0dd6e7deaa8e 100644
>> --- a/drivers/dma/tegra20-apb-dma.c
>> +++ b/drivers/dma/tegra20-apb-dma.c
>> @@ -1492,6 +1492,7 @@ static int tegra_dma_remove(struct platform_device *pdev)
>>  
>>  	for (i = 0; i < tdma->chip_data->nr_channels; ++i) {
>>  		tdc = &tdma->channels[i];
>> +		disable_irq(tdc->irq);
> 
> How about just calling free_irq()? That's how you'd typically handle this.

Yes, however, the interrupt is requested by devm_request_irq(). I guess
I could call devm_free_irq() here?

Cheers
Jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1248608

FromLars-Peter Clausen <lars@metafoo.de>
Date2015-10-16 12:50 +0200
Message-ID<qkaKg-3Nh-73@gated-at.bofh.it>
In reply to#1248514
On 10/16/2015 11:29 AM, Jon Hunter wrote:
> 
> On 16/10/15 09:53, Lars-Peter Clausen wrote:
>> On 10/16/2015 10:25 AM, Jon Hunter wrote:
>>> On driver removal, before killing any tasklets, ensure that the channel
>>> interrupts are disabled so that the tasklet will not try to run during
>>> or after the removal of the driver.
>>>
>>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>>> ---
>>>  drivers/dma/tegra20-apb-dma.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
>>> index 2bfab8d28b53..0dd6e7deaa8e 100644
>>> --- a/drivers/dma/tegra20-apb-dma.c
>>> +++ b/drivers/dma/tegra20-apb-dma.c
>>> @@ -1492,6 +1492,7 @@ static int tegra_dma_remove(struct platform_device *pdev)
>>>  
>>>  	for (i = 0; i < tdma->chip_data->nr_channels; ++i) {
>>>  		tdc = &tdma->channels[i];
>>> +		disable_irq(tdc->irq);
>>
>> How about just calling free_irq()? That's how you'd typically handle this.
> 
> Yes, however, the interrupt is requested by devm_request_irq(). I guess
> I could call devm_free_irq() here?

Just use request_irq() instead of devm_request_irq(). You have the same
issue on the error path in the probe function anyway and also need to add
the free_irq() before the tasklet_kill() there as well.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1248624

FromJon Hunter <jonathanh@nvidia.com>
Date2015-10-16 13:00 +0200
Message-ID<qkaTT-3YR-15@gated-at.bofh.it>
In reply to#1248608
On 16/10/15 11:40, Lars-Peter Clausen wrote:
> On 10/16/2015 11:29 AM, Jon Hunter wrote:
>>
>> On 16/10/15 09:53, Lars-Peter Clausen wrote:
>>> On 10/16/2015 10:25 AM, Jon Hunter wrote:
>>>> On driver removal, before killing any tasklets, ensure that the channel
>>>> interrupts are disabled so that the tasklet will not try to run during
>>>> or after the removal of the driver.
>>>>
>>>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>>>> ---
>>>>  drivers/dma/tegra20-apb-dma.c | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
>>>> index 2bfab8d28b53..0dd6e7deaa8e 100644
>>>> --- a/drivers/dma/tegra20-apb-dma.c
>>>> +++ b/drivers/dma/tegra20-apb-dma.c
>>>> @@ -1492,6 +1492,7 @@ static int tegra_dma_remove(struct platform_device *pdev)
>>>>  
>>>>  	for (i = 0; i < tdma->chip_data->nr_channels; ++i) {
>>>>  		tdc = &tdma->channels[i];
>>>> +		disable_irq(tdc->irq);
>>>
>>> How about just calling free_irq()? That's how you'd typically handle this.
>>
>> Yes, however, the interrupt is requested by devm_request_irq(). I guess
>> I could call devm_free_irq() here?
> 
> Just use request_irq() instead of devm_request_irq(). You have the same
> issue on the error path in the probe function anyway and also need to add
> the free_irq() before the tasklet_kill() there as well.

I was wondering about that but the tasklets should never be scheduled if
the probe does not succeed, so I think it is ok.

Jon

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web