git: 4e9f82956158 - stable/14 - cxgbe(4): Use correct priority in begin_synchronized_op.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 22 Apr 2025 11:22:48 UTC
The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=4e9f82956158d689e378e7dd12f5e1b29d8e25d2 commit 4e9f82956158d689e378e7dd12f5e1b29d8e25d2 Author: Navdeep Parhar <np@FreeBSD.org> AuthorDate: 2024-10-04 18:14:33 +0000 Commit: Navdeep Parhar <np@FreeBSD.org> CommitDate: 2025-04-22 11:12:46 +0000 cxgbe(4): Use correct priority in begin_synchronized_op. It was always set to PCATCH because the driver tested (INTR_OK) instead of (flags & INTR_OK). Fit a WITNESS_WARN in a single line while here. Sponsored by: Chelsio Communications (cherry picked from commit 04bf43505bae1bb20d315a44e977d97aed3e5733) --- sys/dev/cxgbe/t4_main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index f79fb799f5e1..87ef7a53ff6f 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -6338,20 +6338,13 @@ int begin_synchronized_op(struct adapter *sc, struct vi_info *vi, int flags, char *wmesg) { - int rc, pri; + int rc; #ifdef WITNESS /* the caller thinks it's ok to sleep, but is it really? */ if (flags & SLEEP_OK) - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "begin_synchronized_op"); + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); #endif - - if (INTR_OK) - pri = PCATCH; - else - pri = 0; - ADAPTER_LOCK(sc); for (;;) { @@ -6370,7 +6363,8 @@ begin_synchronized_op(struct adapter *sc, struct vi_info *vi, int flags, goto done; } - if (mtx_sleep(&sc->flags, &sc->sc_lock, pri, wmesg, 0)) { + if (mtx_sleep(&sc->flags, &sc->sc_lock, + flags & INTR_OK ? PCATCH : 0, wmesg, 0)) { rc = EINTR; goto done; }