From nobody Tue Nov 26 21:39:34 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=1729018351; cv=none; d=zohomail.com; s=zohoarc; b=fIqQa2THXxaQOSdaVmVshLzGhfR9WhjZj1JDQ9Yf3HL+dEH9rWAhbomCvhQTpSZ4BubjKOsFoMPxFp5oHBYLzOLZ3oAr+9fwSuAmcHtcmsmIXbFQpQK6P8sox/asIC4AH1lxXo7UZ6TrOO+8ZVLD/vsnPLYeciqr6CyqV8Azwfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018351; 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=SU/PZdKXdnBqqSwxJC6QaxHUkhQ/Rh93i2Z0bgmQYHg=; b=V30BiBJgTj89mdQOdFPXh9v76JfhELHjQV7ZebH+hBJ2aO8dqSjmNSbbh2G5YhfcQELjl8tRz1U0Tb2K7q19OrYpWdbVJH9Fp68iwuAJww+csprye4LQrJlsVLiu2eXtSdei7pI4FHDD/krzrxTStVP19Pd9Su8VACwa2aZvOUE= 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 1729018351483745.7743699949511; Tue, 15 Oct 2024 11:52:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819318.1232613 (Exim 4.92) (envelope-from ) id 1t0me8-0006GM-JA; Tue, 15 Oct 2024 18:51:52 +0000 Received: by outflank-mailman (output) from mailman id 819318.1232613; Tue, 15 Oct 2024 18:51:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0me8-0006GF-Fr; Tue, 15 Oct 2024 18:51:52 +0000 Received: by outflank-mailman (input) for mailman id 819318; Tue, 15 Oct 2024 18:51:52 +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 1t0me8-0006G4-1O for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:51:52 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 87b3f433-8b26-11ef-a0be-8be0dac302b0; Tue, 15 Oct 2024 20:51:48 +0200 (CEST) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-W4BbnW53NFSgTcugynJgoA-1; Tue, 15 Oct 2024 14:51:45 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a9a1b8d4563so63830766b.3 for ; Tue, 15 Oct 2024 11:51:45 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:51:42 -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: 87b3f433-8b26-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018307; 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=SU/PZdKXdnBqqSwxJC6QaxHUkhQ/Rh93i2Z0bgmQYHg=; b=Ejkq3oCeQzRplWK1Ber+4RfhZGByV6RiGnFDCSvpfXjLFY9pClZKGC52zyWsLdhvvB+s51 UHL1rnJZabAV7Pgveri2vCyOZkFysoN9r+n2GvI8cDIOPC6aI0Svd7pkwH1P/RA71e/uYW yZusZ581e2AesVmPmgLs1RwWx2grLUE= X-MC-Unique: W4BbnW53NFSgTcugynJgoA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018304; x=1729623104; 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=SU/PZdKXdnBqqSwxJC6QaxHUkhQ/Rh93i2Z0bgmQYHg=; b=WMHhaNlRi6KX++9SC0pTxtrMWO/nayfpADdXmFCF6Li5ZESAhcZAVj3l07N7YKKW0I yu4qOaKCSu3cc3svWUPRm4iJJriq14Y5GYPCUaFaJRxcpaT5V2qjZivJge1TNN/TRRnf vkGAoZM/82TUQ49DAYho9u+kYfHVYWGIRkQPmh5n+3HHTsmBiygnmz4pPyRpg0RZATGz W4f0qieJn7g5LZg++q692VnZQTA3HP2x6O3ZjJjT4kKmhbE7rNNLfgT03lL5xVqiDokH ihn+3412fWR94bjGjaTfgGZfTHsdYBDtVV6yFUXpxe6t9pxs9+k406wmdM2xGMZRefgY Vu6w== X-Forwarded-Encrypted: i=1; AJvYcCWb8CTmH5B+60tAbf7n4q4h0rwa5yxrSFAocjm1x+ptX/xwkpu8/CGcT5umXvOEHjAnDjn7CpQO95Q=@lists.xenproject.org X-Gm-Message-State: AOJu0YxYBEXHoq13OxHpF/bj2IO2ddaHTgvkRl25S2/eDtjXVsAap0Rc N6tOqGY9u7UuRztLNi5T1ab2HTSmQMu+4be9WJ9MQNIZ+ztCBd4bvD5eaQW4ySgxlcmsB064hPF oxmAle1sF6DNPzBPofnCedy1nFohpDquxLSR0rSLpocKYCchMoJ4/nGRUfPlT4pO6 X-Received: by 2002:a05:6402:26d1:b0:5c5:da5e:68e with SMTP id 4fb4d7f45d1cf-5c95ac09876mr18284551a12.3.1729018303813; Tue, 15 Oct 2024 11:51:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZgBAdLrLu4wVCTKTVra2bi/zOy1A/yhu7xkqftgD6kovhQdMFl3ZjsIezqx0bvqyWUCvsqg== X-Received: by 2002:a05:6402:26d1:b0:5c5:da5e:68e with SMTP id 4fb4d7f45d1cf-5c95ac09876mr18284485a12.3.1729018303219; Tue, 15 Oct 2024 11:51:43 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 01/13] PCI: Prepare removing devres from pci_intx() Date: Tue, 15 Oct 2024 20:51:11 +0200 Message-ID: <20241015185124.64726-2-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018353203116600 Content-Type: text/plain; charset="utf-8"; x-default="true" pci_intx() is a hybrid function which sometimes performs devres operations, depending on whether pcim_enable_device() has been used to enable the pci_dev. This sometimes-managed nature of the function is problematic. Notably, it causes the function to allocate under some circumstances which makes it unusable from interrupt context. To, ultimately, remove the hybrid nature from pci_intx(), it is first necessary to provide an always-managed and a never-managed version of that function. Then, all callers of pci_intx() can be ported to the version they need, depending whether they use pci_enable_device() or pcim_enable_device(). An always-managed function exists, namely pcim_intx(), for which __pcim_intx(), a never-managed version of pci_intx() had been implemented. Make __pcim_intx() a public function under the name pci_intx_unmanaged(). Make pcim_intx() a public function. Signed-off-by: Philipp Stanner Reviewed-by: Damien Le Moal --- drivers/pci/devres.c | 24 +++--------------------- drivers/pci/pci.c | 28 ++++++++++++++++++++++++++++ include/linux/pci.h | 2 ++ 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index b133967faef8..d32827a1f2f4 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -411,31 +411,12 @@ static inline bool mask_contains_bar(int mask, int ba= r) return mask & BIT(bar); } =20 -/* - * This is a copy of pci_intx() used to bypass the problem of recursive - * function calls due to the hybrid nature of pci_intx(). - */ -static void __pcim_intx(struct pci_dev *pdev, int enable) -{ - u16 pci_command, new; - - pci_read_config_word(pdev, PCI_COMMAND, &pci_command); - - if (enable) - new =3D pci_command & ~PCI_COMMAND_INTX_DISABLE; - else - new =3D pci_command | PCI_COMMAND_INTX_DISABLE; - - if (new !=3D pci_command) - pci_write_config_word(pdev, PCI_COMMAND, new); -} - static void pcim_intx_restore(struct device *dev, void *data) { struct pci_dev *pdev =3D to_pci_dev(dev); struct pcim_intx_devres *res =3D data; =20 - __pcim_intx(pdev, res->orig_intx); + pci_intx_unmanaged(pdev, res->orig_intx); } =20 static struct pcim_intx_devres *get_or_create_intx_devres(struct device *d= ev) @@ -472,10 +453,11 @@ int pcim_intx(struct pci_dev *pdev, int enable) return -ENOMEM; =20 res->orig_intx =3D !enable; - __pcim_intx(pdev, enable); + pci_intx_unmanaged(pdev, enable); =20 return 0; } +EXPORT_SYMBOL_GPL(pcim_intx); =20 static void pcim_disable_device(void *pdev_raw) { diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 7d85c04fbba2..d7fd0772a885 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4476,6 +4476,34 @@ void pci_disable_parity(struct pci_dev *dev) } } =20 +/** + * pci_intx - enables/disables PCI INTx for device dev, unmanaged version + * @pdev: the PCI device to operate on + * @enable: boolean: whether to enable or disable PCI INTx + * + * Enables/disables PCI INTx for device @pdev + * + * This function behavios identically to pci_intx(), but is never managed = with + * devres. + */ +void pci_intx_unmanaged(struct pci_dev *pdev, int enable) +{ + u16 pci_command, new; + + pci_read_config_word(pdev, PCI_COMMAND, &pci_command); + + if (enable) + new =3D pci_command & ~PCI_COMMAND_INTX_DISABLE; + else + new =3D pci_command | PCI_COMMAND_INTX_DISABLE; + + if (new =3D=3D pci_command) + return; + + pci_write_config_word(pdev, PCI_COMMAND, new); +} +EXPORT_SYMBOL_GPL(pci_intx_unmanaged); + /** * pci_intx - enables/disables PCI INTx for device dev * @pdev: the PCI device to operate on diff --git a/include/linux/pci.h b/include/linux/pci.h index 573b4c4c2be6..6b8cde76d564 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1353,6 +1353,7 @@ int __must_check pcim_set_mwi(struct pci_dev *dev); int pci_try_set_mwi(struct pci_dev *dev); void pci_clear_mwi(struct pci_dev *dev); void pci_disable_parity(struct pci_dev *dev); +void pci_intx_unmanaged(struct pci_dev *pdev, int enable); void pci_intx(struct pci_dev *dev, int enable); bool pci_check_and_mask_intx(struct pci_dev *dev); bool pci_check_and_unmask_intx(struct pci_dev *dev); @@ -2293,6 +2294,7 @@ static inline void pci_fixup_device(enum pci_fixup_pa= ss pass, struct pci_dev *dev) { } #endif =20 +int pcim_intx(struct pci_dev *pdev, int enabled); void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxl= en); void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar, const char *name); --=20 2.47.0 From nobody Tue Nov 26 21:39:34 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=1729018341; cv=none; d=zohomail.com; s=zohoarc; b=jj5802Mp0YWazWmEPnpVtSk49CdMhdZ3aVsB2dFF/DiT5zqeCsEO4LXvgTPy4vrT3PWjhHDsLOAP+g2PFKQnRgXfCC1IeysjNzvIFSX9+GmsZwiazLqY9R3zXRixPMhA8lAKYLzM7Y0mSlL1DFT6W9yAF+pyw+IEVUSggGNbKlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018341; 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=3bl3QB30NLAEEM3JzJm3v9Fl/AaPLWrckmhbzUoxAcY=; b=EEG/7OOnYrRCZuTaAajabm6PxBIx5MetG7CUc4/q+aQspuCVCFkuSlYPX0ESn9o0QpKZD89ZeoX7n7NUG1bwh/Uzr7G24CnR/BH708gwaQ1gVPjB8Opdcyo9HK3KLuGz3V2/NbylFhNKBkf+kmUZKL1HVTQ+PDcEWJwa/H1xznU= 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 1729018341482564.0172385040645; Tue, 15 Oct 2024 11:52:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819319.1232623 (Exim 4.92) (envelope-from ) id 1t0me9-0006UO-Pj; Tue, 15 Oct 2024 18:51:53 +0000 Received: by outflank-mailman (output) from mailman id 819319.1232623; Tue, 15 Oct 2024 18:51:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0me9-0006UH-My; Tue, 15 Oct 2024 18:51:53 +0000 Received: by outflank-mailman (input) for mailman id 819319; Tue, 15 Oct 2024 18:51:52 +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 1t0me8-0006G4-9e for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:51:52 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 896c458b-8b26-11ef-a0be-8be0dac302b0; Tue, 15 Oct 2024 20:51:51 +0200 (CEST) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-dzAfU_2yNtaYtKWelRaoaA-1; Tue, 15 Oct 2024 14:51:48 -0400 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5c94ccfb210so3348180a12.1 for ; Tue, 15 Oct 2024 11:51:48 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:51:46 -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: 896c458b-8b26-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018310; 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=3bl3QB30NLAEEM3JzJm3v9Fl/AaPLWrckmhbzUoxAcY=; b=alSa8kNcBnYuv6Zp6tWAIa9UGNtmWP4u7mcVrlEHVUP8BuSQszwN/J1QidI+L6Drep9DZR UPTRpMlo2VTu0L/OHY3KzxNILAu7xZ60YoB38oKdTM4KXnKGtl5swCw9cOVYB0Esk2l3up 5xABHIKu4k6Wzsh3shX6qs3GLEdKq4w= X-MC-Unique: dzAfU_2yNtaYtKWelRaoaA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018307; x=1729623107; 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=3bl3QB30NLAEEM3JzJm3v9Fl/AaPLWrckmhbzUoxAcY=; b=jx7bSgWqyFDmRqHlHbD1WYybMrVupY1MnBvCz4OYgdhgpMfqenfUNYWJhdEv3ti5gy iYXhK2yDG5FdW2A9htPo5KFkxhgY76sCXoY2ZRgUGFRpJAnyGGZpkeNpZj2TFRj1EogT 4KEzbfOngU8S4SdGPbkhceQQ0TrtjXsIAV5SvlyPbI+TvNyZdOL2tvPbBiEInHTUjTEF t5ZNBHRVhPr0abF1Y2S2An4W9+jJ2nkY9MLJD9kgLpIUTlzjQYWAxNshdG4aKXP+/wQM /3u0fHwfYQAnBg4V+LZSfBJsLdd59Cu/OQFW0kaiwe9kViJKIt04gAbs3bT5eC1Em3sS oGvg== X-Forwarded-Encrypted: i=1; AJvYcCUUlLy55XqxxIn7lOnzlk0PX1MSd+dSV/O+P5kxuGRZNpSTC2i21C3TSAgsK/l7DGxfB1KhHqHaVhM=@lists.xenproject.org X-Gm-Message-State: AOJu0YzVfILdZxrfNEadZHz6lu+KhdkoRxK16V0+hUpEDMWtSmKxkZjC BKhvWyo1jFN67GMZs62Ew+t20YpP2/rVEccoZa8FyJ0r4SUVmcJvHHIwx8ylD/HQN6NrvFWKO01 ioP2DLspXNdq4JcqcCqNdhLzRhw9L11KOscj/kCZC6YDcfuUJ6VaDR0VYhrlhAmT7 X-Received: by 2002:a05:6402:274b:b0:5c9:758c:307d with SMTP id 4fb4d7f45d1cf-5c995123e65mr1042694a12.34.1729018307271; Tue, 15 Oct 2024 11:51:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcpsVUn9n0QaeMUMW5c7DLX/r1R+cfZY7789CvnHFdFGuHG3lQrtgeZ9VzucvxMpAlT7QteA== X-Received: by 2002:a05:6402:274b:b0:5c9:758c:307d with SMTP id 4fb4d7f45d1cf-5c995123e65mr1042656a12.34.1729018306780; Tue, 15 Oct 2024 11:51:46 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 02/13] ALSA: hda_intel: Use always-managed version of pcim_intx() Date: Tue, 15 Oct 2024 20:51:12 +0200 Message-ID: <20241015185124.64726-3-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018343116116600 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. hda_intel enables its PCI-Device with pcim_enable_device(). Thus, it needs the always-managed version. Replace pci_intx() with pcim_intx(). Signed-off-by: Philipp Stanner Acked-by: Takashi Iwai --- sound/pci/hda/hda_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b4540c5cd2a6..b44ca7b6e54f 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -786,7 +786,7 @@ static int azx_acquire_irq(struct azx *chip, int do_dis= connect) } bus->irq =3D chip->pci->irq; chip->card->sync_irq =3D bus->irq; - pci_intx(chip->pci, !chip->msi); + pcim_intx(chip->pci, !chip->msi); return 0; } =20 --=20 2.47.0 From nobody Tue Nov 26 21:39:34 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=1729018352; cv=none; d=zohomail.com; s=zohoarc; b=CT5JMZlEdcgNxjraABT1A58Y8+Y0FDKnUAMx6Z5G0/KmpMO3XO9SQyjafrnNQJUnpt2ZC502JHzGop4QfXIp6zFQoSHKEjleSFjqcFBtNf9nIVVrV4hoVugVAfh/YT2KTqsHjb0+B1JpiY8wpYiWQ88r3YzxXYfcRg2g7P9aF30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018352; 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=2UdUsG2Ce2FuhD+Vr0J1b3PhjfLKCU3S+xUJ9DfCqJQ=; b=XLx134ojF1OcghFM/NOU1IK2qiHiGdrVJxYRKb6/iS82KLQDVYEmUw1U4yfhTeA6LlzwxLPmcql3ccadAYc/o1ZMHODAwAUfg6jlQm8md7OOkEsHzScQN+cjgkCmiFFkVhL7YhxGr8E0nQPiQnNAbUnBvfgf1+S6Xbk4XBYu54Q= 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 1729018351999612.6733698591935; Tue, 15 Oct 2024 11:52:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819321.1232643 (Exim 4.92) (envelope-from ) id 1t0meD-0006zQ-E9; Tue, 15 Oct 2024 18:51:57 +0000 Received: by outflank-mailman (output) from mailman id 819321.1232643; Tue, 15 Oct 2024 18:51:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0meD-0006zH-A8; Tue, 15 Oct 2024 18:51:57 +0000 Received: by outflank-mailman (input) for mailman id 819321; Tue, 15 Oct 2024 18:51:56 +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 1t0meC-0006G4-1B for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:51:56 +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 8bee5f45-8b26-11ef-a0be-8be0dac302b0; Tue, 15 Oct 2024 20:51:55 +0200 (CEST) Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-486-epSy9yN1N36e3VnBmIOQYw-1; Tue, 15 Oct 2024 14:51:52 -0400 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2faca747f94so37293221fa.3 for ; Tue, 15 Oct 2024 11:51:52 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:51:49 -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: 8bee5f45-8b26-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018314; 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=2UdUsG2Ce2FuhD+Vr0J1b3PhjfLKCU3S+xUJ9DfCqJQ=; b=XHvPnXR/Fi+6T5w+v20GvhmTgH3gtr2+S0JaXqM0t6dd1WGFuWh+ATO6h/8jGF0r6SwHzV b3AzzCm8bazCtkCCCANqznWDM26eHv4qZ0jDinRcDZLeamvQ7dpIARXtF59SnPi6o2+jPv eGNDwT8sZxoaKXBduoL+DrbCUObvlBI= X-MC-Unique: epSy9yN1N36e3VnBmIOQYw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018311; x=1729623111; 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=2UdUsG2Ce2FuhD+Vr0J1b3PhjfLKCU3S+xUJ9DfCqJQ=; b=CKgt7WrvUvAa3mX9wwi1rSxkNL6JEaF9e839nfW4MjxdXAdgwNfN5BhTQtqd/tYT8o i/AD2fBvKKZseeDUexSK1SEuocpO/NDkGa4Pyl2hfr4RYZrCuIaEY9tLqkuK9JAWNLgv g/hWXXYRz7RjriDkgfqg5QsqTqXdLm5ZcmxTjKp0/FkOvacVLbOGiW8nQvBs+s6JDhrj Evhl4Q9JE/wr1dcEEjXbS99x6YLFxAJ5Vp77V8NsvcBk+5OQhMV+uZzfTFfYWzgLkeEa s3CsAPdjl8ybvElwAJEjcMZu5TXUYuaK5nocEcANLaaNXG3/sYdWSBJzVmKJzWjbweeu 893Q== X-Forwarded-Encrypted: i=1; AJvYcCXOMbwbqxXajvHGZx0tDFtiL3E0mpaB0SwTCNYVymcI3YKF+2ZsEZv7ELDK6zPlmWDmqAl7mT8BwJI=@lists.xenproject.org X-Gm-Message-State: AOJu0YxRVWqEFcuiVuhDHQeljCypD4rSTGeY2tXjwzBFvMWH2RxPv6d+ Pacxx4MEry0WjP2HraSyVP6DrGHTGMiI0Ppqc7C8s+bGritq00tZq2ty5/6EOjL3buiBpj1vrRO p1vQMxWuM355uAd4OcJPcZTHgyiEe2bkda9+jhYBIXOpgCSfZHviSoA16Wg92v131 X-Received: by 2002:a2e:be13:0:b0:2fa:c0fc:e3d6 with SMTP id 38308e7fff4ca-2fb326fc5a0mr82286071fa.7.1729018310963; Tue, 15 Oct 2024 11:51:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGg0lXB9d95359mfSRgxCA4dveTgVHKUj5pW+Si5SQOi+coS4w/96kFO+qIGBhPz8zuJnYPgA== X-Received: by 2002:a2e:be13:0:b0:2fa:c0fc:e3d6 with SMTP id 38308e7fff4ca-2fb326fc5a0mr82285671fa.7.1729018310336; Tue, 15 Oct 2024 11:51:50 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 03/13] drivers/xen: Use never-managed version of pci_intx() Date: Tue, 15 Oct 2024 20:51:13 +0200 Message-ID: <20241015185124.64726-4-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018353116116600 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. xen 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 Acked-by: Juergen Gross --- drivers/xen/xen-pciback/conf_space_header.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-= pciback/conf_space_header.c index fc0332645966..8d26d64232e8 100644 --- a/drivers/xen/xen-pciback/conf_space_header.c +++ b/drivers/xen/xen-pciback/conf_space_header.c @@ -106,7 +106,7 @@ static int command_write(struct pci_dev *dev, int offse= t, u16 value, void *data) =20 if (dev_data && dev_data->allow_interrupt_control && ((cmd->val ^ value) & PCI_COMMAND_INTX_DISABLE)) - pci_intx(dev, !(value & PCI_COMMAND_INTX_DISABLE)); + pci_intx_unmanaged(dev, !(value & PCI_COMMAND_INTX_DISABLE)); =20 cmd->val =3D value; =20 --=20 2.47.0 From nobody Tue Nov 26 21:39:34 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=1729018347; cv=none; d=zohomail.com; s=zohoarc; b=K1YYPBWY1Vvs1nWnNkMi9de9ojUVeb+rFSIrBrp/RbraqyfVHERQlXrdSZfIRObfO/ekr2YSdn4WlA3DqHFUURCMxDmnxNjRtPGsgvlbawbietC2e7nLoxVSkdaY2Q6U3aOThXpdszcUDfgqI/t49Z/tERvj8dS631At00INmzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018347; 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=SZ3Ct+htOyFcNtVrHcgotVRsHQNuDZcXgRKY/qB2q+Y=; b=BoitB0mnnnTkNNZrDehmc4VjrOHX0RKlNLVUlofDpdg3LIWQW7/DSClUj9KSrDgcd0uFeGWE9Os/YS3n9z3L8DC+5LziaiMPNp6xqt7frklUBOK8mudD5kt+HfmhPLflpM27vHikhVPHYT+2XoMnqlWceOwl0XUcRvlB74HME8Q= 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 1729018347974403.5776712029648; Tue, 15 Oct 2024 11:52:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819322.1232653 (Exim 4.92) (envelope-from ) id 1t0meG-0007I6-L8; Tue, 15 Oct 2024 18:52:00 +0000 Received: by outflank-mailman (output) from mailman id 819322.1232653; Tue, 15 Oct 2024 18:52:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0meG-0007Hz-I0; Tue, 15 Oct 2024 18:52:00 +0000 Received: by outflank-mailman (input) for mailman id 819322; Tue, 15 Oct 2024 18:51: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 1t0meF-0006Um-3b for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:51: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 8d245fd3-8b26-11ef-99a2-01e77a169b0f; Tue, 15 Oct 2024 20:51:57 +0200 (CEST) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-fX4Wa6Q1NuSybcNProATBg-1; Tue, 15 Oct 2024 14:51:54 -0400 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5c96e34ff52so2097750a12.1 for ; Tue, 15 Oct 2024 11:51:54 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:51:52 -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: 8d245fd3-8b26-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018316; 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=SZ3Ct+htOyFcNtVrHcgotVRsHQNuDZcXgRKY/qB2q+Y=; b=B4yN8ZLTdQrfOyeitqPEkaXmHsqvOo49C+BrOLdRht3WK2XjXwTzcabQQcq1K9uREggqn2 jeivVq5fZw7MtHoHIdnQmXR08r45gAfHACH1Jgq2CZZvrJ6+ji0D2R7rSbUU4VIL8QLcVI Lrqk7nnnYUlk0cczlybWdyk3BqjxEAk= X-MC-Unique: fX4Wa6Q1NuSybcNProATBg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018314; x=1729623114; 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=SZ3Ct+htOyFcNtVrHcgotVRsHQNuDZcXgRKY/qB2q+Y=; b=IMYRbEamkHsO7sQbGTTAvbH3qYjt0dredXGYPjva7G0NffkDgBz/3sb07s5WsxbD5q IPXZR6bX0AWdBZPClxY/mSbPmayzGpfMlczpR6aOUp7Zbdi6YXefGe/k3roL1rZU4f50 yflKFqSYU+CXltXc/XyfCpevB7gzxlrPLKo4Lf9Jr1cZKHvuFVHWS839teNTF2THcVQN QeNuj4UrsghP7zaGIWpn/Si+rpHJgeTdHLH/Q0hquh03MCri7wJBfG6KnNCv9g0DcQB/ h6VyAj6oW5WDA+WYJ6Du1ivSBuxksHi4VI9hwod1nFXUut+0HnUCE/GTnI7SnXJb/J4d cWqQ== X-Forwarded-Encrypted: i=1; AJvYcCUe1pDqSlNXsdAGno5VLPtBhJ4DsB2Vi6OwNfBSOEm255odFt7IFxpnj9AYzwllWlenpGCi3eWBqFI=@lists.xenproject.org X-Gm-Message-State: AOJu0YxZwrgvmJuHkALmru7R+DNebLgN0b13w/afwlOdMZ37t6WaKacU j51GeZAr8YAeoD4rqxRn4W2udOfJjzL3Gx6fLJJSwc/4W4B5QQyiGitFuxVZMnFwNzTtaWJkMQB usWLnyyLG2UAIfjGUjF9hZ6nByLC24ULt/EHqAGUa0ww9QtIcesvGZJbXaZrYpiON X-Received: by 2002:a05:6402:42d4:b0:5c5:c4b9:e68f with SMTP id 4fb4d7f45d1cf-5c948c8832bmr14419430a12.5.1729018313592; Tue, 15 Oct 2024 11:51:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6NP2MgEjIAHT9QVnzMFvrKhBgwp9yW28QIpF4WXIKBiXqmi8eGjYmTWyuU93CIou+fVZW2Q== X-Received: by 2002:a05:6402:42d4:b0:5c5:c4b9:e68f with SMTP id 4fb4d7f45d1cf-5c948c8832bmr14419400a12.5.1729018313119; Tue, 15 Oct 2024 11:51:53 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 04/13] net/ethernet: Use never-managed version of pci_intx() Date: Tue, 15 Oct 2024 20:51:14 +0200 Message-ID: <20241015185124.64726-5-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018349079116600 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. broadcom/bnx2x and brocade/bna enable their PCI-Device with pci_enable_device(). Thus, they need the never-managed version. Replace pci_intx() with pci_intx_unmanaged(). Signed-off-by: Philipp Stanner --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- drivers/net/ethernet/brocade/bna/bnad.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net= /ethernet/broadcom/bnx2x/bnx2x_main.c index 678829646cec..2ae63d6e6792 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -1669,7 +1669,7 @@ static void bnx2x_igu_int_enable(struct bnx2x *bp) REG_WR(bp, IGU_REG_PF_CONFIGURATION, val); =20 if (val & IGU_PF_CONF_INT_LINE_EN) - pci_intx(bp->pdev, true); + pci_intx_unmanaged(bp->pdev, true); =20 barrier(); =20 diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet= /brocade/bna/bnad.c index ece6f3b48327..2b37462d406e 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c @@ -2669,7 +2669,7 @@ bnad_enable_msix(struct bnad *bnad) } } =20 - pci_intx(bnad->pcidev, 0); + pci_intx_unmanaged(bnad->pcidev, 0); =20 return; =20 --=20 2.47.0 From nobody Tue Nov 26 21:39:34 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=1729018342; cv=none; d=zohomail.com; s=zohoarc; b=R8YXEZ5NrH1cbTE1lgrmSFOITSbz4iuODgFeKcvdy6V2xACXbZQoVKCFnukzvwVWynKdvZESPfJ7/UtHFfaNM49l40gcXN1ZMsW9CJkahBKh6IhVky3CU9oJ+0V2d2976E2s2sEIat0wYtPyO1knMApwg4nDcK48ge9H0CTPUjA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018342; 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=gh5xBESPiuO8YtWqrs+YzUNc8fkB81YlCR9KwN+kONI=; b=Wjay5m6mtSMKiDVKnjj8EtcIskn1oAlas9kFD+juhRVinHEgrf0kVrlQtnGhEO7CG19VpwC3Hc6s0zgoBRDvKvos/U90UvkE/cjb6SEFSSpQ7tlluPj8npHpFTSK4WHORb/nIINZbzc+Q23gUtygCOMU5eZ8QEGevdXnT4gN0UU= 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 172901834270668.30757516374365; Tue, 15 Oct 2024 11:52:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819323.1232663 (Exim 4.92) (envelope-from ) id 1t0meI-0007ZG-TG; Tue, 15 Oct 2024 18:52:02 +0000 Received: by outflank-mailman (output) from mailman id 819323.1232663; Tue, 15 Oct 2024 18:52:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0meI-0007Z9-P9; Tue, 15 Oct 2024 18:52:02 +0000 Received: by outflank-mailman (input) for mailman id 819323; Tue, 15 Oct 2024 18:52:02 +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 1t0meI-0006Um-5a for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:52:02 +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 8ee04ecc-8b26-11ef-99a2-01e77a169b0f; Tue, 15 Oct 2024 20:52:00 +0200 (CEST) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-f5_X4XZEMkmClp8pgNwoxw-1; Tue, 15 Oct 2024 14:51:57 -0400 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c96e34ff52so2097837a12.1 for ; Tue, 15 Oct 2024 11:51:57 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:51:55 -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: 8ee04ecc-8b26-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018319; 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=gh5xBESPiuO8YtWqrs+YzUNc8fkB81YlCR9KwN+kONI=; b=ASBqMOIWLUCiaeTIdtZxxR2bMbLI9MyGfd2H9JL07tQ2vTxIKfmO8RVt/PgDuue3mDIt1a SnyJqS5LffqO3n9RPsZyMbVK3PIPBlldLZmZebka7TDZ1xCPhET8Gmro2XWDBetP7qK4xn b463U0pOmWD6RQuXuAnCN9QkoyUo47U= X-MC-Unique: f5_X4XZEMkmClp8pgNwoxw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018316; x=1729623116; 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=gh5xBESPiuO8YtWqrs+YzUNc8fkB81YlCR9KwN+kONI=; b=TYh6Ny5VhRIakrmkOYVaods/3tkZsafmLieMZazowZbM9OdhPqCMv7zYqelatdGsg6 UxYDY8bX5AvDY1UjMuTy+UV7dzWToDwhHoTFxBiMbFDMpmVALTzElmrhpn5CoLIJbU88 kCVzKezVcNMNfOA4VBPH6Ln+JNCQ3Fzx5rf1K9Xb4V2RbKVgoAK2qeKxyAJI/qt/v+Zy MnIQEbKkVcPysAH3rtTzRdCdE9aTwTeQs4FzcSnNWulQgnOOK0iAg/6Yo/k5hzuOVfe5 uDzLwePJwrAl4HSiQ5rUlXPLbjTLnirvPKhc6sYKQRHO4OxarNobkIuLbPF36QLIJJgF Xqtg== X-Forwarded-Encrypted: i=1; AJvYcCUbENNAPm14oiVVZU9JWS8Q8NBAdWeEHwpl9ffHtYHxOnT4URW25Zl7IHKG+nZcmhdZzxQJESfpfaI=@lists.xenproject.org X-Gm-Message-State: AOJu0YwVb0ATPhjXKoTdMoS7YNBCtMqVgsh6minCghXVPCOgnf6pm8U3 fGzdVLRr+QwAfCQ1y80SvZeXfWEe16GHxBDwRVc2MMFGbDx87Xry0kyHb1YiNnZjklVQ3LZJZCs W09jeDuktp3D2DDZq0pdYv256GhnESOZvkWWquG7hzfvHQ/vo7rMbKlGYIk3QntBh X-Received: by 2002:a05:6402:2749:b0:5c2:439d:90d4 with SMTP id 4fb4d7f45d1cf-5c948d76b4amr10733522a12.30.1729018316276; Tue, 15 Oct 2024 11:51:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGF3RowDEBzBmFjomZKJb8aI1a+lparmQD2EhJzOsotZnZJFVQLosdt/QHX4IGQZaEh/cAmrg== X-Received: by 2002:a05:6402:2749:b0:5c2:439d:90d4 with SMTP id 4fb4d7f45d1cf-5c948d76b4amr10733454a12.30.1729018315667; Tue, 15 Oct 2024 11:51:55 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 05/13] net/ntb: Use never-managed version of pci_intx() Date: Tue, 15 Oct 2024 20:51:15 +0200 Message-ID: <20241015185124.64726-6-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018343122116600 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. hw/amd and how/intel enable their PCI-Device with pci_enable_device(). Thus, they need the never-managed version. Replace pci_intx() with pci_intx_unmanaged(). Signed-off-by: Philipp Stanner Acked-by: Shyam Sundar S K #for ntb_hw_amd.c --- drivers/ntb/hw/amd/ntb_hw_amd.c | 4 ++-- drivers/ntb/hw/intel/ntb_hw_gen1.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_am= d.c index d687e8c2cc78..b146f170e839 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -791,7 +791,7 @@ static int ndev_init_isr(struct amd_ntb_dev *ndev, err_msi_enable: =20 /* Try to set up intx irq */ - pci_intx(pdev, 1); + pci_intx_unmanaged(pdev, 1); =20 rc =3D request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED, "ndev_irq_isr", ndev); @@ -831,7 +831,7 @@ static void ndev_deinit_isr(struct amd_ntb_dev *ndev) if (pci_dev_msi_enabled(pdev)) pci_disable_msi(pdev); else - pci_intx(pdev, 0); + pci_intx_unmanaged(pdev, 0); } } =20 diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_= hw_gen1.c index 079b8cd79785..9ad9d7fe227e 100644 --- a/drivers/ntb/hw/intel/ntb_hw_gen1.c +++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c @@ -445,7 +445,7 @@ int ndev_init_isr(struct intel_ntb_dev *ndev, =20 /* Try to set up intx irq */ =20 - pci_intx(pdev, 1); + pci_intx_unmanaged(pdev, 1); =20 rc =3D request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED, "ndev_irq_isr", ndev); --=20 2.47.0 From nobody Tue Nov 26 21:39:34 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=1729018357; cv=none; d=zohomail.com; s=zohoarc; b=cpl+Y1mFw6UwDKsoF3rRIuQHoHeo5Os0QCrDBBVGRMl5iYNVo8ToCG8tJX2h41vAkoQTcBN/WtvnUmcKnRnCzTNju7C5gzRXDP3R2yZeLtEORHb3q53a65OGeUZR1EzbZgkQIuOwjwWB46Byeb3jE9orU+GfMlWxY6kPHXs0L4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018357; 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=i/tiT1oHv++iZFY5S8iNVJ0nRwrLe5bjQFEltGuWg0g=; b=aBMiRJFTkMU2eGFl2vg/o+IgKnyUhp07RJj+YGa0WVhN7WAeYTHmBWXQUfshJoBXGU3cTyLtZTmnm3DEcbKyuAzDlM9IH1iBKGmec7e506kS/Fcf9wbRadtMkNubIOYWO3heMraOWW/vbUHsqycnXID/RKF/HeGMEPvHIdIsm0I= 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 1729018357769931.4162678642583; Tue, 15 Oct 2024 11:52:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819324.1232673 (Exim 4.92) (envelope-from ) id 1t0meN-0007zj-6H; Tue, 15 Oct 2024 18:52:07 +0000 Received: by outflank-mailman (output) from mailman id 819324.1232673; Tue, 15 Oct 2024 18:52:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0meN-0007za-2S; Tue, 15 Oct 2024 18:52:07 +0000 Received: by outflank-mailman (input) for mailman id 819324; Tue, 15 Oct 2024 18:52:06 +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 1t0meL-0006Um-VZ for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:52:05 +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 91367b3a-8b26-11ef-99a2-01e77a169b0f; Tue, 15 Oct 2024 20:52:04 +0200 (CEST) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-637-E9Bfkn6SNtilpe5qOzaEpw-1; Tue, 15 Oct 2024 14:52:02 -0400 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5c9452d6321so3556863a12.3 for ; Tue, 15 Oct 2024 11:52:01 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:51:58 -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: 91367b3a-8b26-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018323; 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=i/tiT1oHv++iZFY5S8iNVJ0nRwrLe5bjQFEltGuWg0g=; b=euys1lBaWimYuPsd3pATiacwxgC2qFxyGWDsXYK/V38esHI/+7PjfaXSTb7XaAEbI9KxZN cdAEcHKYEjlvVvGtB1y8DCMogi4vPBwZaCQnZSLVJJ6WJkpxFFXJPNz6xW7+96ZHgLjdfq yIV9P30GjV6yFEZWOXEXWkZK/bTeKQ8= X-MC-Unique: E9Bfkn6SNtilpe5qOzaEpw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018321; x=1729623121; 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=i/tiT1oHv++iZFY5S8iNVJ0nRwrLe5bjQFEltGuWg0g=; b=jFTX4O6dnM1ebrFjyQJskR9im9STL5WJqpLIrBWve0rPQW8H9jiRZ5h3XnwNgNCYdI zC05wSKYyHpVTejPneJcn0j30DJkrvtLwlMz5uHLiG/f2U+DRCC4TMP71Jw3MBoMgqkd 03rVRVj4bC4qJGgE+qJDTnMA7RjDgdVYZKSeCqRQTdlFL21KXLY2xcZRNJ/OJyDxkzb9 0oOZ7ngAY9ipn5w+JsIbOi0iuzUCjBV7vnclg5tcrubtYKxtOV6UIGXivcG2WuKtrvin kyFVeV3Q49WfVsFR+b3bEU+c158DVe7BQrCs7iv5dEp0w/hMj2RhMPLyM+YkOZ1c6b1o Ul+A== X-Forwarded-Encrypted: i=1; AJvYcCVKbY+Wza7K3WIRN99ImhpOIKDPrKQa4TZZql0kmVgedSaa3as80GDxaV21PJ2WtcYtmQRasJEnydQ=@lists.xenproject.org X-Gm-Message-State: AOJu0Yyz0zDowUMOwFR11fS7mgkGgJShDOLt02DwnG01wf5w2lRXnxSm +6gdWf5kru4n6oe85/Jr8H+N6MujpIP2Yg5wOcwB3ylz6AVPgY6xfE1GeLeqm0C1i7N4AH6zR7F jxPsyt2YQe/yT9ksydGPM7qzqbtemrMHHVMS1Q3bFe5MZgr9IHdYy5iL8qhz05bnn X-Received: by 2002:a05:6402:42ca:b0:5c9:8584:12ae with SMTP id 4fb4d7f45d1cf-5c9858414famr4855326a12.29.1729018320676; Tue, 15 Oct 2024 11:52:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNUSaZzJFpcnbAyxu8SUqVbgRkCBc+0eZafkjjXXKs5iCySMs2In3PqmEp1mZm07oblnaLMw== X-Received: by 2002:a05:6402:42ca:b0:5c9:8584:12ae with SMTP id 4fb4d7f45d1cf-5c9858414famr4855284a12.29.1729018320158; Tue, 15 Oct 2024 11:52:00 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 06/13] misc: Use never-managed version of pci_intx() Date: Tue, 15 Oct 2024 20:51:16 +0200 Message-ID: <20241015185124.64726-7-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018359146116600 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. cardreader/rtsx_pcr.c and tifm_7xx1.c enable their PCI-Device with pci_enable_device(). Thus, they need the never-managed version. Replace pci_intx() with pci_intx_unmanaged(). Signed-off-by: Philipp Stanner --- drivers/misc/cardreader/rtsx_pcr.c | 2 +- drivers/misc/tifm_7xx1.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/r= tsx_pcr.c index be3d4e0e50cc..e25e6d560dd7 100644 --- a/drivers/misc/cardreader/rtsx_pcr.c +++ b/drivers/misc/cardreader/rtsx_pcr.c @@ -1057,7 +1057,7 @@ static int rtsx_pci_acquire_irq(struct rtsx_pcr *pcr) } =20 pcr->irq =3D pcr->pci->irq; - pci_intx(pcr->pci, !pcr->msi_en); + pci_intx_unmanaged(pcr->pci, !pcr->msi_en); =20 return 0; } diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index 1d54680d6ed2..5f9c7ccae8d2 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c @@ -327,7 +327,7 @@ static int tifm_7xx1_probe(struct pci_dev *dev, goto err_out; } =20 - pci_intx(dev, 1); + pci_intx_unmanaged(dev, 1); =20 fm =3D tifm_alloc_adapter(dev->device =3D=3D PCI_DEVICE_ID_TI_XX21_XX11_FM ? 4 : 2, &dev->dev); @@ -368,7 +368,7 @@ static int tifm_7xx1_probe(struct pci_dev *dev, err_out_free: tifm_free_adapter(fm); err_out_int: - pci_intx(dev, 0); + pci_intx_unmanaged(dev, 0); pci_release_regions(dev); err_out: if (!pci_dev_busy) @@ -392,7 +392,7 @@ static void tifm_7xx1_remove(struct pci_dev *dev) tifm_7xx1_sock_power_off(tifm_7xx1_sock_addr(fm->addr, cnt)); =20 iounmap(fm->addr); - pci_intx(dev, 0); + pci_intx_unmanaged(dev, 0); pci_release_regions(dev); =20 pci_disable_device(dev); --=20 2.47.0 From nobody Tue Nov 26 21:39:34 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=1729018361; cv=none; d=zohomail.com; s=zohoarc; b=aW7dl9h+/0zb0+SUoU85Hl2bKIJhLL25yvo4RuBgR4Zv4j3lb5YXhbWvPXf61EouE6w0vztnJO2nDoKwXgETOD2S9yRhj/KwHF3TmXiY7BfUn+gzOMRMCzCDTtaApWnvtmfJeClR+pr0u94ItKYQG8pcWkaIhRmjQPqPm7Yfuwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018361; 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=EJ4XNmKILKVxl+onNseLYTHRoVR+YhgVImBClOFypegw2blvtZ+BDC5yDgbYj6UDBQDirkzmPwrKSBsfbvun0eyXByeq0DV5XDSDF29sOhWrCbOYWwknsLBk6HIqwpctjVPORnzAcVUOikcwY6MZU7l4t5K1JC7W0lYIuK2251c= 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 1729018361196236.73292586653224; Tue, 15 Oct 2024 11:52:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819325.1232682 (Exim 4.92) (envelope-from ) id 1t0meR-000051-K5; Tue, 15 Oct 2024 18:52:11 +0000 Received: by outflank-mailman (output) from mailman id 819325.1232682; Tue, 15 Oct 2024 18:52:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0meR-00004r-Ge; Tue, 15 Oct 2024 18:52:11 +0000 Received: by outflank-mailman (input) for mailman id 819325; Tue, 15 Oct 2024 18:52:09 +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 1t0meP-0006Um-L9 for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:52:09 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 93606f18-8b26-11ef-99a2-01e77a169b0f; Tue, 15 Oct 2024 20:52:07 +0200 (CEST) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-aYi3jVLMMhqFM3EgbhOKpg-1; Tue, 15 Oct 2024 14:52:05 -0400 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5c93479b1dcso4556194a12.0 for ; Tue, 15 Oct 2024 11:52:05 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:52:03 -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: 93606f18-8b26-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018326; 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=ddpmrUXjdjLqmJe7js0QjV1g/HoJbIEbr+X8oYEuAhiBMOF9rUMdp4/Z8976ihE8aEEfpu iIh+EoFPsrDWPlC0kRU/VwbQsQ6KEa0dtpHkHHK3e9gRXWRWyjGuP8Nu/lYu7cf+gZ/0P5 qsnKf2E2uqY9cGwx7+Dc9HTRxz5xmfE= X-MC-Unique: aYi3jVLMMhqFM3EgbhOKpg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018324; x=1729623124; 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=EiMn1ymxiXBi4TVebUnaAMR+cEVE7PrFO2OXc+ZjfhAR5nmkEw7SjKU2BFoMEr++T8 Bvb4daMhV6IpF7oSJbKQlN9UdEiEIPMy+nBUl3iTP1TFy0NuRfJHtdAjQuMofHHaseiA msa2/UxKRg7c+1l05lazbeO95OJrlkjKgTJRtvsBEWZ4VaN1NJtk+8xo01dZr68hC9VC g2t6DjEhp+FZ3Ngftdan+KQmmy8C7j2mms7gjqwyv8Dqc0j1XqFXTLNuLoLWIMoo5Ss+ BWEKTDVeq0EjwEhDgO0uyDFtBYySzYa3Wk6DSIGyA9vcbs+7rZ69VRiPmyhGt8+lrmAY AKjw== X-Forwarded-Encrypted: i=1; AJvYcCUqWOJMMgOV6FiRVaIke2idFNORuFW+XSLk/Py4MKX49FyrTjA24mLZguA51y73GhSWLNPpwQ162T0=@lists.xenproject.org X-Gm-Message-State: AOJu0YyC/0naRIJTSKxXG7Dg1uPBYs+LIi4XTyM4smMtLWZI8jL4qCKP vI7cihrXNqbCgtMjwgeWUXi0mcoROWlWa3Qtyzc7dmfDmxbjOzvviWhKheOYXbB5wxJheGU5bWy BVnaQzycEuLLdfYpxrtyivrQltX//WswEJWmKmgiMcDN+dG8v84S/g+ASCPoS+MwH X-Received: by 2002:a05:6402:548c:b0:5c9:3ff:2734 with SMTP id 4fb4d7f45d1cf-5c948cb2e85mr11413464a12.12.1729018324143; Tue, 15 Oct 2024 11:52:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9Mt+tYXeO52xhZKwKuRloVsALYEKQc2I21vAq135PHqTEanBCUagfu1NmMBeK/O6BxAgzuw== X-Received: by 2002:a05:6402:548c:b0:5c9:3ff:2734 with SMTP id 4fb4d7f45d1cf-5c948cb2e85mr11413425a12.12.1729018323667; Tue, 15 Oct 2024 11:52:03 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 07/13] vfio/pci: Use never-managed version of pci_intx() Date: Tue, 15 Oct 2024 20:51:17 +0200 Message-ID: <20241015185124.64726-8-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018363392116600 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 From nobody Tue Nov 26 21:39:34 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=1729018358; cv=none; d=zohomail.com; s=zohoarc; b=iq+LnN6ksnRk715e0h6Ij7jErXNLsrBspyA0nE9sKMxMaUcIB2KofDFN2ZHPUxmeGwkM/YlIAsiyF7mUM9p47le2iqBJymPl/ikXMpJ1hzDZuYwQ+nfyIMxrKVcy5w8wD2WaFy0AeKKZYwBR6JmnSwlwmV1n8Guu7+2GZdJjmRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018358; 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=mBSmCXodCw0N8wx7NhlOOoPljS+PCe6nStjQ8uOvtz/TQjfyycDTap3j1Q04D1TXTKgOwOWBye1Rg5Mq0vrAbevaeROPvBGCcsw3zW4cQ8WT22x6OoRJQaKvql4cghEXCkQAHdIpaHC3pP2fzH/9XhQaKCejBS7jxV4xhZiiiiM= 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 1729018357996594.3440528870594; Tue, 15 Oct 2024 11:52:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819326.1232693 (Exim 4.92) (envelope-from ) id 1t0meT-0000Te-Tq; Tue, 15 Oct 2024 18:52:13 +0000 Received: by outflank-mailman (output) from mailman id 819326.1232693; Tue, 15 Oct 2024 18:52:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0meT-0000Su-Pj; Tue, 15 Oct 2024 18:52:13 +0000 Received: by outflank-mailman (input) for mailman id 819326; Tue, 15 Oct 2024 18:52:12 +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 1t0meR-0006G4-UW for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:52:11 +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 9580159f-8b26-11ef-a0be-8be0dac302b0; Tue, 15 Oct 2024 20:52:11 +0200 (CEST) Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-538-btv5M8XQPdKNeYohVNzpMw-1; Tue, 15 Oct 2024 14:52:08 -0400 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2fb45ca974bso14366691fa.2 for ; Tue, 15 Oct 2024 11:52:08 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:52:06 -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: 9580159f-8b26-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018330; 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=O4EfT2H9WnO5VeuryMyn25009v9RhI/mEJxxnL8tvrr5dW4ZzWnD2nBRXx137ssvOx4kpu EIbLSqOC68S5cEbTR2q+/Tq+WigVIrkV8Dv4GltWq0TZP7Ai+hE7+tzsefg5WKiIfUzhNI s8sBZY0AbQ6K/DAlKUfZze+HMagsF58= X-MC-Unique: btv5M8XQPdKNeYohVNzpMw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018327; x=1729623127; 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=D4CJ4cZiDuNvsvIHwIDsn+/9QRUMIh9dLPpqkzLqyKMLPDLybX5lgukL2EEWcJOEBE y3lI7OrjNhQqvz4icNuvMJwHUwJJ6tc5xybld3+6UH/rgOK4Mql8rwOfqBqtG9aKk5aB AAlMdda/O6dFN0wDssdyVXrP2WiFvnsbva74ojZWadNixGBYMhamazuVKcSIsucL5Sd8 Rj9jc6iUI8cxmSvTYJhrsz96tJrapHsB/GyOhcwje781ie/kRk5mk2h1LYAKqSeK+2EY 7e6YCLEA6k5+YvPhPlY7zp4NWCqgYEJrlZh9qv5Fz6/Z/ioMtFse9XcJBCtBN2oPlFnp mi5g== X-Forwarded-Encrypted: i=1; AJvYcCX3V6fJ/NQQPYsINTdXzRzlJoXHoSNziuAX9/PXEGFhb+lGi0oOIIzBJTMF2r/OGDlDaPq7dKqs2/8=@lists.xenproject.org X-Gm-Message-State: AOJu0YyI5SWkbuwPpHy3oJHrgtXVtcUQTc/ovcf1R8TxVnJIRCuzdPJu 1A0cVq1Qlt24z44GmCM8Rw6FpGabm++6kZox+JBj2W5aN7mU//sm0zHVtvo+3o5e4ObBYXpO4+8 PPRX1rxOE0IQuOz3OR4ROKxsOLk+k2cBVM1yf+TfkgGNi8C4GZJ4ulKZ3tIosIWZE X-Received: by 2002:a2e:bc24:0:b0:2fb:51e0:951 with SMTP id 38308e7fff4ca-2fb51e00cd9mr38862361fa.7.1729018327261; Tue, 15 Oct 2024 11:52:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVZ1XHHUqIGJ2m/RKPcgltoOTO0Mu8nn9SAFlZXigaFQMqbloSJIQ5jr77XkDUgFazWOLC0g== X-Received: by 2002:a2e:bc24:0:b0:2fb:51e0:951 with SMTP id 38308e7fff4ca-2fb51e00cd9mr38861861fa.7.1729018326657; Tue, 15 Oct 2024 11:52:06 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 08/13] PCI: MSI: Use never-managed version of pci_intx() Date: Tue, 15 Oct 2024 20:51:18 +0200 Message-ID: <20241015185124.64726-9-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018359153116600 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 --- 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 From nobody Tue Nov 26 21:39:34 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=1729018371; cv=none; d=zohomail.com; s=zohoarc; b=UyTCjalT8REiQZ8vir2N0sCr0+Hq7Z3pPIiYL7+0PS24poy8g16dEIIr9BjrhZ5BjUYho8+vKbOKUIvDi25Ppj6CfI9pLo5nixZLKZi+iwE/xcdLcPTjMUWr3PHUdAzQw6NjyYjHshSaVVv/+2petrCSQ48CquvQK2Jod1Z33o0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018371; 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=f2Jr5AkqxaPFEKRGVmaRlM7QFZhouz0Sldtn5ZZjCmA=; b=LLqvCZU564POj8YXvWHg/g3igEh+BzJJzaJ7Hnm12T7xMzbDNekZab3H8Zq+3uvHV9ZONi8pf8GGdFbscuCovLW+uUZjE/mvBFCNzcu8Gp7lw6gXL9AR82+ncKULG1vS5ZEn+API6QbGh9AwpcshyYBP/dcti85Z+v+1kVt8oX4= 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 1729018371643305.463889655049; Tue, 15 Oct 2024 11:52:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819336.1232703 (Exim 4.92) (envelope-from ) id 1t0meX-00015P-61; Tue, 15 Oct 2024 18:52:17 +0000 Received: by outflank-mailman (output) from mailman id 819336.1232703; Tue, 15 Oct 2024 18:52:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0meX-00015I-2e; Tue, 15 Oct 2024 18:52:17 +0000 Received: by outflank-mailman (input) for mailman id 819336; Tue, 15 Oct 2024 18:52:16 +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 1t0meW-0006G4-1i for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:52:16 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 97d3cbb0-8b26-11ef-a0be-8be0dac302b0; Tue, 15 Oct 2024 20:52:15 +0200 (CEST) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-QsCyNvYIPm6a-UlLcWjZ0g-1; Tue, 15 Oct 2024 14:52:11 -0400 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5c930ca5d12so127179a12.1 for ; Tue, 15 Oct 2024 11:52:11 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:52:08 -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: 97d3cbb0-8b26-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018334; 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=f2Jr5AkqxaPFEKRGVmaRlM7QFZhouz0Sldtn5ZZjCmA=; b=hCOjnf86RoskrSMea6O/CrmMzMiVhilXhPCSn+dn4hx9sJrAeyyCmt9Ca42guwlvbj3YFh 4/L4PHMQmuel3T0GU4X4gSpJLMuCgRc17qGBxlCp/2lP6ecqSmgH07b2BxmzGgNxl3PowA /t8vTa3w/OgpHYNnRdAH2nJWNmI8Cxc= X-MC-Unique: QsCyNvYIPm6a-UlLcWjZ0g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018330; x=1729623130; 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=f2Jr5AkqxaPFEKRGVmaRlM7QFZhouz0Sldtn5ZZjCmA=; b=RVB+rV4Qjzvs0n5YN7t70qHcGRw0ayFRdOFHuxDu0HBfMzV0CKNq2+DiyDuuBvDT7p m6iWACPXGHLQZNoJehAIrQk2ZEsYdGUQcF+P/TgxekyPcCXNsgyAFSoDc3GkA4O0fsQd QkvGwpeKlHbH6mrsZ6Bq6nUHROQkNrOgmnsc4ah1ZE2IlaQR85dHIWi3V8kE8RjT4aCz g3G6qgHKsmTomUp9LVwVSwdonx6c81LkZKdnXW3KHNYfPwlryqG92j02wMiBSQIX+oEE CPKwcEqlUD/IKH/GtCjBuqzE4YH34lw0rlpcD+CpTrE198ymRBMbwzHc2y8yr5f1ZdGL J/rA== X-Forwarded-Encrypted: i=1; AJvYcCVD7kIZCINBQHOBUNrbgaeDb2e6lZ84Cjyoqwjqs5wYLX+f3Dw+hBJpBThyKdJtj0OVfR3gCWcJgac=@lists.xenproject.org X-Gm-Message-State: AOJu0Yyz4NSpzbcbQroJ+skDKn1H0ZQBw13ATn8LqvAWNXGR5FwRB5uZ clrlrAvCE6VTL7bkipw/hb04fP32fkRLNIvsBJNpdqk/uAHhGMkWGOXUKUqdTogJ/OeN4R7+iGB G6SJMRnZ/WC2sPVV2K+5mCUMzkYFyc75KHyu81v+6qGDA9A0dunzqf3VCb5Di6ilE X-Received: by 2002:a05:6402:27cf:b0:5c9:6981:9325 with SMTP id 4fb4d7f45d1cf-5c9698202e7mr8257651a12.8.1729018329916; Tue, 15 Oct 2024 11:52:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFz3y1lDPzlFIAXe641ucDk32i7Rid6UZFyDapZOvfZWi7HgWp5FyR2ER9dH4XFZXo38YzXpg== X-Received: by 2002:a05:6402:27cf:b0:5c9:6981:9325 with SMTP id 4fb4d7f45d1cf-5c9698202e7mr8257603a12.8.1729018329468; Tue, 15 Oct 2024 11:52:09 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 09/13] ata: Use always-managed version of pci_intx() Date: Tue, 15 Oct 2024 20:51:19 +0200 Message-ID: <20241015185124.64726-10-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018373217116600 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. All users in ata enable their PCI-Device with pcim_enable_device(). Thus, they need the always-managed version. Replace pci_intx() with pcim_intx(). Signed-off-by: Philipp Stanner Acked-by: Niklas Cassel Reviewed-by: Sergey Shtylyov --- drivers/ata/ahci.c | 2 +- drivers/ata/ata_piix.c | 2 +- drivers/ata/pata_rdc.c | 2 +- drivers/ata/sata_sil24.c | 2 +- drivers/ata/sata_sis.c | 2 +- drivers/ata/sata_uli.c | 2 +- drivers/ata/sata_vsc.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 45f63b09828a..9273ff3d4732 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1985,7 +1985,7 @@ static int ahci_init_one(struct pci_dev *pdev, const = struct pci_device_id *ent) =20 if (ahci_init_msi(pdev, n_ports, hpriv) < 0) { /* legacy intx interrupts */ - pci_intx(pdev, 1); + pcim_intx(pdev, 1); } hpriv->irq =3D pci_irq_vector(pdev, 0); =20 diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 093b940bc953..d441246fa357 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -1725,7 +1725,7 @@ static int piix_init_one(struct pci_dev *pdev, const = struct pci_device_id *ent) * message-signalled interrupts currently). */ if (port_flags & PIIX_FLAG_CHECKINTR) - pci_intx(pdev, 1); + pcim_intx(pdev, 1); =20 if (piix_check_450nx_errata(pdev)) { /* This writes into the master table but it does not diff --git a/drivers/ata/pata_rdc.c b/drivers/ata/pata_rdc.c index 0a9689862f71..09792aac7f9d 100644 --- a/drivers/ata/pata_rdc.c +++ b/drivers/ata/pata_rdc.c @@ -340,7 +340,7 @@ static int rdc_init_one(struct pci_dev *pdev, const str= uct pci_device_id *ent) return rc; host->private_data =3D hpriv; =20 - pci_intx(pdev, 1); + pcim_intx(pdev, 1); =20 host->flags |=3D ATA_HOST_PARALLEL_SCAN; =20 diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 72c03cbdaff4..b771ebd41252 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c @@ -1317,7 +1317,7 @@ static int sil24_init_one(struct pci_dev *pdev, const= struct pci_device_id *ent) =20 if (sata_sil24_msi && !pci_enable_msi(pdev)) { dev_info(&pdev->dev, "Using MSI\n"); - pci_intx(pdev, 0); + pcim_intx(pdev, 0); } =20 pci_set_master(pdev); diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c index ef8724986de3..b8b6d9eff3b8 100644 --- a/drivers/ata/sata_sis.c +++ b/drivers/ata/sata_sis.c @@ -290,7 +290,7 @@ static int sis_init_one(struct pci_dev *pdev, const str= uct pci_device_id *ent) } =20 pci_set_master(pdev); - pci_intx(pdev, 1); + pcim_intx(pdev, 1); return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, IRQF_SHARED, &sis_sht); } diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c index 60ea45926cd1..52894ff49dcb 100644 --- a/drivers/ata/sata_uli.c +++ b/drivers/ata/sata_uli.c @@ -221,7 +221,7 @@ static int uli_init_one(struct pci_dev *pdev, const str= uct pci_device_id *ent) } =20 pci_set_master(pdev); - pci_intx(pdev, 1); + pcim_intx(pdev, 1); return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, IRQF_SHARED, &uli_sht); } diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c index d39b87537168..a53a2dfc1e17 100644 --- a/drivers/ata/sata_vsc.c +++ b/drivers/ata/sata_vsc.c @@ -384,7 +384,7 @@ static int vsc_sata_init_one(struct pci_dev *pdev, pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x80); =20 if (pci_enable_msi(pdev) =3D=3D 0) - pci_intx(pdev, 0); + pcim_intx(pdev, 0); =20 /* * Config offset 0x98 is "Extended Control and Status Register 0" --=20 2.47.0 From nobody Tue Nov 26 21:39:34 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=1729018358; cv=none; d=zohomail.com; s=zohoarc; b=SnelqHCUgB9yJscvhFj1rqIHnLkeI4hsANl8Y++CGztHQhuxXbNjphLArRkpRo33TyZae8UDzqggTdYySho8lBfw41yshafcA4S9z2SSyafgdQxBRHJkVXNw//NmvaZt8RR0BNmkKtcL62UHZH9B3JKCU+719axpAfqmdFYxLJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729018358; 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=Y8By1s5DNgX9TQd6/BhnQDktT5vhu3DwbP7hhC4pXIE=; b=E6QOt8LD3fs4ICy6Zk/j9PH5De6fOSgUnEalJONJhZ8qR6nTqy44sIkMxXEtZKoP2wINe5bS1MUVssd2hXGevx8iYnUs/wKL/1clqu9xDVOWhrfKseZ37QH27gtwoOMefHW/BS5K7HFae3JqDujl1ycxvh0JUzLOTouYhyJNiOg= 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 1729018358512953.7578492799407; Tue, 15 Oct 2024 11:52:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.819337.1232713 (Exim 4.92) (envelope-from ) id 1t0meY-0001Qz-HQ; Tue, 15 Oct 2024 18:52:18 +0000 Received: by outflank-mailman (output) from mailman id 819337.1232713; Tue, 15 Oct 2024 18:52:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t0meY-0001QJ-BN; Tue, 15 Oct 2024 18:52:18 +0000 Received: by outflank-mailman (input) for mailman id 819337; Tue, 15 Oct 2024 18:52:16 +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 1t0meW-0006G4-O6 for xen-devel@lists.xenproject.org; Tue, 15 Oct 2024 18:52:16 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 985f0d3b-8b26-11ef-a0be-8be0dac302b0; Tue, 15 Oct 2024 20:52:16 +0200 (CEST) Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-HHsz9RP4P4OEz0tNjkTDfA-1; Tue, 15 Oct 2024 14:52:14 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a9a2593e9e9so97400166b.0 for ; Tue, 15 Oct 2024 11:52:13 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.52.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:52:11 -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: 985f0d3b-8b26-11ef-a0be-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018335; 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=Y8By1s5DNgX9TQd6/BhnQDktT5vhu3DwbP7hhC4pXIE=; b=FIm8lxnLvCZC6syad7dr5VuHqhpnPHpVFdO6FSXxbltJpDrhAOxmukyicJltSYdCfGvSba 7bvl5lBdbJOnaebHjlq3HAtMVKwGlqncXOzb3eQ/j4bgSUGHscqe8bvU9TPAaXbK5yYQJ0 bHCLroVDsbGrgYt/gknTjfzAL8YvK2Q= X-MC-Unique: HHsz9RP4P4OEz0tNjkTDfA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018333; x=1729623133; 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=Y8By1s5DNgX9TQd6/BhnQDktT5vhu3DwbP7hhC4pXIE=; b=ckXF3EAgvZ7PeiahL9p0Pz/UkLOaB/SdDC70hhGlctaPRSDq6od/D7CSRWgWJZXK5I UuO+pkWzsjMj83S++Z3x55DSrPw583adKfWyx3kxXlrroJ7zSAlcMDRAUbgT5mGmzHMR 9Ev8w0NUjbzHuYFIX5I/cLqRxmKtJDSJh2Jo6tNkyjb9BNNXsqqSTMBx1/2pCmL4ieq4 20v5Z1RKKpjcZNtECWHJssEk5ZebuZ9EeLzFSJ0U+y/UmDcvXlFepBXho+oPoIWMdHY5 FdKYlxZ7F336VFoYApaza+bO/erTM3J3Iu3MqXXBML9HcM6pbyZ0Xs4SQchu4mToRYuq 0zRg== X-Forwarded-Encrypted: i=1; AJvYcCXeT6Cz6TH8ttYdflnI2m6uJVoW8/szo8qvD15bfS6wr0lHn9omyTn+30yKSN6eWDOqtQIKIXAN5vw=@lists.xenproject.org X-Gm-Message-State: AOJu0Yz5EBWshUYaFwuip1XFvluZHWVHFs6zjedSmpK0czYiAa2BQy4T y5Z/wnpE549MKnybQyi8hQRjlwNKX4IcU6PgZiBiKAntQbvozzUX+uF0Bx1dy6u+hk1Uy99ESsM lkwVHW5PMp6uoM+pRyQZ2tU4Gxq/FjkOb8EVLruA2POXR95SC7nnS7vnzmGE1ZD9T X-Received: by 2002:a17:907:7296:b0:a99:398b:59a2 with SMTP id a640c23a62f3a-a99e3ea2b27mr1249221366b.54.1729018332774; Tue, 15 Oct 2024 11:52:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVMiEMyqRAKWpWp2L+WAD0bOjYiITCR1i/AfinVgUXX5Av5wUs1Mv5vuWKI1T3DD0pJ93RAg== X-Received: by 2002:a17:907:7296:b0:a99:398b:59a2 with SMTP id a640c23a62f3a-a99e3ea2b27mr1249213666b.54.1729018332219; Tue, 15 Oct 2024 11:52:12 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 10/13] wifi: qtnfmac: use always-managed version of pcim_intx() Date: Tue, 15 Oct 2024 20:51:20 +0200 Message-ID: <20241015185124.64726-11-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-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: 1729018359131116600 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. qtnfmac enables its PCI-Device with pcim_enable_device(). Thus, it needs the always-managed version. Replace pci_intx() with pcim_intx(). Signed-off-by: Philipp Stanner Acked-by: Kalle Valo --- drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c b/drivers/n= et/wireless/quantenna/qtnfmac/pcie/pcie.c index f66eb43094d4..3adcfac2886f 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c @@ -204,7 +204,7 @@ static void qtnf_pcie_init_irq(struct qtnf_pcie_bus_pri= v *priv, bool use_msi) =20 if (!priv->msi_enabled) { pr_warn("legacy PCIE interrupts enabled\n"); - pci_intx(pdev, 1); + pcim_intx(pdev, 1); } } =20 --=20 2.47.0 From nobody Tue Nov 26 21:39:34 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9185720265A for ; Tue, 15 Oct 2024 18:52:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729018341; cv=none; b=gboVnsGwkaQq2+0knyGsUSLrknkbqotuxi9JlboV/wdixRY2IWlUf9ADLbLw/Rn8HV6UHBYGaIwl5O70A5oyMwLPx0CA0iUnzJ9nL1duRJ2n7Dhq8M+YJzy3ytdOwsYZ0PbiAgsSI5JTTpMbRSoW/kfW6kpo3c+D4WtHOxtYx44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729018341; c=relaxed/simple; bh=aAbe7GmqFC4E4dG0vzWtJY0/IVRJ0ypsn5oCbly1PXY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tkmuHGauiYXu/Kx1NXyLAT7OS/6pHAOjBxHWPezy05sAR4Sw3Bocn5TgwmCmM7apNjGPZc/BTHaP+7QGlKMG+eYrMpMgKFhr26ERZd9gnJ9M+LR4SoVurxuPdXYLI7Zj/OCGSHBHcuBhcvkS/Yfcl4Qegy9dnGx1NQqDBP0Gmi0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=AyzJ9r73; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AyzJ9r73" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nkAJx4kdHqc1uo2Ugvp3a9JlaC6teLxc6IU39omygl8=; b=AyzJ9r73d5AXa+nOnllYHXJaszAnjtZwafE24E6XNz7vyTPqVThDPYyNv0vZtC1wdCesCG jDk7ctasL+9MKppdkB16RQxmfT6T2gkcF4jlsJGafGjaOHLFiI7a4PtJpewST7sNX6+XAT a7TPQeYTbbA2CLe20hJGPOiRu84Ycv0= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-475-N7oebwSiOku3HQnpilN--g-1; Tue, 15 Oct 2024 14:52:16 -0400 X-MC-Unique: N7oebwSiOku3HQnpilN--g-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a99efc7d881so218152166b.1 for ; Tue, 15 Oct 2024 11:52:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018335; x=1729623135; 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=nkAJx4kdHqc1uo2Ugvp3a9JlaC6teLxc6IU39omygl8=; b=WTq8zXWbGbjz8eNUdYH4Yeda2+wC5DnuoEgTOyxMsWTmKEal7UO1ktsShvuqB3k8eH WwCAK2R/SYBzJDRz4paAgbunDWBWnOZrpdVN3bi6oo3q42SczOOs4H2FP7zYdngykW+d WlY8xHsZ0V8b16yGGaA21FOeC+XH79C+3T2jZ/feBsIJ8YGuLEErybLOMlbDlZKgx0d1 jtsBkdvHViMFeDa4uBLoF7fC3Wuw1j7zq6zvolhS9J1pgyGxc+Mj2e1lT9LVDqc4yLog HPrf21S1UUYH3am6F9lVN7HG+BjWNgzToKiAYmz7SN0PKeWPeDWyvpONZAIFI7IjI+lu nGuw== X-Forwarded-Encrypted: i=1; AJvYcCUf+zroGkVRM2gX8zbowk9Yhj9iLdEDpzcWeV7hYtq1emgjTuf2xtr5rSlsQGN5ZSaJ5u1YVnkUDtg8Zd0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywt5ah36hoio/UstUjn7o6jIGcyseLnCtOtu7cMP2M6Z+Ipwf2f 2HK6tqLJJ8FMs9ajo+iFPjKIcnllyFzjF1Xsr8srzBcJtDvWa4GreaI2QjXzdg22ChehPHso/dR yKt+8flpABS5RRKAxZt2Vzd33SOolZ2jNMA4YgnZefhFZGgH/LGkK8vy0gBcPUA== X-Received: by 2002:a17:907:3f9a:b0:a9a:597:8cca with SMTP id a640c23a62f3a-a9a05978db6mr977637566b.45.1729018335337; Tue, 15 Oct 2024 11:52:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtzFRtQHPl8Fct9iuZuGo9S3vsShVLZO8po30QG967TcviSYGZFyEBgz7XqihkkBKNzop8BQ== X-Received: by 2002:a17:907:3f9a:b0:a9a:597:8cca with SMTP id a640c23a62f3a-a9a05978db6mr977631966b.45.1729018334888; Tue, 15 Oct 2024 11:52:14 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:52:14 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org, Basavaraj Natikar Subject: [PATCH 11/13] HID: amd_sfh: Use always-managed version of pcim_intx() Date: Tue, 15 Oct 2024 20:51:21 +0200 Message-ID: <20241015185124.64726-12-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-1-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. All users of amd_mp2_pci_remove(), where pci_intx() is used, call pcim_enable_device(), which is why the driver needs the always-managed version. Replace pci_intx() with pcim_intx(). Signed-off-by: Philipp Stanner Acked-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 4 ++-- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-h= id/amd_sfh_pcie.c index 0c28ca349bcd..48cfd0c58241 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -122,7 +122,7 @@ int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata) { int rc; =20 - pci_intx(privdata->pdev, true); + pcim_intx(privdata->pdev, true); =20 rc =3D devm_request_irq(&privdata->pdev->dev, privdata->pdev->irq, amd_sfh_irq_handler, 0, DRIVER_NAME, privdata); @@ -248,7 +248,7 @@ static void amd_mp2_pci_remove(void *privdata) struct amd_mp2_dev *mp2 =3D privdata; amd_sfh_hid_client_deinit(privdata); mp2->mp2_ops->stop_all(mp2); - pci_intx(mp2->pdev, false); + pcim_intx(mp2->pdev, false); amd_sfh_clear_intr(mp2); } =20 diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/am= d-sfh-hid/sfh1_1/amd_sfh_init.c index db36d87d5634..ec9feb8e023b 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c @@ -289,7 +289,7 @@ static void amd_mp2_pci_remove(void *privdata) sfh_deinit_emp2(); amd_sfh_hid_client_deinit(privdata); mp2->mp2_ops->stop_all(mp2); - pci_intx(mp2->pdev, false); + pcim_intx(mp2->pdev, false); amd_sfh_clear_intr(mp2); } =20 --=20 2.47.0 From nobody Tue Nov 26 21:39:34 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E82B32281DB for ; Tue, 15 Oct 2024 18:52:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729018345; cv=none; b=IfRXR3KmhP/IpG1ggOkUNlHZ53XZPzEzPvURGnTtt/EDxZ04Mwccv6wfpFFCbOV+n3qWJgj7r6Ofeb2+r4toqi7rlvPnNLXmXH/2phoqTEAJdA0vDRpEbEvkhoPCWKDeNiRRoAiwgKuNAeWzswtlGkGFJgAnN/Ti8/Rqu9XD8YY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729018345; c=relaxed/simple; bh=fdw035rCdwMOQJJEWabNUDilY7julNkLgF3LGiGK664=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OIulD0UY2WlXIunkT6tqPjtBSacZ6TwX2g4uxTQI4nOKuEk1krF9LHin5xUUUYokFp93PUJ4HpRkWg4mWN4xM+KM5UjDR73rPLO6aXI01oXipQX6l87nWavkuHdhXrKddr779ZktHY8TBzGJ2LyAE9bgKi9qT5igrtcxh7egRGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hdCWwKTt; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hdCWwKTt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gRWF4l7RXrDlZGfZLpCnJ3qwA/L5ZI5EY2R8A6I+3b8=; b=hdCWwKTtobtOKoIekKiH0U6609r3w5TBgJcsa1hVIKDkd8nwX4o8J4lYuZej92r0tf5cVy NzUQSOTOessdBxYed+apCBIOXbEV/srGEOn9xujbD9rhEccKjEsmMDLw3nY9CIUyqufcaU bXdq1Wk4kkl1V+dWctLXRKDLNgrSzBE= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-qR74cD3APza4ykNyhJbMMg-1; Tue, 15 Oct 2024 14:52:20 -0400 X-MC-Unique: qR74cD3APza4ykNyhJbMMg-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5c9362c26a9so4060056a12.0 for ; Tue, 15 Oct 2024 11:52:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018339; x=1729623139; 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=gRWF4l7RXrDlZGfZLpCnJ3qwA/L5ZI5EY2R8A6I+3b8=; b=Rqk/QSncgV09T5JlODt6RtQPwIhI5Uo69l324Wj9LUNTHmvFGrdaF9DvFqlfmlnKGO OqTZh24T4w8wdmiX1RrXNXAEso+9hfRkWAKRCuUESO9G6jpIuzL7qM5Lw1wl0dX8dLP/ UVU7RC17g1m5M11pCrphoCs8zvFAgnJFleWm0tVmHnBsyF8WVXzFuaUw3LCaSU55wosx uEyHjDgPFh7gKkxRNAIXojchmOmDrzgazz4S6uBddvGN2ug9paXrcTUUeIXP9vBEc2VK 28foJ5eX00WZ2GWLoQaeldyaXgOmEAQnqk/lt+YwC7WnpgUjYQsU3glwIbIs62f5hVWs AUaw== X-Forwarded-Encrypted: i=1; AJvYcCW/Wph9V7v1P+0s3vhj68FigrzT2h/CG1PNOP0DJAEVDo1SO1wz7JfZ2sd3MZ6jghcyr2EW8DOMh1ycMSE=@vger.kernel.org X-Gm-Message-State: AOJu0YxOVRlz3DVAyWlbNLDNNiR6YWg+eu8x7js/DOx+WnBegORHhdmq CKdQvLtMpG3iOoI/wT7QQ1+Qlz5VDlNsVljv1k6L3Y3yGBPRKf5OIT2ZYY310G5DPoiXK63M4A9 jFqpUQjKo47mPbq8jtTM6//Hb7NrCuylaccLsBYMMPMbV+bD7kGM0lVLoMUUjpQ== X-Received: by 2002:a05:6402:26ce:b0:5c9:74e3:acbb with SMTP id 4fb4d7f45d1cf-5c974e3b178mr8124733a12.10.1729018338999; Tue, 15 Oct 2024 11:52:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgrJeKaKX4m4zRoSkTZ2iU9WDo14/3/71DwH5+IKd6TCcrfjCz2uiFI8ehE0urDwBhnYN1MQ== X-Received: by 2002:a05:6402:26ce:b0:5c9:74e3:acbb with SMTP id 4fb4d7f45d1cf-5c974e3b178mr8124648a12.10.1729018338365; Tue, 15 Oct 2024 11:52:18 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.52.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:52:17 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 12/13] Remove devres from pci_intx() Date: Tue, 15 Oct 2024 20:51:22 +0200 Message-ID: <20241015185124.64726-13-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-1-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" pci_intx() is a hybrid function which can sometimes be managed through devres. This hybrid nature is undesirable. Since all users of pci_intx() have by now been ported either to always-managed pcim_intx() or never-managed pci_intx_unmanaged(), the devres functionality can be removed from pci_intx(). Consequently, pci_intx_unmanaged() is now redundant, because pci_intx() itself is now unmanaged. Remove the devres functionality from pci_intx(). Have all users of pci_intx_unmanaged() call pci_intx(). Remove pci_intx_unmanaged(). Signed-off-by: Philipp Stanner --- drivers/misc/cardreader/rtsx_pcr.c | 2 +- drivers/misc/tifm_7xx1.c | 6 +-- .../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- drivers/net/ethernet/brocade/bna/bnad.c | 2 +- drivers/ntb/hw/amd/ntb_hw_amd.c | 4 +- drivers/ntb/hw/intel/ntb_hw_gen1.c | 2 +- drivers/pci/devres.c | 4 +- drivers/pci/msi/api.c | 2 +- drivers/pci/msi/msi.c | 2 +- drivers/pci/pci.c | 42 +------------------ drivers/vfio/pci/vfio_pci_core.c | 2 +- drivers/vfio/pci/vfio_pci_intrs.c | 10 ++--- drivers/xen/xen-pciback/conf_space_header.c | 2 +- include/linux/pci.h | 1 - 14 files changed, 22 insertions(+), 61 deletions(-) diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/r= tsx_pcr.c index e25e6d560dd7..be3d4e0e50cc 100644 --- a/drivers/misc/cardreader/rtsx_pcr.c +++ b/drivers/misc/cardreader/rtsx_pcr.c @@ -1057,7 +1057,7 @@ static int rtsx_pci_acquire_irq(struct rtsx_pcr *pcr) } =20 pcr->irq =3D pcr->pci->irq; - pci_intx_unmanaged(pcr->pci, !pcr->msi_en); + pci_intx(pcr->pci, !pcr->msi_en); =20 return 0; } diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index 5f9c7ccae8d2..1d54680d6ed2 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c @@ -327,7 +327,7 @@ static int tifm_7xx1_probe(struct pci_dev *dev, goto err_out; } =20 - pci_intx_unmanaged(dev, 1); + pci_intx(dev, 1); =20 fm =3D tifm_alloc_adapter(dev->device =3D=3D PCI_DEVICE_ID_TI_XX21_XX11_FM ? 4 : 2, &dev->dev); @@ -368,7 +368,7 @@ static int tifm_7xx1_probe(struct pci_dev *dev, err_out_free: tifm_free_adapter(fm); err_out_int: - pci_intx_unmanaged(dev, 0); + pci_intx(dev, 0); pci_release_regions(dev); err_out: if (!pci_dev_busy) @@ -392,7 +392,7 @@ static void tifm_7xx1_remove(struct pci_dev *dev) tifm_7xx1_sock_power_off(tifm_7xx1_sock_addr(fm->addr, cnt)); =20 iounmap(fm->addr); - pci_intx_unmanaged(dev, 0); + pci_intx(dev, 0); pci_release_regions(dev); =20 pci_disable_device(dev); diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net= /ethernet/broadcom/bnx2x/bnx2x_main.c index 2ae63d6e6792..678829646cec 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -1669,7 +1669,7 @@ static void bnx2x_igu_int_enable(struct bnx2x *bp) REG_WR(bp, IGU_REG_PF_CONFIGURATION, val); =20 if (val & IGU_PF_CONF_INT_LINE_EN) - pci_intx_unmanaged(bp->pdev, true); + pci_intx(bp->pdev, true); =20 barrier(); =20 diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet= /brocade/bna/bnad.c index 2b37462d406e..ece6f3b48327 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c @@ -2669,7 +2669,7 @@ bnad_enable_msix(struct bnad *bnad) } } =20 - pci_intx_unmanaged(bnad->pcidev, 0); + pci_intx(bnad->pcidev, 0); =20 return; =20 diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_am= d.c index b146f170e839..d687e8c2cc78 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -791,7 +791,7 @@ static int ndev_init_isr(struct amd_ntb_dev *ndev, err_msi_enable: =20 /* Try to set up intx irq */ - pci_intx_unmanaged(pdev, 1); + pci_intx(pdev, 1); =20 rc =3D request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED, "ndev_irq_isr", ndev); @@ -831,7 +831,7 @@ static void ndev_deinit_isr(struct amd_ntb_dev *ndev) if (pci_dev_msi_enabled(pdev)) pci_disable_msi(pdev); else - pci_intx_unmanaged(pdev, 0); + pci_intx(pdev, 0); } } =20 diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_= hw_gen1.c index 9ad9d7fe227e..079b8cd79785 100644 --- a/drivers/ntb/hw/intel/ntb_hw_gen1.c +++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c @@ -445,7 +445,7 @@ int ndev_init_isr(struct intel_ntb_dev *ndev, =20 /* Try to set up intx irq */ =20 - pci_intx_unmanaged(pdev, 1); + pci_intx(pdev, 1); =20 rc =3D request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED, "ndev_irq_isr", ndev); diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index d32827a1f2f4..6f8f712fe34e 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -416,7 +416,7 @@ static void pcim_intx_restore(struct device *dev, void = *data) struct pci_dev *pdev =3D to_pci_dev(dev); struct pcim_intx_devres *res =3D data; =20 - pci_intx_unmanaged(pdev, res->orig_intx); + pci_intx(pdev, res->orig_intx); } =20 static struct pcim_intx_devres *get_or_create_intx_devres(struct device *d= ev) @@ -453,7 +453,7 @@ int pcim_intx(struct pci_dev *pdev, int enable) return -ENOMEM; =20 res->orig_intx =3D !enable; - pci_intx_unmanaged(pdev, enable); + pci_intx(pdev, enable); =20 return 0; } diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c index c95e2e7dc9ab..b956ce591f96 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_unmanaged(dev, 1); + pci_intx(dev, 1); return 1; } } diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index 53f13b09db50..3a45879d85db 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_unmanaged(dev, enable); + pci_intx(dev, enable); } =20 static void pci_msi_set_enable(struct pci_dev *dev, int enable) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d7fd0772a885..7ce1d0e3a1d5 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4477,16 +4477,13 @@ void pci_disable_parity(struct pci_dev *dev) } =20 /** - * pci_intx - enables/disables PCI INTx for device dev, unmanaged version + * pci_intx - enables/disables PCI INTx for device dev * @pdev: the PCI device to operate on * @enable: boolean: whether to enable or disable PCI INTx * * Enables/disables PCI INTx for device @pdev - * - * This function behavios identically to pci_intx(), but is never managed = with - * devres. */ -void pci_intx_unmanaged(struct pci_dev *pdev, int enable) +void pci_intx(struct pci_dev *pdev, int enable) { u16 pci_command, new; =20 @@ -4502,41 +4499,6 @@ void pci_intx_unmanaged(struct pci_dev *pdev, int en= able) =20 pci_write_config_word(pdev, PCI_COMMAND, new); } -EXPORT_SYMBOL_GPL(pci_intx_unmanaged); - -/** - * pci_intx - enables/disables PCI INTx for device dev - * @pdev: the PCI device to operate on - * @enable: boolean: whether to enable or disable PCI INTx - * - * Enables/disables PCI INTx for device @pdev - * - * NOTE: - * This is a "hybrid" function: It's normally unmanaged, but becomes manag= ed - * when pcim_enable_device() has been called in advance. This hybrid featu= re is - * DEPRECATED! If you want managed cleanup, use pcim_intx() instead. - */ -void pci_intx(struct pci_dev *pdev, int enable) -{ - u16 pci_command, new; - - pci_read_config_word(pdev, PCI_COMMAND, &pci_command); - - if (enable) - new =3D pci_command & ~PCI_COMMAND_INTX_DISABLE; - else - new =3D pci_command | PCI_COMMAND_INTX_DISABLE; - - if (new !=3D pci_command) { - /* Preserve the "hybrid" behavior for backwards compatibility */ - if (pci_is_managed(pdev)) { - WARN_ON_ONCE(pcim_intx(pdev, enable) !=3D 0); - return; - } - - pci_write_config_word(pdev, PCI_COMMAND, new); - } -} EXPORT_SYMBOL_GPL(pci_intx); =20 /** diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_c= ore.c index 90240c8d51aa..1ab58da9f38a 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_unmanaged(pdev, 0); + pci_intx(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 40abb0b937a2..8382c5834335 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_unmanaged(pdev, 0); + pci_intx(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_unmanaged(pdev, 0); + pci_intx(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_unmanaged(pdev, 1); + pci_intx(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_unmanaged(pdev, !ctx->masked); + pci_intx(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_unmanaged(pdev, 0); + pci_intx(pdev, 0); =20 vdev->irq_type =3D VFIO_PCI_NUM_IRQS; } diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-= pciback/conf_space_header.c index 8d26d64232e8..fc0332645966 100644 --- a/drivers/xen/xen-pciback/conf_space_header.c +++ b/drivers/xen/xen-pciback/conf_space_header.c @@ -106,7 +106,7 @@ static int command_write(struct pci_dev *dev, int offse= t, u16 value, void *data) =20 if (dev_data && dev_data->allow_interrupt_control && ((cmd->val ^ value) & PCI_COMMAND_INTX_DISABLE)) - pci_intx_unmanaged(dev, !(value & PCI_COMMAND_INTX_DISABLE)); + pci_intx(dev, !(value & PCI_COMMAND_INTX_DISABLE)); =20 cmd->val =3D value; =20 diff --git a/include/linux/pci.h b/include/linux/pci.h index 6b8cde76d564..1b2a6dd1dfed 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1353,7 +1353,6 @@ int __must_check pcim_set_mwi(struct pci_dev *dev); int pci_try_set_mwi(struct pci_dev *dev); void pci_clear_mwi(struct pci_dev *dev); void pci_disable_parity(struct pci_dev *dev); -void pci_intx_unmanaged(struct pci_dev *pdev, int enable); void pci_intx(struct pci_dev *dev, int enable); bool pci_check_and_mask_intx(struct pci_dev *dev); bool pci_check_and_unmask_intx(struct pci_dev *dev); --=20 2.47.0 From nobody Tue Nov 26 21:39:34 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D51772296CF for ; Tue, 15 Oct 2024 18:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729018347; cv=none; b=tBurp/SpbdaB5zxrfccZSiujW2YcuCdKHV+Th3kmr8nJgQdo+KWXC+/if4nRx4XSXKgUS9fZ+IXe55kvH2hD76xQIiELurSw3yN016je3WL0w+4C6enkbUuA+krddkORZVey80ytK6yyt/jOJg11tjJApDNNimHJCiXE/IFQ9/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729018347; c=relaxed/simple; bh=ZGl79UfjjHp/dbanoMIKpsfiBb1RGuN8b5mG9T34Oqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n8hWaNW4NS9Pu/vyc4b+KAtyXd5k7p8u02qsk1Qnsf/+4CuGXhX9jUD+CjNpvAV5c0dj6KAGj24UIS71rMhLEmjfNwYj+yhpAfABCSHFmvexyzrQzo/WXQz5zA2uU6FFRMY00rPvFe4P0Wvnkj74DF7IJIvRd/DhfwalosDAgDg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZpEQlPAs; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZpEQlPAs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729018344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GXTMrjROGaTcKBpC5zD8IzpbS8kTElR36tpy9F32tfY=; b=ZpEQlPAsYeOvXntrSbW0ABh7+2tSnwXa7WDwEHLDoPzkzPlltrF8A4RHQEjn0jScLBUlis wmd0W+PAX8Yx9bEeoXRDah/Ys1P/curCYyNwbglXIlutUGsLFDcqyRME90m3ZSCtEYFUp5 H9moGF9JCYMYdcT+qjaQvzQDOz9LTZQ= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-NU25J-VNOveCGcw_YH-8jw-1; Tue, 15 Oct 2024 14:52:22 -0400 X-MC-Unique: NU25J-VNOveCGcw_YH-8jw-1 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c9166079c0so4114679a12.3 for ; Tue, 15 Oct 2024 11:52:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729018341; x=1729623141; 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=GXTMrjROGaTcKBpC5zD8IzpbS8kTElR36tpy9F32tfY=; b=MylEDOUOyWennzPHBDa0FZoff/RpnGoEd4Gxo2dw+L+sFUY8uJn914hryMsrlGibse zX8NL6HLujRF0goD7jWktLfNHOgsV249qUFQwmX+u0m6824GY4vDRvm0TWH6pp4wL5UU Iliit98qzOP00YcIzMclEfjhS6hvnzRTXCImLgly6qit2KmCjAV6ZKFgTgTuYfgQMXuq cVuZ8HI3bx6oS19LtL1AA+NHSQyNYO7xMt0ONg+FURiHvxwn4Gto4ExcyJxjkOcMOSBs ptYkXCXgkR/eQ3asB6gJzLbzEa0FobFCmsE54melE+x9jh2fPDn7i304CNwFcNAWpCiH 4OFg== X-Forwarded-Encrypted: i=1; AJvYcCVNIjuUjptMvgGmqMQ0HQl2NKpzOsvKSO6BwfSUcwA3LCWZn0ObmFvaM0BllyjagwEt/E2k8cxCHCm/d5k=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6zBS30j84TlwTnozHzNhgD+jS08JT9zet9wy29qi9vvyIPUa2 02Rs6AruERqTFTB2aoccmOa6Z2nN/Jr+Kgn2D3j3xGVEPhMHVRAJkAnJl50aNB6kPokbVofeMPH hcRodicrgUCQmmKzow6uCjUHeXMurC14rbXpycBgZ1wSMEUkYc6Hfq5BCYcBpRQ== X-Received: by 2002:a05:6402:520f:b0:5c5:ba82:c3b1 with SMTP id 4fb4d7f45d1cf-5c95ac4e471mr9747002a12.29.1729018341587; Tue, 15 Oct 2024 11:52:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4IRS8nhPSbHHMGAr1esFr/1sORzxV4dHhLUSla/ENaT5Qe2x1SJKm+qMzu8Ky2rtxd6imbQ== X-Received: by 2002:a05:6402:520f:b0:5c5:ba82:c3b1 with SMTP id 4fb4d7f45d1cf-5c95ac4e471mr9746938a12.29.1729018341069; Tue, 15 Oct 2024 11:52:21 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d5d5a0006e2615320d1d4db.dip.versatel-1u1.de. [2001:16b8:2d5d:5a00:6e2:6153:20d1:d4db]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d39a9a2sm974438a12.0.2024.10.15.11.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 11:52:20 -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 , Chen Ni , Mario Limonciello , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra 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, linux-sound@vger.kernel.org Subject: [PATCH 13/13] PCI: Deprecate pci_intx(), pcim_intx() Date: Tue, 15 Oct 2024 20:51:23 +0200 Message-ID: <20241015185124.64726-14-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015185124.64726-1-pstanner@redhat.com> References: <20241015185124.64726-1-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" pci_intx() and its managed counterpart pcim_intx() only exist for older drivers which have not been ported yet for various reasons. Future drivers should preferably use pci_alloc_irq_vectors(). Mark pci_intx() and pcim_intx() as deprecated and encourage usage of pci_alloc_irq_vectors() in its place. Signed-off-by: Philipp Stanner --- drivers/pci/devres.c | 5 ++++- drivers/pci/pci.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index 6f8f712fe34e..4c76fc063104 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -435,7 +435,7 @@ static struct pcim_intx_devres *get_or_create_intx_devr= es(struct device *dev) } =20 /** - * pcim_intx - managed pci_intx() + * pcim_intx - managed pci_intx() (DEPRECATED) * @pdev: the PCI device to operate on * @enable: boolean: whether to enable or disable PCI INTx * @@ -443,6 +443,9 @@ static struct pcim_intx_devres *get_or_create_intx_devr= es(struct device *dev) * * Enable/disable PCI INTx for device @pdev. * Restore the original state on driver detach. + * + * This function is DEPRECATED. Do not use it in new code. + * Use pci_alloc_irq_vectors() instead (there is no managed version, curre= ntly). */ int pcim_intx(struct pci_dev *pdev, int enable) { diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 7ce1d0e3a1d5..dc69e23b8982 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4477,11 +4477,14 @@ void pci_disable_parity(struct pci_dev *dev) } =20 /** - * pci_intx - enables/disables PCI INTx for device dev + * pci_intx - enables/disables PCI INTx for device dev (DEPRECATED) * @pdev: the PCI device to operate on * @enable: boolean: whether to enable or disable PCI INTx * * Enables/disables PCI INTx for device @pdev + * + * This function is DEPRECATED. Do not use it in new code. + * Use pci_alloc_irq_vectors() instead. */ void pci_intx(struct pci_dev *pdev, int enable) { --=20 2.47.0