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 3995DC433EF for ; Wed, 12 Jan 2022 00:06:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346894AbiALAGK (ORCPT ); Tue, 11 Jan 2022 19:06:10 -0500 Received: from mx.socionext.com ([202.248.49.38]:6014 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233810AbiALAF7 (ORCPT ); Tue, 11 Jan 2022 19:05:59 -0500 Received: from unknown (HELO kinkan2-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 12 Jan 2022 09:05:58 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan2-ex.css.socionext.com (Postfix) with ESMTP id 859602059054; Wed, 12 Jan 2022 09:05:58 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Wed, 12 Jan 2022 09:05:58 +0900 Received: from [10.212.180.44] (unknown [10.212.180.44]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 56BA9B62A1; Wed, 12 Jan 2022 09:05:56 +0900 (JST) Subject: Re: [patch] genirq/msi: Populate sysfs entry only once To: Thomas Gleixner , LKML Cc: 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 References: <20211206210600.123171746@linutronix.de> <20211206210749.224917330@linutronix.de> <87leznqx2a.ffs@tglx> From: Kunihiko Hayashi Message-ID: <1d5711be-c26d-d57b-10db-1b45d279515d@socionext.com> Date: Wed, 12 Jan 2022 09:05:55 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87leznqx2a.ffs@tglx> Content-Type: text/plain; charset=iso-2022-jp; format=flowed; delsp=yes Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, Is this fix the same as below? https://marc.info/?l=linux-kernel&m=164061119923119&w=2 On 2022/01/11 3:12, 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++; > } > --- Best Regards Kunihiko Hayashi