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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA2B1C54EBE for ; Mon, 16 Jan 2023 16:35:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.478860.742313 (Exim 4.92) (envelope-from ) id 1pHSSA-0008D3-Qc; Mon, 16 Jan 2023 16:35:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 478860.742313; Mon, 16 Jan 2023 16:35:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHSSA-0008Cw-O0; Mon, 16 Jan 2023 16:35:22 +0000 Received: by outflank-mailman (input) for mailman id 478860; Mon, 16 Jan 2023 16:35:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHSS9-0008Cp-Ih for xen-devel@lists.xen.org; Mon, 16 Jan 2023 16:35:21 +0000 Received: from galois.linutronix.de (galois.linutronix.de [193.142.43.55]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c2dbec27-95bb-11ed-91b6-6bf2151ebd3b; Mon, 16 Jan 2023 17:35:19 +0100 (CET) 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: c2dbec27-95bb-11ed-91b6-6bf2151ebd3b From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673886917; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y5aBMbxFAFIdStpWd8PjTw92BwcyzNQZ6KDghf5lWME=; b=WcOzXIZhvSGHI4kvKmeXfaaJdxjdle5MVf1vpbxI/AmUPipq+r7qwkITTv//VM9mg2PMc7 LJyptKIS3yd4uD1y6XgEyOBdnZINhLk4pwbRiAJcb7tXuvov9dJEQxirB+Wi2tCA8f1eIa h2cO72zuZ79rBMwZaKUf4/SNsPtLgaWlTBOzrBSUW7ykALM+MBfG/QKRYEG1fzOv6vMTSa yJY53J3efC7hTx+lqxx5IvHLGh81f78i2M2JK9nKssO6CgT8pgnSPs0ravGlqLQ+uozKD7 9S28aL/s/ATwBDcokK0dTbo+ezQyz5JBswbnBs3R4ZIqdf2rLtC9muKIMPPjcA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673886917; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y5aBMbxFAFIdStpWd8PjTw92BwcyzNQZ6KDghf5lWME=; b=9t2m2hJfCfUhEd3ewF1n6zPM2zYK0sf7ZNxJnZ3SeXx+vQAZEnM9dxnpLeYBFOWDXJwYSF lbgkBHygutn1QsAw== To: David Woodhouse , LKML , Juergen Gross , xen-devel Cc: x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe Subject: Re: [patch V3 16/22] genirq/msi: Provide new domain id based interfaces for freeing interrupts In-Reply-To: <1901d84f8f999ac6b2f067360f098828cb8c17cf.camel@infradead.org> References: <20221124225331.464480443@linutronix.de> <20221124230314.337844751@linutronix.de> <1901d84f8f999ac6b2f067360f098828cb8c17cf.camel@infradead.org> Date: Mon, 16 Jan 2023 17:35:16 +0100 Message-ID: <875yd6o2t7.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable David! On Mon, Jan 16 2023 at 09:56, David Woodhouse wrote: > On Fri, 2022-11-25 at 00:24 +0100, Thomas Gleixner wrote: >> + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ops->domain_free_irqs) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0ops->domain_free_irqs(domain, dev); > > Do you want a call to msi_free_dev_descs(dev) here? In the case where > the core code calls ops->domain_alloc_irqs() it *has* allocated the > descriptors first... but it's expecting the irqdomain to free them? No. Let me stare at it. > However, it's not quite as simple as adding msi_free_dev_descs()... Correct. > diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c > index 955267bbc2be..812e1ec1a633 100644 > --- a/kernel/irq/msi.c > +++ b/kernel/irq/msi.c > @@ -1533,9 +1533,10 @@ static void msi_domain_free_locked(struct device *= dev, struct msi_ctrl *ctrl) > info =3D domain->host_data; > ops =3D info->ops; >=20=20 > - if (ops->domain_free_irqs) > + if (ops->domain_free_irqs) { > ops->domain_free_irqs(domain, dev); > - else > + msi_free_msi_descs(dev); This is just wrong. I need to taxi my grandson. Will have a look afterwards. Thanks, tglx