From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADDD7C433FE for ; Mon, 10 Jan 2022 18:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238867AbiAJSPK (ORCPT ); Mon, 10 Jan 2022 13:15:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238804AbiAJSPH (ORCPT ); Mon, 10 Jan 2022 13:15:07 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EE01C06173F; Mon, 10 Jan 2022 10:15:07 -0800 (PST) Received: from zn.tnic (dslb-088-067-202-008.088.067.pools.vodafone-ip.de [88.67.202.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C94C31EC0588; Mon, 10 Jan 2022 19:15:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1641838501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=yJijyw2InAbx08UK5J76GgYEEJY5KfsyCm4JE5m3fms=; b=XNy8DlnSFy5+pvHFn1Uae4lUG0DSZMGU0faYz8w+Fv7gpg6JAo9zXBqKieOd8I7vD58WvZ Mx4VozLANk7ONAXZcUc6pDwdBR8Ge12nIcRlXQHzQAsDV8Ir7IWhmVTLfOCEzMRx6QGAIl SSSYTY/xkGLIfNjTCjZvCI60KIoezZE= Date: Mon, 10 Jan 2022 19:15:03 +0100 From: Borislav Petkov To: Thomas Gleixner Cc: LKML , Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , linux-pci@vger.kernel.org, Cedric Le Goater , xen-devel@lists.xenproject.org, Juergen Gross , Greg Kroah-Hartman , Niklas Schnelle , linux-s390@vger.kernel.org, Heiko Carstens , Christian Borntraeger , Logan Gunthorpe , Jon Mason , Dave Jiang , Allen Hubbe , linux-ntb@googlegroups.com Subject: Re: [patch] genirq/msi: Populate sysfs entry only once Message-ID: References: <20211206210600.123171746@linutronix.de> <20211206210749.224917330@linutronix.de> <87leznqx2a.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87leznqx2a.ffs@tglx> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 10, 2022 at 07:12:45PM +0100, Thomas Gleixner wrote: > The MSI entries for multi-MSI are populated en bloc for the MSI descriptor, > but the current code invokes the population inside the per interrupt loop > which triggers a warning in the sysfs code and causes the interrupt > allocation to fail. > > Move it outside of the loop so it works correctly for single and multi-MSI. > > Fixes: bf5e758f02fc ("genirq/msi: Simplify sysfs handling") > Reported-by: Borislav Petkov > Signed-off-by: Thomas Gleixner > --- > kernel/irq/msi.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > --- a/kernel/irq/msi.c > +++ b/kernel/irq/msi.c > @@ -887,12 +887,11 @@ int __msi_domain_alloc_irqs(struct irq_d > ret = msi_init_virq(domain, virq + i, vflags); > if (ret) > return ret; > - > - if (info->flags & MSI_FLAG_DEV_SYSFS) { > - ret = msi_sysfs_populate_desc(dev, desc); > - if (ret) > - return ret; > - } > + } > + if (info->flags & MSI_FLAG_DEV_SYSFS) { > + ret = msi_sysfs_populate_desc(dev, desc); > + if (ret) > + return ret; > } > allocated++; > } Yap, works. Tested-by: Borislav Petkov -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette