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 0D535C433F5 for ; Tue, 11 Jan 2022 09:08:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349155AbiAKJIJ (ORCPT ); Tue, 11 Jan 2022 04:08:09 -0500 Received: from 1.mo552.mail-out.ovh.net ([178.32.96.117]:37573 "EHLO 1.mo552.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349146AbiAKJIJ (ORCPT ); Tue, 11 Jan 2022 04:08:09 -0500 Received: from mxplan5.mail.ovh.net (unknown [10.108.4.36]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id D4DDE2252A; Tue, 11 Jan 2022 09:02:10 +0000 (UTC) Received: from kaod.org (37.59.142.95) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 11 Jan 2022 10:02:01 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-95G001713f3599-f95f-45bc-8458-3cc8394211bc, 5383433EA887FCAE918FFCB03530F9AACAE8953B) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <83cac5d2-b5f2-836c-1f4f-bfe054a8bedb@kaod.org> Date: Tue, 11 Jan 2022 10:02:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [patch] genirq/msi: Populate sysfs entry only once Content-Language: en-US To: Thomas Gleixner , LKML CC: Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , , , Juergen Gross , Greg Kroah-Hartman , Niklas Schnelle , , Heiko Carstens , Christian Borntraeger , Logan Gunthorpe , Jon Mason , Dave Jiang , Allen Hubbe , References: <20211206210600.123171746@linutronix.de> <20211206210749.224917330@linutronix.de> <87leznqx2a.ffs@tglx> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <87leznqx2a.ffs@tglx> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.95] X-ClientProxiedBy: DAG6EX1.mxp5.local (172.16.2.51) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 62e82270-dbcc-463c-8f53-caaee6d6cca0 X-Ovh-Tracer-Id: 5157184527403223894 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvuddrudehvddguddvjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeeigedvffekgeeftedutddttdevudeihfegudffkeeitdekkeetkefhffelveelleenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtoheplhhinhhugidqnhhtsgesghhoohhglhgvghhrohhuphhsrdgtohhm Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On 1/10/22 19: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 Reviewed-by: Cédric Le Goater Thanks, C. > --- > 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++; > } >