Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp441382rwb; Tue, 29 Nov 2022 00:12:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf5msdIa38YeDlEgApxFoke/WhGtUd0D4SchY5Izqcla5X300nYmFgln4e/M3qjX5c3vrgBu X-Received: by 2002:a05:6402:2912:b0:46a:c132:8a25 with SMTP id ee18-20020a056402291200b0046ac1328a25mr18214178edb.205.1669709544170; Tue, 29 Nov 2022 00:12:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669709544; cv=none; d=google.com; s=arc-20160816; b=qKLWrjiAmHiGaPrfEHZEkRdxeDLYBf1yHRzB1/kT6zAINtgT/9jrqEJVaG+/FnQ81I 5YjKUMKNv1+a+ZQ0LdPdjETIzUVQq5e548V6oPAjcQyHDUzPsYUqiYRvmAnVd4tEyAni l2T+AYdHi3mUOSaEs0NLfr52Hnv/OAN3RtDwrbKzc7GkoKAcCGozfXN+NqiOk8TZI6bj 6AG2NMBGlwyXfauC90F1d9Wt1DdOziwUuKLyLKvYqHZCBXnCMrku3R/Wf/8+d8nvzUuE VnJ4KtkHp1bQBhzRSh5KmW7t06HoUkwjb1Waf3a/Db1i2nDY0Q4UniVhF2Uu/Sp5KnI0 B7sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FFN4o0ozsILilNHBdNT9qHszVn6tlF9litgAXIgGsA0=; b=Q6qwrHfP1SfyWgYPjLyt9RV1iaNCMPmDhRIBWNM7p96DVeG8pTOnvHoFjyn7FyLoAi 3Yb9bp+PKOwqXJfW7RmnSj27VUVGvuU1fXLRoh8tufnGTajmNVVJCl/sspDcu7phZWIk exlv+cGGd2cf43GML//n8GFxf1QF+G1q0c38FdXg6Cqq32yvVJyaLJVFN25f8KnfZpnZ qxcckDY+IRQyByF3fMxZ/3SBwBs9MUN/eWqIE4cKUF/xtFxhxRA9KYSBL05GH2pQV5GJ sC2GGDYzHUlivwevEyOPY2V9a4mlYpMtQ8G/KG7VSnWDydU7NY3D9UvD9pRwq5nzdCPG 7Iyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XTMlAi9M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he18-20020a1709073d9200b007919388d2c6si13800172ejc.357.2022.11.29.00.12.02; Tue, 29 Nov 2022 00:12:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XTMlAi9M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230023AbiK2Hyc (ORCPT + 83 others); Tue, 29 Nov 2022 02:54:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbiK2Hy2 (ORCPT ); Tue, 29 Nov 2022 02:54:28 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4617E3FB83 for ; Mon, 28 Nov 2022 23:54:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5BCB615B7 for ; Tue, 29 Nov 2022 07:54:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF9C1C433D6; Tue, 29 Nov 2022 07:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669708466; bh=7vBalyth42QY7Wd4sXJsLJfQcQQNSL1bq/tPn3eVsdM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XTMlAi9MfhgmUFVbuoFKrES+oaVwje+i/LLzM+Vp3DfDoJkDu2LHKztVxtDwXeC0y 7nxC5MOI6rIk4cJFLY5lOxpqmk3YX8eTi2iQ0LxYjG5ZhaGTthjrEI+xZ5vMwqN8lv TMa41HvKITGaoJksDNa5bw2VZgqe1BXYEhef275k= Date: Tue, 29 Nov 2022 08:54:23 +0100 From: Greg KH To: Thomas Gleixner Cc: Yang Yingliang , kraig@google.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] genirq/irqdesc: fix WARNING in irq_sysfs_del() Message-ID: References: <20221128151612.1786122-1-yangyingliang@huawei.com> <87zgcavrhm.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zgcavrhm.ffs@tglx> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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