From nobody Sun Dec 22 16:20:49 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=1733749643; cv=none; d=zohomail.com; s=zohoarc; b=KUrxsG/oI6f5vnY0ixnm2YvrP/PxUGZGM+0YjuUWl4zxBZgJ/7kkQ3lQMpX/EuAy+yjcWQordT5woLU88IJaVDO3odFo0pQFYP2Qb4T1gNd4zi5A4sWKkPtcucFfRiFXT37XHZjiTsouj23XdhorHuHmAsAhs1abQs7uy7muEug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733749643; 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=LjtlDqjVbjjdLVPvux+VnzDcjHru5NMyBrbq6sIUPEE=; b=kz4que3Ws8Wcp5Vd7Llf7hUPTbUdc0PMZhwajoZYOawPbE1hO3wnTqnX0BOgZ/U5/EN4qqMmQhOP0Ef53NZwdHDQ6MQAvHdYMara5Gfd61FVxEMIhgZ9/my93esRH85LcjcI4qRXD9ZAaLZoCYTE1iJoqoTrJSro+Y1DEQgdbXA= 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 1733749642532194.4934247475635; Mon, 9 Dec 2024 05:07:22 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.851186.1265305 (Exim 4.92) (envelope-from ) id 1tKdTU-0000cp-PA; Mon, 09 Dec 2024 13:06:56 +0000 Received: by outflank-mailman (output) from mailman id 851186.1265305; Mon, 09 Dec 2024 13:06:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTU-0000ci-MS; Mon, 09 Dec 2024 13:06:56 +0000 Received: by outflank-mailman (input) for mailman id 851186; Mon, 09 Dec 2024 13:06:55 +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 1tKdTT-0000OS-2L for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:06:55 +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 754b1de1-b62e-11ef-99a3-01e77a169b0f; Mon, 09 Dec 2024 14:06:53 +0100 (CET) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-573-RntLltv2P2OQe3fWt62NcQ-1; Mon, 09 Dec 2024 08:06:50 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-385e1339790so2818253f8f.2 for ; Mon, 09 Dec 2024 05:06:49 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:06:47 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 754b1de1-b62e-11ef-99a3-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749612; 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=LjtlDqjVbjjdLVPvux+VnzDcjHru5NMyBrbq6sIUPEE=; b=boiqgX+io6aHOSt616ajLORqvl0bmi2llFO3yxsK1RvPY1KVt0Idnb2gruX6jHdUtGVdhc BEuVA1FDkOsx34vrEdLZtEw6iCkgS2szP3jZ3fSu9nIVUbAw5e2EunoxfZFsB1Utkc9iPA DjxDtQmnGW03pf7Lz41Dw93H8K3jtD0= X-MC-Unique: RntLltv2P2OQe3fWt62NcQ-1 X-Mimecast-MFC-AGG-ID: RntLltv2P2OQe3fWt62NcQ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749608; x=1734354408; 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=LjtlDqjVbjjdLVPvux+VnzDcjHru5NMyBrbq6sIUPEE=; b=ejDzf6VF5O+HnWi19qz5uwSu1gv5Lq2bzA4uUTsbhNLliOiXFuucInBhE/WaVZsfRp AH2w6NzGEotfuaaCdv3/WiUZMzr9MttvItiazJ9LY2Fa15xp0m5VxsDia7B+I60L7ENE F5yP/p7sx23WyyaUOSigCnqBtG5+JeJJL4WvpCN7nwPkmaFtZFp6ZbBRJW8LdrBJwrge IbdPhSdG0+ECrmFaMgWDCaduCprLLmEdraKzEzVo6clYbLjJ7B+av/oYBuG/YVzYYsR2 jMNUAX2owG4AiO5npkExeVdUHqwTLyLP050Mh6UOCdMwNsGzAiKR/MW5CWoct0Sf5aTE JuTQ== X-Forwarded-Encrypted: i=1; AJvYcCVTaYanweuSw46135x4DD1eM6nMI4gXEVzQuLCxazfpDynYextrJpMw5torbxRKrEMpQPUKQ3Jv6Jg=@lists.xenproject.org X-Gm-Message-State: AOJu0Yx++8hSPVyIcX6kAHFrYMGODo+y/UMLSkQiYkJbttIEm2TZU8Lj M6fptLQjMvJJ0T86HpKdUY71I2RHARnrKPxr+G2Yms8xbGmalYaEFgt1/7Yxos145hNmrha0+yG 1/2LTkLEfHUYtjdDssx3p0jrsCGEBf9wvR4VEcUZPtMXpqIeUpPUusiAKcXrqJnx2 X-Gm-Gg: ASbGncs8WjLa+RLQ4VIM4ziaNSsWP0IYjwSkB9XAEEOfSybsK4DS7bNr8+dpID6t2r7 pjHL18hu81yL4UhzyaH/l40ChwiwqB6HXLaZkXlCBrnIXrruOcJggv8yBRP7129Q/3yf5XxHfYq j+4azQDqpz1yOsI76CYWme3YmBAr5z1c6Ec4oK0IroDBf+fMSdrtGg+R4JTQyC0l7G6kj9nsstZ YfobmhLmgOCpKYmCwZvjf9MduN0tcPeztKJhh28r/56npeORJEHq7QKWvPUyx1krFpQ5hAYLuYj l/8SZ240 X-Received: by 2002:a5d:6c65:0:b0:385:ebaf:3824 with SMTP id ffacd0b85a97d-386453e1638mr347887f8f.27.1733749608211; Mon, 09 Dec 2024 05:06:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFe4lx/EENwtCaRxhJCz0NOg0TrCmZKbhSzjlYB6+7PsBpCd1abctGiIUuR4mdyx/fkgNv7cA== X-Received: by 2002:a5d:6c65:0:b0:385:ebaf:3824 with SMTP id ffacd0b85a97d-386453e1638mr347789f8f.27.1733749607612; Mon, 09 Dec 2024 05:06:47 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 01/11] PCI: Prepare removing devres from pci_intx() Date: Mon, 9 Dec 2024 14:06:23 +0100 Message-ID: <20241209130632.132074-3-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 56JekqhS3SovCf_AbJ7MI7OlWXqVdw1HuXxTJv9Jbm8_1733749608 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1733749645210116600 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() has 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 | 29 +++++++++++++++++++++++++++++ include/linux/pci.h | 2 ++ 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index 3b59a86a764b..3594eea37993 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 0b29ec6e8e5e..30d17ec771fc 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4482,6 +4482,35 @@ void pci_disable_parity(struct pci_dev *dev) } } =20 +/** + * pci_intx_unmanaged - 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 db9b47ce3eef..b5eb8bda655d 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1350,6 +1350,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); @@ -2297,6 +2298,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); int pcim_request_all_regions(struct pci_dev *pdev, const char *name); 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, --=20 2.47.1 From nobody Sun Dec 22 16:20:49 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=1733749643; cv=none; d=zohomail.com; s=zohoarc; b=AcnSM36r1m5euest9CocWbG/Kya46lnwDxi5+Rtfyy0dePaqLyTmZd1OdJkZMpq4Db6/vYCFccGJSZQVtd3vZR1JsMZXiGzglkbg72chkv9jXwumqBF285exbZKA8hToKGhcs180BV14AYy4B8U18ED2ApfYktF8NZlBN/FqmRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733749643; 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=JzWiWxh4LRhHWrBZAH8gP8nNmxU8jwjjwHhpaGNecfw=; b=eF3eS87fFuaU3tFc/VRlhhGpW0OXPURFx72UjWFjOLXIgikbsVawsNcx9HfqpyzO1QisTqddIcsIJGD5x/rKZmp/X0IVjRe2D4A5YrnOXP46MRgDwbjF8Yh5tIwzZeSVrCpJ3CSfcBTJRkgppJCr67DPh88w7BYRRa3h8BsxycQ= 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 173374964252939.988155805304245; Mon, 9 Dec 2024 05:07:22 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.851187.1265316 (Exim 4.92) (envelope-from ) id 1tKdTW-0000rK-4l; Mon, 09 Dec 2024 13:06:58 +0000 Received: by outflank-mailman (output) from mailman id 851187.1265316; Mon, 09 Dec 2024 13:06:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTW-0000rD-0h; Mon, 09 Dec 2024 13:06:58 +0000 Received: by outflank-mailman (input) for mailman id 851187; Mon, 09 Dec 2024 13:06:57 +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 1tKdTV-0000ch-98 for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:06:57 +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 7654070e-b62e-11ef-a0d5-8be0dac302b0; Mon, 09 Dec 2024 14:06:55 +0100 (CET) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-353-LOaZd975P36jbMOlT3Bxdw-1; Mon, 09 Dec 2024 08:06:52 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-434f15c1c8fso8812925e9.2 for ; Mon, 09 Dec 2024 05:06:52 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:06:49 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7654070e-b62e-11ef-a0d5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749614; 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=JzWiWxh4LRhHWrBZAH8gP8nNmxU8jwjjwHhpaGNecfw=; b=I2MU793kCJdxJqWTyIzOLeN324MDOAIZWMJja0gGcnDsxSHSaA29/T3dlUkmscviVXNiIS ITZ7sAM23lg0YyhO/j1V92jOxLUXwxC4+scckBibwmjVJ/pVr1z+cAqekNMX8/kw5Dtawo 9x5/6mPpQCGTNuvvADbsXdyJzSw2zQs= X-MC-Unique: LOaZd975P36jbMOlT3Bxdw-1 X-Mimecast-MFC-AGG-ID: LOaZd975P36jbMOlT3Bxdw X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749611; x=1734354411; 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=JzWiWxh4LRhHWrBZAH8gP8nNmxU8jwjjwHhpaGNecfw=; b=IC8E8oD7z/QrNevycVXHIgUUs7YGZmtfwINnZEIyYllslclfY9OvpvWp2+O2qEHH3u 1of0E6UqcYFWu8rMHLDSQaqI/iTsSneqWK39aFPPMGsknRwE6GIAgPiOExgq43RYeAi0 PigQukEXbH9pkOr+LuQraexTKXEzJgSZhMOKDCfP9NQ2Bom58TsnTuA8H51YpM+A877R llwyeNpZgK/7JaUCoUlQmcEa3OSRg1QFqYrR9ewjZh/lqhE5xDsUeiHFJ2aipKgl+n49 iDPw8tDwfXN8/wZa5/aHyw80Tb5R2xm7HWRB5QA9pCJoxnmGOVMzK2YAw6mCVfoPZX7y q/rA== X-Forwarded-Encrypted: i=1; AJvYcCW7DuNs81tnxjaUVUsxYJhole7w8qTUrTGy2+mITE4apu/Y2rjoedMb7FeX0P3V6DYFzU7bb7FzazI=@lists.xenproject.org X-Gm-Message-State: AOJu0YyRySCvMopfj+qhvB+NCOAgdppeK/G+7nwoaiRMHjTYUSa58qvg k4OvdMT9MH5hNGybekGbXW2XUfYedVJfSxdIThWTGNtv4rzZdThCG+iK1J1Xuhne8gXw5Z2CaDu +XVdHJGm9IkmxSU7QNChwkeZv13EH/kVwuwR/QKnJDejY8ZR+y6sdNKTnySnb0cbq X-Gm-Gg: ASbGncsBuR1Oeax9Kmi5BTstQ9ZWcngF4giPqZfMDQ5v/7ZlYyxa2wEDnUFa+s7qHkM ZgOBoSLzfEY31JKjfoH6q6IxEJzEBy3qzEKHYCRv+effIBV3EAIY69xvMFH7+s49IUK6iGK1BLs e+9UYA3ebLw5c8RtsaijJDwhVXRJY81P+mwbJyxqhnUW3uYPOPgWIdXC/cvL8kqUIi3pwgyM7ZO f3OcsktdhSoE1lIGBBGdg6QI47qarizH9xog4SBAUSb11kA8ALyCeTUBldWd6SC9w/mJYkn5RPN 69aJTYhY X-Received: by 2002:a05:6000:186c:b0:385:f465:12f8 with SMTP id ffacd0b85a97d-386453f6891mr224945f8f.47.1733749611248; Mon, 09 Dec 2024 05:06:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYLGzMuES8pL8UNwc6rduiHNSssmgKFMI0arqDxmQvwrHwV9r5BJKNGyDbmmGP7hHm3hITRA== X-Received: by 2002:a05:6000:186c:b0:385:f465:12f8 with SMTP id ffacd0b85a97d-386453f6891mr224791f8f.47.1733749609723; Mon, 09 Dec 2024 05:06:49 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 02/11] drivers/xen: Use never-managed version of pci_intx() Date: Mon, 9 Dec 2024 14:06:24 +0100 Message-ID: <20241209130632.132074-4-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 3gDdNv9p2cS8ouGS955YkhTnpQG_o4BuqQnhN5cId8o_1733749611 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1733749645028116600 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.1 From nobody Sun Dec 22 16:20:49 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=1733749652; cv=none; d=zohomail.com; s=zohoarc; b=T+u1Agoyy7gV9HLbpKQYo4tFuU7RiPpGK/XWFVrTzVlplhKNROvcMfAllH2xVZkicB8pgY9NxAIP81amSk29/M/bD7qyAne/6BXy0T84Bu1v72+0cy571fcWEbszL5+QG9DnmxktXOesQnFdnCqsPrQXT0UuhaV7OK9qKTdD6M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733749652; 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=BJlyFDGVHa1KIDhGsh03tIghv1/oE2/0tVlBeLCm6QY=; b=P4i+TMXbvShRv8pjWZrARzmN7PldVPS4CeIVBnWNTu5qdLRbodqfNoaV+DPZ96DxNbcTYl5ueeTN/PiAptBtOIRVYdVrkrKSMoil6tkGhSlie7zAxig004dLTsn2wHt2RWO+m3VpanZZY54XDme9Ptxcarme4zhDAqiSIFC0xu4= 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 1733749652324959.332301429824; Mon, 9 Dec 2024 05:07:32 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.851188.1265326 (Exim 4.92) (envelope-from ) id 1tKdTZ-00018Y-AZ; Mon, 09 Dec 2024 13:07:01 +0000 Received: by outflank-mailman (output) from mailman id 851188.1265326; Mon, 09 Dec 2024 13:07:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTZ-00018N-70; Mon, 09 Dec 2024 13:07:01 +0000 Received: by outflank-mailman (input) for mailman id 851188; Mon, 09 Dec 2024 13:06:59 +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 1tKdTX-0000ch-Qa for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:06:59 +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 78b0736b-b62e-11ef-a0d5-8be0dac302b0; Mon, 09 Dec 2024 14:06:59 +0100 (CET) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-60-xvUCrlphP5afoRypEeNXAg-1; Mon, 09 Dec 2024 08:06:55 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-385f0829430so2934808f8f.1 for ; Mon, 09 Dec 2024 05:06:54 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:06:52 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 78b0736b-b62e-11ef-a0d5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749617; 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=BJlyFDGVHa1KIDhGsh03tIghv1/oE2/0tVlBeLCm6QY=; b=Qlr8oNK28eNpw682MBL8U6SKkhMY5HjbyugMJQqarq/kxKRPxLdwOlOcGk88idw0DAkY6g 9025gnylQ1//eg6ZsJ+2FkNeW819UX70LrXGgO17U6/Akb9yuSuM5D0ZwLYTnoxU8w1E1C /nDYcE0dnWaG1X8D0BBb4Q0hAw0rkMc= X-MC-Unique: xvUCrlphP5afoRypEeNXAg-1 X-Mimecast-MFC-AGG-ID: xvUCrlphP5afoRypEeNXAg X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749613; x=1734354413; 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=BJlyFDGVHa1KIDhGsh03tIghv1/oE2/0tVlBeLCm6QY=; b=UmrWczkwFZ6DzVKtS+UvCHlehJ0K0AbkSGyEIweHQr0i1R9tpja9ULKHEkmqvWQM6i VxyUJsrHwXZpV22plcFZ/ERk7N/mp36Fo8now+/IazDwGCspKZHPe3/ZIOwIyQKcZz3b MOUmghjNuhskKc0Yj+al7oWdzNMaSfvcOzhkqEQcq8Y+tQomVSFstCvcaYs9wBh5YxJ0 b2kUr6wRyvhjjAgiUTzILrr6pyjKHQvDPckGHj7R8rWE/EH4xhaoZsHmhs3F2r8SCDKw aP3Giu/VGytFw3tBeM/modxNc7rQPZm7VWaiWnl/8zIO77aEid9c8tg5SfdeaG5zbWqp sVwA== X-Forwarded-Encrypted: i=1; AJvYcCUHl4CN4TIUl4n4HzANL9NCinl7ConNHq66t0JYWAZeNgNfBMyzBqgGoR1u///hl+nV3RMeI/lGqhQ=@lists.xenproject.org X-Gm-Message-State: AOJu0Ywd1cIax3Biy6ZtFkPOmzP3oXXXUmwX/Gcuf+Y+BTN2XtWGhqzG Zh6YdtAzjjCqsFUP4ZupOTDBugENo2l+rg4JU86W5ukeQkYqo53qqexw2vcxMlFI3VtLJHs4pVL R9aMRN0wKWAaVtn2wTd9NlB2QB/yrmUTGVpM0sYOHKtQko1f+uoMPhYoiFmzSECHu X-Gm-Gg: ASbGncuwftnq+Cm+S2pJCmXWAuQMRu1eCpQQl2irt45JrH7/4AUtBUwL7FMJ0auWUaq FZEGEUaxi2lCahdpETzbohMJG6hBdeHJr0jfoAooz0xWu1PxaCvE1PdQzZKt3jOkLUHpBwM65Vh CSNsrauLHUnm72OeZ8iepuCllG2vqt94JiKIWO/xEKa+79q0MrBKuSJrHuiKntGQAkMxfkBBMwI G6XjQlzbRh/+1Ie36TrVvAJWcOQKkkmVv1dHx6OiZ4JU6cdEgirdpk0JedfzPAQCIsN/McDP2uW O3ww31Bn X-Received: by 2002:a05:6000:2d08:b0:386:144d:680f with SMTP id ffacd0b85a97d-386453fd870mr188104f8f.54.1733749613282; Mon, 09 Dec 2024 05:06:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFj1wppsmKOkdvfdKSfuff+I9JjxqlZHOEEdHEk5K3zylRh/0qa/2JfnJnGp4etqXepLTEqow== X-Received: by 2002:a05:6000:2d08:b0:386:144d:680f with SMTP id ffacd0b85a97d-386453fd870mr188043f8f.54.1733749612866; Mon, 09 Dec 2024 05:06:52 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 03/11] net/ethernet: Use never-managed version of pci_intx() Date: Mon, 9 Dec 2024 14:06:25 +0100 Message-ID: <20241209130632.132074-5-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: sRO3flFZN5rImIblnx9bF4jePElaLmy0JByv90d20Wo_1733749613 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1733749653082116600 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 Acked-by: Paolo Abeni --- 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.1 From nobody Sun Dec 22 16:20:49 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=1733749647; cv=none; d=zohomail.com; s=zohoarc; b=lg5atk/HsNRcBN5f5+W2NsN+Ol75iGcafm2nrIqqhAlyAJwckSnzJc+j98m7wBuxpkj+6a/3m0fyKSrpBaKYSixJDaWUqFTkpjX7mHnojJjiz7rjDeaBq/cwjo6ga7ku+bjEBQ3gPwVzj/2ZLx7GPfcTe2N2Y76XE76ci5pGpoA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733749647; 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=jVrHbQL/WtPUoVmg5iNOH6KPahEUlaDR0JYKoVLlaPE=; b=OI/aqgW3I7D1V5DC2kSnLIyNgM6CBezTwXUq8e2StVPn2XwcSPX2BdMe5eYIFEBR+6B0uHiaFJ1V5IJJczA96P/0ewgklFka98Heina4siefi7kxUJAzfAX0jI+2k1GBhDQ4ZoUBVufEk+KtKnYXrxET2Rw4E7FF76OWnPOo4zs= 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 1733749647673665.0145616405667; Mon, 9 Dec 2024 05:07:27 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.851190.1265335 (Exim 4.92) (envelope-from ) id 1tKdTa-0001OA-HD; Mon, 09 Dec 2024 13:07:02 +0000 Received: by outflank-mailman (output) from mailman id 851190.1265335; Mon, 09 Dec 2024 13:07: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 1tKdTa-0001Nz-EU; Mon, 09 Dec 2024 13:07:02 +0000 Received: by outflank-mailman (input) for mailman id 851190; Mon, 09 Dec 2024 13:07:00 +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 1tKdTY-0000ch-Qn for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:07:00 +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 78c5d02a-b62e-11ef-a0d5-8be0dac302b0; Mon, 09 Dec 2024 14:06:59 +0100 (CET) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-i5JWUEMzO_issIoAJnJZig-1; Mon, 09 Dec 2024 08:06:56 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-434f47b0512so8002065e9.2 for ; Mon, 09 Dec 2024 05:06:56 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:06:54 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 78c5d02a-b62e-11ef-a0d5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749618; 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=jVrHbQL/WtPUoVmg5iNOH6KPahEUlaDR0JYKoVLlaPE=; b=Fl0gD+S2thj/enHGWj1pLgTFSpSEagOMA/IAiOiFDBLpTIz/3DKEj6VO6Fq3OSifenkhGZ 0G6LVjMTW236fCuD0I6EMfwcVkkllQedkYIU2fwLFbTyyV+zNIE005udKqHN8lBDL8MUPQ 2E7d2CSFFh3xzB9gJsp7D3YMtRGiOl4= X-MC-Unique: i5JWUEMzO_issIoAJnJZig-1 X-Mimecast-MFC-AGG-ID: i5JWUEMzO_issIoAJnJZig X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749615; x=1734354415; 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=jVrHbQL/WtPUoVmg5iNOH6KPahEUlaDR0JYKoVLlaPE=; b=gNsOB2IfARxHihQA4rybYJFltEvXDRBnPRVbYr75wWsZssDwQiRz0gBL3vOKCdw402 xRetAlX5XxQ7hlCaFJi+Es5mOfLAsGrRwOkh+U7B3tmG21QRKYvmd052FJW9LnoHOZY8 JTpYLx5CJ8bapIkF916W5V9rlBUpynVAWS+CSB86d3G0VDvb1F2kaIDJAz+EUNzeo461 BHng4aatJzMK95ghkZaGYznbPVXvK8+pUj+DCN3w5ufgU2lVhp6dYqy9nVWh/lpb5t+w 9PjgYOopMO74NW2kVLtbyaWWZ4VNb+qpKeMxovq9xzhk00pS8uKnOVwxR1qYEbS2XyQJ qrpA== X-Forwarded-Encrypted: i=1; AJvYcCXVGBMsMS10SHHuEafrfMrroz4SDCneGhKFIQvSgnPMB0qnWWcW3Rcfd0ug7/9KUMONIb16db6x8MQ=@lists.xenproject.org X-Gm-Message-State: AOJu0YwUXbRulNIFMSa87Sdx9/IFrb5/e5Q4bL5ArZxNhLW9bthUjxUn 6sir2wOIeblMcW2vKHiUCNxqHadZA3mZlbyOBCJGlSamH4C9X8ZZW+cdepoQ6Tz9eRejJVLQXaI xAaFn1zcSA8dBaeC1ypmE/H8PSt2ZlDyI89H1kxgMxgT+dH72nKtvWvJD9o6mivls X-Gm-Gg: ASbGncvfz5+YZG13GPmruyVfi7Ytg+daF5blbP+IYt64bf6mehH6jIZeasXXDi/9SdG JRoY46iMF1JmTQL8eTBwL4aQrQ4GasN6O4cIBQs6nG1bgMg83xTZo2SPznTQWn22Kv7r9FXYTPh b6rnimnbhFCsnuoA4sUDeqEX5KWYf+PeE12lLvvuErCmdCpArhXa8yPsng8nF5mYLcCjmi/njc2 zs+EUuBjDFDOIZZjg6jH2BQvpvWNVYPv7BXIjXeYJFllS7Bs4oRCnL0srr4VWsH9qCOX4qPVE7v rOrvsJtO X-Received: by 2002:a05:600c:3544:b0:431:60ec:7a91 with SMTP id 5b1f17b1804b1-434ddeade70mr103095365e9.2.1733749615454; Mon, 09 Dec 2024 05:06:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8dWBtsXMwPpsQh4FEW+o80sVo3gsVutdK8rZwCICXTNWn24DfDXUekpZhDfdomYwt5/+rkA== X-Received: by 2002:a05:600c:3544:b0:431:60ec:7a91 with SMTP id 5b1f17b1804b1-434ddeade70mr103094435e9.2.1733749614932; Mon, 09 Dec 2024 05:06:54 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 04/11] net/ntb: Use never-managed version of pci_intx() Date: Mon, 9 Dec 2024 14:06:26 +0100 Message-ID: <20241209130632.132074-6-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: FYlxY7uDdRJU2zmEYf023vX2f6xofWfouOB7XjsLfiQ_1733749616 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1733749649369116600 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 Acked-by: Dave Jiang # for ntb_hw_gen1.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.1 From nobody Sun Dec 22 16:20:49 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 B0D05233D6E for ; Mon, 9 Dec 2024 13:07:03 +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=1733749626; cv=none; b=OFM5GyyO1SIasvgOnfSTYbCmifAD5o59fRr1V3zjvaizPwrU2YC1WVYGy3XzpCyrf7agbIEZ7taPh53lMkLCimaiemMJip2M1vfdvk4zNNR5p4to2E/IXYf4mqxDzgHs9BBnJ/Y+xJLuFGQnP2rrHxsZpnebFsvkzIZEKtM6euk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733749626; c=relaxed/simple; bh=p0/gWxUTpmVAZUhoNYoMEndzzz2nBwZ50lbcwipiIRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qQAgxQ2Kc0BYXuohS8sMETRoE/ibmS0a2p0mLfSK0HGDPSxzB/xBRJt40NQ64R5QmUTPn5TNVMIWZ+KeYDqGo+q3ZCnO1HCKEZSRm+Vy4UIuxOnut5IJe5D2UoHkPWjISx47E/KY9++1bMXzTEHFgu0lBsSQGeCI6QkhcMNTKnk= 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=jP0F2H5k; 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="jP0F2H5k" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749622; 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=iGrvh/xDUNx0Zym0wN3Xe7A7dJtO5ZhSWVvmuSF27ww=; b=jP0F2H5kfj0VHUnncCJ7umywp1CFjdcnSCGPwHy7K3guRx/Z56aSMpOq7zMmmG8z1yZDk3 wBOVx02MFye2AQEo7heCKeT174LD0x8W7tCzfv+I7uXsr5i8vR4KyieLJF3YAoRT1BKfSN 21kaaMuRlHN9jU9VoKbqOmzN1Kpc5BU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-625-vUW9EC8mNdCHQWESz46s2w-1; Mon, 09 Dec 2024 08:06:58 -0500 X-MC-Unique: vUW9EC8mNdCHQWESz46s2w-1 X-Mimecast-MFC-AGG-ID: vUW9EC8mNdCHQWESz46s2w Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-385e49efd59so1691277f8f.0 for ; Mon, 09 Dec 2024 05:06:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749617; x=1734354417; 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=iGrvh/xDUNx0Zym0wN3Xe7A7dJtO5ZhSWVvmuSF27ww=; b=QRU5zJaKDYgdxZrHboI64nlSqIieb3Am/TJl1U0s2LJVOfKH/DZkwfUven3PEuwr8F CIzF/f23/9wkEYnAzmYnnZzshzrOQzG+jy2UUCBZ5s9U8p0Vw3j+p/sAesih3f/u0qZ0 x/JtfNzP0DyfDJr6sSvVhckGuvO89lgSAUUIqxkEoZYAy/pbbkx1GnouidDM8GIHrUVA HwoWp9ZRqdkstnLdGKrrWcaFKh1v8sT09MFFQT+6Oq4AFtF0JQU0dxw9ooBwVCHLnOwo p0qmDWqgEDEUqo7H3bpvKo/rE/OG8w+6Ll8juFHMYM2GrF7JK5HFe4sKz9QQ89u1zs75 VWkA== X-Forwarded-Encrypted: i=1; AJvYcCVDHTO3efusXrHGwCv9yNDe3HFZdhrjFdDTNjOfd55vI9XfJvMMBnqC8NHuDEOmNr2mtzruaDIm/Rv2gA0=@vger.kernel.org X-Gm-Message-State: AOJu0YzzZvKUxxFMq1n2E+uhd+AUDK54TWbismqAna9+caQTWGXBMHtI 6ZdVGQnL4Jt2cw0/ijk6LIyc7PQxbYEWlAJqKHiViPfEtgTEm4h3BCGIRwsvx3PEAvHf6pbY7em 4hl4ZdXtHnGRRXiXWzSYiaRq5psbXAH+6Kvcpa5RUB81c4L4P7q87mwJthFQxJQ== X-Gm-Gg: ASbGnctRIwjSt1kZGxCIuJZDtTRHwNlOVaVl9epydgIzptBj0KpmXoHhqHJqnK9MpA1 aMxRp2bcGkx+e+GLbtR6NqJdtOUefkq3lE3NQAfy/UfvvEGhvrE97KQyFdJY7ECdMpXCo05glki Btj58FZbE7JrGwPhzXvWeku+G4880ZU7qdeQzpq48zLou6f0ipvGcmyn4RQRZxcEQhzJ/gn62lE /YylC29WhqbbjqtB12LiaWjMKGLKv7sysZLNPvXz0+vs0GGbtpI2gs4UZHaPNrwTrb7NdEZLEFB KqHRRuxD X-Received: by 2002:a5d:47c9:0:b0:385:db11:badf with SMTP id ffacd0b85a97d-386453d6c46mr225615f8f.22.1733749617378; Mon, 09 Dec 2024 05:06:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+w+VXnhTGgYCQrqoxE7Q0eQycE2/xL59lBRJp9LXmIJ3oiAACyABfaofCQ1IoSgKVucKxLg== X-Received: by 2002:a5d:47c9:0:b0:385:db11:badf with SMTP id ffacd0b85a97d-386453d6c46mr225568f8f.22.1733749616959; Mon, 09 Dec 2024 05:06:56 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:06:56 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 05/11] misc: Use never-managed version of pci_intx() Date: Mon, 9 Dec 2024 14:06:27 +0100 Message-ID: <20241209130632.132074-7-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-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. 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 Acked-by: Greg Kroah-Hartman --- 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.1 From nobody Sun Dec 22 16:20:49 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 64382233D6A for ; Mon, 9 Dec 2024 13:07:03 +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=1733749626; cv=none; b=X3ERpqQKlrfv2tpNw5gF7yxdDDNteTVtX8at9dEI8QxK9UKS7CoWQ5JcLjjzlHqgJGARbss+tWQLpqbO7lweSr1M6upU+o8xVXySvh5UugTclqFQSXR6VG7X9Mx49i2C2YZLdunXsCrNdP+HRRyWqF4x8+tmX5cW5sDDH8i6+dg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733749626; c=relaxed/simple; bh=0TEaieIECTc3OVhk8DBvWvo0jSHs3A2Aqh2fvN636xE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u1+muyTGyIRA9C0SujB1Sb8+A43Kok9X3YMZT9rvp7AjdmZ8pAUIOIhwU4l9ILEATTqw/xrkpHuwtApZrnYODwZL2okKXUQAo9TMDUEDkNy9fkUEILUaN2DChz0BpI8RuF0U5apVsLX+GERz7ZY1dSaLQnxLhO/qLtuOhgsedfc= 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=TFkY59K+; 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="TFkY59K+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749622; 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=J6O49TnPkNeMtIPoWkV2XdJjg3ziNzZQ3FlPq3drZuU=; b=TFkY59K+0YI6oq2tdTrR/JKZAyzRPZrCVX4vUguTgB6YNx1kmrcZN2aO5GaXC1Op7U2mA1 rpNIDG9cGgs194xg10ZamDxlALJBAySu42OGaBRFRjX6BuLASD2UAIg5kpOYVx71/cP6iP P1isAdQPpt95N/h7g8WLRQBbBUGAi3Y= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-80gqNug2O2GMIQmcqMHzTw-1; Mon, 09 Dec 2024 08:07:01 -0500 X-MC-Unique: 80gqNug2O2GMIQmcqMHzTw-1 X-Mimecast-MFC-AGG-ID: 80gqNug2O2GMIQmcqMHzTw Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-385e9c69929so784108f8f.1 for ; Mon, 09 Dec 2024 05:07:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749620; x=1734354420; 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=J6O49TnPkNeMtIPoWkV2XdJjg3ziNzZQ3FlPq3drZuU=; b=CFQFZlhw6n4ejWNM1LnDP370TDOaD6zY4sI1/IZ0tGHsUuL+/yxBwXfSHiZJ0wJL5q vp69k3XAV4QM39prfZ4UqerGF3LGuGkeWQEsFUKR6zyihTrOcdbAbpPLkYvTVEZUXCQG +3Su9XWoKeSbYpXL3s7IW9Ax9Nv/rQjR340hjo5WmWXMEddW/xc6LNkYECNhtB+ag58u yAD/oNR6HluhVS/DJxKNlJLX49YbFgSs71aQZgxQIKb8sEL99V3kHLa6NO5uuP4ZksfD rxCPmXmavJTLXtPTLny/WwYPuVzCrLw+p97apB5Yeh2gDOiaIczyqLSzWdSGb2moN0qK 6qjw== X-Forwarded-Encrypted: i=1; AJvYcCV++aLBLU602VV4HY3PVPCy08b96L/wHqFXMYd13rXk0WkFppx/T7j3Ww5Wjwzna7jDd5r63GWkWrE/Bwk=@vger.kernel.org X-Gm-Message-State: AOJu0YzCqnuSRenNPWyMZRdCoPtVW6JKpa3VJe8i9CSzvH1KtBg62zyI vy7wQF4CV2ZfJGcFK7WGcOF8LbOcaTUfaU7nfMbsJRqRMR55F0hquCKJ8hMuwVaqWz8nAmsf+Bo gbt/i6RLomTxVnK7/yZGEimDfvZYEMwdrziHH+L4jAgFtjnfTb38F1QmDG4G9rQ== X-Gm-Gg: ASbGncst3QKpNWcGVslFVou+K7N18mLLIS5Q92NWEYvHuGwjYRJKW2+ROL8Ca0JQrVT tMZGN+zYMwyCkVQSDKc/xPLNLHeXqDbSJg2atmBzB83vMOvKX+0O9XxN8EN4KzDU0QBjYu3CSsZ XmSVYjhQnNYQRQ1eHUeV0aascVad65lN+3CzZT60hBLyVsq6eLiLS0zaizmIvybJbG0XHRvKXyt mjVQSUe83hnJQTsGw59/NGu/ubw1ETM/CrAIL3LEM81sdH14QFR9VohcU4IeHynaFeOgu+GFrz0 w+eYaP0Y X-Received: by 2002:a05:6000:481d:b0:386:1cd3:8a05 with SMTP id ffacd0b85a97d-38645402350mr183808f8f.54.1733749619740; Mon, 09 Dec 2024 05:06:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtkNHnOC202GyBKEBPTwiG4UTLfJs2pkouVC4IktFgJYuC2xwE//LEhilVtJ79VvBlgBAiYw== X-Received: by 2002:a05:6000:481d:b0:386:1cd3:8a05 with SMTP id ffacd0b85a97d-38645402350mr183738f8f.54.1733749619256; Mon, 09 Dec 2024 05:06:59 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:06:58 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 06/11] vfio/pci: Use never-managed version of pci_intx() Date: Mon, 9 Dec 2024 14:06:28 +0100 Message-ID: <20241209130632.132074-8-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-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. 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 Acked-by: Alex Williamson --- 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.1 From nobody Sun Dec 22 16:20:49 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 688531ACEB9 for ; Mon, 9 Dec 2024 13:07:04 +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=1733749627; cv=none; b=gcD0r4xHfMWAOojQisncU/oXLJKopkEW9cwZRP3XXvhC/m40jZvmX2nmTWqgFJGw8IpIl420/sWiIk/PASI7elIv3elUnNPV1fP+e7t1UZMlBT8iosp7px5JeETDLCsfXYL4a6ao5z9A+HV8ylctFNxcdlFyiSn1uhozNqdRnkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733749627; c=relaxed/simple; bh=9Z1Cy2anDz0HAw/5Tw9Wb58QkDW/mnPO9GaPuFYE3VA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KjrvYBbQKl1s6kSemsKqazEEGe1O/cF+TSNPq8WWxTM0eIU+hzwMwIJxRtlrVNXSbBEDOnnbstmFQuTKezspqLaWSXyzTDN3cKuYQI+q4lZqkWl1GkHRMmjgIQdOYT+YiTUn71AWZnqON2lY4VwfmRtZJ/QTk4aCVy7OFkE81oI= 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=BN8Ca6cj; 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="BN8Ca6cj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749624; 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=oiILKR2a3QjvArtxAPrSG5MTRD3aI59eir0l7Eg71/Q=; b=BN8Ca6cj59vvXYYuhNe3ZKRRHZFODoFZicp6sHJevZdTUj1dosBljMlI8PFM+TVsZ6M7Oq S2XD0gdXl7i6le2eVMUqcS557SBG3WGlzN2QJvNw1S+HuWWOxmHBkeuNbMuR0BWFGIe8aA 8wv1KhdLOSN9vwsmKuZKP4qzlyawzPU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518-7jPsrXeaM1K_gH5-LDZZRw-1; Mon, 09 Dec 2024 08:07:03 -0500 X-MC-Unique: 7jPsrXeaM1K_gH5-LDZZRw-1 X-Mimecast-MFC-AGG-ID: 7jPsrXeaM1K_gH5-LDZZRw Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-385d51ba2f5so1674251f8f.2 for ; Mon, 09 Dec 2024 05:07:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749622; x=1734354422; 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=oiILKR2a3QjvArtxAPrSG5MTRD3aI59eir0l7Eg71/Q=; b=uRpQhOkpwRf1W3MG9QQclx5l3C1HXDdaJAMFBONMUzSyBhtQLuAqwgPv0D9jQupybW qV7dySNl3nhuqfPpywSlbZJnCH6DtFIQtVv+ggNUcsJZBu/tO1rFsS7c4IDpy2R0NRcv nHfwqm/n20kPNLXlHa/C9bRJ/YK2HU3lHNNqwqg24M0GSQfQL5gtMhvfmSgSrFHSvduK inLZNHvsJb6IQjdo5vfP60IYVlkNSI3txHZ4+rwvYoW7vvl0FWTWMgezR/4zCiME40KF T+K5XBiLNRhlhVh6R0adfmbhbgExi22IAa2KjnxT40X8fqCZDs4ujXG1/iWM9i2c9bnC P9kw== X-Forwarded-Encrypted: i=1; AJvYcCWsZ1MpkHvKv6FMA0B5kqFxqOetLXC1XvXDaB2uE7K0c9igcccEUEyCT+Rz16OmyJHtKczdJtX5lZ4A5ns=@vger.kernel.org X-Gm-Message-State: AOJu0Yw28t63sKqJwTLwfxTMSBeBPHQLSlAtznZkiy9YdrclyDPMjfi0 SCR0770mQE7nRB3pvoZiWujCY9afNjGCzOfTEDaiwJg+i7qOfpBAbmCZExgbMpWp/DQhG9OMv76 UHNfP8MJ6sFdrjQegxAeHaTJa/3uN8sx93U3yCX+2yJIuItNO+SgTBDIza6OdxQ== X-Gm-Gg: ASbGncvW7oAEIN9DHhVMqmbqpEMfBDZCH4XZQhTy6LYB0iB+W1/DUe/W4LHe9MPdcJz 58Ph/HYIJMOglcMGkjfOlSAOwicfgPYK/+7rbdjNAdWsYwVte2MSkdPyMORhQbxwi+wy00/Yy9h f8V+NqTf9ZM0v9YKobJyQ2rc7yTqyudjSSpcaVz5o1km5qDvlpuvii6A6rL4gWUg6OF2dTY4HuU MZUXHVYCQfRMSvLDifGA/Lok52lSCNGH1VQ9JOOveBgef81s56QH4FOLYNFlM++g51OepJL44ga s3Tnc/je X-Received: by 2002:adf:e18a:0:b0:385:e3b8:f331 with SMTP id ffacd0b85a97d-3862b355ed9mr8982778f8f.14.1733749621863; Mon, 09 Dec 2024 05:07:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEcWIoVaHlqXXOi6I/o8U0Sx4v85WRQCbXdmf3r6S4bXIGyWlICGFsXbMo+gcSn1pLdSeKWw== X-Received: by 2002:adf:e18a:0:b0:385:e3b8:f331 with SMTP id ffacd0b85a97d-3862b355ed9mr8982697f8f.14.1733749621414; Mon, 09 Dec 2024 05:07:01 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:07:01 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 07/11] PCI: MSI: Use never-managed version of pci_intx() Date: Mon, 9 Dec 2024 14:06:29 +0100 Message-ID: <20241209130632.132074-9-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-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. MSI sets up its own separate devres callback implicitly in pcim_setup_msi_release(). This callback ultimately uses pci_intx(), which is problematic since the callback of course runs on driver-detach. That problem has last been described here: https://lore.kernel.org/all/ee44ea7ac760e73edad3f20b30b4d2fff66c1a85.camel@= redhat.com/ Replace the call to pci_intx() with one to the never-managed version pci_intx_unmanaged(). Signed-off-by: Philipp Stanner Reviewed-by: Thomas Gleixner --- drivers/pci/msi/api.c | 2 +- drivers/pci/msi/msi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c index b956ce591f96..c95e2e7dc9ab 100644 --- a/drivers/pci/msi/api.c +++ b/drivers/pci/msi/api.c @@ -289,7 +289,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev,= unsigned int min_vecs, */ if (affd) irq_create_affinity_masks(1, affd); - pci_intx(dev, 1); + pci_intx_unmanaged(dev, 1); return 1; } } diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index 3a45879d85db..53f13b09db50 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(pci_write_msi_msg); static void pci_intx_for_msi(struct pci_dev *dev, int enable) { if (!(dev->dev_flags & PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG)) - pci_intx(dev, enable); + pci_intx_unmanaged(dev, enable); } =20 static void pci_msi_set_enable(struct pci_dev *dev, int enable) --=20 2.47.1 From nobody Sun Dec 22 16:20:49 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 A87C21ACEB5 for ; Mon, 9 Dec 2024 13:07:07 +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=1733749630; cv=none; b=YdjRxvDPYJ10bcNG0A7nhA4x+L/dbWiA6lQ6ObrztVqlL/Ka1PSCVc7ewKe3Bp7wNetusUWLzsN4DpQoe95PH2zErfMUnQrWD8cXWUBUagbJ/Nh1k8yasP6x6cJ7rksTTwvVuBD6+diU9W5a2l8q0kVqeUrSu8B//cSpyUb8WfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733749630; c=relaxed/simple; bh=wJE9vV/l3hdW8HDPZeW2FSJ+9CxTJ0aSSSqG6rS2R+8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nzih9i784rtghEOJMOMAbI2nIIsJ7qQ6a/lzJ7uKs1L0BuZSKeHXCKeaS6a7qzEVwdoMbNpHvWbjl4mtJNbEqpHPZ2UOESA4/pBgqcIbssDNjHK8P84B/308WwTVA8noHZCmzsI55J+f3apZlpMCMboSVkWnlGXG691q+ui1VV4= 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=LvxEDuGZ; 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="LvxEDuGZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749626; 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=nnuXTvhYTlwCBDrOS1s2G6F9Hq/4HeIeK8aJfi4Wc90=; b=LvxEDuGZHhsT9Sloe6LnuhMee6+/DTLqPfay58Bi5xhZc3kegX1wBhsoyj5vO8TcPDJy4S sods/SEmPWNxH1Mwz+Ia6uOYdBmL7O+3R9iyWEHjO7r+K0RXJ1jSIJYI72erIOWNJenYHz gHHqgDms1hMrey10ajnQihV+hlVxX1g= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-267-TonMwR9TPBS0Ej22I1gnZg-1; Mon, 09 Dec 2024 08:07:05 -0500 X-MC-Unique: TonMwR9TPBS0Ej22I1gnZg-1 X-Mimecast-MFC-AGG-ID: TonMwR9TPBS0Ej22I1gnZg Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3862c67763dso1832549f8f.3 for ; Mon, 09 Dec 2024 05:07:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749624; x=1734354424; 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=nnuXTvhYTlwCBDrOS1s2G6F9Hq/4HeIeK8aJfi4Wc90=; b=BpSqS29ShROPSRdjrDgpzz3cnGuN5C9lrNCZo2W41Sv0AziiRW7CMEF2LnvzMws4XS V9nmf3qbM6V2z9Z+vqFBx5SDudRvip74r5D0w7uGtDb46aLB6yXp797wFGord0vT6aq5 fQZ2hz1gOA0o5+vBV0AClUx8gqTAJlAWD8vI6DVcyZUYj2kSpih/cUMBAKXXjT4p3Lm8 /HLyPOGtW9u2uQk6IhdrjO4FOpt6lH9LM7UR95yF52WW2Pr3XItXiBNRIW/SU4iebc9J tOk6d8srsRwq2R61T24wen+qZTTwfcw8DUymy+OlJacLOz82nfvE3iYhgdXP2p2bNNX+ h71w== X-Forwarded-Encrypted: i=1; AJvYcCUxcy7T/gu5RoKwg8q/qx3ZREieDy5zqACPeSx9g3wPoC8fq+PwoaO7gXTMNYMH4wwReQKxgzOFrblOdts=@vger.kernel.org X-Gm-Message-State: AOJu0Yw67AbfaxElkNmyldceNK4jZH/YYiJohSXGqsi93R6j+A604jAL qMT81dsnSZ6Xj16ERJLwOUR3wDwJrWwPIKQIqhORNO2wYncyXmFI8DJQ8jVM45sOJB1+Ntp6OhS SAeOtVWbrTduvZ9pwQ4nu5VU59JNKDpPzoq5FpE9bx3RJOoBmPqePGnLpbJJknA== X-Gm-Gg: ASbGncsqEvPX1Zw/w0NRvTsC0JGO9oKRSBkvCi5XntUj0bTJL3tXsFOFYzW8g1G1p4M EUnZUZN74hlUw5BBE8kjPrIycyxYxDNrFHxV6bqJoSzFRLffHfAW9trJ+EWppo7WiEPLkIlPLoS CHnbAP8NWEemR3l1CgX7LPMpcRWmW6SK9/utlvA2QBaspgbv2yE6eEbFBudhMGZuickXNXODXLg NdRuPrLAQhgW2oQJozggyNvDSmJeDDYSjaWKSgDeBuwiycBugtTC5lep3PZ3NXkaC0X+S44HTXP HFrrUgrC X-Received: by 2002:a05:6000:a07:b0:386:1ba1:37dc with SMTP id ffacd0b85a97d-3862b3d02a7mr10541547f8f.47.1733749624059; Mon, 09 Dec 2024 05:07:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IED6lK+xP3ASai9pzso97+PoKUV4QmBIbg3KzJDkAOewaSmInet03lP+u9hg0Iot8N8fifU+Q== X-Received: by 2002:a05:6000:a07:b0:386:1ba1:37dc with SMTP id ffacd0b85a97d-3862b3d02a7mr10541452f8f.47.1733749623572; Mon, 09 Dec 2024 05:07:03 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:07:03 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Sergey Shtylyov Subject: [PATCH v3 08/11] ata: Use always-managed version of pci_intx() Date: Mon, 9 Dec 2024 14:06:30 +0100 Message-ID: <20241209130632.132074-10-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-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 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 Reviewed-by: Sergey Shtylyov Acked-by: Niklas Cassel --- 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 8d27c567be1c..f813dbdc2346 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1987,7 +1987,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.1 From nobody Sun Dec 22 16:20:49 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 EE9FA238753 for ; Mon, 9 Dec 2024 13:07:09 +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=1733749632; cv=none; b=BYHrGHiVKb3wR6Bfpkx4fm/D2rox4xet7M2Uc399h6MNZtvZh+7c7aGuFJtU7H0F2+67Zp98CqaQQ5QsTXzwhPXz27njFp9s/fcmkJ8NoXj9Op55s72W+XdByn2ukVnthPGT8mjSNjrnLqzGhlHUs3yRm+pNIcpaqOGMtfiVo+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733749632; c=relaxed/simple; bh=jwv6lYop8TdP9htf7xZwf/ELhC2D1ascIg4aYDeJpYw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fLJyR3YFiSHuk1xwtOl/c9V6/lupcQKLRSu4fXqVSYNAIHUbEMTVSvQlT3xQrY8CReV9Me24X378W6XuW2f5b/2BjM1ZtlW2JOjjQtewcf5qQEtMZ1TIYLxVgnbMqJ5cSYtAGX+WQMh28D58UlD0fLt1se+O9l2NOaheHsNeKao= 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=HvF9pQ7y; 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="HvF9pQ7y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749628; 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=QrzFiyozzKwphrmER/QLBGC9UXhx6Rbz0xOMvDA9uiM=; b=HvF9pQ7yxte6Zj086vXS91oaZk0/BiR9FRxajzADYmI3wYBZ6K9ueL46ONKCU9smD/prKM 6z5yNRewwV/FiyKFJNM6HoFts798lmpGUDfDGn+FSYeJf3yZ1Bv0PypyVRD+zmP5liLxdP q05Qgi6XbllBr/6TxojIkTCBkgQXCKg= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-389--Q8pfEfvNw6QkIheg1cysw-1; Mon, 09 Dec 2024 08:07:07 -0500 X-MC-Unique: -Q8pfEfvNw6QkIheg1cysw-1 X-Mimecast-MFC-AGG-ID: -Q8pfEfvNw6QkIheg1cysw Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3861cd03a89so1764684f8f.1 for ; Mon, 09 Dec 2024 05:07:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749626; x=1734354426; 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=QrzFiyozzKwphrmER/QLBGC9UXhx6Rbz0xOMvDA9uiM=; b=fiurIex80fIgnykgbjtQ0Pu0ysITEKEhVYWHt7SgBBADuYIuKMDR59P3dmGYVn8wXS C7I1oWy4xY38bp/EfntsRKtLU6JSk7xK2zwzKDPJji6U2wpxxoodHir67DZ2R/1qPDNN AgBEdOG+K1yzgQ+uHrcNv3Fphmr15nf0RVT3bF92GhCULKn8DqL/5viM4CL3neUTKJIO ZS+N20VxZ8FxAdHAGRe0Kg71QdaT4FEgcuoS6xUENZLFqo4p7xAjQv1B6ODbDAFmO1Tt wl5oq2D4cSzeVTQGelX16+6R9/1+B9umMoeHUF5dniv2lzoHgAe9aG9KgDj/c/X+pbwA 0ATQ== X-Forwarded-Encrypted: i=1; AJvYcCXMGQB3UT3E5A5WihT0d5zRFLzVYSeqtNBC9wP9a0o6RJNBn8uUl3mxXUsZbxo91lMgpGwhjs0Y41RlmJg=@vger.kernel.org X-Gm-Message-State: AOJu0YwcluPoOUzAe1SnbOZOXWcfZH8gHAoSyQccIM0JSKVeHGjmr+cy pPBHrTFmApQFImhpYucRv7iY/AaPse2W61bF6MCVftcIDp0uVQLSo4RqaBwvf75RRMzqVgZLi6G 5fcqB+wC3/mlhrg39SfXkLGrCtRLA0IDmCDJLJH5fT0L8OHrwoFVKjFHVcbRI0w== X-Gm-Gg: ASbGncvTr/PpESVeaW6HI7evKMzsI94hHXIAYsKOjyDTDK7zn79Er8QSe5W1c8YgEas SztiGf4FsgDbn7T1Y1PL0+Oei90LcnsfcvVD5bt/iGQzRiT7cbBym0sq/CyCblonlpJDUlnzPfZ Ata8rt/s1NgjHvVfFyv/Q5Wiw2expCA1dXZUlotm2k0jLu7FF8BOA6MrPEnEgrnU6K8W1GSfXps FB0Qj7buOOAVinkUIwE2kAlEPoqV4R4ECHCb444ptplOIVPbUIvUO8TT1kqf9uLmbLiQ1qeYPfY uploBblt X-Received: by 2002:a05:6000:79e:b0:385:e9c0:c069 with SMTP id ffacd0b85a97d-3862b3d0941mr9603901f8f.57.1733749626176; Mon, 09 Dec 2024 05:07:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IERHmOpW9Cz/hix9sJGhQKCFL65VOvqT0smHQwQu2JVZ9uttb5F5Byv3ep6mSTcPHbKk0ee2g== X-Received: by 2002:a05:6000:79e:b0:385:e9c0:c069 with SMTP id ffacd0b85a97d-3862b3d0941mr9603809f8f.57.1733749625729; Mon, 09 Dec 2024 05:07:05 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:07:05 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 09/11] wifi: qtnfmac: use always-managed version of pcim_intx() Date: Mon, 9 Dec 2024 14:06:31 +0100 Message-ID: <20241209130632.132074-11-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-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. 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.1 From nobody Sun Dec 22 16:20:49 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 D7DC83DAC14 for ; Mon, 9 Dec 2024 13:07:11 +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=1733749635; cv=none; b=BxN6AG7tppmijoAjcw6qQQh3zo4RpHvIdNTFF2xAI3dSbzf0KPNuDZuWsAsatPHy3PtIJHGBfN2y6x7/KyxZshFoCZTgCjKAWtik0jgYMBJ0vlw6Tx7zxdUI+XIBLWZW86Moulb3RvF5iuW8jWPyBcYLnYosqPDZs1OzLp3/MgM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733749635; c=relaxed/simple; bh=kEzRZlYHQ35CA9CnBRQZ7a8YwaQDWA/y9wHnTg2Gq0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G2T9qJNP1WuVmUJP6G4T2TBFVujazIZxMcuc0CY4EcWMtEr69DrQ803Hem/qfIEyleY7MBvbaBBJXVkJ4hQ1MLMJv2obULAH4GJxPS50tuZcpmZhJ89b3XlN2HKVMNUwGHrXVIw2HCocj598rLhAUwmqMlVTmve1nzSSLEPlaDE= 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=Uk7DOXS0; 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="Uk7DOXS0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749630; 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=cg5FDrf0+9NG9f4wa7LEIeg49zn7uGzDf8HKpIKXKbU=; b=Uk7DOXS0pKDwwgrUE7AoI6sJGb49Otm4W9tOm3pILEAqne+s1qpqntlah4kIpK7x2VaJ44 lAqhpTMAbbgU1w+D0Npa5DvbNw0OQ0rBUq5dR+o0h1809b9tvfiN/j80oF4PdL9VaBw6J7 UPcjJbCCLDpyiY6H6tLYsUjktJBR8o8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-WYFClprnPky1JP211bz-Gw-1; Mon, 09 Dec 2024 08:07:09 -0500 X-MC-Unique: WYFClprnPky1JP211bz-Gw-1 X-Mimecast-MFC-AGG-ID: WYFClprnPky1JP211bz-Gw Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-434f387f346so10874335e9.1 for ; Mon, 09 Dec 2024 05:07:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749628; x=1734354428; 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=cg5FDrf0+9NG9f4wa7LEIeg49zn7uGzDf8HKpIKXKbU=; b=q4vZdxWaRkWnClzKjTc40HNIKu80e3yv7RU2pWwNzKPsBF7/CyX7Hq0uXly72hYE09 +w4RneJPfPYbMHE3sa49ZuwITUBZAoDjrhvcd0frPMBBb6TL8pp/FSqGzzUNioVt5JhB HKQa5QGshmuwQY7+N0AkHBkqVwy2tY4R2uGMjNaSP4d10atW2k2HBn8TSaGCZR4enjNQ E2Tv0YW2PJLDY5u3CH+JK9kCmplo2mPh0PytVMppI/4e57Lm43KUwzgWuGAjKQDwqisS Tvtau2Pk0RZa/EeFyYAPK926FwYu12qpvtlyyHk9ure6S9MpccoP2EqoDHQdpI49z99J NBMg== X-Forwarded-Encrypted: i=1; AJvYcCWhFDKscvTNb+HP1M02z47E0Ol+sotg50RQr0s9JH45BPb07GbFLyb2YCa0SqNijeTe61zFRuCqKsrYLLQ=@vger.kernel.org X-Gm-Message-State: AOJu0YymgnHXPdfgE13Jm381jmLb6GYB7c9wr+F5h951Y2+9P7azlGnJ GWYQ1CAf/t9oMSX76GiVrewdJmaR+10gvXHgkxAFdh0p6eg6Xw/rP9M56AFAL3I/W7EoA9uSUgS QMyOrXY533wWk1fOnaNEQc2QJcdo2bDGk1wW2dPRVHXXlX2ianwUc8Ns9e8wxJA== X-Gm-Gg: ASbGncveFXlS06hNZJooRhDglAExK35BfJNiRG2cilLBRfHYHsTcI5L+0tl+kdKPpLT OljoeoB848l/H/THIKC4H2OjKxUcjj7L62vvtxbm+Wud4OJead4h3tEFz0IBIpor1PyfVoJ+/NV Mb2D1086CxB3bdilFRM2PGCsBbgBRdNt7RlZ9U3SiCmOsknfyOVWhuPSzs898eiJdiW8cvGgaxB 4QAKQCqfm+YclCYa/i5jz9OjSFAjxZPwbWBhDXziTrV65oaaFOkgNBuSsRGf5ysmnSeHv3VZPiH AsQsZzEj X-Received: by 2002:a05:6000:2d12:b0:385:faec:d94d with SMTP id ffacd0b85a97d-3862b3e2f99mr6786269f8f.51.1733749628328; Mon, 09 Dec 2024 05:07:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzvkT5DctzF6sU2GBgKgYj4TZMfZMHtf63D+x4hcRmPdkPLtxCBfCUCCjCewKM8z5+rRuxWg== X-Received: by 2002:a05:6000:2d12:b0:385:faec:d94d with SMTP id ffacd0b85a97d-3862b3e2f99mr6786186f8f.51.1733749627860; Mon, 09 Dec 2024 05:07:07 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:07:07 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Basavaraj Natikar Subject: [PATCH v3 10/11] HID: amd_sfh: Use always-managed version of pcim_intx() Date: Mon, 9 Dec 2024 14:06:32 +0100 Message-ID: <20241209130632.132074-12-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-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.1 From nobody Sun Dec 22 16:20:49 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 7FAB9222D6D for ; Mon, 9 Dec 2024 13:07:15 +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=1733749638; cv=none; b=cXnkijOecGATC1nIH28u7axUrbkOkAl7vyqVAQSPcUW5DbFNhCgQa0vRmLZ7fFnZXaUtWj3HLqGGDy84vtfSKbX2XHy3aZUnVPKyJOFiOFKCQeQDU3bweXik5y+FshM1SXxINx2vFmUrmM7UoRPefoPA0Vv57NhOyHilEBIIQGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733749638; c=relaxed/simple; bh=iQxm4QfjlR4Q7L78H1eAEsRALrLF6d6wl8eA0eVuu8s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c8jjz11awaBj/USPOvLpBQGlym4vkgcexP5I5kZ4NrK/FoIj/6tNW6mFoAqr5RfGhT1GulpM0yEWss9EuL3SpxSLo6d3MGZrarrCWUtgA0FV28LCeii5q2Und+TfNJ0SQ83gyMNFaux7m8z5wMx9Wwp4JkKrxwnQ6bYJR/37M/Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=fail smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GeLkMs42; 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=fail 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="GeLkMs42" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749634; 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=6HNQFFZFNBo2fKXDk5eFuu7P7NBI6b9tUTkzIaFtOWU=; b=GeLkMs4274hrXI2F80eB2gT6McGzmzHIbOgp0znDKyre23yhi8wMfRlrJI8gNVb9TrCmBx 8V/aw16xCa+0Ql60cgdtLEa4aXNwMM+G4tIpw+3kE7XLDeUo7F3P+RF0ZG7JH9zioVGCcV 8frd4k7ONf1YJb6WgMCBY7mlNqE4BTA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-592-CorQ66ZUPH-RZ5TF5_Y6pQ-1; Mon, 09 Dec 2024 08:07:13 -0500 X-MC-Unique: CorQ66ZUPH-RZ5TF5_Y6pQ-1 X-Mimecast-MFC-AGG-ID: CorQ66ZUPH-RZ5TF5_Y6pQ Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-434f15b4b6fso8713565e9.0 for ; Mon, 09 Dec 2024 05:07:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733749631; x=1734354431; 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=6HNQFFZFNBo2fKXDk5eFuu7P7NBI6b9tUTkzIaFtOWU=; b=NeTeK3tqDcCDZhpnZMKhihPf3k5Lk/sZL2kuk4OpOBg5C53oqospkL6qsuvyTWLEgJ 5175z4cX54W1ItnXC3gvTG7F7+Nsld2euUjEt0y+FGVxhX7U5Gja1pm1x1zp7tmfpY/v HU2bNkaazZev75cFJqb2eD8AvY3Wxfq8maKBTHPdIsENe4P6dj59OoUAVt0m1lNM8oJn oS5rHt/JMm1QE3HS26z8kI3pAtN1o50ScvZlz00pC2jlU+swsE5cceKWsfzqDe9cfqSf 9kwOcihNUrILx1FwMaxp05z4IuX5WngJEI1ic7lQbIeFOUmGkx9suwJuBVsUyTW5LGiJ 0/kw== X-Forwarded-Encrypted: i=1; AJvYcCX43fdxm/zNJRawgNCYzgGpSZewOKaFecKRH1MmmJ/GVN9gMPt3nwgSELkEDtDZrm+KqJj+psd2wqSeL9M=@vger.kernel.org X-Gm-Message-State: AOJu0YzUDVYzLk7VKm2EEkuvaaRvb4j2dgvqIvngMeTWYkA9ricJS2N8 xzhGvRg/Wz4QKPvESCufZ/0ipWenesmyeaGIQ9Kj+JQJEFyRuqlA4nDY7MGd/KGw55Sesm2H5v7 r18OkGHjLK8WSvu/hHsnPg0Ja+aiTV+kHtXgjMm5gKynOHDoN/ilOEKeQeJIYUA== X-Gm-Gg: ASbGncvAjtouErrB4GmEhPcm9tKTD7Zsb9hkLZEErD/Dz9z0fxNt+pFi3NGemKFv5k7 0fohpOjaRiyq2itlAfnQiA/IEaoElMI32muay7xBO8JZv++1F2X3Kc1vNxAsZka/6E3NEaLHy40 sZYOPLfi+07DhzUBdkZsUP46NC/1cbenGhJELym9PR98fogyyZR5v0QAbqPGxXZyA2kSsbYvmmW qmvqx+Ba6T/OVJMvSItUC+yauAUSRvUkcS/vDVtHqgCyc8+eSuZD6e1lqTOh7R3xIa9krYFr9Wp 7SBtynaO X-Received: by 2002:a05:600c:3547:b0:434:a525:7257 with SMTP id 5b1f17b1804b1-434fffd0490mr3115845e9.21.1733749630736; Mon, 09 Dec 2024 05:07:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IELX86PBcQHpAJDUmCcFKSGck+5vkGUq7O4wFXOdXDUx7b79IoLlNFEza+cDwu9qun6lbiQKA== X-Received: by 2002:a05:600c:3547:b0:434:a525:7257 with SMTP id 5b1f17b1804b1-434fffd0490mr3115205e9.21.1733749630127; Mon, 09 Dec 2024 05:07:10 -0800 (PST) Received: from eisenberg.redhat.com (nat-pool-muc-u.redhat.com. [149.14.88.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862190965asm13200127f8f.82.2024.12.09.05.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:07:09 -0800 (PST) From: Philipp Stanner To: amien Le Moal , Niklas Cassel , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Mario Limonciello , Chen Ni , Philipp Stanner , Ricky Wu , Al Viro , Breno Leitao , Thomas Gleixner , Kevin Tian , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Kunwu Chan , Dan Carpenter , "Dr. David Alan Gilbert" , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v3 11/11] Remove devres from pci_intx() Date: Mon, 9 Dec 2024 14:06:33 +0100 Message-ID: <20241209130632.132074-13-pstanner@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209130632.132074-2-pstanner@redhat.com> References: <20241209130632.132074-2-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 Acked-by: Paolo Abeni --- 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 | 43 +------------------ 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(+), 62 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 3594eea37993..cc3195134721 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 30d17ec771fc..121eb7b0b1b7 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4483,17 +4483,13 @@ void pci_disable_parity(struct pci_dev *dev) } =20 /** - * pci_intx_unmanaged - 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 @@ -4509,41 +4505,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 b5eb8bda655d..f05903dd7695 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1350,7 +1350,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.1