From nobody Fri Nov 29 10:26:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linutronix.de ARC-Seal: i=1; a=rsa-sha256; t=1641838411; cv=none; d=zohomail.com; s=zohoarc; b=koYcCj9Tux+w6+eNYK0LkdAvvbvuUJhpTJXsTuY46pwMuEbv48EpYENWOyS4KRNuteBjqyeUp8gj0bye9bMy9HAU7/zdJzTfJ7z+c6wG9HsYbQxQulc7oox/9AoThTToSYTMZ5XRaC+wwuhfhbTQIsMDnZaMaRH0v2Qod/uaC5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641838411; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2zo1GoaegfwLq8ByWLgrCdt6kQL15RfNmR27qdFkCXs=; b=KLB3ApdEKVMoI5Phnika9fjQoTiz/1OPnq7BfBWk516PWJ4h3PXY5N9U/OTmg8NSBY6AKUFx+tQPbk7EYPzHzKG1xGCB2aRnjLWgZ9ImnPloXCO1EUMUylp6G3LTZUt+DjeY7kjP2lV8r4t1D1YW6sDIJQE17agYQfnH4towsoA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1641838411812350.31713382894566; Mon, 10 Jan 2022 10:13:31 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.255523.437882 (Exim 4.92) (envelope-from ) id 1n6zA6-0001n3-L7; Mon, 10 Jan 2022 18:12:54 +0000 Received: by outflank-mailman (output) from mailman id 255523.437882; Mon, 10 Jan 2022 18:12:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1n6zA6-0001mw-H8; Mon, 10 Jan 2022 18:12:54 +0000 Received: by outflank-mailman (input) for mailman id 255523; Mon, 10 Jan 2022 18:12:53 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1n6zA4-0001mq-RY for xen-devel@lists.xenproject.org; Mon, 10 Jan 2022 18:12:53 +0000 Received: from galois.linutronix.de (galois.linutronix.de [193.142.43.55]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ea4d805d-7240-11ec-81c1-a30af7de8005; Mon, 10 Jan 2022 19:12:50 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ea4d805d-7240-11ec-81c1-a30af7de8005 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1641838366; 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: in-reply-to:in-reply-to:references:references; bh=2zo1GoaegfwLq8ByWLgrCdt6kQL15RfNmR27qdFkCXs=; b=wg+0jYPkfyXBANMF9DrbB1VZY/A2H3NxCDNL0PdKZaQjveELygI6vChYjpmK8mezF1B8JM 3Q6Fgd45hThR6NFyrAztLFQW0Du/St5l9y9ZtElwgFl9NDDq0PXVzJtEVKov8EaNRDZ81L eVdqnmysikOkVjpjAg882Gsjz6yZ54Uctmk12wQHCofZiwWVPnCbHkpvv4tDyYO3vZLG9w e64U20W7FggbG9+ID3eENSFzucC7Eorc5fEgfrJ4OKYz0CE6hPEZM+Xgk2ce8kuvb0VAsa X3V2Ri9KCwv0+VUgAxjPNl/CVqXJXoiumYuNcRD9koqxMMscv8p75zWFHCgf8Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1641838366; 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: in-reply-to:in-reply-to:references:references; bh=2zo1GoaegfwLq8ByWLgrCdt6kQL15RfNmR27qdFkCXs=; b=1JyyFqm//sjHNxcOA43/6zXwebeoZM76NF5Ms6lFcm7i8cDw3SAOwzaBpYafr8eAGkMdhU XC6nlPN+OSbMq8AQ== To: 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 Subject: [patch] genirq/msi: Populate sysfs entry only once In-Reply-To: <20211206210749.224917330@linutronix.de> References: <20211206210600.123171746@linutronix.de> <20211206210749.224917330@linutronix.de> Date: Mon, 10 Jan 2022 19:12:45 +0100 Message-ID: <87leznqx2a.ffs@tglx> MIME-Version: 1.0 X-ZohoMail-DKIM: pass (identity @linutronix.de) X-ZM-MESSAGEID: 1641838412875100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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=C3=A9dric Le Goater Reviewed-by: Greg Kroah-Hartman Tested-by: Borislav Petkov --- 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 =3D msi_init_virq(domain, virq + i, vflags); if (ret) return ret; - - if (info->flags & MSI_FLAG_DEV_SYSFS) { - ret =3D msi_sysfs_populate_desc(dev, desc); - if (ret) - return ret; - } + } + if (info->flags & MSI_FLAG_DEV_SYSFS) { + ret =3D msi_sysfs_populate_desc(dev, desc); + if (ret) + return ret; } allocated++; }