FreeCalypso > hg > fc-tourmaline
view cdg-hybrid/gen-file-list @ 220:0ed36de51973
ABB semaphore protection overhaul
The ABB semaphone protection logic that came with TCS211 from TI
was broken in several ways:
* Some semaphore-protected functions were called from Application_Initialize()
context. NU_Obtain_Semaphore() called with NU_SUSPEND fails with
NU_INVALID_SUSPEND in this context, but the return value wasn't checked,
and NU_Release_Semaphore() would be called unconditionally at the end.
The latter call would increment the semaphore count past 1, making the
semaphore no longer binary and thus no longer effective for resource
protection. The fix is to check the return value from NU_Obtain_Semaphore()
and skip the NU_Release_Semaphore() call if the semaphore wasn't properly
obtained.
* Some SPI hardware manipulation was being done before entering the semaphore-
protected critical section. The fix is to reorder the code: first obtain
the semaphore, then do everything else.
* In the corner case of L1/DSP recovery, l1_abb_power_on() would call some
non-semaphore-protected ABB & SPI init functions. The fix is to skip those
calls in the case of recovery.
* A few additional corner cases existed, all of which are fixed by making
ABB semaphore protection 100% consistent for all ABB functions and code paths.
There is still one remaining problem of priority inversion: suppose a low-
priority task calls an ABB function, and some medium-priority task just happens
to preempt right in the middle of that semaphore-protected ABB operation. Then
the high-priority SPI task is locked out for a non-deterministic time until
that medium-priority task finishes its work and goes back to sleep. This
priority inversion problem remains outstanding for now.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 26 Apr 2021 20:55:25 +0000 |
parents | 35f7a1dc9f7d |
children |
line wrap: on
line source
calc.cdg calcidx.cdg ccdent.cdg ccdid.h ccdmtab.cdg ccdptab.cdg cdemstr.cdg cdemval.cdg cdepval.cdg m_cc.h m_cc.val m_fac.h m_fac.val m_gmm.h m_gmm.val m_grlc.h m_grlc.val m_grr.h m_grr.val m_mm.h m_mm.val m_rr.h m_rr.val m_rr_com.h m_rr_com.val m_rr_short_pd.h m_rr_short_pd.val m_sat.h m_sat.val m_sm.h m_sm.val m_sms.h m_sms.val m_ss.h m_ss.val m_t30.h m_t30.val m_tst.h m_tst.val malias.cdg mcomp.cdg mconst.cdg melem.cdg mmtxidx.cdg mmtxval.cdg mstr.cdg mval.cdg mvar.cdg p_8010_128_sm_sap.h p_8010_128_sm_sap.val p_8010_134_mmpm_sap.h p_8010_134_mmpm_sap.val p_8010_135_sn_sap.h p_8010_135_sn_sap.val p_8010_136_simdrv_sap.h p_8010_136_simdrv_sap.val p_8010_137_nas_include.h p_8010_137_nas_include.val p_8010_142_smreg_sap.h p_8010_142_smreg_sap.val p_8010_147_l1_include.h p_8010_147_l1_include.val p_8010_152_ps_include.h p_8010_152_ps_include.val p_8010_153_cause_include.h p_8010_153_cause_include.val p_8010_157_upm_sap.h p_8010_157_upm_sap.val p_aci.h p_aci.val p_app.h p_app.val p_bat.h p_bat.val p_cci.h p_cci.val p_cgrlc.h p_cgrlc.val p_cl.h p_cl.val p_cst.h p_cst.val p_dcm.h p_dcm.val p_dio.h p_dio.val p_dl.h p_dl.val p_dti.h p_dti.val p_dti2.h p_dti2.val p_em.h p_em.val p_fad.h p_fad.val p_gmmaa.h p_gmmaa.val p_gmmreg.h p_gmmreg.val p_gmmrr.h p_gmmrr.val p_gmmsms.h p_gmmsms.val p_grlc.h p_grlc.val p_gsim.h p_gsim.val p_gsmcom.h p_gsmcom.val p_ip.h p_ip.val p_ipa.h p_ipa.val p_l1test.h p_l1test.val p_l2r.h p_l2r.val p_ll.h p_ll.val p_llgmm.h p_llgmm.val p_mac.h p_mac.val p_mdl.h p_mdl.val p_mmcm.h p_mmcm.val p_mmgmm.h p_mmgmm.val p_mmi.h p_mmi.val p_mmreg.h p_mmreg.val p_mmsms.h p_mmsms.val p_mmss.h p_mmss.val p_mncc.h p_mncc.val p_mnlc.h p_mnlc.val p_mnsms.h p_mnsms.val p_mnss.h p_mnss.val p_mon.h p_mon.val p_mph.h p_mph.val p_mphc.h p_mphc.val p_mphp.h p_mphp.val p_ph.h p_ph.val p_pkt.h p_pkt.val p_ppp.h p_ppp.val p_psi.h p_psi.val p_ra.h p_ra.val p_rlp.h p_rlp.val p_rr.h p_rr.val p_rrgrr.h p_rrgrr.val p_rrlc.h p_rrlc.val p_rrlp.h p_rrlp.val p_rrrrlp.h p_rrrrlp.val p_sim.h p_sim.val p_t30.h p_t30.val p_tb.h p_tb.val p_tcpip.h p_tcpip.val p_tra.h p_tra.val p_uart.h p_uart.val p_udp.h p_udp.val p_udpa.h p_udpa.val palias.cdg pcomp.cdg pconst.cdg pelem.cdg pmtxidx.cdg pmtxval.cdg pstr.cdg pval.cdg pvar.cdg spare.cdg uicc.h uicc.intf