[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4W6rzRZ/7llmsVx@kroah.com>
Date: Tue, 29 Nov 2022 08:54:23 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Yang Yingliang <yangyingliang@...wei.com>, kraig@...gle.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] genirq/irqdesc: fix WARNING in irq_sysfs_del()
On Mon, Nov 28, 2022 at 07:55:17PM +0100, Thomas Gleixner wrote:
> On Mon, Nov 28 2022 at 18:20, Greg KH wrote:
> > On Mon, Nov 28, 2022 at 11:16:12PM +0800, Yang Yingliang wrote:
> >> @@ -292,6 +292,8 @@ static void irq_sysfs_add(int irq, struct irq_desc *desc)
> >> */
> >> if (kobject_add(&desc->kobj, irq_kobj_base, "%d", irq))
> >> pr_warn("Failed to add kobject for irq %d\n", irq);
> >> + else
> >> + desc->sysfs_added = true;
> >
> > Wait, no. Why are you just not properly failing and unwinding here?
>
> There is an issue here.
>
> sysfs is not yet available when the first interrupts are allocated. So
> we add the sysfs files late in the boot.
>
> So what can we do if that fails? Unwind the boot process? :)
>
> Sure we can fail after sysfs has been initialized, but that's
> inconsistent at best and we need some special treatment for the late add
> anyway.
>
> I agree that this is not pretty, but the resulting choices are all but
> pretty.
Ah, ok, that makes more sense. In this case, yes, the flag should be
fine to have.
Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Powered by blists - more mailing lists