From nobody Wed Nov 27 17:29:25 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728463104; cv=none; d=zohomail.com; s=zohoarc; b=mU1EtmomF8YOc8i/W82V1eRXg8LM9pEsJ+G1FSKU2DTzjP5rIAfHnx5xz3WzFmoO8gM5fdmsrTP1cNXJSUGwAFQqt8UZfcLL558Lzkiiu04zi28C/kpnlpm+B5ONRrKS2VGIj+6SOGGlGY+Fsq2MYrP9wNd26KEltrJ9aNbWPFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728463104; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QnZVeWBmT+J+LidRf6mImSoyv0oTiirkxqtpTQtBia8=; b=En3Df+WDE5ZEFdudKrxqX97m0AxWffBe+fe3eeCW6FH2084+PZEm5oeQ7nTpiI09p/KWWZL8LpvIYLpO7VLp68g2BNPGDQvRTsGtB5S5T2hJkAM1EcMYlJd1DYJXodlTOS7MzF9MWCkmumiK5NsfHZQYVqrXHi6b3AOkKq+EJw0= 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 172846310454932.34108798610157; Wed, 9 Oct 2024 01:38:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.813900.1226995 (Exim 4.92) (envelope-from ) id 1sySCn-0000kC-74; Wed, 09 Oct 2024 08:38:01 +0000 Received: by outflank-mailman (output) from mailman id 813900.1226995; Wed, 09 Oct 2024 08:38:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sySCn-0000k0-3i; Wed, 09 Oct 2024 08:38:01 +0000 Received: by outflank-mailman (input) for mailman id 813900; Wed, 09 Oct 2024 08:37:59 +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 1sySCl-00075z-Q7 for xen-devel@lists.xenproject.org; Wed, 09 Oct 2024 08:37:59 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c85fd329-8619-11ef-99a2-01e77a169b0f; Wed, 09 Oct 2024 10:37:57 +0200 (CEST) Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-RBlU6NC9PruUI_0XQWTBsw-1; Wed, 09 Oct 2024 04:37:53 -0400 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7acca6cbe87so1143053385a.1 for ; Wed, 09 Oct 2024 01:37:53 -0700 (PDT) Received: from eisenberg.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7ae75615aa2sm439643585a.14.2024.10.09.01.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 01:37:51 -0700 (PDT) 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: c85fd329-8619-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728463076; 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=QnZVeWBmT+J+LidRf6mImSoyv0oTiirkxqtpTQtBia8=; b=dh3CGZqwFbGbkOQFkK+aC/GmDWsDARcODrEKETSygpK0ET6B3gYLhEMIaVF3SbP2iNTTY9 x9SfXmRxTEi93mFZCftzKfOWjRWlmZgp3XPqOLEsz/Y12kAYvh8+6jE35/gX0lp/U3OxL6 DUMs6srzaf4vwN2l+Z80/iJBn3UOv8Y= X-MC-Unique: RBlU6NC9PruUI_0XQWTBsw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728463073; x=1729067873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QnZVeWBmT+J+LidRf6mImSoyv0oTiirkxqtpTQtBia8=; b=SYOEbmK0IXkta6+abV5H2WjPUEDJzMGUmtQPpq78qk3djZ/bBJ4zr6Hn/VlnBnDvlb IDFvzEQf00ZuYNVB97tLx0P9kbCV82k6xPH+4q7Ge+l71b8R35p0VJpNSGo/3mWPapBx NL2LJGZK617dxsGbb0UB1m45r6iVPs5tBR/myD78w8ly3iOCr5f0DveJxyTzEV46eeup 5Hh7of2ufnt6aJHTJT9R4TeYUNUEptTI6HRZxHBhNtC2GQjcnkQ7Knq+ERAK1/K+tgVF HhAsmIZ6oCvf0MVdNUeU9ITJ9iUULBYZ9Yu1XN3woYkIao4fNfJHC8R42jnmzKqDWffS aFDQ== X-Forwarded-Encrypted: i=1; AJvYcCXNrumu1n8tUhXCpbe7RI3IsHvhvpJ2cYnlG/l4ARDStq2Zrna74YOdRf9mG3J2DepNQJD+RBYgnrk=@lists.xenproject.org X-Gm-Message-State: AOJu0YyhMSYey7TiiaPoTnMYIvpDGNQkxJf1gTn03xZRbxSCW5unplJU aVJ1TEfowCIE0z+3O3rxJNkNx4i7UNhafGU9ve9jumJMQ3EOxap6i6ffpfEhbe4NtQrKTQuW76K QDvuCIc+AGlpAY45cUCxDcXO/d1nrUt52EOhMqTLuZrrFlVdXvw5AHrMRUe7HYz1M X-Received: by 2002:a05:620a:40a:b0:7a7:fdef:27a with SMTP id af79cd13be357-7b0874d7cdemr203378385a.58.1728463072667; Wed, 09 Oct 2024 01:37:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVcvq1l/JiYDRYGcvT0xuobZAhQYwMoKmOoPhvJp1jfhxUy6a6lyXKK7lz5Kz5T1IwGDIQGw== X-Received: by 2002:a05:620a:40a:b0:7a7:fdef:27a with SMTP id af79cd13be357-7b0874d7cdemr203375485a.58.1728463072097; Wed, 09 Oct 2024 01:37:52 -0700 (PDT) From: Philipp Stanner To: Damien Le Moal , Niklas Cassel , Sergey Shtylyov , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Jaroslav Kysela , Takashi Iwai , Philipp Stanner , Mario Limonciello , Chen Ni , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Mostafa Saleh , Andy Shevchenko , Hannes Reinecke , John Garry , Soumya Negi , Jason Gunthorpe , Yi Liu , "Dr. David Alan Gilbert" , Christian Brauner , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Maarten Lankhorst , Kai Vehmanen , Peter Ujfalusi , Rui Salvaterra , Marc Zyngier Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, linux-sound@vger.kernel.org Subject: [RFC PATCH 08/13] PCI: MSI: Use never-managed version of pci_intx() Date: Wed, 9 Oct 2024 10:35:14 +0200 Message-ID: <20241009083519.10088-9-pstanner@redhat.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241009083519.10088-1-pstanner@redhat.com> References: <20241009083519.10088-1-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1728463104939116600 Content-Type: text/plain; charset="utf-8"; x-default="true" pci_intx() is a hybrid function which can sometimes be managed through devres. To remove this hybrid nature from pci_intx(), it is necessary to port users to either an always-managed or a never-managed version. MSI sets up its own separate devres callback implicitly in pcim_setup_msi_release(). This callback ultimately uses pci_intx(), which is problematic since the callback of course runs on driver-detach. That problem has last been described here: https://lore.kernel.org/all/ee44ea7ac760e73edad3f20b30b4d2fff66c1a85.camel@= redhat.com/ Replace the call to pci_intx() with one to the never-managed version pci_intx_unmanaged(). Signed-off-by: Philipp Stanner --- This MSI part here is probably the part of the series that needs most attention. --- drivers/pci/msi/api.c | 2 +- drivers/pci/msi/msi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c index b956ce591f96..c95e2e7dc9ab 100644 --- a/drivers/pci/msi/api.c +++ b/drivers/pci/msi/api.c @@ -289,7 +289,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev,= unsigned int min_vecs, */ if (affd) irq_create_affinity_masks(1, affd); - pci_intx(dev, 1); + pci_intx_unmanaged(dev, 1); return 1; } } diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index 3a45879d85db..53f13b09db50 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(pci_write_msi_msg); static void pci_intx_for_msi(struct pci_dev *dev, int enable) { if (!(dev->dev_flags & PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG)) - pci_intx(dev, enable); + pci_intx_unmanaged(dev, enable); } =20 static void pci_msi_set_enable(struct pci_dev *dev, int enable) --=20 2.46.1