public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Philipp Stanner <pstanner@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: [PATCH RFC 2/2] PCI: Remove MWI and INTX related members from struct pci_devres
Date: Fri, 29 Mar 2024 22:42:29 +0100	[thread overview]
Message-ID: <abc8adf3-32e2-4d43-87bc-a835c01a900d@gmail.com> (raw)
In-Reply-To: <cb48fd68-9bfa-45b7-ac4f-d1c2b9b1f207@gmail.com>

After patch 1 of the series the original value of register PCI_COMMAND
is restored in pcim_release. Therefore the code removed here isn't
needed any longer.

In a follow-up step pcim_set_mwi() could be removed.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/pci/devres.c |  7 -------
 drivers/pci/pci.c    | 11 +----------
 drivers/pci/pci.h    |  3 ---
 3 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 7766f4df4..2661f7775 100644
--- a/drivers/pci/devres.c
+++ b/drivers/pci/devres.c
@@ -150,13 +150,6 @@ EXPORT_SYMBOL(devm_pci_remap_cfg_resource);
  */
 int pcim_set_mwi(struct pci_dev *dev)
 {
-	struct pci_devres *dr;
-
-	dr = find_pci_dr(dev);
-	if (!dr)
-		return -ENOMEM;
-
-	dr->mwi = 1;
 	return pci_set_mwi(dev);
 }
 EXPORT_SYMBOL(pcim_set_mwi);
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e5f243dd4..2007edaaa 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4408,17 +4408,8 @@ void pci_intx(struct pci_dev *pdev, int enable)
 	else
 		new = pci_command | PCI_COMMAND_INTX_DISABLE;
 
-	if (new != pci_command) {
-		struct pci_devres *dr;
-
+	if (new != pci_command)
 		pci_write_config_word(pdev, PCI_COMMAND, new);
-
-		dr = find_pci_dr(pdev);
-		if (dr && !dr->restore_intx) {
-			dr->restore_intx = 1;
-			dr->orig_intx = !enable;
-		}
-	}
 }
 EXPORT_SYMBOL_GPL(pci_intx);
 
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 17fed1846..a1bb8191c 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -825,9 +825,6 @@ static inline pci_power_t mid_pci_get_power_state(struct pci_dev *pdev)
 struct pci_devres {
 	unsigned int enabled:1;
 	unsigned int pinned:1;
-	unsigned int orig_intx:1;
-	unsigned int restore_intx:1;
-	unsigned int mwi:1;
 	u32 region_mask;
 };
 
-- 
2.44.0



      parent reply	other threads:[~2024-03-29 21:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29 21:40 [PATCH RFC 0/2] PCI: Restore original PCI_COMMAND value in pcim_release Heiner Kallweit
2024-03-29 21:41 ` [PATCH RFC 1/2] " Heiner Kallweit
2024-03-29 21:42 ` Heiner Kallweit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abc8adf3-32e2-4d43-87bc-a835c01a900d@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=pstanner@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox