[Skiboot] [PATCH] core/pci: Rename pci_slot_op poll to run_sm

Michael Neuling mikey at neuling.org
Mon May 29 17:35:04 AEST 2017


This renames the "poll" op to "run_sm" (short for run state machine).

I think this is a better name since the function does a bunch of
things like reseting the slot.  Also it avoids confusion with the
"poll_link" op which does something different (and can even be called
from run_sm).

No functional change.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 core/pci-opal.c    | 4 ++--
 core/pci-slot.c    | 4 ++--
 core/pci.c         | 4 ++--
 hw/phb3.c          | 4 ++--
 hw/phb4.c          | 2 +-
 include/pci-slot.h | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/core/pci-opal.c b/core/pci-opal.c
index 27872aa219..5d58a88f69 100644
--- a/core/pci-opal.c
+++ b/core/pci-opal.c
@@ -640,11 +640,11 @@ static int64_t opal_pci_poll(uint64_t id)
 
 	if (!slot || !phb)
 		return OPAL_PARAMETER;
-	if (!slot->ops.poll)
+	if (!slot->ops.run_sm)
 		return OPAL_UNSUPPORTED;
 
 	phb_lock(phb);
-	rc = slot->ops.poll(slot);
+	rc = slot->ops.run_sm(slot);
 	phb_unlock(phb);
 
 	/* Return milliseconds for caller to sleep: round up */
diff --git a/core/pci-slot.c b/core/pci-slot.c
index c703fe94b9..69bdb86aba 100644
--- a/core/pci-slot.c
+++ b/core/pci-slot.c
@@ -76,7 +76,7 @@ static void pci_slot_prepare_link_change(struct pci_slot *slot, bool up)
 	}
 }
 
-static int64_t pci_slot_sm_poll(struct pci_slot *slot)
+static int64_t pci_slot_run_sm(struct pci_slot *slot)
 {
 	uint64_t now = mftb();
 	int64_t ret;
@@ -176,7 +176,7 @@ struct pci_slot *pci_slot_alloc(struct phb *phb,
 	slot->pd = pd;
 	pci_slot_set_state(slot, PCI_SLOT_STATE_NORMAL);
 	slot->power_state = PCI_SLOT_POWER_ON;
-	slot->ops.poll = pci_slot_sm_poll;
+	slot->ops.run_sm = pci_slot_run_sm;
 	slot->ops.prepare_link_change = pci_slot_prepare_link_change;
 	if (!pd) {
 		slot->id = PCI_PHB_SLOT_ID(phb);
diff --git a/core/pci.c b/core/pci.c
index d69eb28ecb..0adc6d2cd7 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -874,7 +874,7 @@ static void pci_reset_phb(void *data)
 	rc = slot->ops.freset(slot);
 	while (rc > 0) {
 		time_wait(rc);
-		rc = slot->ops.poll(slot);
+		rc = slot->ops.run_sm(slot);
 	}
 	pci_slot_remove_flags(slot, PCI_SLOT_FLAG_BOOTUP);
 	if (rc < 0)
@@ -1571,7 +1571,7 @@ void pci_reset(void)
 			rc = slot->ops.creset(slot);
 			while (rc > 0) {
 				time_wait(rc);
-				rc = slot->ops.poll(slot);
+				rc = slot->ops.run_sm(slot);
 			}
 			if (rc < 0) {
 				PCIERR(phb, 0, "Complete reset failed, aborting"
diff --git a/hw/phb3.c b/hw/phb3.c
index deb0d38acf..b33ed7ba53 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -2244,7 +2244,7 @@ static int64_t phb3_retry_state(struct pci_slot *slot)
 	slot->delay_tgt_tb = 0;
 	pci_slot_set_state(slot, slot->retry_state);
 	slot->retry_state = PCI_SLOT_STATE_NORMAL;
-	return slot->ops.poll(slot);
+	return slot->ops.run_sm(slot);
 }
 
 static int64_t phb3_poll_link(struct pci_slot *slot)
@@ -4680,7 +4680,7 @@ static bool phb3_host_sync_reset(void *data)
 		phb3_creset(slot);
 		return false;
 	default:
-		rc = slot->ops.poll(slot);
+		rc = slot->ops.run_sm(slot);
 		return rc <= OPAL_SUCCESS;
 	}
 }
diff --git a/hw/phb4.c b/hw/phb4.c
index 1d6d5ccb96..e4a90a6d97 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -1917,7 +1917,7 @@ static int64_t phb4_retry_state(struct pci_slot *slot)
 	slot->delay_tgt_tb = 0;
 	pci_slot_set_state(slot, slot->retry_state);
 	slot->retry_state = PCI_SLOT_STATE_NORMAL;
-	return slot->ops.poll(slot);
+	return slot->ops.run_sm(slot);
 }
 
 static int64_t phb4_poll_link(struct pci_slot *slot)
diff --git a/include/pci-slot.h b/include/pci-slot.h
index 4ebe043bf1..03d966b9fa 100644
--- a/include/pci-slot.h
+++ b/include/pci-slot.h
@@ -109,7 +109,7 @@ struct pci_slot_ops {
 	int64_t (*creset)(struct pci_slot *slot);
 	int64_t (*freset)(struct pci_slot *slot);
 	int64_t (*hreset)(struct pci_slot *slot);
-	int64_t (*poll)(struct pci_slot *slot);
+	int64_t (*run_sm)(struct pci_slot *slot);
 
 	/* Auxillary functions */
 	void (*add_properties)(struct pci_slot *slot, struct dt_node *np);
-- 
2.11.0



More information about the Skiboot mailing list