From patchwork Mon Dec 9 13:06:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAD01E77180 for ; Mon, 9 Dec 2024 13:07:12 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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-type: text/plain; charset="US-ASCII"; 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 bar) return mask & BIT(bar); } -/* - * 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 = pci_command & ~PCI_COMMAND_INTX_DISABLE; - else - new = pci_command | PCI_COMMAND_INTX_DISABLE; - - if (new != pci_command) - pci_write_config_word(pdev, PCI_COMMAND, new); -} - static void pcim_intx_restore(struct device *dev, void *data) { struct pci_dev *pdev = to_pci_dev(dev); struct pcim_intx_devres *res = data; - __pcim_intx(pdev, res->orig_intx); + pci_intx_unmanaged(pdev, res->orig_intx); } static struct pcim_intx_devres *get_or_create_intx_devres(struct device *dev) @@ -472,10 +453,11 @@ int pcim_intx(struct pci_dev *pdev, int enable) return -ENOMEM; res->orig_intx = !enable; - __pcim_intx(pdev, enable); + pci_intx_unmanaged(pdev, enable); return 0; } +EXPORT_SYMBOL_GPL(pcim_intx); 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) } } +/** + * 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 = pci_command & ~PCI_COMMAND_INTX_DISABLE; + else + new = pci_command | PCI_COMMAND_INTX_DISABLE; + + if (new == 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_pass pass, struct pci_dev *dev) { } #endif +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 maxlen); void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar, From patchwork Mon Dec 9 13:06:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2885E7717D for ; Mon, 9 Dec 2024 13:07:12 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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-type: text/plain; charset="US-ASCII"; 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 offset, u16 value, void *data) 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)); cmd->val = value; From patchwork Mon Dec 9 13:06:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF369E77184 for ; Mon, 9 Dec 2024 13:07:13 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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-type: text/plain; charset="US-ASCII"; 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); if (val & IGU_PF_CONF_INT_LINE_EN) - pci_intx(bp->pdev, true); + pci_intx_unmanaged(bp->pdev, true); barrier(); 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) } } - pci_intx(bnad->pcidev, 0); + pci_intx_unmanaged(bnad->pcidev, 0); return; From patchwork Mon Dec 9 13:06:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAD4AC3DA4A for ; Mon, 9 Dec 2024 13:07:12 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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-type: text/plain; charset="US-ASCII"; 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_amd.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: /* Try to set up intx irq */ - pci_intx(pdev, 1); + pci_intx_unmanaged(pdev, 1); rc = 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); } } 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, /* Try to set up intx irq */ - pci_intx(pdev, 1); + pci_intx_unmanaged(pdev, 1); rc = request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED, "ndev_irq_isr", ndev); From patchwork Mon Dec 9 13:06:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03FAFE7717D for ; Mon, 9 Dec 2024 13:07:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.851196.1265356 (Exim 4.92) (envelope-from ) id 1tKdTh-00026A-CM; Mon, 09 Dec 2024 13:07:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 851196.1265356; Mon, 09 Dec 2024 13:07:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTh-00025x-7B; Mon, 09 Dec 2024 13:07:09 +0000 Received: by outflank-mailman (input) for mailman id 851196; Mon, 09 Dec 2024 13:07:08 +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 1tKdTg-0000OS-8l for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:07:08 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7d204215-b62e-11ef-99a3-01e77a169b0f; Mon, 09 Dec 2024 14:07:06 +0100 (CET) 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-562-W9DMkNCnNM6IcveM0LyOzw-1; Mon, 09 Dec 2024 08:06:58 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-385df115288so1806905f8f.2 for ; Mon, 09 Dec 2024 05:06:58 -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) 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: 7d204215-b62e-11ef-99a3-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749625; 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=iGrvh/xDUNx0Zym0wN3Xe7A7dJtO5ZhSWVvmuSF27ww=; b=Z5+FKy7ioJjd8a8u3GNDGGSVChuU+Ji3ernXFZ5vODPI/JynNHeat5aeykaVEkoYK4SWQq YCqrzsCjamKy2JkM1ClyQvj/viB+BRPGuRnEjZu30nTJUIPngVk3hyENQoYcMycZ+rqfcu 4Z7F5FYHyyXM0HPXvivgNbzJtWom/CQ= X-MC-Unique: W9DMkNCnNM6IcveM0LyOzw-1 X-Mimecast-MFC-AGG-ID: W9DMkNCnNM6IcveM0LyOzw 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=gHJcg0AUcHUT4pzhzzyWpHPS7YoqicnkTqyRSLhudJuHydRvLWb77aeYgXodt4POoh xbotmjNoDt3I4NNKVrpw4CjxW5TI5N7/RFPwrlUE24YGvSox0OB7+Kx65O3wBXVkDJvj uq01klZTsjbdnAcXOQ/nVoCx0E1/PoJQsoZIoKBetNL7QhbY1LqnlvLroFjl/nIO5O0U 302bhKOkM/01RT2Btp2W/xdA/Edlz6W9p3v1b/IiM1N8uiMEYW7b1X3l3hldfOtFkqZT DCITgnFedYLpFC/cgHujN3h8L4ywAfJmlyhkkwyqAm9FPBuA9GLeRA9w+9WkLZH6oWIf l2yw== X-Forwarded-Encrypted: i=1; AJvYcCW+h0Dl2B4y/+XRvfewGq0u1GWpZSWjPkTxl1jhAibXqWdyiaeIzTJseONmsYzV03sRwHGlA1UZuW8=@lists.xenproject.org X-Gm-Message-State: AOJu0YwROzCNlnSamZGR9myCRMKMBQDN1GL4RRuHf5DE+OoS6v5Co+MT H7Xsjsj7bywYu1FyLuCqUFUw7BjshYpYLtAbooI4nehNCwXOzmeIys+cKdFK/G+OG44u09IuZEE af1cT0XyJTdel00w3YjJXNzIYb6D968lObMdcvzXf+/pBHZvDrSUJsHcf9CJXS5cy X-Gm-Gg: ASbGnctOoXd7Grr6ot/DRWrcUeADDNjPvVGTLhqoCOPZfmd29OnRokksnTnXDv/lrT1 v0nbwPO8mNaAMXe9/WH7orG7akaK1YEHg310iC1uJUG8+RoBU3e6YnIJHZrgV6AuOiUovfmnKI0 k0s7muy7LbTB4UZxHu7X/qOancvqPKe7kNOUMtFLzZZclE5HenryJDapeG458Mu9htFuA3aOHR5 DRZS7L9IJHZBgOeP+KpGSY3fvqb/dDDMBJGjUCTKRRGSK1TjlLSN2jFt8oZd7ArVO1mKQZp1S06 G9ok+ZeN X-Received: by 2002:a5d:47c9:0:b0:385:db11:badf with SMTP id ffacd0b85a97d-386453d6c46mr225651f8f.22.1733749617417; 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) 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> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rogXN74MqKl5dDgRxmQ7IPX_Ruvc0sue5YY4JdVmxqI_1733749617 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true pci_intx() is a hybrid function which can sometimes be managed through devres. To remove this hybrid nature from pci_intx(), it is necessary to port users to either an always-managed or a never-managed version. cardreader/rtsx_pcr.c and tifm_7xx1.c enable their PCI-Device with pci_enable_device(). Thus, they need the never-managed version. Replace pci_intx() with pci_intx_unmanaged(). Signed-off-by: Philipp Stanner 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/rtsx_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) } pcr->irq = pcr->pci->irq; - pci_intx(pcr->pci, !pcr->msi_en); + pci_intx_unmanaged(pcr->pci, !pcr->msi_en); 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; } - pci_intx(dev, 1); + pci_intx_unmanaged(dev, 1); fm = tifm_alloc_adapter(dev->device == 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)); iounmap(fm->addr); - pci_intx(dev, 0); + pci_intx_unmanaged(dev, 0); pci_release_regions(dev); pci_disable_device(dev); From patchwork Mon Dec 9 13:06:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB2D9E77181 for ; Mon, 9 Dec 2024 13:07:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.851191.1265347 (Exim 4.92) (envelope-from ) id 1tKdTd-0001j3-Sg; Mon, 09 Dec 2024 13:07:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 851191.1265347; Mon, 09 Dec 2024 13:07:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTd-0001iq-Mv; Mon, 09 Dec 2024 13:07:05 +0000 Received: by outflank-mailman (input) for mailman id 851191; Mon, 09 Dec 2024 13:07:03 +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 1tKdTb-0000ch-Ue for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:07:03 +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 7b3b88d6-b62e-11ef-a0d5-8be0dac302b0; Mon, 09 Dec 2024 14:07:03 +0100 (CET) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361-VorUt1UHNKeLt_5llKv9cA-1; Mon, 09 Dec 2024 08:07:01 -0500 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-385dcadffebso865060f8f.0 for ; Mon, 09 Dec 2024 05:07:00 -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) 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: 7b3b88d6-b62e-11ef-a0d5-8be0dac302b0 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J6O49TnPkNeMtIPoWkV2XdJjg3ziNzZQ3FlPq3drZuU=; b=ZMPrH0El9WXhGOxw0fW4XhShln57ftb7xbRSlGkLqeF1GR8+JmtAdxyBg2d89usufnZ69H RGAFkpaKKt52ugrmLBsTA/QM58pCS5RLfQT1eaqLw7C0cdkfaVJcPkXqdiH+9kAecvgxho Zw2tFH2NuVNgYuGyHJFP0mr6U8JxUE8= X-MC-Unique: VorUt1UHNKeLt_5llKv9cA-1 X-Mimecast-MFC-AGG-ID: VorUt1UHNKeLt_5llKv9cA 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=d20SdWIRx+5ScS531ktqOcaW9EaO9SF9uG0ipBtgzKtUBU2ACVm48H6SRnh+Tmd9oq Q0W+mPwNKAGeQbrwbF0+yhFkpnitExoLSdn1Qb+cD5/Q8OH7hPx6Ux6cCGisg34ZIiiF XmHtuvWymxiPoIwsQpbq///LufIlboToNkTeaRP7Quhva1z3aMG4t35vnXZ54+ZLUlpD Vn+EGtbmFdUQO43AIh1hTcEJD1p4sxN41RcfdJgLfU3VtdJVhkgWRN1dkgS542ahkWMp RpcW3yyFI6fxLHo4G+B0+WMFoy7Da4t57TFPlgi9GWosiEGm5dvOOEBeMw7MoHoIfspr ssYQ== X-Forwarded-Encrypted: i=1; AJvYcCXYu7wjrRbFfhcI3aEdnLe0U+4K4gD+38WT63R38aDLYGj4KXYeVN04eOL8zeQqPder6ablloI7k8I=@lists.xenproject.org X-Gm-Message-State: AOJu0YxGFtq13XoBeE6OqhL7oBZTCb7gbBTEmFCr9OW2TA2H5S2FwkuJ z5p3fpyrVA6kjT+tiAwpGlDLlqgmOUEGKWtC5k1Lu/Y1qGaTYjIMHOv+P6ZNus54Ty19SdvUyu4 2X5iMuyP5mQW019DyY8yV6UQngO6PoavuNOL4j28TkhrX4Jvtm6yUO20ptRwi3MWV X-Gm-Gg: ASbGncsmc9hQlJq2Syk15CNsQnuTG7VRI4K5xbJ6QhsAnnmEBd/skGnGcHqvjeQkw9w RNaGJ/eTCS9soxobyTbvvThBp4+Fi+qGB35WL2Lkjm2m/kJJaE2YuwljfUIgTDDDJg1Iebm4LSE glj6xsfk6D8/XIRYh6otXnzNdeLSJsuhiu/X5sq3UoIsiuGrCmv9ak4Jbb2xTX05/NRE7dqK83s Je4k5gtlUlPcleScQ5eovVoZArEHuA8rHsv7LryfTXmG4rw9OgXXyUR2M1oK7UiLTF+KxHLzsd2 1/b2zAOM X-Received: by 2002:a05:6000:481d:b0:386:1cd3:8a05 with SMTP id ffacd0b85a97d-38645402350mr183799f8f.54.1733749619736; 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) 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> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: OejXA53lW106SfX-Ga5FPGYnABT84rBGhxPuyjq_VME_1733749620 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true pci_intx() is a hybrid function which can sometimes be managed through devres. To remove this hybrid nature from pci_intx(), it is necessary to port users to either an always-managed or a never-managed version. vfio enables its PCI-Device with pci_enable_device(). Thus, it needs the never-managed version. Replace pci_intx() with pci_intx_unmanaged(). Signed-off-by: Philipp Stanner 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_core.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 *vdev) if (vfio_pci_nointx(pdev)) { pci_info(pdev, "Masking broken INTx support\n"); vdev->nointx = true; - pci_intx(pdev, 0); + pci_intx_unmanaged(pdev, 0); } else vdev->pci_2_3 = 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_device *vdev) */ if (unlikely(!is_intx(vdev))) { if (vdev->pci_2_3) - pci_intx(pdev, 0); + pci_intx_unmanaged(pdev, 0); goto out_unlock; } @@ -132,7 +132,7 @@ static bool __vfio_pci_intx_mask(struct vfio_pci_core_device *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); @@ -178,7 +178,7 @@ static int vfio_pci_intx_unmask_handler(void *opaque, void *data) */ if (unlikely(!is_intx(vdev))) { if (vdev->pci_2_3) - pci_intx(pdev, 1); + pci_intx_unmanaged(pdev, 1); goto out_unlock; } @@ -296,7 +296,7 @@ static int vfio_intx_enable(struct vfio_pci_core_device *vdev, */ ctx->masked = vdev->virq_disabled; if (vdev->pci_2_3) { - pci_intx(pdev, !ctx->masked); + pci_intx_unmanaged(pdev, !ctx->masked); irqflags = IRQF_SHARED; } else { irqflags = ctx->masked ? IRQF_NO_AUTOEN : 0; @@ -569,7 +569,7 @@ static void vfio_msi_disable(struct vfio_pci_core_device *vdev, bool msix) * via their shutdown paths. Restore for NoINTx devices. */ if (vdev->nointx) - pci_intx(pdev, 0); + pci_intx_unmanaged(pdev, 0); vdev->irq_type = VFIO_PCI_NUM_IRQS; } From patchwork Mon Dec 9 13:06:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB4D2E77181 for ; Mon, 9 Dec 2024 13:07:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.851199.1265366 (Exim 4.92) (envelope-from ) id 1tKdTj-0002TY-LM; Mon, 09 Dec 2024 13:07:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 851199.1265366; Mon, 09 Dec 2024 13:07:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTj-0002TG-Gh; Mon, 09 Dec 2024 13:07:11 +0000 Received: by outflank-mailman (input) for mailman id 851199; Mon, 09 Dec 2024 13:07:10 +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 1tKdTi-0000OS-8q for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:07:10 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7dcbea3c-b62e-11ef-99a3-01e77a169b0f; Mon, 09 Dec 2024 14:07:07 +0100 (CET) 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-648-TAmSbDjWOA-EQIgmb-aQFA-1; Mon, 09 Dec 2024 08:07:03 -0500 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-385e03f54d0so1754316f8f.3 for ; Mon, 09 Dec 2024 05:07:02 -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) 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: 7dcbea3c-b62e-11ef-99a3-01e77a169b0f 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oiILKR2a3QjvArtxAPrSG5MTRD3aI59eir0l7Eg71/Q=; b=eUs8Rv4TbziekXVV36RNSDyOsZlArC5rtz6d9u9rQoFTG+vS4M9tDgeorAfJWvQm6ptea1 bfgeURj/kezC2d8gbgNDqu2Rz72woxZmo9z+EsboN5RX/pbVl4nWJdOq73gRxyRKBuRH9V yG3+IbPi9adgB3f5N3QuLnCNAcmIwjg= X-MC-Unique: TAmSbDjWOA-EQIgmb-aQFA-1 X-Mimecast-MFC-AGG-ID: TAmSbDjWOA-EQIgmb-aQFA 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=BiE2fl5L+PP6SALSEb4yf43I1cDcZZoxeDT60sZU5I87w+h59SLDh2dJ1LHjf4FgPw vQTxEBBvR0lj9wIlLVck7wV9+VCm6gCMeaPdqYO4BYscIpTcvarl6QaMwVa5a3wq2k9k JcJ4os4QlvpOD74cXVrDb3zibmwUsSiN17Eb9p8PZuPlAv9dkZhoHWAZxZI8iMRGCbRv CqJLHJaG+Ju7HjusElt1u0vv79ht1ofqO348j3HjUpudJ3anpOTJFFJUsT1cFvnhfDaJ ul9CT87lRjS1jbEp2B1MzSupqS4HCvv4NjTlpFnw9r6Wo67xjTig7kMFZ8/knpQdYaub qEqQ== X-Forwarded-Encrypted: i=1; AJvYcCVtqZeDxZ+8fxiXM8YAV6OgxnviWMsAzZ6VpFfhGWohoL1C2UIf80+FXLMqLXbevfmiQ4Te0aMjTGU=@lists.xenproject.org X-Gm-Message-State: AOJu0Yx2ZPAjIbe2bMvcF//P1cSQXcTHnh8rY+3KlVB+mM9bGVfXIbNP Y6c7Q+cvEKJjW9l1MnwGbx29ReqOlr7LCkz19E6AL9dxMfZxMAB7tTFAAOwTVb8nTeWqScqJRvf 4pZG81WaCHUMNXiasGD2d9jA61k/VNNbiyiNoeRXh3mum3J1WXd9uY1LYiXEgRYL+ X-Gm-Gg: ASbGncvJJFznai54yBWT/jdmJkZNd75dRDYcEWJCtOp0ub5xJ2uQxoO3XIquiHHJv5O vk2o0visIu1J2lxCvonk87GmUoHVDIyPkK4SvbzmvCYfrTnoo9d/Cwg9JDb1jZ+NSRPyOHjEOqh OnUzxM6+G+ul51SydeWQbDaj1d6Nfjijb4Ek99N8s686dOkbPFnaQm0lVLXD3VgF3n7oTOostTi JcmlKsbWxm7kTJHVpEd/yiQXNTbtNfxZOUSBwwOaCjnmrCPAHf3tJTzUncXC9F4q47Bs8Q95PxU y1JZqzgB X-Received: by 2002:adf:e18a:0:b0:385:e3b8:f331 with SMTP id ffacd0b85a97d-3862b355ed9mr8982755f8f.14.1733749621852; 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) 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> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: mcadjiQ_Y4gVOF9CqH3DI3k7t95Y-5oJv_VqqFlxR14_1733749622 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true pci_intx() is a hybrid function which can sometimes be managed through devres. To remove this hybrid nature from pci_intx(), it is necessary to port users to either an always-managed or a never-managed version. MSI sets up its own separate devres callback implicitly in pcim_setup_msi_release(). This callback ultimately uses pci_intx(), which is problematic since the callback of course runs on driver-detach. That problem has last been described here: https://lore.kernel.org/all/ee44ea7ac760e73edad3f20b30b4d2fff66c1a85.camel@redhat.com/ Replace the call to pci_intx() with one to the never-managed version pci_intx_unmanaged(). Signed-off-by: Philipp Stanner Reviewed-by: Thomas Gleixner --- drivers/pci/msi/api.c | 2 +- drivers/pci/msi/msi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c index b956ce591f96..c95e2e7dc9ab 100644 --- a/drivers/pci/msi/api.c +++ b/drivers/pci/msi/api.c @@ -289,7 +289,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, */ if (affd) irq_create_affinity_masks(1, affd); - pci_intx(dev, 1); + pci_intx_unmanaged(dev, 1); return 1; } } diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index 3a45879d85db..53f13b09db50 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(pci_write_msi_msg); static void pci_intx_for_msi(struct pci_dev *dev, int enable) { if (!(dev->dev_flags & PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG)) - pci_intx(dev, enable); + pci_intx_unmanaged(dev, enable); } static void pci_msi_set_enable(struct pci_dev *dev, int enable) From patchwork Mon Dec 9 13:06:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF772E77182 for ; Mon, 9 Dec 2024 13:07:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.851204.1265386 (Exim 4.92) (envelope-from ) id 1tKdTm-00039M-Ci; Mon, 09 Dec 2024 13:07:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 851204.1265386; Mon, 09 Dec 2024 13:07:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTm-00038u-70; Mon, 09 Dec 2024 13:07:14 +0000 Received: by outflank-mailman (input) for mailman id 851204; Mon, 09 Dec 2024 13:07:12 +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 1tKdTk-0000OS-9U for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:07:12 +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 7f0a196d-b62e-11ef-99a3-01e77a169b0f; Mon, 09 Dec 2024 14:07:09 +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-661-k0VvuAkBNoGDssioiK_UpQ-1; Mon, 09 Dec 2024 08:07:05 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-385df115300so2533957f8f.2 for ; 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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:07:03 -0800 (PST) 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: 7f0a196d-b62e-11ef-99a3-01e77a169b0f 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nnuXTvhYTlwCBDrOS1s2G6F9Hq/4HeIeK8aJfi4Wc90=; b=iZbKJL8wiWWAHLaxPEEmQomjtPQWeJdGB+ViDqye9UvXGMZVXzT7z6mzy3PVUjl1RGpW6X xsHglo5TceUu95FXfFgar2MbdGZPlCbKcjGiPMxfkL5e2y7mGvc4RjUmZUXGZd9HZeij+O tMcB3ecJ7G28iU5OUlBoqOib+Ov9mxY= X-MC-Unique: k0VvuAkBNoGDssioiK_UpQ-1 X-Mimecast-MFC-AGG-ID: k0VvuAkBNoGDssioiK_UpQ 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=gFSoSZqKnOXr9c1Et3X3Q92IuXxjyw+VccYv97W6MVZjajMKads064DYeKaWpT7BYq oLF6D2tHnAwuvpEHpbpiuPP2rXYeeqe8gdggciHkNCu5lRiNnHpID85o0sj9CEyOpEk7 C61kmi91E0qqRJ8qNQdT/zmymvKcv0AG7uT6hk1ppjeDgD6Q8oMJFvxHcx59nkVh3dwv GKEWtvEgW308z36Ps2/kL6Y1vxtsR1ol2aGTE7niykXxQKjbNDyH92A+6XGHrUk/HNJy 9mtvttVRjjWfHxHd8NW0vCYYMcIjQob9Hqhs87wlFMyy+39kZHJfRgIpLUR/f28ND/x1 SpKA== X-Forwarded-Encrypted: i=1; AJvYcCV3syEX2Kjjdgnv/l4/wJcBrcPJC6Zrg+0WdIw5P9DmmkJf3NFNe2hkt2+26VtY+PqyEqeoa6jOfXk=@lists.xenproject.org X-Gm-Message-State: AOJu0YzXytDaPGWEEzIA47I1ec1C4hFg3g2Xh5yuyNck+CKFWKcEzGsN Sew9vhH2XM2A4GBtjT72D/TVsDb7xEJofbp89rvVTV4hmNXCvQNyX/GVzmSlGRWlG7VwLpTQ8G0 Tloty/So7Aj7qfuFBWcYz2kSzSMDbhGpLeRv6NZ4WKJK4sUhlpeiFoYsnvMXQ5ljV X-Gm-Gg: ASbGncsvURBpTzGDd9EVwls1v6ILJlLmNlTJ1o1Xp1ZXrL0nEdEZqdLAi6Ay/IYxfCb 1F2eHzPS85OlA4bgHC6qDBZZgLEWtwDqLet2A7B4a7+uf8BuV4EDUVhM3nXpuEsaoHNe4ggjM2s 9bH5lfjUa4Qr89L7N0oiO8E7sznbVNszqIsTTn8QnTw6fua3nvEP3NeZ3E5ApjcY92aYgIriKyK YzbDtMbpvZQ7vy7kIo7Z6GbK07UCCmhZHvrxyAjcr6TFyP35JRUm+t6nT4ZEnChysouq1r6Dp3F IIRkfda4 X-Received: by 2002:a05:6000:a07:b0:386:1ba1:37dc with SMTP id ffacd0b85a97d-3862b3d02a7mr10541521f8f.47.1733749624044; 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) 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> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: UPqrqIGy0DeB6m8us0pT3QKU2uKvNDYpxz5f3H1elcM_1733749624 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true pci_intx() is a hybrid function which can sometimes be managed through devres. To remove this hybrid nature from pci_intx(), it is necessary to port users to either an always-managed or a never-managed version. All users in ata enable their PCI-Device with pcim_enable_device(). Thus, they need the always-managed version. Replace pci_intx() with pcim_intx(). Signed-off-by: Philipp Stanner 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) if (ahci_init_msi(pdev, n_ports, hpriv) < 0) { /* legacy intx interrupts */ - pci_intx(pdev, 1); + pcim_intx(pdev, 1); } hpriv->irq = pci_irq_vector(pdev, 0); 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); 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 struct pci_device_id *ent) return rc; host->private_data = hpriv; - pci_intx(pdev, 1); + pcim_intx(pdev, 1); host->flags |= ATA_HOST_PARALLEL_SCAN; 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) if (sata_sil24_msi && !pci_enable_msi(pdev)) { dev_info(&pdev->dev, "Using MSI\n"); - pci_intx(pdev, 0); + pcim_intx(pdev, 0); } 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 struct pci_device_id *ent) } 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 struct pci_device_id *ent) } 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); if (pci_enable_msi(pdev) == 0) - pci_intx(pdev, 0); + pcim_intx(pdev, 0); /* * Config offset 0x98 is "Extended Control and Status Register 0" From patchwork Mon Dec 9 13:06:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BEDBCE7717D for ; Mon, 9 Dec 2024 13:07:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.851200.1265371 (Exim 4.92) (envelope-from ) id 1tKdTk-0002X7-17; Mon, 09 Dec 2024 13:07:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 851200.1265371; Mon, 09 Dec 2024 13:07:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTj-0002WQ-Rw; Mon, 09 Dec 2024 13:07:11 +0000 Received: by outflank-mailman (input) for mailman id 851200; Mon, 09 Dec 2024 13:07:10 +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 1tKdTi-0000ch-Kj for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:07:10 +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 7f3dac26-b62e-11ef-a0d5-8be0dac302b0; Mon, 09 Dec 2024 14:07:10 +0100 (CET) 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-56-IgpqTL54MBeCdSRbIwd3BA-1; Mon, 09 Dec 2024 08:07:07 -0500 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3861cd03a89so1764675f8f.1 for ; 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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 05:07:05 -0800 (PST) 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: 7f3dac26-b62e-11ef-a0d5-8be0dac302b0 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QrzFiyozzKwphrmER/QLBGC9UXhx6Rbz0xOMvDA9uiM=; b=YmWQ6iKCwI3+3rUQkJ6JMqQOz5ieCLFkktJvs5VRw9t5MIcph5sZF+kuysSoNRhgITxqDV J+TF7DK+cacr44n9J5nDKKAqWFJVmoct8+8AsS5BOGKAeVk0EltnLlAxOncBJoHVgSyqFz qH7Z8Pvh9oCvATd5ibX9yO3BILxOEl8= X-MC-Unique: IgpqTL54MBeCdSRbIwd3BA-1 X-Mimecast-MFC-AGG-ID: IgpqTL54MBeCdSRbIwd3BA 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=SiONKch5O4kXiaQ5Gwdl469aUJ+tyAlPqGQtE3+QHaRYbScVucmGs2/S0lscKkfyHX 1fe3G34LtflX7zSMINX+wRBy+HaylHqBcmGX9FziK4n5BB3YohArjoiK2gk/anM7vM/w LJAv1aRjFsNpsPLcNHR96qTScAH5S2vyTJT+WjAJotKJ5vyGFbE+EoElEn7+dH1XAa1U Lj5uoMQNMF9w6TlORIgGZlF1nGeALXWKpN6HdwMFszy9otBapy4OXJcv3BsOUgHqV8xH yubcHvI+EPvxnjt/2Js3+XBw3YtLkgFX2dJDb0rVmGM1Cl8tcAn2ix7LoWmzv642Uru+ ppuw== X-Forwarded-Encrypted: i=1; AJvYcCVutv7NdzqJq8eZxiMVvPQF0CDVp+kJOsGbd1WmMHujOJYGc+OD7jtGYke7Hes+zaDFqCunpOjeNbc=@lists.xenproject.org X-Gm-Message-State: AOJu0YxQQAwqrhCMEgtku9TiTfkiewbuc9K2uJL9kJ1WuWhDXHWTT6XZ N55/Z7fsa7y85Nq9Ow1lHhOMjOn8NZdowBDtUT0esQSb/HKUIX4GRCkr/n8bALQkjQQlFrPl9YD DAK0744WSxXqJK7G8Qyk3JFwa9+KE807yb/Npt6zFWvFnqXY4iQmV23fYeWQhkzq8 X-Gm-Gg: ASbGncu+wUP6uE2rxfluOtjwx6+ne4y5IiCZtJtQJF6how2KkNLWm7RXGcY0SqNilN9 qQAVd/1GdLo3ugcKfLfsdfwlUJHm71eAmZlpqltzUV2TMOAKKS2WZXVPKObe8QFYKjgS759Ap1O 2JFJDow0ucbLtR5FLprCJphs6Vfeul8dJ7TbM/8E/dzRxQRlzLGO5RSXX1l2oiFYT9OTvIerU1t ddYPcsC1CBdp/Nl3/meH2HljDamjaWd0bWWoo8XH89bN7ZOPPWIIsudYow1mrKYvJJ9+dxzedFN qXs/HDex X-Received: by 2002:a05:6000:79e:b0:385:e9c0:c069 with SMTP id ffacd0b85a97d-3862b3d0941mr9603888f8f.57.1733749626167; 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) 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> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ntTZ69gNOfwOYfO13OYiTTilOnNZ2L7BWMVgxKiek24_1733749626 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true pci_intx() is a hybrid function which can sometimes be managed through devres. To remove this hybrid nature from pci_intx(), it is necessary to port users to either an always-managed or a never-managed version. qtnfmac enables its PCI-Device with pcim_enable_device(). Thus, it needs the always-managed version. Replace pci_intx() with pcim_intx(). Signed-off-by: Philipp Stanner Acked-by: Kalle Valo --- drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c b/drivers/net/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_priv *priv, bool use_msi) if (!priv->msi_enabled) { pr_warn("legacy PCIE interrupts enabled\n"); - pci_intx(pdev, 1); + pcim_intx(pdev, 1); } } From patchwork Mon Dec 9 13:06:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4C89E7717D for ; Mon, 9 Dec 2024 13:07:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.851207.1265392 (Exim 4.92) (envelope-from ) id 1tKdTn-0003GL-10; Mon, 09 Dec 2024 13:07:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 851207.1265392; Mon, 09 Dec 2024 13:07:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdTm-0003El-Pp; Mon, 09 Dec 2024 13:07:14 +0000 Received: by outflank-mailman (input) for mailman id 851207; Mon, 09 Dec 2024 13:07:13 +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 1tKdTl-0000OS-Nm for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:07:13 +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 80721f25-b62e-11ef-99a3-01e77a169b0f; Mon, 09 Dec 2024 14:07:12 +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-117-uac86oUmOFObv_Lg_jXchQ-1; Mon, 09 Dec 2024 08:07:09 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-434c214c05aso36610395e9.0 for ; Mon, 09 Dec 2024 05:07:09 -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) 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: 80721f25-b62e-11ef-99a3-01e77a169b0f 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cg5FDrf0+9NG9f4wa7LEIeg49zn7uGzDf8HKpIKXKbU=; b=VM7y4uGewQosbc7LfMjsniDOAjbmfqEqTJM42BDCKc9Prxx5eOrQ9Nsp/YveAiXus5TM5u RdvYDaOP306MnCVwa/0Dtc58OJT5j3poeEwL5ne0FQHuohxfTjALZIn5hsALMbQ7VU494a FfncfBtBrqtNN+JsovTTGurqk97jNj0= X-MC-Unique: uac86oUmOFObv_Lg_jXchQ-1 X-Mimecast-MFC-AGG-ID: uac86oUmOFObv_Lg_jXchQ 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=UM/DCV4uO3y2wmmhuGo2y7fpAF8WnvwEOtFTdnGCmhU9PWOpXpdUJ3uPt/AsAuhCxU xpEvUCneoqWvlMVV/79z4/YQGkTy4o65/WvtOQuktpMCwrbzXYRSKlxydQBtJRb7yCtv 1qwvR2XE3g3R7YKM5ivOhV8rXgE9+VL8JAfdmRiKvROY3CAF1vXz3S+BdlNjsNyPgGbh VTlua+1Wj5TPXhBK3hScteyIibOcDjmTyxzNrve2sexzKeX9ddngPiy+3rqsiKK8K0LJ KyFaoxzIsVE+aYrJsG0GSvOwkwxV0okgqEkOOd16RxUvJztinx+gYKZROO81CFLV9Mz9 hlxw== X-Forwarded-Encrypted: i=1; AJvYcCUxjBMTcbl5aG43oKgdn5T50BTxtA6+CPW/KnPeo2jUrX/d9T+sABX8CBUTY5qvpVDnlAuLN3bxyWo=@lists.xenproject.org X-Gm-Message-State: AOJu0YzQz4OB9aUhuAip86SGVP3KjwQX2BZcXv/PaF3oytCBEgSKkIXW fyB8G9SSI4p+kZrj+Xpfy1p8B6yU2b7tZz4rHOoi9cwy97yFpBnQm4HFIAsWsDDgnl7NPQwHmEJ fn1/7QuGfdZszL6kZ6/PTrxGA/m3xF6ljUQzAByQpi+ky00NdqhO9096+HJkqiwZL X-Gm-Gg: ASbGnculvldtMHU4GE1CvMRcpdpw67hIDzEXYV6utI9GrjhOfMDUl30oje3doc0Vq8B zTu5cyAQKMd/hyDEwiwE3kerEgRxf/FLOl4aVOgx1KlqSOEgnm++IoeJ9M6SXJvvm307ZRElSYW 416Dj+mxGL9bpDZtty+n8prmny6Hol8ZYf4I9UF4sU0Z6iFMfEKgXXpz9xB7oCM8Ir33FaNc3hG RLEuu1HLHw+nkZGK0fZAU/+6bUuwRtfFVND1+goZwKULWmdVuygt2JppTRKWq1DwA4WYyNh2h9v ZELL4Ufd X-Received: by 2002:a05:6000:2d12:b0:385:faec:d94d with SMTP id ffacd0b85a97d-3862b3e2f99mr6786250f8f.51.1733749628311; 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) 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> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: cokNTiC4lOpw8nwSmQlxwFLcd9thvpkkTOzojUKq7_k_1733749628 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true pci_intx() is a hybrid function which can sometimes be managed through devres. To remove this hybrid nature from pci_intx(), it is necessary to port users to either an always-managed or a never-managed version. All users 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-hid/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; - pci_intx(privdata->pdev, true); + pcim_intx(privdata->pdev, true); rc = 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 = 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); } diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-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); } From patchwork Mon Dec 9 13:06:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13899747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03086E7717D for ; Mon, 9 Dec 2024 13:10:46 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.851256.1265406 (Exim 4.92) (envelope-from ) id 1tKdX3-0007Ue-LX; Mon, 09 Dec 2024 13:10:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 851256.1265406; Mon, 09 Dec 2024 13:10:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tKdX3-0007UD-IQ; Mon, 09 Dec 2024 13:10:37 +0000 Received: by outflank-mailman (input) for mailman id 851256; Mon, 09 Dec 2024 13:10:36 +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 1tKdTs-0000ch-NU for xen-devel@lists.xenproject.org; Mon, 09 Dec 2024 13:07:20 +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 83007d97-b62e-11ef-a0d5-8be0dac302b0; Mon, 09 Dec 2024 14:07:16 +0100 (CET) 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-636-73G_LgCWMNy0xbJQsLo6Tw-1; Mon, 09 Dec 2024 08:07:14 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-434fff37885so888695e9.3 for ; Mon, 09 Dec 2024 05:07:13 -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) 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: 83007d97-b62e-11ef-a0d5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733749635; 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=6HNQFFZFNBo2fKXDk5eFuu7P7NBI6b9tUTkzIaFtOWU=; b=NRatnZhGonb65bvfPmdPRDr8bgEh0s0peyHC9oGS/z5Fz29Hy7/yD/2afUNByoTvVFK9lj TTXzjvfQNmvuXdNPpaLrso5IsuEffdZzk4XidNJxf9+nS44/saPeWdruAP2tELxIw1Wivt pEWg18GUxAe+EaBdIzY1sPkKOyL9r+k= X-MC-Unique: 73G_LgCWMNy0xbJQsLo6Tw-1 X-Mimecast-MFC-AGG-ID: 73G_LgCWMNy0xbJQsLo6Tw 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=UF7n6ToAGffhM3hDZZMnUd72FFV03BTVznosiQGqcL5X8rtRZjsojku26WTTnJVTSd ZUEBPoWVGH+fFnoMX99XZiYhskqRYJD8WhJQu6st+d4gP8Giu0azHOPII0QbPQ5qYlw8 bx6IGXYixZCw3afLxGHmlNGT8JASusUXHb2eN02cmZt7gJ1as1EXG0ixF8H52nD7pJa1 SKrtulA3cAst6wb50KEMNUWU6r2N9efko7wYg73UXmYphnG4a3KJjxsr4y+5EUsfnj1y YEeCWSPS1KK9Lav07HvUpcUkhLqJ8cc2zNod23U4tK77ZN5L0+n6FVmY9hhxldtrx3tw x2ig== X-Forwarded-Encrypted: i=1; AJvYcCWPinTjmHlp6+roiVZfigB/wSZhPb3wWHi186D1+PjurkAMaD6eLChz8cP9Ny6yNOxPRORF66yWKJQ=@lists.xenproject.org X-Gm-Message-State: AOJu0YwoxK4907iqcL7vEjKQvERSAV84RQCkbepHhZyvhBgNLRXuTuwJ 7e/CD1+wdHBDrry6OugEBXoTpt6ND1+zmUuQI80U2bqqLCsw/h0j6OUXlaRCGeB8LYgzaNYAyeJ 45j6YWsdaMFUf3z5I7UDONsIacXn2kZDAph3sbNkn4VicCflqduwIRADp10qZZOmJ X-Gm-Gg: ASbGnctc0Joyp81BxpzLkjW366J00LJCvruqU+oi+W/4DJo5Xzz7bO041tN0qLYWF1V myVLf/q6pQ1fLtcNehzVmz7OY7j4tCXfVGEW+Pc1BQ697AUWeSObMcEJpE3W/2/2VuxFB+KAnay gRCHXHE8U90+Xd9jzI3jG/uRfGr8B1Ja+HA/Jhl2Ok5nCu/Z4O/UB8f3/OAMUWC81yXeJ00clYv fpJgUpt+EsRQHPbsLq0bLuTWLN9ZIU+UB1J5Lb12Lt7NHwi1ygHwMYO9FXtLanhY2caaVfjMbzS yp3koh5Y X-Received: by 2002:a05:600c:3547:b0:434:a525:7257 with SMTP id 5b1f17b1804b1-434fffd0490mr3116165e9.21.1733749630791; 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) 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> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: xz6DGUNq0y1h8u6CeMDiaJ4kGfcKhmhrEydd4DKMdSg_1733749633 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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/rtsx_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) } pcr->irq = pcr->pci->irq; - pci_intx_unmanaged(pcr->pci, !pcr->msi_en); + pci_intx(pcr->pci, !pcr->msi_en); 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; } - pci_intx_unmanaged(dev, 1); + pci_intx(dev, 1); fm = tifm_alloc_adapter(dev->device == 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)); iounmap(fm->addr); - pci_intx_unmanaged(dev, 0); + pci_intx(dev, 0); pci_release_regions(dev); 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); if (val & IGU_PF_CONF_INT_LINE_EN) - pci_intx_unmanaged(bp->pdev, true); + pci_intx(bp->pdev, true); barrier(); 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) } } - pci_intx_unmanaged(bnad->pcidev, 0); + pci_intx(bnad->pcidev, 0); return; diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.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: /* Try to set up intx irq */ - pci_intx_unmanaged(pdev, 1); + pci_intx(pdev, 1); rc = 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); } } 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, /* Try to set up intx irq */ - pci_intx_unmanaged(pdev, 1); + pci_intx(pdev, 1); rc = 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 = to_pci_dev(dev); struct pcim_intx_devres *res = data; - pci_intx_unmanaged(pdev, res->orig_intx); + pci_intx(pdev, res->orig_intx); } static struct pcim_intx_devres *get_or_create_intx_devres(struct device *dev) @@ -453,7 +453,7 @@ int pcim_intx(struct pci_dev *pdev, int enable) return -ENOMEM; res->orig_intx = !enable; - pci_intx_unmanaged(pdev, enable); + pci_intx(pdev, enable); 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); } 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) } /** - * 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; @@ -4509,41 +4505,6 @@ void pci_intx_unmanaged(struct pci_dev *pdev, int enable) 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 managed - * when pcim_enable_device() has been called in advance. This hybrid feature 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 = pci_command & ~PCI_COMMAND_INTX_DISABLE; - else - new = pci_command | PCI_COMMAND_INTX_DISABLE; - - if (new != pci_command) { - /* Preserve the "hybrid" behavior for backwards compatibility */ - if (pci_is_managed(pdev)) { - WARN_ON_ONCE(pcim_intx(pdev, enable) != 0); - return; - } - - pci_write_config_word(pdev, PCI_COMMAND, new); - } -} EXPORT_SYMBOL_GPL(pci_intx); /** diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.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 *vdev) if (vfio_pci_nointx(pdev)) { pci_info(pdev, "Masking broken INTx support\n"); vdev->nointx = true; - pci_intx_unmanaged(pdev, 0); + pci_intx(pdev, 0); } else vdev->pci_2_3 = 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_device *vdev) */ if (unlikely(!is_intx(vdev))) { if (vdev->pci_2_3) - pci_intx_unmanaged(pdev, 0); + pci_intx(pdev, 0); goto out_unlock; } @@ -132,7 +132,7 @@ static bool __vfio_pci_intx_mask(struct vfio_pci_core_device *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); @@ -178,7 +178,7 @@ static int vfio_pci_intx_unmask_handler(void *opaque, void *data) */ if (unlikely(!is_intx(vdev))) { if (vdev->pci_2_3) - pci_intx_unmanaged(pdev, 1); + pci_intx(pdev, 1); goto out_unlock; } @@ -296,7 +296,7 @@ static int vfio_intx_enable(struct vfio_pci_core_device *vdev, */ ctx->masked = vdev->virq_disabled; if (vdev->pci_2_3) { - pci_intx_unmanaged(pdev, !ctx->masked); + pci_intx(pdev, !ctx->masked); irqflags = IRQF_SHARED; } else { irqflags = ctx->masked ? IRQF_NO_AUTOEN : 0; @@ -569,7 +569,7 @@ static void vfio_msi_disable(struct vfio_pci_core_device *vdev, bool msix) * via their shutdown paths. Restore for NoINTx devices. */ if (vdev->nointx) - pci_intx_unmanaged(pdev, 0); + pci_intx(pdev, 0); vdev->irq_type = 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 offset, u16 value, void *data) 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)); cmd->val = value; 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);