From bdefdf28434aff6bf58a915221f1ab256b9070f7 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Wed, 12 Jul 2017 12:06:52 +1000 Subject: phb4: Avoid recursive call into run state machine Currently we recursively call run_sm() in phb4_retry_state(). This is unnecessary and overly complex. This just returns with a small wait time. 1ms should be a very small over head compared to having to do the actual retry. Signed-off-by: Michael Neuling Signed-off-by: Stewart Smith --- hw/phb4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/phb4.c') diff --git a/hw/phb4.c b/hw/phb4.c index 81cb282..91da17d 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -2173,7 +2173,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.run_sm(slot); + return pci_slot_set_sm_timeout(slot, msecs_to_tb(1)); } static int64_t phb4_poll_link(struct pci_slot *slot) -- cgit v1.1