From: stsp Date: Thu, 22 Feb 2024 09:12:45 +0000 (+0000) Subject: start qwx(4) MHI channels in process context rather than in a task X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4b7d609e491630d73e47d4c7cdcfd77fa84e05f5;p=openbsd start qwx(4) MHI channels in process context rather than in a task This removes all sleep points from the MHI state-change task, which will allow us to get rid of it. And I can now reproduce the channel startup issue kettenis@ saw on arm64 by removing the delay() call. --- diff --git a/sys/dev/pci/if_qwx_pci.c b/sys/dev/pci/if_qwx_pci.c index f896544aebd..ef84e060238 100644 --- a/sys/dev/pci/if_qwx_pci.c +++ b/sys/dev/pci/if_qwx_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_qwx_pci.c,v 1.12 2024/02/22 09:08:08 stsp Exp $ */ +/* $OpenBSD: if_qwx_pci.c,v 1.13 2024/02/22 09:12:45 stsp Exp $ */ /* * Copyright 2023 Stefan Sperling @@ -462,7 +462,6 @@ int qwx_mhi_fw_load_handler(struct qwx_pci_softc *); int qwx_mhi_await_device_reset(struct qwx_softc *); int qwx_mhi_await_device_ready(struct qwx_softc *); void qwx_mhi_ready_state_transition(struct qwx_pci_softc *); -void qwx_mhi_ee_amss_state_transition(struct qwx_pci_softc *); void qwx_mhi_mission_mode_state_transition(struct qwx_pci_softc *); void qwx_mhi_low_power_mode_state_transition(struct qwx_pci_softc *); void qwx_mhi_set_state(struct qwx_softc *, uint32_t); @@ -2937,6 +2936,10 @@ qwx_mhi_start(struct qwx_pci_softc *psc) ret = qwx_mhi_fw_load_handler(psc); if (ret) return ret; + + /* XXX without this delay starting the channels may fail */ + delay(1000); + qwx_mhi_start_channels(psc); } else { /* XXX Handle partially initialized device...?!? */ ee = qwx_pci_read(sc, psc->bhi_off + MHI_BHI_EXECENV); @@ -3173,15 +3176,6 @@ qwx_mhi_ready_state_transition(struct qwx_pci_softc *psc) qwx_mhi_set_state(sc, MHI_STATE_M0); } -void -qwx_mhi_ee_amss_state_transition(struct qwx_pci_softc *psc) -{ - /* XXX without this delay starting the channels may fail */ - delay(1000); - - qwx_mhi_start_channels(psc); -} - void qwx_mhi_mission_mode_state_transition(struct qwx_pci_softc *psc) { @@ -3649,7 +3643,6 @@ qwx_mhi_state_change(void *arg) DNPRINTF(QWX_D_MHI, "%s: new EE AMSS\n", sc->sc_dev.dv_xname); psc->bhi_ee = ee; - qwx_mhi_ee_amss_state_transition(psc); /* Wake thread loading the full AMSS image. */ wakeup(&psc->bhie_off); break;