Skip to content

Commit f58838d

Browse files
Mani-Sadhasivambjorn-helgaas
authored andcommitted
PCI: endpoint: Rename BME to Bus Master Enable
BME which stands for 'Bus Master Enable' is not defined in the PCIe base spec even though it is commonly referred in many places (vendor docs). To align with the spec, rename it to its expansion 'Bus Master Enable'. Suggested-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/linux-pci/[email protected] Link: https://lore.kernel.org/linux-pci/[email protected] Tested-by: Niklas Cassel <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> [bhelgaas: squash removal of irrelevant 'Link is enabled'] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Niklas Cassel <[email protected]>
1 parent 4edd7dc commit f58838d

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

drivers/pci/controller/dwc/pcie-qcom-ep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,10 @@ static irqreturn_t qcom_pcie_ep_global_irq_thread(int irq, void *data)
642642
pcie_ep->link_status = QCOM_PCIE_EP_LINK_DOWN;
643643
pci_epc_linkdown(pci->ep.epc);
644644
} else if (FIELD_GET(PARF_INT_ALL_BME, status)) {
645-
dev_dbg(dev, "Received BME event. Link is enabled!\n");
645+
dev_dbg(dev, "Received Bus Master Enable event\n");
646646
pcie_ep->link_status = QCOM_PCIE_EP_LINK_ENABLED;
647647
qcom_pcie_ep_icc_update(pcie_ep);
648-
pci_epc_bme_notify(pci->ep.epc);
648+
pci_epc_bus_master_enable_notify(pci->ep.epc);
649649
} else if (FIELD_GET(PARF_INT_ALL_PM_TURNOFF, status)) {
650650
dev_dbg(dev, "Received PM Turn-off event! Entering L23\n");
651651
val = readl_relaxed(pcie_ep->parf + PARF_PM_CTRL);

drivers/pci/endpoint/functions/pci-epf-mhi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ static int pci_epf_mhi_link_down(struct pci_epf *epf)
819819
return 0;
820820
}
821821

822-
static int pci_epf_mhi_bme(struct pci_epf *epf)
822+
static int pci_epf_mhi_bus_master_enable(struct pci_epf *epf)
823823
{
824824
struct pci_epf_mhi *epf_mhi = epf_get_drvdata(epf);
825825
const struct pci_epf_mhi_ep_info *info = epf_mhi->info;
@@ -882,8 +882,8 @@ static void pci_epf_mhi_unbind(struct pci_epf *epf)
882882

883883
/*
884884
* Forcefully power down the MHI EP stack. Only way to bring the MHI EP
885-
* stack back to working state after successive bind is by getting BME
886-
* from host.
885+
* stack back to working state after successive bind is by getting Bus
886+
* Master Enable event from host.
887887
*/
888888
if (mhi_cntrl->mhi_dev) {
889889
mhi_ep_power_down(mhi_cntrl);
@@ -900,7 +900,7 @@ static const struct pci_epc_event_ops pci_epf_mhi_event_ops = {
900900
.epc_init = pci_epf_mhi_epc_init,
901901
.link_up = pci_epf_mhi_link_up,
902902
.link_down = pci_epf_mhi_link_down,
903-
.bme = pci_epf_mhi_bme,
903+
.bus_master_enable = pci_epf_mhi_bus_master_enable,
904904
};
905905

906906
static int pci_epf_mhi_probe(struct pci_epf *epf,

drivers/pci/endpoint/pci-epc-core.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -775,14 +775,15 @@ void pci_epc_notify_pending_init(struct pci_epc *epc, struct pci_epf *epf)
775775
EXPORT_SYMBOL_GPL(pci_epc_notify_pending_init);
776776

777777
/**
778-
* pci_epc_bme_notify() - Notify the EPF device that the EPC device has received
779-
* the BME event from the Root complex
780-
* @epc: the EPC device that received the BME event
778+
* pci_epc_bus_master_enable_notify() - Notify the EPF device that the EPC
779+
* device has received the Bus Master
780+
* Enable event from the Root complex
781+
* @epc: the EPC device that received the Bus Master Enable event
781782
*
782-
* Invoke to Notify the EPF device that the EPC device has received the Bus
783-
* Master Enable (BME) event from the Root complex
783+
* Notify the EPF device that the EPC device has generated the Bus Master Enable
784+
* event due to host setting the Bus Master Enable bit in the Command register.
784785
*/
785-
void pci_epc_bme_notify(struct pci_epc *epc)
786+
void pci_epc_bus_master_enable_notify(struct pci_epc *epc)
786787
{
787788
struct pci_epf *epf;
788789

@@ -792,13 +793,13 @@ void pci_epc_bme_notify(struct pci_epc *epc)
792793
mutex_lock(&epc->list_lock);
793794
list_for_each_entry(epf, &epc->pci_epf, list) {
794795
mutex_lock(&epf->lock);
795-
if (epf->event_ops && epf->event_ops->bme)
796-
epf->event_ops->bme(epf);
796+
if (epf->event_ops && epf->event_ops->bus_master_enable)
797+
epf->event_ops->bus_master_enable(epf);
797798
mutex_unlock(&epf->lock);
798799
}
799800
mutex_unlock(&epc->list_lock);
800801
}
801-
EXPORT_SYMBOL_GPL(pci_epc_bme_notify);
802+
EXPORT_SYMBOL_GPL(pci_epc_bus_master_enable_notify);
802803

803804
/**
804805
* pci_epc_destroy() - destroy the EPC device

include/linux/pci-epc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void pci_epc_linkup(struct pci_epc *epc);
226226
void pci_epc_linkdown(struct pci_epc *epc);
227227
void pci_epc_init_notify(struct pci_epc *epc);
228228
void pci_epc_notify_pending_init(struct pci_epc *epc, struct pci_epf *epf);
229-
void pci_epc_bme_notify(struct pci_epc *epc);
229+
void pci_epc_bus_master_enable_notify(struct pci_epc *epc);
230230
void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf,
231231
enum pci_epc_interface_type type);
232232
int pci_epc_write_header(struct pci_epc *epc, u8 func_no, u8 vfunc_no,

include/linux/pci-epf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ struct pci_epf_ops {
7373
* @epc_init: Callback for the EPC initialization complete event
7474
* @link_up: Callback for the EPC link up event
7575
* @link_down: Callback for the EPC link down event
76-
* @bme: Callback for the EPC BME (Bus Master Enable) event
76+
* @bus_master_enable: Callback for the EPC Bus Master Enable event
7777
*/
7878
struct pci_epc_event_ops {
7979
int (*epc_init)(struct pci_epf *epf);
8080
int (*link_up)(struct pci_epf *epf);
8181
int (*link_down)(struct pci_epf *epf);
82-
int (*bme)(struct pci_epf *epf);
82+
int (*bus_master_enable)(struct pci_epf *epf);
8383
};
8484

8585
/**

0 commit comments

Comments
 (0)