Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/pci mtsleep(9) is depreciated use kpause(9) in...



details:   https://anonhg.NetBSD.org/src-all/rev/0580d7818622
branches:  trunk
changeset: 364314:0580d7818622
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Mon Jan 31 02:26:40 2022 +1100

description:
mtsleep(9) is depreciated use kpause(9) instead.

NB: Indefinite timeouts were changed to 1 second timeouts for which no
functional change was intended.

diffstat:

 sys/dev/pci/if_iwm.c |  17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diffs (62 lines):

diff -r 1a013975fa11 -r 0580d7818622 sys/dev/pci/if_iwm.c
--- a/sys/dev/pci/if_iwm.c      Fri Jan 07 01:06:57 2022 +1100
+++ b/sys/dev/pci/if_iwm.c      Mon Jan 31 02:26:40 2022 +1100
@@ -702,7 +702,7 @@
                fw->fw_status = IWM_FW_STATUS_INPROGRESS;
        } else {
                while (fw->fw_status == IWM_FW_STATUS_INPROGRESS)
-                       mtsleep(&sc->sc_fw, 0, "iwmfwp", 0, &sc->sc_lock);
+                       kpause("iwmfwp", false, hz, &sc->sc_lock);
        }
        status = fw->fw_status;
 
@@ -3477,8 +3477,7 @@
        /* Wait for this segment to load. */
        err = 0;
        while (!sc->sc_fw_chunk_done) {
-               err = mtsleep(&sc->sc_fw, 0, "iwmfw", mstohz(5000),
-                   &sc->sc_lock);
+               err = kpause("iwmfw", false, mstohz(5000), &sc->sc_lock);
                if (err)
                        break;
        }
@@ -3694,8 +3693,7 @@
 
        /* wait for the firmware to load */
        for (w = 0; !sc->sc_uc.uc_intr && w < 10; w++)
-               err = mtsleep(&sc->sc_uc, 0, "iwmuc", mstohz(100),
-                   &sc->sc_lock);
+               err = kpause("iwmuc", false, mstohz(100), &sc->sc_lock);
        if (err || !sc->sc_uc.uc_ok) {
                aprint_error_dev(sc->sc_dev,
                    "could not load firmware (error %d, ok %d)\n",
@@ -3871,8 +3869,7 @@
         * from the firmware
         */
        while (!sc->sc_init_complete) {
-               err = mtsleep(&sc->sc_init_complete, 0, "iwminit",
-                   mstohz(2000), &sc->sc_lock);
+               err = kpause("iwminit", false, mstohz(2000), &sc->sc_lock);
                if (err)
                        break;
        }
@@ -4349,8 +4346,7 @@
        if (wantresp) {
                KASSERT(!async);
                while (sc->sc_wantresp != IWM_CMD_RESP_IDLE)
-                       mtsleep(&sc->sc_wantresp, 0, "iwmcmdsl", 0,
-                           &sc->sc_lock);
+                       kpause("iwmcmdsl", false, hz, &sc->sc_lock);
                sc->sc_wantresp = ring->qid << 16 | ring->cur;
        }
 
@@ -4475,8 +4471,7 @@
 
        if (!async) {
                int generation = sc->sc_generation;
-               err = mtsleep(desc, PCATCH, "iwmcmd", mstohz(2000),
-                   &sc->sc_lock);
+               err = kpause("iwmcmd", false, mstohz(2000), &sc->sc_lock);
                if (err == 0) {
                        /* if hardware is no longer up, return error */
                        if (generation != sc->sc_generation) {



Home | Main Index | Thread Index | Old Index