From nobody Wed Jan 21 14:02:30 2026 X-Original-To: freebsd-hackers@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 4dx5hJ5Mj5z6PGSb for ; Wed, 21 Jan 2026 14:10:56 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from mail.fabiankeil.de (fabiankeil.de [95.211.138.7]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4dx5hH709Rz3RZF for ; Wed, 21 Jan 2026 14:10:55 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fabiankeil.de header.s=blafasel header.b=b9NcVwBM; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-listen@fabiankeil.de designates 95.211.138.7 as permitted sender) smtp.mailfrom=freebsd-listen@fabiankeil.de Received: by mail.fabiankeil.de (Postfix) id 800912990 for ; Wed, 21 Jan 2026 15:02:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fabiankeil.de; s=blafasel; t=1769004137; bh=Q1ouPsZMouGnhoAvhUpmdGVwsPVOrEbJFamSCudBI98=; h=Date:From:To:Subject:In-Reply-To:References:Reply-To; b=b9NcVwBMTf0oe8wEt5qDzPxicpSOjriMeJ0A02SSvEwU2RadnBZ2m3bSQgMhiVF65 8zHjTKW1rmTeL2yZzjAo51bdM9wxD6dnMa2AmyjKESGKFadUuruzUxs1z/3zU7S0px mJXagu4A8JVwVFpPR4SbLGv7yw+a+b+eB40hGwkANtIXktSLUCn/1MH3lU7rIV9/zr u0l58HT7V1xz86ApvMjJfzLXRLk5Nr7/udHOvA+ZzPJ+bR6r8qqq5YeOE9zfJHW01c wSwozNyKJ37FQndum5YojG/WGhYeCcOOatUM6rDOUlNemAclq3A3GMe0TDfzJjIso6 Oj93VTSNpa6mg== Date: Wed, 21 Jan 2026 15:02:30 +0100 From: Fabian Keil To: freebsd-hackers@freebsd.org Subject: Re: "(ada0:ahcich0:0:0:0): Periph destroyed", followed by panic Message-ID: <20260121150230.16e3be9d.freebsd-listen@fabiankeil.de> In-Reply-To: References: <20260117175331.4b5eb147.freebsd-listen@fabiankeil.de> <20260118122005.06288476.freebsd-listen@fabiankeil.de> <20260119183249.34199c88.freebsd-listen@fabiankeil.de> Reply-To: freebsd-hackers@freebsd.org List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.73 / 15.00]; REPLYTO_EQ_TO_ADDR(5.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.970]; ONCE_RECEIVED(0.20)[]; R_DKIM_ALLOW(-0.20)[fabiankeil.de:s=blafasel]; R_SPF_ALLOW(-0.20)[+ip4:95.211.138.7:c]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; GREYLIST(0.00)[pass,body]; DMARC_NA(0.00)[fabiankeil.de: no valid DMARC record]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[fabiankeil.de:+]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:60781, ipnet:95.211.0.0/16, country:NL]; MIME_TRACE(0.00)[0:+]; HAS_REPLYTO(0.00)[freebsd-hackers@freebsd.org] X-Rspamd-Queue-Id: 4dx5hH709Rz3RZF Warner Losh wrote on 2026-01-20 at 05:05:46: > On Mon, Jan 19, 2026 at 10:52=E2=80=AFAM Fabian Keil > wrote: >=20 > > Fabian Keil wrote on 2026-01-18 at > > 12:20:05: > > > (kgdb) f 8 > > > #8 0xffffffff80369a66 in xpt_async (async_code=3D256, > > path=3D0xfffff8000606eb60, async_arg=3D0x0) at /usr/src/sys/cam/cam_xpt= .c:4321 > > > 4321 xpt_freeze_simq(path->bus->sim, 1); > > [...] > > > (kgdb) p *path > > > $1 =3D {periph =3D 0x0, bus =3D 0x0, target =3D 0x0, device =3D 0x0} > > > > I've come up with a patch that seems to prevent the problem [0]. > > >=20 > I'd use a bool for that patch, not an int. How often do you see 'not > detaching detached device?' It seems like a reasonable roadblock in the > surface... especially since it looks like it can only be true when we > succeed in attach. I will update the patch to use a bool and will try to upstream it shortly. When running ahcich0-detacher.sh in two terminals the message appears frequently but that seems to be expected. > > > I also once managed to get devctl sleeping "forever" by running only > > > one ahcich0-detacher.sh instance, but haven't been able to reproduce > > > this yet. > > > > Now that the panic is prevented this issue can be reliably triggered > > by running ahcich0-detacher.sh in parallel for a while. [...] > > (kgdb) p *mtx > > $2 =3D {lock_object =3D {lo_name =3D 0xffffffff81070545 "AHCI channel l= ock", > > lo_flags =3D 16973824, lo_data =3D 0, lo_witness =3D 0xfffff802bfd7f700= }, > > mtx_lock =3D 0} > > (kgdb) l > > 152 mtx_assert(mtx, MA_OWNED); > > 153 } > > 154 KASSERT(sim->refcount >=3D 1, ("sim->refcount >=3D 1")); > > 155 sim->refcount--; > > 156 if (sim->refcount > 0) { > > 157 error =3D msleep(sim, mtx, PRIBIO, "simfree", 0= ); > > 158 KASSERT(error =3D=3D 0, ("invalid error value f= or > > msleep(9)")); > > 159 } > > 160 KASSERT(sim->refcount =3D=3D 0, ("sim->refcount =3D=3D = 0")); > > 161 if (mtx =3D=3D &cam_sim_free_mtx) /* sim->mtx =3D=3D = NULL */ > > > > I'm not sure what to do about this. > > >=20 > Sadly, you have to find the leak, or what's holding onto the sim. You will > have to track, likely with dtrace since I don't see any cam debug in it, > calls to cam_sim_hold and cam_sim_release. They are mismatched for some > reason, and you'll have to hunt that down. It looks like they are called > from only one place, though, and that's xpt_bus_register and > xpt_release_bus respectively. You'll need to see what path can cause > xpt_bus_register to be called, but then fail to call the matching > xpt_release_bus. It doesn't look like an error in ahci_ch_attach (it calls > xpt_bus_deregister which drops the reference with a call to > xpt_release_bus). But it looks like if you are putting the NULL chek and > short circuit, you might have two threads racing: > (1) creation path creating the device and it's past xpt_bus_register, but > not yet to ahci_attached -- there's no giant dropping sleeps here > (2) in the detach path *somehow* that gets to ahci_ch_detach in this > window, maybe because the locking of the channel and updating the channel > are with different mutexes, allowing the race. > This also suggests that the multiple different locks may not be held long > enough. >=20 > Now in theory we take out Giant in the newbus code to prevent this. > However, we drop Giant sometimes when we sleep which can lead to races (t= he > race is already lost before we get into simfree sleep though). If the abo= ve > is the confirmed race you are provoking in your testing (which arguably is > a bit artificial, but maybe not SO artificial). It might also be the > absence of a bus_topo_lock() in one of these paths. Using dtrace indicates that cam_sim_free() is always called with a refcount of 2, but usually cam_sim_release() is then called through geom which lets cam_sim_free() return. The following dtrace output doesn't explicitly show this because fbt:kernel:cam_sim_free:return seems to be optimised away: 2026 Jan 21 14:07:40.061: 1 100400 ahci_ch_attach:entry 2026 Jan 21 14:07:40.061: 1 100400 cam_sim_hold:entry Sim: ahcich 0:0 Refco= unt: 1 kernel`xpt_bus_register+0xf9 kernel`ahci_ch_attach+0x709 kernel`device_attach+0x43d kernel`devctl2_ioctl+0x144 kernel`devfs_ioctl+0xcb kernel`vn_ioctl+0xc8 kernel`devfs_ioctl_f+0x1e kernel`kern_ioctl+0x286 kernel`sys_ioctl+0x117 kernel`amd64_syscall+0x117 kernel`0xffffffff80e981bb 2026 Jan 21 14:07:40.061: 1 100400 cam_sim_hold:return Sim: ahcich 0:0 Refc= ount: 2 2026 Jan 21 14:07:40.061: 1 100400 ahci_ch_attach:return 2026 Jan 21 14:07:40.151: 0 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.151: 0 100034 g_detach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: ada0 2026 Jan 21 14:07:40.151: 0 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.151: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 00, geom->name: ada0 2026 Jan 21 14:07:40.151: 0 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: label:taste, provider->name: No provider 2026 Jan 21 14:07:40.151: 0 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.151: 0 100034 g_detach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: label:taste, provider->name: ada0 2026 Jan 21 14:07:40.151: 0 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: label:taste, provider->name: No provider 2026 Jan 21 14:07:40.151: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 00, geom->name: label:taste 2026 Jan 21 14:07:40.151: 0 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.151: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.151: 0 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.151: 0 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provider->name:= No provider 2026 Jan 21 14:07:40.161: 0 100034 g_detach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provider->name:= diskid/DISK-BHYVE-38D3-F1E6-DA3C 2026 Jan 21 14:07:40.161: 0 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provi= der->name: No provider 2026 Jan 21 14:07:40.161: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 00, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C 2026 Jan 21 14:07:40.161: 0 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provider->name:= No provider 2026 Jan 21 14:07:40.161: 0 100034 g_wither_washer:entry=20 2026 Jan 21 14:07:40.161: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.161: 0 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0001, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.161: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.161: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 01, geom->name: ada0 2026 Jan 21 14:07:40.161: 0 100034 g_wither_washer:return 2026 Jan 21 14:07:40.161: 0 100034 g_wither_washer:entry=20 2026 Jan 21 14:07:40.161: 0 100034 g_wither_washer:return 2026 Jan 21 14:07:40.201: 0 100388 ahci_ch_detach:entry 2026 Jan 21 14:07:40.201: 0 100388 cam_sim_free:entry Sim: ahcich 0:0 Refco= unt: 2 kernel`ahci_ch_detach+0xb1 kernel`device_detach+0x180 kernel`devctl2_ioctl+0x412 kernel`devfs_ioctl+0xcb kernel`vn_ioctl+0xc8 kernel`devfs_ioctl_f+0x1e kernel`kern_ioctl+0x286 kernel`sys_ioctl+0x117 kernel`amd64_syscall+0x117 kernel`0xffffffff80e981bb 2026 Jan 21 14:07:40.211: 0 100044 g_orphan_provider:entry : access: r0w0e0= , geom->flags: 0x0000, geom->name: ada0, provider->name: ada0 2026 Jan 21 14:07:40.211: 0 100034 g_orphan_provider:entry : access: r0w0e0= , geom->flags: 0x0001, geom->name: ada0, provider->name: diskid/DISK-BHYVE-= 38D3-F1E6-DA3C 2026 Jan 21 14:07:40.211: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.211: 0 100034 g_wither_washer:entry=20 2026 Jan 21 14:07:40.211: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.211: 0 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0001, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.211: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.211: 0 100034 g_wither_washer:return 2026 Jan 21 14:07:40.211: 0 100034 g_detach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: ada0 2026 Jan 21 14:07:40.211: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.211: 0 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.211: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 00, geom->name: ada0 2026 Jan 21 14:07:40.211: 0 100034 g_detach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provider->name:= diskid/DISK-BHYVE-38D3-F1E6-DA3C 2026 Jan 21 14:07:40.211: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.211: 0 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provi= der->name: No provider 2026 Jan 21 14:07:40.211: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 00, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C 2026 Jan 21 14:07:40.211: 0 100034 g_wither_washer:entry=20 2026 Jan 21 14:07:40.211: 0 100034 g_destroy_provider:entry : access: r0w0e= 0, geom->flags: 0x0001, geom->name: ada0, provider->name: diskid/DISK-BHYVE= -38D3-F1E6-DA3C 2026 Jan 21 14:07:40.211: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.211: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 01, geom->name: ada0 2026 Jan 21 14:07:40.211: 0 100034 g_destroy_provider:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: ada0, provider->name: ada0 2026 Jan 21 14:07:40.211: 0 100034 g_disk_providergone:entry dp->d_gone: set 2026 Jan 21 14:07:40.222: 0 100034 cam_sim_release:entry Sim: ahcich 0:0 Re= fcount: 1 kernel`xpt_release_bus+0xde kernel`xpt_free_path+0x43 kernel`cam_periph_release_locked_buses+0x239 kernel`cam_periph_release+0x47 kernel`g_disk_providergone+0x27 kernel`g_destroy_provider+0x4c kernel`g_wither_washer+0x7e kernel`g_run_events+0x388 kernel`fork_exit+0x81 kernel`0xffffffff80e988ee 2026 Jan 21 14:07:40.222: 0 100034 cam_sim_release:return Sim: ahcich 0:0 R= efcount: 0 2026 Jan 21 14:07:40.222: 0 100034 g_wither_washer:return 2026 Jan 21 14:07:40.222: 0 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.222: 0 100034 g_wither_washer:entry=20 2026 Jan 21 14:07:40.222: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 01, geom->name: ada0 2026 Jan 21 14:07:40.222: 0 100034 g_wither_washer:return 2026 Jan 21 14:07:40.231: 1 100388 ahci_ch_detach:return When the problem does occur, cam_sim_release() isn't called at all and it looks like geom only starts to process the attached device after the detaching is already in progress: 2026 Jan 21 14:07:40.271: 0 100406 ahci_ch_attach:entry 2026 Jan 21 14:07:40.271: 0 100406 cam_sim_hold:entry Sim: ahcich 0:0 Refco= unt: 1 kernel`xpt_bus_register+0xf9 kernel`ahci_ch_attach+0x709 kernel`device_attach+0x43d kernel`devctl2_ioctl+0x144 kernel`devfs_ioctl+0xcb kernel`vn_ioctl+0xc8 kernel`devfs_ioctl_f+0x1e kernel`kern_ioctl+0x286 kernel`sys_ioctl+0x117 kernel`amd64_syscall+0x117 kernel`0xffffffff80e981bb 2026 Jan 21 14:07:40.271: 0 100406 cam_sim_hold:return Sim: ahcich 0:0 Refc= ount: 2 2026 Jan 21 14:07:40.271: 0 100406 ahci_ch_attach:return 2026 Jan 21 14:07:40.271: 1 100400 ahci_ch_detach:entry 2026 Jan 21 14:07:40.271: 1 100400 cam_sim_free:entry Sim: ahcich 0:0 Refco= unt: 2 kernel`ahci_ch_detach+0xb1 kernel`device_detach+0x180 kernel`devctl2_ioctl+0x412 kernel`devfs_ioctl+0xcb kernel`vn_ioctl+0xc8 kernel`devfs_ioctl_f+0x1e kernel`kern_ioctl+0x286 kernel`sys_ioctl+0x117 kernel`amd64_syscall+0x117 kernel`0xffffffff80e981bb 2026 Jan 21 14:07:40.361: 1 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.361: 0 100034 g_detach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: ada0 2026 Jan 21 14:07:40.361: 0 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.361: 0 100034 g_destroy_geom:entry : geom->flags: 0x00= 00, geom->name: ada0 2026 Jan 21 14:07:40.361: 0 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: label:taste, provider->name: No provider 2026 Jan 21 14:07:40.391: 1 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.391: 1 100034 g_detach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: label:taste, provider->name: ada0 2026 Jan 21 14:07:40.391: 1 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: label:taste, provider->name: No provider 2026 Jan 21 14:07:40.391: 1 100034 g_destroy_geom:entry : geom->flags: 0x00= 00, geom->name: label:taste 2026 Jan 21 14:07:40.391: 1 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.391: 1 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.391: 1 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.391: 1 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provider->name:= No provider 2026 Jan 21 14:07:40.391: 1 100034 g_detach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provider->name:= diskid/DISK-BHYVE-38D3-F1E6-DA3C 2026 Jan 21 14:07:40.401: 1 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provi= der->name: No provider 2026 Jan 21 14:07:40.401: 1 100034 g_destroy_geom:entry : geom->flags: 0x00= 00, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C 2026 Jan 21 14:07:40.401: 1 100034 g_attach:entry : access: r0w0e0, geom->f= lags: 0x0000, geom->name: diskid/DISK-BHYVE-38D3-F1E6-DA3C, provider->name:= No provider 2026 Jan 21 14:07:40.401: 1 100034 g_wither_washer:entry=20 2026 Jan 21 14:07:40.401: 1 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.401: 1 100034 g_destroy_consumer:entry : access: r0w0e= 0, geom->flags: 0x0001, geom->name: ada0, provider->name: No provider 2026 Jan 21 14:07:40.401: 1 100034 g_do_wither:entry=20 2026 Jan 21 14:07:40.401: 1 100034 g_destroy_geom:entry : geom->flags: 0x00= 01, geom->name: ada0 2026 Jan 21 14:07:40.401: 1 100034 g_wither_washer:return 2026 Jan 21 14:07:40.401: 1 100034 g_wither_washer:entry=20 2026 Jan 21 14:07:40.401: 1 100034 g_wither_washer:return 2026 Jan 21 14:07:40.411: 1 100407 ahci_ch_detach:entry 2026 Jan 21 14:07:40.411: 1 100407 ahci_ch_detach:return 2026 Jan 21 14:07:40.481: 0 100386 ahci_ch_detach:entry 2026 Jan 21 14:07:40.493: 0 100386 ahci_ch_detach:return Setting kern.cam.iosched.dynamic=3D0 makes the problem a lot harder to trigger. In the meantime the system with the real flaky disk (elektrobier4) panicked again in xpt_done_process() and I noticed that a similar problem has been reported in PR/277499 "panic in doneq0 xpt_done_td xpt_done_process after HDD falling off the bus (Periph destroyed)" [0] which references PR 263704 "Panic because device went away with XPT_ATA_IO pending" [1]. Both are "Closed FIXED" at the moment. For now I've set kern.cam.iosched.dynamic=3D0 on elektrobier4 as well to see how the behaviour differs when ada0 acts up again which I expect to happen within days. Fabian [0] [1]