[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <875z7ipgcn.wl-maz@kernel.org>
Date: Sat, 10 Oct 2020 10:42:16 +0100
From: Marc Zyngier <maz@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Dmitry Osipenko <digetx@...il.com>,
Sowjanya Komatineni <skomatineni@...dia.com>,
Venkat Reddy Talla <vreddytalla@...dia.com>,
kernel-team@...roid.com
Subject: Re: [PATCH v3 1/4] genirq/irqdomain: Allow partial trimming of irq_data hierarchy
On Thu, 08 Oct 2020 21:47:29 +0100,
Thomas Gleixner <tglx@...utronix.de> wrote:
>
> On Thu, Oct 08 2020 at 14:06, Marc Zyngier wrote:
> > On 2020-10-08 12:22, Thomas Gleixner wrote:
> > Here's what I have now, with the pmc driver calling
> > irq_domain_disconnect_hierarchy() at the right spots.
> >
> > static int irq_domain_alloc_irq_data(struct irq_domain *domain,
> > @@ -1362,11 +1442,16 @@ int __irq_domain_alloc_irqs(struct irq_domain
> > *domain, int irq_base,
> > mutex_unlock(&irq_domain_mutex);
> > goto out_free_irq_data;
> > }
> > - for (i = 0; i < nr_irqs; i++)
> > + for (i = 0; i < nr_irqs; i++) {
> > + ret = irq_domain_trim_hierarchy(virq + i);
> > + if (ret)
> > + break;
> > irq_domain_insert_irq(virq + i);
>
> You can't do that in one go because in case of an error you leak the
> already inserted irqs. You need two loops.
>
> for (i = 0; i < nr_irqs; i++) {
> ret = irq_domain_trim_hierarchy(virq + i);
> if (ret) {
> mutex_unlock(&irq_domain_mutex);
> goto out_free_irq_data;
> }
>
> for (i = 0; i < nr_irqs; i++)
> irq_domain_insert_irq(virq + i);
>
> mutex_unlock(&irq_domain_mutex);
> return virq;
Of course you are right. I'll fold that in.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists