From: Bjorn Helgaas <helgaas@kernel.org>
To: Vidya Sagar <vidyas@nvidia.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Krishna Kishore <kthota@nvidia.com>,
Manikanta Maddireddy <mmaddireddy@nvidia.com>,
Vidya Sagar <sagar.tv@gmail.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>
Subject: [PATCH v3 2/3] PCI/MSI: Move MSI/MSI-X flags updaters to msi.c
Date: Thu, 3 Dec 2020 12:51:09 -0600 [thread overview]
Message-ID: <20201203185110.1583077-3-helgaas@kernel.org> (raw)
In-Reply-To: <20201203185110.1583077-1-helgaas@kernel.org>
From: Bjorn Helgaas <bhelgaas@google.com>
pci_msi_set_enable() and pci_msix_clear_and_set_ctrl() are only used from
msi.c, so move them from drivers/pci/pci.h to msi.c. No functional change
intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/msi.c | 21 +++++++++++++++++++++
drivers/pci/pci.h | 21 ---------------------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 555791c0ee1a..3e302ca8a96f 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -412,6 +412,17 @@ static void pci_intx_for_msi(struct pci_dev *dev, int enable)
pci_intx(dev, enable);
}
+static void pci_msi_set_enable(struct pci_dev *dev, int enable)
+{
+ u16 control;
+
+ pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
+ control &= ~PCI_MSI_FLAGS_ENABLE;
+ if (enable)
+ control |= PCI_MSI_FLAGS_ENABLE;
+ pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control);
+}
+
static void __pci_restore_msi_state(struct pci_dev *dev)
{
u16 control;
@@ -434,6 +445,16 @@ static void __pci_restore_msi_state(struct pci_dev *dev)
pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control);
}
+static void pci_msix_clear_and_set_ctrl(struct pci_dev *dev, u16 clear, u16 set)
+{
+ u16 ctrl;
+
+ pci_read_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, &ctrl);
+ ctrl &= ~clear;
+ ctrl |= set;
+ pci_write_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, ctrl);
+}
+
static void __pci_restore_msix_state(struct pci_dev *dev)
{
struct msi_desc *entry;
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 3f5f303775c4..5692f11bc146 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -187,27 +187,6 @@ void pci_no_msi(void);
static inline void pci_no_msi(void) { }
#endif
-static inline void pci_msi_set_enable(struct pci_dev *dev, int enable)
-{
- u16 control;
-
- pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
- control &= ~PCI_MSI_FLAGS_ENABLE;
- if (enable)
- control |= PCI_MSI_FLAGS_ENABLE;
- pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control);
-}
-
-static inline void pci_msix_clear_and_set_ctrl(struct pci_dev *dev, u16 clear, u16 set)
-{
- u16 ctrl;
-
- pci_read_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, &ctrl);
- ctrl &= ~clear;
- ctrl |= set;
- pci_write_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, ctrl);
-}
-
void pci_realloc_get_opt(char *);
static inline int pci_no_d1d2(struct pci_dev *dev)
--
2.25.1
next prev parent reply other threads:[~2020-12-03 18:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 18:51 [PATCH v3 0/3] PCI/MSI: Cleanup init and improve 32-bit MSI checking Bjorn Helgaas
2020-12-03 18:51 ` [PATCH v3 1/3] PCI/MSI: Move MSI/MSI-X init to msi.c Bjorn Helgaas
2020-12-04 11:05 ` Thierry Reding
2020-12-04 18:11 ` Bjorn Helgaas
2020-12-03 18:51 ` Bjorn Helgaas [this message]
2020-12-04 11:06 ` [PATCH v3 2/3] PCI/MSI: Move MSI/MSI-X flags updaters " Thierry Reding
2020-12-03 18:51 ` [PATCH v3 3/3] PCI/MSI: Set device flag indicating only 32-bit MSI support Bjorn Helgaas
2020-12-04 11:07 ` Thierry Reding
2020-12-04 18:21 ` [PATCH v3 0/3] PCI/MSI: Cleanup init and improve 32-bit MSI checking Bjorn Helgaas
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=20201203185110.1583077-3-helgaas@kernel.org \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=jonathanh@nvidia.com \
--cc=kthota@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mmaddireddy@nvidia.com \
--cc=sagar.tv@gmail.com \
--cc=thierry.reding@gmail.com \
--cc=vidyas@nvidia.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;
as well as URLs for NNTP newsgroup(s).