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

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.

Thanks,

        tglx



  reply	other threads:[~2022-11-28 18:55 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 [this message]
2022-11-29  7:54     ` Greg KH
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=87zgcavrhm.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kraig@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).