linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip/mbigen: Free msi_desc on device teardown
@ 2020-04-08 11:43 Zenghui Yu
  2020-04-09  9:27 ` Marc Zyngier
  2020-04-17  9:56 ` [tip: irq/urgent] " tip-bot2 for Zenghui Yu
  0 siblings, 2 replies; 4+ messages in thread
From: Zenghui Yu @ 2020-04-08 11:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: maz, tglx, jason, wuyun.wu, wanghaibin.wang, Zenghui Yu

Using irq_domain_free_irqs_common() on the irqdomain free path will
leave the MSI descriptor unfreed when platform devices get removed.
Properly free it by MSI domain free function.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
 drivers/irqchip/irq-mbigen.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
index 6b566bba263b..ff7627b57772 100644
--- a/drivers/irqchip/irq-mbigen.c
+++ b/drivers/irqchip/irq-mbigen.c
@@ -220,10 +220,16 @@ static int mbigen_irq_domain_alloc(struct irq_domain *domain,
 	return 0;
 }
 
+static void mbigen_irq_domain_free(struct irq_domain *domain, unsigned int virq,
+				   unsigned int nr_irqs)
+{
+	platform_msi_domain_free(domain, virq, nr_irqs);
+}
+
 static const struct irq_domain_ops mbigen_domain_ops = {
 	.translate	= mbigen_domain_translate,
 	.alloc		= mbigen_irq_domain_alloc,
-	.free		= irq_domain_free_irqs_common,
+	.free		= mbigen_irq_domain_free,
 };
 
 static int mbigen_of_create_domain(struct platform_device *pdev,
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] irqchip/mbigen: Free msi_desc on device teardown
  2020-04-08 11:43 [PATCH] irqchip/mbigen: Free msi_desc on device teardown Zenghui Yu
@ 2020-04-09  9:27 ` Marc Zyngier
  2020-04-09 10:30   ` Zenghui Yu
  2020-04-17  9:56 ` [tip: irq/urgent] " tip-bot2 for Zenghui Yu
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2020-04-09  9:27 UTC (permalink / raw)
  To: Zenghui Yu; +Cc: linux-kernel, tglx, jason, wuyun.wu, wanghaibin.wang

On Wed, 8 Apr 2020 19:43:52 +0800
Zenghui Yu <yuzenghui@huawei.com> wrote:

Hi Zenghui,

> Using irq_domain_free_irqs_common() on the irqdomain free path will
> leave the MSI descriptor unfreed when platform devices get removed.
> Properly free it by MSI domain free function.
> 
> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
> ---
>  drivers/irqchip/irq-mbigen.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
> index 6b566bba263b..ff7627b57772 100644
> --- a/drivers/irqchip/irq-mbigen.c
> +++ b/drivers/irqchip/irq-mbigen.c
> @@ -220,10 +220,16 @@ static int mbigen_irq_domain_alloc(struct irq_domain *domain,
>  	return 0;
>  }
>  
> +static void mbigen_irq_domain_free(struct irq_domain *domain, unsigned int virq,
> +				   unsigned int nr_irqs)
> +{
> +	platform_msi_domain_free(domain, virq, nr_irqs);
> +}
> +
>  static const struct irq_domain_ops mbigen_domain_ops = {
>  	.translate	= mbigen_domain_translate,
>  	.alloc		= mbigen_irq_domain_alloc,
> -	.free		= irq_domain_free_irqs_common,
> +	.free		= mbigen_irq_domain_free,
>  };
>  
>  static int mbigen_of_create_domain(struct platform_device *pdev,

Should this deserve a:

Fixes: 9650c60ebfec0 ("irqchip/mbigen: Create irq domain for each
mbigen device")

Otherwise queued for post -rc1.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] irqchip/mbigen: Free msi_desc on device teardown
  2020-04-09  9:27 ` Marc Zyngier
@ 2020-04-09 10:30   ` Zenghui Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Zenghui Yu @ 2020-04-09 10:30 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: linux-kernel, tglx, jason, wuyun.wu, wanghaibin.wang

Hi Marc,

On 2020/4/9 17:27, Marc Zyngier wrote:
> On Wed, 8 Apr 2020 19:43:52 +0800
> Zenghui Yu <yuzenghui@huawei.com> wrote:
> 
> Hi Zenghui,
> 
>> Using irq_domain_free_irqs_common() on the irqdomain free path will
>> leave the MSI descriptor unfreed when platform devices get removed.
>> Properly free it by MSI domain free function.
>>
>> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
>> ---
>>   drivers/irqchip/irq-mbigen.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
>> index 6b566bba263b..ff7627b57772 100644
>> --- a/drivers/irqchip/irq-mbigen.c
>> +++ b/drivers/irqchip/irq-mbigen.c
>> @@ -220,10 +220,16 @@ static int mbigen_irq_domain_alloc(struct irq_domain *domain,
>>   	return 0;
>>   }
>>   
>> +static void mbigen_irq_domain_free(struct irq_domain *domain, unsigned int virq,
>> +				   unsigned int nr_irqs)
>> +{
>> +	platform_msi_domain_free(domain, virq, nr_irqs);
>> +}
>> +
>>   static const struct irq_domain_ops mbigen_domain_ops = {
>>   	.translate	= mbigen_domain_translate,
>>   	.alloc		= mbigen_irq_domain_alloc,
>> -	.free		= irq_domain_free_irqs_common,
>> +	.free		= mbigen_irq_domain_free,
>>   };
>>   
>>   static int mbigen_of_create_domain(struct platform_device *pdev,
> 
> Should this deserve a:
> 
> Fixes: 9650c60ebfec0 ("irqchip/mbigen: Create irq domain for each
> mbigen device")

Yes, please help to add it.

> 
> Otherwise queued for post -rc1.

Thanks!


Zenghui


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: irq/urgent] irqchip/mbigen: Free msi_desc on device teardown
  2020-04-08 11:43 [PATCH] irqchip/mbigen: Free msi_desc on device teardown Zenghui Yu
  2020-04-09  9:27 ` Marc Zyngier
@ 2020-04-17  9:56 ` tip-bot2 for Zenghui Yu
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Zenghui Yu @ 2020-04-17  9:56 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Zenghui Yu, Marc Zyngier, x86, LKML

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     edfc23f6f9fdbd7825d50ac1f380243cde19b679
Gitweb:        https://git.kernel.org/tip/edfc23f6f9fdbd7825d50ac1f380243cde19b679
Author:        Zenghui Yu <yuzenghui@huawei.com>
AuthorDate:    Wed, 08 Apr 2020 19:43:52 +08:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Fri, 17 Apr 2020 08:59:27 +01:00

irqchip/mbigen: Free msi_desc on device teardown

Using irq_domain_free_irqs_common() on the irqdomain free path will
leave the MSI descriptor unfreed when platform devices get removed.
Properly free it by MSI domain free function.

Fixes: 9650c60ebfec0 ("irqchip/mbigen: Create irq domain for each mbigen device")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200408114352.1604-1-yuzenghui@huawei.com
---
 drivers/irqchip/irq-mbigen.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
index 6b566bb..ff7627b 100644
--- a/drivers/irqchip/irq-mbigen.c
+++ b/drivers/irqchip/irq-mbigen.c
@@ -220,10 +220,16 @@ static int mbigen_irq_domain_alloc(struct irq_domain *domain,
 	return 0;
 }
 
+static void mbigen_irq_domain_free(struct irq_domain *domain, unsigned int virq,
+				   unsigned int nr_irqs)
+{
+	platform_msi_domain_free(domain, virq, nr_irqs);
+}
+
 static const struct irq_domain_ops mbigen_domain_ops = {
 	.translate	= mbigen_domain_translate,
 	.alloc		= mbigen_irq_domain_alloc,
-	.free		= irq_domain_free_irqs_common,
+	.free		= mbigen_irq_domain_free,
 };
 
 static int mbigen_of_create_domain(struct platform_device *pdev,

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-17  9:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-08 11:43 [PATCH] irqchip/mbigen: Free msi_desc on device teardown Zenghui Yu
2020-04-09  9:27 ` Marc Zyngier
2020-04-09 10:30   ` Zenghui Yu
2020-04-17  9:56 ` [tip: irq/urgent] " tip-bot2 for Zenghui Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).