From nobody Wed Aug 6 13:54:52 2025 X-Original-To: dev-commits-src-all@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 4bxsHQ6g3Sz63l7N; Wed, 06 Aug 2025 13:54:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxsHQ5KLcz3q0F; Wed, 06 Aug 2025 13:54:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754488498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+Egv37duUk16QjRHW0cBZv3zbGCkMR8vsY59XA6jLiI=; b=M/3O2MNUNNaGb5T6hSsLAzRLCWaT/RQtMiR0LPY6MOadFIpa02Rw0SlRHcZvRjJ+9HbphK OUu+PuC/t9/gJXXf705WNloqmQofPmnkvfeLdxiEwZa5GTMlHlh3ifdLZNauxAWxlYfpud cteOpyW9tu06T3MBwIR2Uq5GTrwSknf7621DIlOkABAfda6sXfZB/6Q+9K71wU4fVOgZdM ksRVROH14bCLP1Ofjs5mJPPCxzUzUlPm7A/PWBj7rGCbJE/ZSbPEH5i++phOAyNF67gC3S QX9WqZLRQD/85uwfuHIC9XNNLl2kUEF+hUMAJwBDHMOiXFFTEdLATc/0q66tpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754488498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+Egv37duUk16QjRHW0cBZv3zbGCkMR8vsY59XA6jLiI=; b=Mj7eOcFm6uPGdP1+BC5igmj3n1VxtrmoLPFXSA91cKINP586iCcgYTjenPcyd2zPQYWN2g jc9A4bPsSi39br8E/xQoabbm304sIwgfmxN/vgYyo+64WC2aytdPhUP8+snCNTG+KpgpZa 65K5reRWSeTA3FWQZfcVioOOQMz3o4DCZxEcEcTMByRoX3EvhLoxFUaL3KMtMgcnW32MBS HppDmf/83ud+0FioqIz3vQXbdBcXYLBw6P271tT6bZ9fbuZP1uRpBq/7g1Bgzx3SuDz5l7 3y5HQ1Vn65T4XbKsN5/FsSAyHLUddgt208iIemfj8riRcR/hQ+teEBCX/y8S7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754488498; a=rsa-sha256; cv=none; b=HJcwq86QGe5JvwgZkov2iax6EWBeOyosGr6RJVQbI9+AcJl0XBsraAAxMn5xEks34Kk4At M/WM5lPgcCTHGkXwPxn9jASJjEBZAdpOxQcGOkJB1cYsKwHB+s1XRypPh8yhlUxYHzFpXW z4IUqR4sXwZyEpmjZK6J1XzrLoaNPpna18KpIGrjHso1EiTEX3hi7HJW09U35VmMSGMRwT ncXgc+bLaGkNgnpUYLKSOEWnwwE4lTtdfeTlilCHBsv4k1i34FNuv1S0lJjA9FpJsa+kIt SZv9kw2vjY8LJh/GlHOblW7YCKBcjivaJiXsa1gwWN9Dk2XZ5zC/pgoYPogn1w== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bxsHQ28QTzF8h; Wed, 06 Aug 2025 13:54:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 40676A64808; Wed, 06 Aug 2025 13:54:48 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 9F1CF2D029E3; Wed, 6 Aug 2025 13:54:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id Bk-ByrgeQ1nV; Wed, 6 Aug 2025 13:54:52 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:a66b:b6ff:fe40:39a9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 61C8A2D029E1; Wed, 6 Aug 2025 13:54:52 +0000 (UTC) Date: Wed, 6 Aug 2025 13:54:52 +0000 (UTC) From: "Bjoern A. Zeeb" To: Andriy Gapon cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 6eb503116e88 - main - sdio: don't use CAM_PRIORITY_NONE for queued CCB-s In-Reply-To: <504491b6-932a-4e68-a324-2f7fc2637f63@FreeBSD.org> Message-ID: <9s0qo0o4-3275-p062-0qnq-nro5prqq2881@SerrOFQ.bet> References: <202508051629.575GTBYK035918@gitrepo.freebsd.org> <030509rq-32n5-3rn0-98nq-o154pqo676s9@SerrOFQ.bet> <504491b6-932a-4e68-a324-2f7fc2637f63@FreeBSD.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1098556516-1822392576-1754488492=:4561" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1098556516-1822392576-1754488492=:4561 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Wed, 6 Aug 2025, Andriy Gapon wrote: > On 05/08/2025 23:32, Bjoern A. Zeeb wrote: >> On Tue, 5 Aug 2025, Andriy Gapon wrote: >> >>> The branch main has been updated by avg: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/? >>> id=6eb503116e88cc430c2c9f01f48aa979fb0a7e1b >>> >>> commit 6eb503116e88cc430c2c9f01f48aa979fb0a7e1b >>> Author:     Andriy Gapon >>> AuthorDate: 2025-08-05 14:40:21 +0000 >>> Commit:     Andriy Gapon >>> CommitDate: 2025-08-05 16:27:12 +0000 >>> >>>    sdio: don't use CAM_PRIORITY_NONE for queued CCB-s >>> >>>    This is similar to changes done in other CAM drivers and fixes a panic >>>    because of a sanity check added in b4b166b8c46b. >>> >>>    While here, remove unneeded ccb setup in sdiobdiscover. >>>    It's possible that ccb allocation in that function is not needed as >>>    well, but I wasn't sure about that. >> >> I have a lot more changes to sdio here;  I would appreciate if they go >> through review if you have more. > > Sorry about that. > No, this was a one-off change to fix a panic on boot after an upgrade. Sorry, I fixed too many things recently incl. dwmmc and probably forgot that it didn't boot anymore (I likely had done the NONE->NORMAL change even before booting following imp's other changes) and didn't even notice. > I didn't see any recent non-trivial activity in the file, so I skipped a > review. > >> Are you testing this with any device? > > Not really testing but I have an old Orange Pi PC Plus which got broken > (panic on boot) after an update to the latest main (+INVARIANTS). I think > that it has a WiFi device on SDIO. What WiFi is that? Broadcom, Realtek or something else? > sdiob0: on aw_mmc1 > sdiob0 at aw_mmc_sim1 bus 0 scbus1 target 0 lun 0 > sdiob0: Relative addr: 00000001 > Card features: > Card IO OCR: 00fc0000 > > >>>    MFC after:      1 week >>> --- >>> sys/dev/sdio/sdiob.c | 7 ++----- >>> 1 file changed, 2 insertions(+), 5 deletions(-) >>> >>> diff --git a/sys/dev/sdio/sdiob.c b/sys/dev/sdio/sdiob.c >>> index 4ec2058fa2e4..cb2cc0da6b77 100644 >>> --- a/sys/dev/sdio/sdiob.c >>> +++ b/sys/dev/sdio/sdiob.c >>> @@ -150,7 +150,7 @@ sdiob_rw_direct_sc(struct sdiob_softc *sc, uint8_t fn, >>> uint32_t addr, bool wr, >>>         sc->ccb = xpt_alloc_ccb(); >>>     else >>>         memset(sc->ccb, 0, sizeof(*sc->ccb)); >>> -    xpt_setup_ccb(&sc->ccb->ccb_h, sc->periph->path, CAM_PRIORITY_NONE); >>> +    xpt_setup_ccb(&sc->ccb->ccb_h, sc->periph->path, >>> CAM_PRIORITY_NORMAL); >>>     CAM_DEBUG(sc->ccb->ccb_h.path, CAM_DEBUG_TRACE, >>>         ("%s(fn=%d, addr=%#02x, wr=%d, *val=%#02x)\n", __func__, >>>         fn, addr, wr, *val)); >>> @@ -250,7 +250,7 @@ sdiob_rw_extended_cam(struct sdiob_softc *sc, uint8_t >>> fn, uint32_t addr, >>>         sc->ccb = xpt_alloc_ccb(); >>>     else >>>         memset(sc->ccb, 0, sizeof(*sc->ccb)); >>> -    xpt_setup_ccb(&sc->ccb->ccb_h, sc->periph->path, CAM_PRIORITY_NONE); >>> +    xpt_setup_ccb(&sc->ccb->ccb_h, sc->periph->path, >>> CAM_PRIORITY_NORMAL); >>>     CAM_DEBUG(sc->ccb->ccb_h.path, CAM_DEBUG_TRACE, >>>         ("%s(fn=%d addr=%#0x wr=%d b_count=%u blksz=%u buf=%p incr=%d)\n", >>>         __func__, fn, addr, wr, b_count, blksz, buffer, incaddr)); >>> @@ -977,9 +977,6 @@ sdiobdiscover(void *context, int pending) >>> >>>     if (sc->ccb == NULL) >>>         sc->ccb = xpt_alloc_ccb(); >>> -    else >>> -        memset(sc->ccb, 0, sizeof(*sc->ccb)); >>> -    xpt_setup_ccb(&sc->ccb->ccb_h, periph->path, CAM_PRIORITY_NONE); >> >> This likely just made a problem worse of ccb re-use.  I have locally >> changed them to be allocated/freed per transaction now. > From my examination of the code, the sc->ccb is always re-initialized before > actual use. I mean memset + xpt_setup_ccb in sdiob_rw_direct_sc and > sdiob_rw_extended_cam. > > -- Bjoern A. Zeeb r15:7 --1098556516-1822392576-1754488492=:4561--