From nobody Wed Nov 27 03:16:55 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=1731501802; cv=none; d=zohomail.com; s=zohoarc; b=HMWel/5dFtiC34H1wHHDmAOfsRyrRe4x/mHoRX6vMTyZwj5aUh+SeDmzPBIZhat27WmWR/W26rgl5cUXs/zECiZCi/crOG9PTCsah4Zm93yi+53+vh56aNk2cVr8l/oF22H5RFDjRQXqyiqxlPZNODt8E/zvL1IKp9QCc9SVVsY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731501802; 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=NsJKOkpA+QoYlzqeYDbY0Dl9xjdlxWNvzFNzd4dMwhk=; b=BzXyr5KiDCNO2H93D6Smk2zZBA6Ba5ZX8GCGcyQQFfJlKtNfVjafEXFJjJv8jgXBCkvXklEn/WFWfXzb9858zdruidrS3OBIks6RmxS6vse+5j0jHS1gtxZp7eLgVl1Syk5pZRGGcz2yz8TfzayVeoDrMw8GYHz7Itb4UNkD6T4= 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 1731501802325224.7085915674893; Wed, 13 Nov 2024 04:43:22 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.835559.1251483 (Exim 4.92) (envelope-from ) id 1tBChy-0005aA-7Y; Wed, 13 Nov 2024 12:42:54 +0000 Received: by outflank-mailman (output) from mailman id 835559.1251483; Wed, 13 Nov 2024 12:42: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 1tBChy-0005Zv-38; Wed, 13 Nov 2024 12:42:54 +0000 Received: by outflank-mailman (input) for mailman id 835559; Wed, 13 Nov 2024 12:42:51 +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 1tBChv-0003m4-RJ for xen-devel@lists.xenproject.org; Wed, 13 Nov 2024 12:42:51 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ca0d8b05-a1bc-11ef-a0c7-8be0dac302b0; Wed, 13 Nov 2024 13:42:49 +0100 (CET) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-510-Znl_OwPCOsGvl-aZhJUwyA-1; Wed, 13 Nov 2024 07:42:47 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4314a22ed8bso48055185e9.1 for ; Wed, 13 Nov 2024 04:42:47 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed99aa18sm18023528f8f.61.2024.11.13.04.42.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 04:42:45 -0800 (PST) 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: ca0d8b05-a1bc-11ef-a0c7-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjE3MC4xMC4xMzMuMTI0IiwiaGVsbyI6InVzLXNtdHAtZGVsaXZlcnktMTI0Lm1pbWVjYXN0LmNvbSJ9 X-Custom-Transaction: eyJpZCI6ImNhMGQ4YjA1LWExYmMtMTFlZi1hMGM3LThiZTBkYWMzMDJiMCIsInRzIjoxNzMxNTAxNzcwLjA1MTM5Mywic2VuZGVyIjoicHN0YW5uZXJAcmVkaGF0LmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731501768; 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=NsJKOkpA+QoYlzqeYDbY0Dl9xjdlxWNvzFNzd4dMwhk=; b=MFK04fSO1v4A8gg0Q4b7u1tPHBYnvQhE36O67GxgPRlhWI/kyTLgxwmsbVYu8YV7XmJv80 nugar1/I4YYnUgaVRe/7nzUVsWqDl9li8nffyoeBCI/0qN/4cMhtVwnMf1miCpPMWeMr4p aUg3NbNnuAJtkB8Y8eHXSLjjVYH6M6g= X-MC-Unique: Znl_OwPCOsGvl-aZhJUwyA-1 X-Mimecast-MFC-AGG-ID: Znl_OwPCOsGvl-aZhJUwyA X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731501766; x=1732106566; 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=NsJKOkpA+QoYlzqeYDbY0Dl9xjdlxWNvzFNzd4dMwhk=; b=aAbxIYZEr6T4v8WFmToDPtFqT0hSqwKD7GTSp+shpdLMWQ+riJ/VD59T2f3M9r/Laa cpuQzVektd2LsMf3fItP97F2uixGJKOZfuRmGIlcdxeqlYLE7fwi9d4NKRkFLrQ+YsQ5 Xns65Q1uBfoASImLT1wMYOcIajXWy514wJBI85jQYGMUDV4QVdSoRhTr8YsSM2boA6bi f2DNZL307YYFO8P9iMfT/uTwweu80L4rWX6XavrZcgwUXxMWEbZ8BwVswecChJLobtEZ 6ceEZHGiyoZXxhV7GkpwIiJpBFUQuAuprUBFirK2ARBbx5Zs2tDKkhLI7UFPooL6zEdP Xzbw== X-Forwarded-Encrypted: i=1; AJvYcCUHCT63qyIt3bV+h5ltn1wP3fXhoJhm74L/0Te0fNb5WNDMNJnPnIJNYDINluw6/3taUQhIbrKW7R0=@lists.xenproject.org X-Gm-Message-State: AOJu0YzgtfNQzWzWf7cqgtcpMPoHLUDAFu5/sOu3bBHgE+R/9IliFG7k WOkPA0C9J2h/8eFrtMb2TlV24A+/Oo5AALRteulAkLAz5MaPwZAMOf19mSXmP0RAdIlTRyRNx72 T3fYTtp1sMFLn2uLfgNyW9cffYN1Bi/5jx5Uq22+1mGiMM6hR+NGY4ef0ACNUzOD/ X-Received: by 2002:a5d:47ac:0:b0:37d:5282:1339 with SMTP id ffacd0b85a97d-3820df6136cmr2369033f8f.22.1731501766128; Wed, 13 Nov 2024 04:42:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpjkcG3JEnob3xzqfsNCARyMkng1y9gR5mdhMcNm6Gi1JEJjom42U2s4Q7CInAPcp8pAzepA== X-Received: by 2002:a5d:47ac:0:b0:37d:5282:1339 with SMTP id ffacd0b85a97d-3820df6136cmr2368992f8f.22.1731501765706; Wed, 13 Nov 2024 04:42:45 -0800 (PST) From: Philipp Stanner To: Damien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "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 , Philipp Stanner , Mario Limonciello , Chen Ni , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , Mostafa Saleh , Andy Shevchenko , Jason Gunthorpe , Yi Liu , Kunwu Chan , Ankit Agrawal , Christian Brauner , Reinette Chatre , Eric Auger , Ye Bin 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, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v2 07/11] PCI: MSI: Use never-managed version of pci_intx() Date: Wed, 13 Nov 2024 13:41:55 +0100 Message-ID: <20241113124158.22863-9-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241113124158.22863-2-pstanner@redhat.com> References: <20241113124158.22863-2-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ONzCFdd622infrRSa4EIP7GLsp2bCmZ2icVg8xy3jQI_1731501766 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1731501802939116600 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 Reviewed-by: Thomas Gleixner --- 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.47.0