From nobody Tue Jul 22 04:04:52 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bmNvm05dgz62NZ0 for ; Tue, 22 Jul 2025 04:05:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bmNvk3X4Kz3h92 for ; Tue, 22 Jul 2025 04:05:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=kTPjI5wa; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::536) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-b3bad2f99f5so3945513a12.1 for ; Mon, 21 Jul 2025 21:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1753157104; x=1753761904; darn=freebsd.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QWAlsYJkCFjGT2ojanbZXrtb9L0dIxpGq4DGAwRvIzo=; b=kTPjI5waSfmn9NTGUTt9lNk7Ob9/ZxiaLfD7YUY+y6Pcb9KZGbkcrvtY6GrG8tGnMu DU/6wLes3jWSzLppThGmV306pkXQhnIf5CQ7Oe2f613sCSI8VzeKY5+xbDSAnekaHGjq 6GVy6MH+/9b7fspi8VFrMZyuSsdmzAzurSgCnDsJKiXmRlrSUUcvHyP07ELix43OQYat s0VDFjr+LB4I2BoND7jm/Vks+j/YSEjQaq/HG3h8M7SFonD+3DAjhq0nbfcUIAt+tdhV BwmkKSH4QbdtXyTKs9hK3EDFbP+YF+g1NoubS4RY3BacsCe/SQrdvQK5eeP493+YRthH ghgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753157104; x=1753761904; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QWAlsYJkCFjGT2ojanbZXrtb9L0dIxpGq4DGAwRvIzo=; b=RBaveTJd8hwKSRBkFJj88oKuaBX1dDlfA4657qlzM4e1CotHbLn4+c1fHCt6R15kQ4 x3peQrGltF3BSe6bHGFUFDQQ3lhP7jA0Lmd4iPv8jwMARs7JSmbJA5LWBZsxj+g7NnId FpxEyWMIsiQQvSsmOv0UF/WycgjMQpJFkJzZMfkI2rE1PvV68k/QtP2RPWVU8uxXAN8I RucWtbph+IxcOmMKKC4rAeqQAonudap9TKnVCbHkghhI564+n3YNPR0T3r/bz0tg4qXf DA+Aw7mMVKi/D2YKXqnMWuZMQOCqcVbo0pZh2EA13/WvUtcH8rgETKTBh1V0thWNSMEM KUkg== X-Gm-Message-State: AOJu0Yy5zVtYBc2dN0W/EXyLrtRUTm2xlohYJqs0rtwuPv/lKLH+LX2B ZQRK/AY7iasshZ8uM2m3L73mT8q9d8zZYNHBuwRjxOYbI9qYxOF2mcKKjL34c+EFa+4Y1HiNzFJ YNTmJFDAZ3DQsE7mvc+OXOA/zm343UB/w7JEG0JnTnQAiZYAQ5Wvy41o= X-Gm-Gg: ASbGnctdtuX7zoPZG1usL3AC1IEU9TTZXdC2jJQyzyzoQYHoCxUVrJXp1ORJdGC5Xfx 4x9xT8rmpRwS7OOdHO88vx/4ZUJle0mTFCHmvz0e8EXBwRpW9wFPbnENVMEXLCCIj9eapONNDYK EKZ7548NDNh0iCiPmVfX/uz95Jtjg/x05kDDpaoaueH7L34uT/p8IANJRagoM3iqO8sOt55p0cd 6nEEQs= X-Google-Smtp-Source: AGHT+IHCclvhGmyU/pfVUWoOHhGXtY+JYAW/jLeh/nBRfMycoOIvtmkbONZbyI3ehEIea5e8ePGbOxgNu7Kor9Xxd9k= X-Received: by 2002:a17:90b:3882:b0:30e:e9f1:8447 with SMTP id 98e67ed59e1d1-31e3e107a1fmr2393358a91.4.1753157103488; Mon, 21 Jul 2025 21:05:03 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <202507220400.56M40udG032587@gitrepo.freebsd.org> In-Reply-To: <202507220400.56M40udG032587@gitrepo.freebsd.org> From: Warner Losh Date: Mon, 21 Jul 2025 22:04:52 -0600 X-Gm-Features: Ac12FXx3Dztlzjb3rnd9URrasCzUeXQ5CBlzVG1CD8ZnxOTOj_atTjogGASL1Kc Message-ID: Subject: Fwd: git: b4b166b8c46b - main - cam: Enforce real priorities in xpt_action for queued ccbs. To: FreeBSD Current Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-0.54 / 15.00]; NEURAL_HAM_SHORT(-0.95)[-0.946]; NEURAL_SPAM_MEDIUM(0.88)[0.875]; NEURAL_HAM_LONG(-0.47)[-0.470]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; R_SPF_NA(0.00)[no SPF record]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::536:from]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4bmNvk3X4Kz3h92 X-Spamd-Bar: / Heads up: I added some enforcement of the rules to CAM. I'd been bitten by this condition with some cleanup I did that caused mmccam to no longer probe devices. I've tested it locally on a couple of machines that have a couple of different SIMs/HBAs, for scsi, ata, nvme and mmc. I fixed what I could find, but if you hit this assert, please let me know. Warner ---------- Forwarded message --------- From: Warner Losh Date: Mon, Jul 21, 2025 at 10:01=E2=80=AFPM Subject: git: b4b166b8c46b - main - cam: Enforce real priorities in xpt_action for queued ccbs. To: , , The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3Db4b166b8c46b86df855f1621d2aa= 4b6ab26b3a5e commit b4b166b8c46b86df855f1621d2aa4b6ab26b3a5e Author: Warner Losh AuthorDate: 2025-07-22 03:52:22 +0000 Commit: Warner Losh CommitDate: 2025-07-22 04:00:53 +0000 cam: Enforce real priorities in xpt_action for queued ccbs. All queued CCBs should be created with a real priority (one that's not CAM_PRIORITY_NONE). Recently, I introduced a bug that revealed a latent MMC bug where it would stop enumerating due to a bad priority. Add an assert to catch that (the other bug in mmc_da that it found has been fixed). Sponsored by: Netflix --- sys/cam/cam_xpt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 2ec736e7f4ac..cae29226d13c 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -2515,6 +2515,15 @@ xpt_action(union ccb *start_ccb) ("xpt_action: func %#x %s\n", start_ccb->ccb_h.func_code, xpt_action_name(start_ccb->ccb_h.func_code))); + /* + * Either it isn't queued, or it has a real priority. There still t= oo + * many places that reuse CCBs with a real priority to do immediate + * queries to do the other side of this assert. + */ + KASSERT((start_ccb->ccb_h.func_code & XPT_FC_QUEUED) =3D=3D 0 || + start_ccb->ccb_h.pinfo.priority !=3D CAM_PRIORITY_NONE, + ("%s: queued ccb and CAM_PRIORITY_NONE illegal.", __func__)); + start_ccb->ccb_h.status =3D CAM_REQ_INPROG; (*(start_ccb->ccb_h.path->bus->xport->ops->action))(start_ccb); }