diff options
author | Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | 2023-06-02 17:17:52 +0530 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2023-06-23 15:05:28 -0500 |
commit | 6360efb96b19d89990b2a5bf3a73c689a429f5da (patch) | |
tree | 41239fd2544dfc99c325f528c03c21dcfc7d1dca /drivers/pci | |
parent | a1f6c3d7d3a2fdcb7bf77da17a17944c81ca13de (diff) | |
download | linux-stable-6360efb96b19d89990b2a5bf3a73c689a429f5da.tar.gz linux-stable-6360efb96b19d89990b2a5bf3a73c689a429f5da.tar.bz2 linux-stable-6360efb96b19d89990b2a5bf3a73c689a429f5da.zip |
PCI: endpoint: Add BME notifier support
Add support to notify the EPF device about the Bus Master Enable (BME)
event received by the EPC device from the Root complex.
Link: https://lore.kernel.org/r/20230602114756.36586-6-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kishon Vijay Abraham I <kishon@kernel.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/endpoint/pci-epc-core.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index e0570b52698d..6c54fa5684d2 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -759,6 +759,32 @@ 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) +{ + struct pci_epf *epf; + + if (!epc || IS_ERR(epc)) + return; + + mutex_lock(&epc->list_lock); + list_for_each_entry(epf, &epc->pci_epf, list) { + mutex_lock(&epf->lock); + if (epf->event_ops && epf->event_ops->bme) + epf->event_ops->bme(epf); + mutex_unlock(&epf->lock); + } + mutex_unlock(&epc->list_lock); +} +EXPORT_SYMBOL_GPL(pci_epc_bme_notify); + +/** * pci_epc_destroy() - destroy the EPC device * @epc: the EPC device that has to be destroyed * |