From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: kishon@ti.com, lorenzo.pieralisi@arm.com, kw@linux.com,
bhelgaas@google.com, robh@kernel.org
Cc: linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: [PATCH 5/8] PCI: endpoint: Add BME notifier support
Date: Mon, 2 May 2022 11:36:08 +0530 [thread overview]
Message-ID: <20220502060611.58987-6-manivannan.sadhasivam@linaro.org> (raw)
In-Reply-To: <20220502060611.58987-1-manivannan.sadhasivam@linaro.org>
Add support to notify the EPF device about the Bus Master Enable (BME)
event received by the EPC device from the Root complex.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/endpoint/pci-epc-core.c | 17 +++++++++++++++++
include/linux/pci-epc.h | 1 +
include/linux/pci-epf.h | 1 +
3 files changed, 19 insertions(+)
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
index 8401c2750c9e..6120d99bff73 100644
--- a/drivers/pci/endpoint/pci-epc-core.c
+++ b/drivers/pci/endpoint/pci-epc-core.c
@@ -731,6 +731,23 @@ void pci_epc_init_notify(struct pci_epc *epc)
}
EXPORT_SYMBOL_GPL(pci_epc_init_notify);
+/**
+ * pci_epc_bme_notify() - Notify the EPF device that the EPC device has received
+ * the BME event from the Root complex
+ * @epc: the EPC device that received the BME event
+ *
+ * Invoke to Notify the EPF device that the EPC device has received the Bus
+ * Master Enable (BME) event from the Root complex
+ */
+void pci_epc_bme_notify(struct pci_epc *epc)
+{
+ if (!epc || IS_ERR(epc))
+ return;
+
+ atomic_notifier_call_chain(&epc->notifier, BME, NULL);
+}
+EXPORT_SYMBOL_GPL(pci_epc_bme_notify);
+
/**
* pci_epc_destroy() - destroy the EPC device
* @epc: the EPC device that has to be destroyed
diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h
index d346ab9ae061..8454610df4c3 100644
--- a/include/linux/pci-epc.h
+++ b/include/linux/pci-epc.h
@@ -217,6 +217,7 @@ int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf,
void pci_epc_linkup(struct pci_epc *epc);
void pci_epc_linkdown(struct pci_epc *epc);
void pci_epc_init_notify(struct pci_epc *epc);
+void pci_epc_bme_notify(struct pci_epc *epc);
void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf,
enum pci_epc_interface_type type);
int pci_epc_write_header(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
diff --git a/include/linux/pci-epf.h b/include/linux/pci-epf.h
index b1fcd88d0b1f..e03c57129ed5 100644
--- a/include/linux/pci-epf.h
+++ b/include/linux/pci-epf.h
@@ -21,6 +21,7 @@ enum pci_notify_event {
CORE_INIT,
LINK_UP,
LINK_DOWN,
+ BME,
};
enum pci_barno {
--
2.25.1
next prev parent reply other threads:[~2022-05-02 6:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-02 6:06 [PATCH 0/8] Add support for MHI Endpoint function driver Manivannan Sadhasivam
2022-05-02 6:06 ` [PATCH 1/8] PCI: endpoint: Pass EPF device ID to the probe function Manivannan Sadhasivam
2022-05-02 6:06 ` [PATCH 2/8] PCI: endpoint: Warn and return if EPC is started/stopped multiple times Manivannan Sadhasivam
2022-05-02 6:06 ` [PATCH 3/8] PCI: endpoint: Add an API for unregistering the EPF notifier Manivannan Sadhasivam
2022-05-02 6:06 ` [PATCH 4/8] PCI: endpoint: Add linkdown notifier support Manivannan Sadhasivam
2022-05-02 6:06 ` Manivannan Sadhasivam [this message]
2022-05-02 6:06 ` [PATCH 6/8] PCI: qcom-ep: Add support for Link down notification Manivannan Sadhasivam
2022-05-02 6:06 ` [PATCH 7/8] PCI: qcom-ep: Add support for BME notification Manivannan Sadhasivam
2022-05-02 6:06 ` [PATCH 8/8] PCI: endpoint: Add PCI Endpoint function driver for MHI bus Manivannan Sadhasivam
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=20220502060611.58987-6-manivannan.sadhasivam@linaro.org \
--to=manivannan.sadhasivam@linaro.org \
--cc=bhelgaas@google.com \
--cc=kishon@ti.com \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=robh@kernel.org \
/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).