Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/usb Lock some more - from James Browning.



details:   https://anonhg.NetBSD.org/src-all/rev/33ee36f52879
branches:  trunk
changeset: 371083:33ee36f52879
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Tue Dec 07 18:27:23 2021 +0100

description:
Lock some more - from James Browning.

diffstat:

 sys/dev/usb/if_run.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (38 lines):

diff -r e470d146818b -r 33ee36f52879 sys/dev/usb/if_run.c
--- a/sys/dev/usb/if_run.c      Tue Dec 07 18:22:37 2021 +0100
+++ b/sys/dev/usb/if_run.c      Tue Dec 07 18:27:23 2021 +0100
@@ -1742,6 +1742,7 @@
        uint32_t tmp, sta[3];
        uint8_t wcid;
 
+       usbwifi_lock_core(&sc->sc_uw);
        callout_stop(&sc->calib_to);
 
        ostate = vap->iv_state;
@@ -1822,6 +1823,7 @@
                printf ("RUN UNKNOWN nSTATE: %d\n", nstate);
                break;
        }
+       usbwifi_unlock_core(&sc->sc_uw);
        
        return (*rvap->newstate)(vap, nstate, arg);
 }
@@ -2135,6 +2137,8 @@
        uint32_t sta[3];
        int s, error;
        struct ieee80211com *ic = &sc->sc_uw.uw_ic;
+       
+       usbwifi_lock_core(&sc->sc_uw);
 
        /* read statistic counters (clear on read) and update AMRR state */
        error = run_read_region_1(sc, RT2860_TX_STA_CNT0, (uint8_t *)sta,
@@ -2164,7 +2168,8 @@
        */
        splx(s);
 
-skip:  callout_schedule(&sc->calib_to, hz);
+skip:  usbwifi_unlock_core(&sc->sc_uw);        
+       callout_schedule(&sc->calib_to, hz);
 }
 
 static void



Home | Main Index | Thread Index | Old Index