From nobody Sat Nov 23 11:52:43 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=1731501808; cv=none; d=zohomail.com; s=zohoarc; b=D98zlrySiQP8chyVywsCuSFcosB2bO25ansQwZo4hYW5mZdJGNkoMuDS1uLoo0GTiPV8b9kpIRWLhbe13j3bxJ/vhQrNBo1yNZY4AZpUidYegWJGVc+tLuvzPzWkVE3DvwNOQuWyQFn7OXhzqxbf8mpxAA1xhcLacuIXARphom8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731501808; 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=op+AvZ1YCKZsOQFtb06qEXzMr+HQn8e2wB0EdtWp+RY=; b=foRXPRvVUkIR9myIz8NN763+S245LvBjFNy/q7ZahLok+zzDKUHwHwrY+sx91Zlp+pcSia02aHqRMPk+4mBhtmQzr6jvuPHgMrm4RxsUrBEEGORmcgI5lblwtYkUwr9A7IlELxuSC4XYCWJt9L8rbbyeuDu5Y3FoWcjLZM94nTo= 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 173150180830864.99763525316439; Wed, 13 Nov 2024 04:43:28 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.835557.1251468 (Exim 4.92) (envelope-from ) id 1tBChv-00053i-1Q; Wed, 13 Nov 2024 12:42:51 +0000 Received: by outflank-mailman (output) from mailman id 835557.1251468; Wed, 13 Nov 2024 12:42:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tBChu-00052x-Ql; Wed, 13 Nov 2024 12:42:50 +0000 Received: by outflank-mailman (input) for mailman id 835557; Wed, 13 Nov 2024 12:42:49 +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 1tBCht-0003m4-Oq for xen-devel@lists.xenproject.org; Wed, 13 Nov 2024 12:42:49 +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 c8db0bf5-a1bc-11ef-a0c7-8be0dac302b0; Wed, 13 Nov 2024 13:42:47 +0100 (CET) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-8nNvpUA1PfylntgdSn7_GQ-1; Wed, 13 Nov 2024 07:42:45 -0500 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-37d531a19a9so3827787f8f.1 for ; Wed, 13 Nov 2024 04:42:45 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 04:42:43 -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: c8db0bf5-a1bc-11ef-a0c7-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjE3MC4xMC4xMzMuMTI0IiwiaGVsbyI6InVzLXNtdHAtZGVsaXZlcnktMTI0Lm1pbWVjYXN0LmNvbSJ9 X-Custom-Transaction: eyJpZCI6ImM4ZGIwYmY1LWExYmMtMTFlZi1hMGM3LThiZTBkYWMzMDJiMCIsInRzIjoxNzMxNTAxNzY3LjgzNzg5LCJzZW5kZXIiOiJwc3Rhbm5lckByZWRoYXQuY29tIiwicmVjaXBpZW50IjoieGVuLWRldmVsQGxpc3RzLnhlbnByb2plY3Qub3JnIn0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731501766; 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=op+AvZ1YCKZsOQFtb06qEXzMr+HQn8e2wB0EdtWp+RY=; b=eU82t0RqZDMnOwn8zuoklPbH5eNIt669KIz1LYTG3y3dOL7f7M0Rf/a8OC3SUXdDvqJa3Y oxKNiXzRpn5VnFFLOGMhX5ykY6VfuqRwR716IL/46BxM82Uq0zKYGfx12Mfmnx/7u3SRg4 z3jKFbJoJVquwtik2bU/Txtq90LgApc= X-MC-Unique: 8nNvpUA1PfylntgdSn7_GQ-1 X-Mimecast-MFC-AGG-ID: 8nNvpUA1PfylntgdSn7_GQ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731501764; x=1732106564; 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=op+AvZ1YCKZsOQFtb06qEXzMr+HQn8e2wB0EdtWp+RY=; b=v41HIUlHC7jt6YtwR+/mj5PmeyA9s3W8jwxybao2jfAYibJxaOelH/QYnBW9YOhQbc elNST5iI0OR847Mi2gYTy1f21F5y/QOHx1fgwnJpNjdTMljLFFoJ8kIcCup2tyyEegsg ySk2hiZNdSQzBnyS3NcEdp63w0yY/PKHNXRaSGQ375SMPP73VJXfJM9cQ/2BAHPK1edP DLYQuOr3/sqGqTCPRONJY3+i7pL3xo+Mlw71eq6JHaebPkzZBOh1aUg8/ngqbkT8o873 3Q69BKlaj7bVeUQfuySFpeeWXQNmLIp1zmuChjeIDLb4ewdk67H47qnX0I3myRlsZgUZ XVLw== X-Forwarded-Encrypted: i=1; AJvYcCW0RIFI6Jt5UaXMjgedigCH30jV7JH6WlaM0SBxGYehbnkYkIoZ5HTGGD4i5ANP6gZcSdn69Pgvjuc=@lists.xenproject.org X-Gm-Message-State: AOJu0YzDKnmpgADyQWi3qaMRqr1MBO0QoGPyr/6MVIWjkKGAzs7KAp4o n+PnMR/mC6FVWJe6WQKjnlDLayFgUXGsfxWaS6WGERiyR15vJC9sU2mrTdfKc49k9rQTCL9h5sI 2OEnLkEMdSUOVL5Ei4mifrinwLbVeLgK2+4XJboRX/gSm60qJx5YZZDIyKj1+zZOo X-Received: by 2002:a05:6000:704:b0:382:d0a:fe4e with SMTP id ffacd0b85a97d-3820df7add5mr2320634f8f.40.1731501763943; Wed, 13 Nov 2024 04:42:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvKoYvBUp37kzzcOw/kNuKZIW7fG0pUujGd0dqmiteiiQa85bm4vAcxVjs1ubCq0XbXcf6/A== X-Received: by 2002:a05:6000:704:b0:382:d0a:fe4e with SMTP id ffacd0b85a97d-3820df7add5mr2320584f8f.40.1731501763480; Wed, 13 Nov 2024 04:42:43 -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 06/11] vfio/pci: Use never-managed version of pci_intx() Date: Wed, 13 Nov 2024 13:41:54 +0100 Message-ID: <20241113124158.22863-8-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: Z8Jv4i57PwCRZ6MGd1yzOuDV9Da1z2OJmjdENl2CGWQ_1731501764 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1731501809426116600 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. vfio enables its PCI-Device with pci_enable_device(). Thus, it needs the never-managed version. Replace pci_intx() with pci_intx_unmanaged(). Signed-off-by: Philipp Stanner --- drivers/vfio/pci/vfio_pci_core.c | 2 +- drivers/vfio/pci/vfio_pci_intrs.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_c= ore.c index 1ab58da9f38a..90240c8d51aa 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -498,7 +498,7 @@ int vfio_pci_core_enable(struct vfio_pci_core_device *v= dev) if (vfio_pci_nointx(pdev)) { pci_info(pdev, "Masking broken INTx support\n"); vdev->nointx =3D true; - pci_intx(pdev, 0); + pci_intx_unmanaged(pdev, 0); } else vdev->pci_2_3 =3D pci_intx_mask_supported(pdev); } diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_= intrs.c index 8382c5834335..40abb0b937a2 100644 --- a/drivers/vfio/pci/vfio_pci_intrs.c +++ b/drivers/vfio/pci/vfio_pci_intrs.c @@ -118,7 +118,7 @@ static bool __vfio_pci_intx_mask(struct vfio_pci_core_d= evice *vdev) */ if (unlikely(!is_intx(vdev))) { if (vdev->pci_2_3) - pci_intx(pdev, 0); + pci_intx_unmanaged(pdev, 0); goto out_unlock; } =20 @@ -132,7 +132,7 @@ static bool __vfio_pci_intx_mask(struct vfio_pci_core_d= evice *vdev) * mask, not just when something is pending. */ if (vdev->pci_2_3) - pci_intx(pdev, 0); + pci_intx_unmanaged(pdev, 0); else disable_irq_nosync(pdev->irq); =20 @@ -178,7 +178,7 @@ static int vfio_pci_intx_unmask_handler(void *opaque, v= oid *data) */ if (unlikely(!is_intx(vdev))) { if (vdev->pci_2_3) - pci_intx(pdev, 1); + pci_intx_unmanaged(pdev, 1); goto out_unlock; } =20 @@ -296,7 +296,7 @@ static int vfio_intx_enable(struct vfio_pci_core_device= *vdev, */ ctx->masked =3D vdev->virq_disabled; if (vdev->pci_2_3) { - pci_intx(pdev, !ctx->masked); + pci_intx_unmanaged(pdev, !ctx->masked); irqflags =3D IRQF_SHARED; } else { irqflags =3D ctx->masked ? IRQF_NO_AUTOEN : 0; @@ -569,7 +569,7 @@ static void vfio_msi_disable(struct vfio_pci_core_devic= e *vdev, bool msix) * via their shutdown paths. Restore for NoINTx devices. */ if (vdev->nointx) - pci_intx(pdev, 0); + pci_intx_unmanaged(pdev, 0); =20 vdev->irq_type =3D VFIO_PCI_NUM_IRQS; } --=20 2.47.0