linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Yang Yingliang <yangyingliang@huawei.com>,
	kraig@google.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] genirq/irqdesc: fix WARNING in irq_sysfs_del()
Date: Tue, 29 Nov 2022 08:54:23 +0100	[thread overview]
Message-ID: <Y4W6rzRZ/7llmsVx@kroah.com> (raw)
In-Reply-To: <87zgcavrhm.ffs@tglx>

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@linuxfoundation.org>

  reply	other threads:[~2022-11-29  7:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 15:16 [PATCH v2] genirq/irqdesc: fix WARNING in irq_sysfs_del() Yang Yingliang
2022-11-28 17:20 ` Greg KH
2022-11-28 18:55   ` Thomas Gleixner
2022-11-29  7:54     ` Greg KH [this message]
2022-11-29  3:38   ` Yang Yingliang
2022-11-30 14:14 ` [tip: irq/core] genirq/irqdesc: Don't try to remove non-existing sysfs files tip-bot2 for Yang Yingliang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4W6rzRZ/7llmsVx@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=kraig@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).