NetBSD Problem Report #57870

From www@netbsd.org  Mon Jan 22 01:04:26 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 19BF61A9238
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 22 Jan 2024 01:04:26 +0000 (UTC)
Message-Id: <20240122010421.EEFD21A9239@mollari.NetBSD.org>
Date: Mon, 22 Jan 2024 01:04:21 +0000 (UTC)
From: rwhitlock22@gmail.com
Reply-To: rwhitlock22@gmail.com
To: gnats-bugs@NetBSD.org
Subject: umount hang (ld/sdmmc/rtsx)
X-Send-Pr-Version: www-1.0

>Number:         57870
>Category:       kern
>Synopsis:       umount hang (ld/sdmmc/rtsx)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    riastradh
>State:          analyzed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 22 01:05:00 +0000 2024
>Closed-Date:    
>Last-Modified:  Sat Feb 03 15:18:45 +0000 2024
>Originator:     Robert Whitlock
>Release:        NetBSD 10.0 RC2
>Organization:
>Environment:
NetBSD thinkpad 10.0_RC2 NetBSD 10.0_RC2 (GENERIC) #0: Mon Jan  1 14:04:52 UTC 2024  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64

>Description:
I put a microSD card in a microSD to SD card adapter and put it in the SD slot on my computer. I wrote an ISO image to it. I then tried to unmount the disk with

umount /mnt

but the umount program hung. It was stuck in a tstile state and information from various commands related to this state are in the output of crash(8) below.

There is also a small typo in the sdmmc dmesg error string where a newline character is missing. See the dmesg output below for an instance of that message.


thinkpad# crash     
Crash version 10.0_RC2, image version 10.0_RC2.
Kernel compiled without options LOCKDEBUG.
Output from a running system is unreliable.
crash> ps | sh -c 'cat - > crash_ps_output.txt'
crash> ps/w | sh -c 'cat - > crash_ps_w_output.txt'
crash> show all tstiles | sh -c 'cat - > crash_show_all_tstiles_output.txt'
crash> bt/a fffffcd89a0e7a80 | sh -c 'cat - > crash_bt_a_output.txt'
crash> quit
thinkpad#


Contents of crash_ps_output.txt:


PID    LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
18109>18109 7   0         0   fffffcd8be760a80                 sh
11509>11509 7   2         0   fffffcd8b1ef20c0              crash
7151  7151 3   0       180   fffffcd89dd4e480                ksh ttyraw
25754 25754 3   0       180   fffffcd8ace36280              xterm select
22182 22182 3   0       180   fffffcd958277780                ksh pause
25471 25471 3   2       180   fffffcd7d6b2d540                ksh pause
2949  2949 3   0       180   fffffcd8d2c32180              xterm select
1172  1172 3   0       180   fffffcd8d15bfa40             pickup kqueue
29628 29628 3   2         0   fffffcd8a3da8100                 df biowait
21937 21937 3   0       180   fffffcd8ba437480           postdrop netio
14994 14994 3   2       180   fffffcd8ba4378c0           sendmail pipe_rd
20514 20514 3   2       180   fffffcd89e337080                tee pipe_rd
12005 12005 3   0       180   fffffcd8c55dd0c0                 sh wait
25005 25005 3   2       180   fffffcd8ace36b00                 sh wait
8904  8904 3   0       180   fffffcd8e61d5040               cron pipe_rd
21422 21422 3   0       180   fffffcd8ecef25c0                ksh ttyraw
20542 20542 3   0       180   fffffcd8ae78f040                ksh ttyraw
23360 23360 3   2       1c0   fffffcd8b9bdc340                vim select
7159  7159 3   0       180   fffffcd8d22b34c0                ksh pause
24376 24376 3   0       1c0   fffffcd8ecef2a00              xterm select
20956 20956 3   2       180   fffffcd8b1130300                ksh ttyraw
1903  1903 3   2       180   fffffcd8e61d5480              xterm select
9802  9802 3   0         0   fffffcd8b8e2d6c0             umount tstile
12707 12707 4   0   1000100   fffffcd8c55dd940               more
6041  6041 4   2   1000100   fffffcd8b33ff600                man
10793 19857 3   0       180   fffffcd8b33ff1c0    ProxyResolution parked
10793 26070 3   2       180   fffffcd8be760200     mozStorage #12 parked
10793 1807 3   3       180   fffffcd8d149c240              gdbus poll
10793 6898 3   0       180   fffffcd8b4324a80     mozStorage #11 parked
10793 18557 3   0       180   fffffcd8d2c32a00      mozStorage #6 parked
10793 16376 3   3       180   fffffcd8c55dd500        DataStorage parked
10793 16335 3   3       180   fffffcd8d15bf1c0    SysProxySetting parked
10793 23522 3   0       180   fffffcd8b4324200      mozStorage #4 parked
10793 22855 3   2       180   fffffcd8c0bfd500    Classifier Upda parked
10793 10935 3   3       180   fffffcd8d12ee540     URL Classifier parked
10793 2845 3   0       180   fffffcd8b9bdcbc0    QuotaManager IO parked
10793 21682 3   2       1c0   fffffcd89feee9c0    localStorage DB parked
10793 13240 3   0       180   fffffcd8b899eac0      mozStorage #3 parked
10793 16647 3   0       180   fffffcd8b1130740          Cache I/O parked
10793 22099 3   0       1c0   fffffcd910110780        SaveScripts parked
10793 15087 3   2       180   fffffcd8b1130b80    ImageBridgeChil parked
10793 25132 3   3       180   fffffcd8c6066040        DataStorage parked
10793 20000 3   2       180   fffffcd958277bc0        DataStorage parked
10793 23986 3   0       180   fffffcd8b032eb00      mozStorage #2 parked
10793 4680 3   3       180   fffffcd8a44c1a00      mozStorage #1 parked
10793 22105 3   0       180   fffffcd8ace366c0         DOM Worker parked
10793 16716 3   3       180   fffffcd8be760640            ImageIO parked
10793 11770 3   3       180   fffffcd8e5ef5140      ImgDecoder #3 parked
10793 17053 3   1       180   fffffcd8c0bfd0c0      ImgDecoder #2 parked
10793 16256 3   2       180   fffffcd8ae78f480      ImgDecoder #1 parked
10793 14312 3   3       180   fffffcd8a6915a80         VRListener parked
10793 13159 3   0       180   fffffcd8a7a77680         Compositor parked
10793 27230 3   2       1c0   fffffcd8fd242500    SoftwareVsyncTh parked
10793 15816 3   0       180   fffffcd8b2c81100    IPDL Background parked
10793 27326 3   0       180   fffffcd8ecef2180       HTML5 Parser parked
10793 5939 3   0       180   fffffcd89b552b00          LoadRoots parked
10793 20330 3   1       1c0   fffffcd8e5ef59c0              gmain poll
10793 23095 3   1       180   fffffcd8b33ffa40       pool-spawner parked
10793 16304 3   0       180   fffffcd8e61d58c0          GMPThread parked
10793 20779 3   2       180   fffffcd8fd242940              Timer parked
10793 8783 3   0       180   fffffcd8c60668c0         Cache2 I/O parked
10793 25660 3   0       180   fffffcd8b032e280       Hang Monitor parked
10793 21155 3   2       180   fffffcd8b9bdc780          JS Helper parked
10793 11528 3   3       180   fffffcd8b2d44180          JS Helper parked
10793 22273 3   2       180   fffffcd8ddbada80          JS Helper parked
10793 22876 3   2       180   fffffcd8c0bfd940          JS Helper parked
10793 7061 3   3       180   fffffcd8fd2420c0          JS Helper parked
10793 8419 3   0       180   fffffcd8ae78f8c0          JS Helper parked
10793 18766 3   1       180   fffffcd8d12ee100          JS Helper parked
10793 5857 3   1       180   fffffcd89e3374c0          JS Helper parked
10793 13750 3   2       1c0   fffffcd8ba437040        JS Watchdog parked
10793 22359 3   2       1c0   fffffcd99c4b6580      Socket Thread poll
10793 12263 3   3       180   fffffcd89ccf1340     Gecko_IOThread kqueue
10793 10793 3   2       1c0   fffffcd8c6066480          seamonkey poll
9568  9568 3   2       180   fffffcd910110340                 sh wait
21573 21573 4   2   1000100   fffffcd8f37d6a40                vim
1691  20473 3   1       180   fffffcd8b2c81540              gdbus poll
1691  4875 3   0       180   fffffcd910110bc0              gmain poll
1691  13449 3   0       180   fffffcd9a7ce9940       pool-spawner parked
1691  1691 3   0       180   fffffcd89c16f740   at-spi2-registry poll
11180 11180 3   0       1c0   fffffcd8f4cb5080        dbus-daemon poll
21355 13350 3   3       180   fffffcd8b1ef2940              gdbus poll
21355 16325 5   2  10000140   fffffcd7ad879b40           (zombie)
21355 15214 3   2       180   fffffcd8b1ef2500       pool-spawner parked
21355 13980 3   1       1c0   fffffcd906963ac0              gmain poll
21355 21355 3   2       180   fffffcd7d6b2d980   at-spi-bus-launc poll
2027  2027 3   0       180   fffffcd8d22b3080                ksh ttyraw
19922 19922 3   2       180   fffffcd89b0f4600              xterm select
7646  7646 3   2       180   fffffcd8d7466700                ksh pause
18803 18803 3   2       180   fffffcd89adf5a80              login wait
16283 16283 3   2       180   fffffcd8b9366b40                ksh ttyraw
14915 14915 3   2       1c0   fffffcd8b4324640              xterm select
3252  3252 3   3       180   fffffcd8a3da8540        dbus-daemon poll
1410  1410 3   3       180   fffffcd8ae9e5080        dbus-launch select
1117   955 3   3       180   fffffcd89b5526c0              gmain poll
1117  1117 3   0       180   fffffcd8a7a77240              irssi poll
1158  1158 3   0       180   fffffcd8a6915200                ksh pause
1164  1164 3   0       180   fffffcd8a6915640              xterm select
997    997 3   0       180   fffffcd89b0f4a40                ksh ttyraw
1013  1013 3   2       180   fffffcd89b298240                ksh pause
1014  1014 3   2       180   fffffcd8a44c15c0                ksh pause
2427  2427 3   3       180   fffffcd89a2a7140              xterm select
2616  2616 3   2       180   fffffcd89b0f41c0             xclock poll
2611  2611 3   2       1c0   fffffcd89dd4e8c0              xterm select
484    484 3   2       1c0   fffffcd89ccf1780               ctwm select
481    481 3   1       180   fffffcd89b298680              getty ttyraw
480    480 3   1       180   fffffcd89a20a980              getty ttyraw
350    350 3   2       180   fffffcd89adf5640              login wait
344    344 3   2       180   fffffcd8a44c1180               cron nanoslp
336    336 3   0       180   fffffcd89feee140              inetd kqueue
2119  2119 3   0       180   fffffcd89ccf1bc0               qmgr kqueue
325    325 3   2       180   fffffcd89feee580             master kqueue
1189  1189 3   1       180   fffffcd8a3da8980           xconsole poll
414    414 3   2       180   fffffcd8a082b500                xdm wait
1991   413 3   2       180   fffffcd8a082b940                  X poll
1991  2342 3   2   1000180   fffffcd8a082b0c0                  X parked
1991  1330 3   2   1000180   fffffcd89e337900                  X parked
1991  1991 3   2       180   fffffcd89dd4e040                  X poll
1914  1914 3   3       180   fffffcd89c16fb80                xdm pause
1854  1854 3   0       180   fffffcd89c16f300             powerd kqueue
1071  1071 3   0       180   fffffcd89a0f1600            syslogd kqueue
805    805 3   3       180   fffffcd89bef6b40             dhcpcd poll
760    760 3   1       180   fffffcd89bef6700             dhcpcd poll
761    761 3   1       180   fffffcd89bef62c0             dhcpcd poll
840    840 3   0       180   fffffcd89b298ac0             dhcpcd poll
700    700 3   0       180   fffffcd89b552280     wpa_supplicant kqueue
1        1 3   3       180   fffffcd89a20a100               init wait
0     20013 5   0       200   fffffcd8e5ef5580           (zombie)
0      253 3   0       200   fffffcd89adf5200            physiod physiod
0      174 3   1       200   fffffcd89a5b9a40    i915-userptr-ac i915-userptr-acq
0      173 3   3       200   fffffcd89a5b9600          i915_flip i915_flip
0      172 3   3       200   fffffcd89a5b91c0       i915_modeset i915_modeset
0      171 3   0       200   fffffcd89a574a00          pooldrain pooldrain
0      170 3   2       200   fffffcd89a5745c0            ioflush syncer
0      169 3   2       200   fffffcd89a574180           pgdaemon pgdaemon
0      168 3   0       200   fffffcd89a2a79c0            i915-dp i915-dp
0      167 3   3       200   fffffcd89a2a7580               i915 i915
0      164 3   2       200   fffffcd89a0cc5c0          swwreboot swwreboot
0      162 3   2       200   fffffcd89a20a540             npfgc0 npfgcw
0      161 3   0       200   fffffcd89a1b6940            rt_free rt_free
0      160 3   0       200   fffffcd89a1b6500              unpgc unpgc
0       95 3   2       200   fffffcd89a0cca00    key_timehandler key_timehandler
0      222 3   2       200   fffffcd89a1b60c0               usb2 usbevt
0      221 3   3       200   fffffcd899959900    icmp6_wqinput/3 icmp6_wqinput
0      220 3   2       200   fffffcd8999594c0    icmp6_wqinput/2 icmp6_wqinput
0      219 3   1       200   fffffcd899959080    icmp6_wqinput/1 icmp6_wqinput
0      218 3   0       200   fffffcd89a19c8c0    icmp6_wqinput/0 icmp6_wqinput
0      217 3   2       200   fffffcd89a19c480          nd6_timer nd6_timer
0      216 3   3       200   fffffcd89a19c040    carp6_wqinput/3 carp6_wqinput
0      215 3   2       200   fffffcd89a177bc0    carp6_wqinput/2 carp6_wqinput
0      214 3   1       200   fffffcd89a177780    carp6_wqinput/1 carp6_wqinput
0      213 3   0       200   fffffcd89a177340    carp6_wqinput/0 carp6_wqinput
0      212 3   3       200   fffffcd89a18ab80     carp_wqinput/3 carp_wqinput
0      211 3   2       200   fffffcd89a18a740     carp_wqinput/2 carp_wqinput
0      210 3   1       200   fffffcd89a18a300     carp_wqinput/1 carp_wqinput
0      209 3   0       200   fffffcd89a16db40     carp_wqinput/0 carp_wqinput
0      208 3   3       200   fffffcd89a16d700     icmp_wqinput/3 icmp_wqinput
0      207 3   2       200   fffffcd89a16d2c0     icmp_wqinput/2 icmp_wqinput
0      206 3   1       200   fffffcd89a22bb00     icmp_wqinput/1 icmp_wqinput
0      205 3   0       200   fffffcd89a22b6c0     icmp_wqinput/0 icmp_wqinput
0      204 3   2       200   fffffcd899f659c0           acpibat0 acpibat0
0      203 3   0       200   fffffcd89a0cc180           acpibat1 acpibat1
0      202 3   2       200   fffffcd89a22b280           rt_timer rt_timer
0      201 3   0       200   fffffcd89a0f1a40        vmem_rehash vmem_rehash
0      198 3   2       200   fffffcd89a125ac0          coretemp1 coretemp1
0      197 3   1       200   fffffcd89a125680          coretemp0 coretemp0
0      196 3   2       200   fffffcd89a125240            acpitz0 acpitz0
0      195 3   0       200   fffffcd89a0f11c0          thinkpad0 thinkpad0
0      194 3   2       200   fffffcd89a0e7a80             sdmmc0 ldsdmmc
0      193 3   2       200   fffffcd89a0e7640               usb1 usbevt
0      192 3   0       200   fffffcd89a0e7200               usb0 usbevt
0      119 3   2       200   fffffcd899f65580          entbutler entropy
0      118 3   0       240   fffffcd899f65140               tpm0 tpm0
0      117 3   0       240   fffffcd899a4d980            atabus0 atath
0      116 3   0       200   fffffcd899a4d540              iwmns iwmns
0      115 3   1       200   fffffcd899a4d100           wm0Reset wm0Reset
0      114 3   3       200   fffffcd899a28940          wm0TxRx/3 wm0TxRx
0      113 3   2       200   fffffcd899a28500          wm0TxRx/2 wm0TxRx
0      112 3   1       200   fffffcd899a280c0          wm0TxRx/1 wm0TxRx
0      111 3   0       200   fffffcd8999e2900          wm0TxRx/0 wm0TxRx
0      110 3   0       200   fffffcd8999e24c0         usbtask-dr usbtsk
0      109 3   0       200   fffffcd8999e2080         usbtask-hc usbtsk
0      108 3   0       200   fffffcd8998f48c0            intelfb intelfb
0      107 3   0       200   fffffcd8998f4480               pms0 pmsreset
0      106 3   0       200   fffffcd8998f4040    acpiec sci thre ecsci
0      105 3   3       200   fffffcd899873bc0            xcall/3 xcall
0      104 1   3       200   fffffcd899873780          softser/3
0      103 1   3       200   fffffcd899873340          softclk/3
0      102 1   3       200   fffffcd899846b80          softbio/3
0      101 1   3       200   fffffcd899846740          softnet/3
0    > 100 1   3       201   fffffcd899846300             idle/3
0       99 3   2       200   fffffcd8997c6b40            xcall/2 xcall
0       98 1   2       200   fffffcd8997c6700          softser/2
0       97 1   2       200   fffffcd8997c62c0          softclk/2
0       96 1   2       200   fffffcd8997b1b00          softbio/2
0       30 1   2       200   fffffcd8997b16c0          softnet/2
0       29 1   2       201   fffffcd8997b1280             idle/2
0       28 3   1       200   fffffcd899715ac0            xcall/1 xcall
0       27 1   1       200   fffffcd899715680          softser/1
0       26 1   1       200   fffffcd899715240          softclk/1
0       25 1   1       200   fffffcd8996f6a80          softbio/1
0       24 1   1       200   fffffcd8996f6640          softnet/1
0    >  23 1   1       201   fffffcd8996f6200             idle/1
0       22 3   3       200   fffffcd9b5881a40           lnxsyswq lnxsyswq
0       21 3   0       200   fffffcd9b5881600           lnxubdwq lnxubdwq
0       20 3   0       200   fffffcd9b58811c0           lnxpwrwq lnxpwrwq
0       19 3   0       200   fffffcd9b588aa00           lnxlngwq lnxlngwq
0       18 3   0       200   fffffcd9b588a5c0           lnxhipwq lnxhipwq
0       17 3   0       240   fffffcd9b588a180           lnxrcugc lnxrcugc
0       16 3   0       200   fffffcd9b589a9c0             sysmon smtaskq
0       15 3   0       200   fffffcd9b589a580         pmfsuspend pmfsuspend
0       14 3   0       200   fffffcd9b589a140           pmfevent pmfevent
0       13 3   0       200   fffffcd9b58b2980         sopendfree sopendfr
0       12 3   2       200   fffffcd9b58b2540             ifwdog ifwdog
0       11 3   0       200   fffffcd9b58b2100            iflnkst iflnkst
0       10 3   0       200   fffffcd9b68e5940           nfssilly nfssilly
0        9 3   2       240   fffffcd9b68e5500             vdrain vdrain
0        8 3   0       200   fffffcd9b68e50c0          modunload mod_unld
0        7 3   0       200   fffffcd9b690a900            xcall/0 xcall
0        6 1   0       200   fffffcd9b690a4c0          softser/0
0        5 1   0       200   fffffcd9b690a080          softclk/0
0        4 1   0       200   fffffcd9b69398c0          softbio/0
0        3 1   0       200   fffffcd9b6939480          softnet/0
0        2 1   0       201   fffffcd9b6939040             idle/0
0        0 3   2       200   ffffffff8188abc0            swapper uvm


Contents of crash_ps_w_output.txt:


PID   LID          COMMAND     EMUL  PRI WAIT-MSG    WAIT-CHANNEL
25917>25917               sh   netbsd   43              0
11509>11509            crash   netbsd   43              0
7151  7151              ksh   netbsd   43 ttyraw       fffffcd89b302148
25754 25754            xterm   netbsd   43 select       fffffcd9b6d95580
22182 22182              ksh   netbsd   43 pause        fffffcd958277780
25471 25471              ksh   netbsd   43 pause        fffffcd7d6b2d540
2949  2949            xterm   netbsd   43 select       fffffcd9b6d95580
1172  1172           pickup   netbsd   43 kqueue       fffffcd8d77c1ea0
29628 29628               df   netbsd   35 biowait      fffffcd8e46ac970
21937 21937         postdrop   netbsd   43 netio        fffffcd7f13fdd08
14994 14994         sendmail   netbsd   43 pipe_rd      fffffcd8df541638
20514 20514              tee   netbsd   43 pipe_rd      fffffcd8df541448
12005 12005               sh   netbsd   35 wait         fffffcd89b517418
25005 25005               sh   netbsd   43 wait         fffffcd8dfd62b18
8904  8904             cron   netbsd   43 pipe_rd      fffffcd8a7b42a00
21422 21422              ksh   netbsd   43 ttyraw       fffffcd89ae0c9c8
20542 20542              ksh   netbsd   43 ttyraw       fffffcd89c318448
23360 23360              vim   netbsd   43 select       fffffcd8997a30c0
7159  7159              ksh   netbsd   43 pause        fffffcd8d22b34c0
24376 24376            xterm   netbsd   43 select       fffffcd9b6d95580
20956 20956              ksh   netbsd   34 ttyraw       fffffcd8aecc7a48
1903  1903            xterm   netbsd   43 select       fffffcd8997a30c0
9802  9802           umount   netbsd   43 tstile       fffffcd8e4f460a8
12707 12707             more   netbsd   43              0
6041  6041              man   netbsd   43              0
10793 19857        seamonkey   netbsd   40 parked       fffffcd8b33ff1c0
10793 26070        seamonkey   netbsd   43 parked       fffffcd8be760200
10793 1807        seamonkey   netbsd   43 poll         fffffcd9b6d95580
10793 6898        seamonkey   netbsd   43 parked       fffffcd8b4324a80
10793 18557        seamonkey   netbsd   43 parked       fffffcd8d2c32a00
10793 16376        seamonkey   netbsd   43 parked       fffffcd8c55dd500
10793 16335        seamonkey   netbsd   43 parked       fffffcd8d15bf1c0
10793 23522        seamonkey   netbsd   43 parked       fffffcd8b4324200
10793 22855        seamonkey   netbsd   43 parked       fffffcd8c0bfd500
10793 10935        seamonkey   netbsd   43 parked       fffffcd8d12ee540
10793 2845        seamonkey   netbsd   43 parked       fffffcd8b9bdcbc0
10793 21682        seamonkey   netbsd   43 parked       fffffcd89feee9c0
10793 13240        seamonkey   netbsd   43 parked       fffffcd8b899eac0
10793 16647        seamonkey   netbsd   43 parked       fffffcd8b1130740
10793 22099        seamonkey   netbsd   43 parked       fffffcd910110780
10793 15087        seamonkey   netbsd   43 parked       fffffcd8b1130b80
10793 25132        seamonkey   netbsd   43 parked       fffffcd8c6066040
10793 20000        seamonkey   netbsd   43 parked       fffffcd958277bc0
10793 23986        seamonkey   netbsd   43 parked       fffffcd8b032eb00
10793 4680        seamonkey   netbsd   43 parked       fffffcd8a44c1a00
10793 22105        seamonkey   netbsd   43 parked       fffffcd8ace366c0
10793 16716        seamonkey   netbsd   43 parked       fffffcd8be760640
10793 11770        seamonkey   netbsd   43 parked       fffffcd8e5ef5140
10793 17053        seamonkey   netbsd   43 parked       fffffcd8c0bfd0c0
10793 16256        seamonkey   netbsd   43 parked       fffffcd8ae78f480
10793 14312        seamonkey   netbsd   43 parked       fffffcd8a6915a80
10793 13159        seamonkey   netbsd   43 parked       fffffcd8a7a77680
10793 27230        seamonkey   netbsd   43 parked       fffffcd8fd242500
10793 15816        seamonkey   netbsd   43 parked       fffffcd8b2c81100
10793 27326        seamonkey   netbsd   43 parked       fffffcd8ecef2180
10793 5939        seamonkey   netbsd   43 parked       fffffcd89b552b00
10793 20330        seamonkey   netbsd   43 poll         fffffcd9b6d95580
10793 23095        seamonkey   netbsd   43 parked       fffffcd8b33ffa40
10793 16304        seamonkey   netbsd   43 parked       fffffcd8e61d58c0
10793 20779        seamonkey   netbsd   43 parked       fffffcd8fd242940
10793 8783        seamonkey   netbsd   43 parked       fffffcd8c60668c0
10793 25660        seamonkey   netbsd   43 parked       fffffcd8b032e280
10793 21155        seamonkey   netbsd   43 parked       fffffcd8b9bdc780
10793 11528        seamonkey   netbsd   43 parked       fffffcd8b2d44180
10793 22273        seamonkey   netbsd   43 parked       fffffcd8ddbada80
10793 22876        seamonkey   netbsd   43 parked       fffffcd8c0bfd940
10793 7061        seamonkey   netbsd   43 parked       fffffcd8fd2420c0
10793 8419        seamonkey   netbsd   43 parked       fffffcd8ae78f8c0
10793 18766        seamonkey   netbsd   43 parked       fffffcd8d12ee100
10793 5857        seamonkey   netbsd   43 parked       fffffcd89e3374c0
10793 13750        seamonkey   netbsd   43 parked       fffffcd8ba437040
10793 22359        seamonkey   netbsd   43 poll         fffffcd8997a30c0
10793 12263        seamonkey   netbsd   43 kqueue       fffffcd968e55a20
10793 10793        seamonkey   netbsd   43 poll         fffffcd8997a30c0
9568  9568               sh   netbsd   43 wait         fffffcd89b47f7d8
21573 21573              vim   netbsd   43              0
1691  20473 at-spi2-registry   netbsd   43 poll         fffffcd9b6d95580
1691  4875 at-spi2-registry   netbsd   43 poll         fffffcd8997a3240
1691  13449 at-spi2-registry   netbsd   43 parked       fffffcd9a7ce9940
1691  1691 at-spi2-registry   netbsd   43 poll         fffffcd8997a30c0
11180 11180      dbus-daemon   netbsd   43 poll         fffffcd9b6d95580
21355 13350 at-spi-bus-launc   netbsd   43 poll         fffffcd8997a30c0
21355 16325 at-spi-bus-launc   netbsd   43              0
21355 15214 at-spi-bus-launc   netbsd   43 parked       fffffcd8b1ef2500
21355 13980 at-spi-bus-launc   netbsd   43 poll         fffffcd8997a30c0
21355 21355 at-spi-bus-launc   netbsd   43 poll         fffffcd9b5770f00
2027  2027              ksh   netbsd   43 ttyraw       fffffcd8dbf88748
19922 19922            xterm   netbsd   43 select       fffffcd8997a30c0
7646  7646              ksh   netbsd   43 pause        fffffcd8d7466700
18803 18803            login   netbsd   43 wait         fffffcd89a2d36d8
16283 16283              ksh   netbsd   43 ttyraw       fffffcd8aa2d2408
14915 14915            xterm   netbsd   43 select       fffffcd8997a30c0
3252  3252      dbus-daemon   netbsd   43 poll         fffffcd9b6d95580
1410  1410      dbus-launch   netbsd   43 select       fffffcd8997a3240
1117   955            irssi   netbsd   43 poll         fffffcd8997a3240
1117  1117            irssi   netbsd   43 poll         fffffcd9b6d95580
1158  1158              ksh   netbsd   43 pause        fffffcd8a6915200
1164  1164            xterm   netbsd   43 select       fffffcd9b6d95580
997    997              ksh   netbsd   43 ttyraw       fffffcd8a2259988
1013  1013              ksh   netbsd   43 pause        fffffcd89b298240
1014  1014              ksh   netbsd   43 pause        fffffcd8a44c15c0
2427  2427            xterm   netbsd   43 select       fffffcd8997a30c0
2616  2616           xclock   netbsd   43 poll         fffffcd8997a30c0
2611  2611            xterm   netbsd   43 select       fffffcd8997a30c0
484    484             ctwm   netbsd   43 select       fffffcd8997a30c0
481    481            getty   netbsd   43 ttyraw       fffffcd89c1b4a08
480    480            getty   netbsd   43 ttyraw       fffffcd89c6356c8
350    350            login   netbsd   43 wait         fffffcd89a2d3398
344    344             cron   netbsd   43 nanoslp      fffffcd8a44c1180
336    336            inetd   netbsd   43 kqueue       fffffcd899d5bb20
2119  2119             qmgr   netbsd   43 kqueue       fffffcd89f080b20
325    325           master   netbsd   43 kqueue       fffffcd8a22d6820
1189  1189         xconsole   netbsd   43 poll         fffffcd9b5770f00
414    414              xdm   netbsd   43 wait         fffffcd89e26eb98
1991   413                X   netbsd   43 poll         fffffcd8997a30c0
1991  2342                X   netbsd   43 parked       fffffcd8a082b0c0
1991  1330                X   netbsd   43 parked       fffffcd89e337900
1991  1991                X   netbsd   43 poll         fffffcd9b6d95580
1914  1914              xdm   netbsd   43 pause        fffffcd89c16fb80
1854  1854           powerd   netbsd   43 kqueue       fffffcd89b102b20
1071  1071          syslogd   netbsd   43 kqueue       fffffcd89b102820
805    805           dhcpcd   netbsd   43 poll         fffffcd8997a30c0
760    760           dhcpcd   netbsd   43 poll         fffffcd9b6d95580
761    761           dhcpcd   netbsd   43 poll         fffffcd8997a30c0
840    840           dhcpcd   netbsd   43 poll         fffffcd8997a30c0
700    700   wpa_supplicant   netbsd   43 kqueue       fffffcd89b5c34a0
1        1             init   netbsd   43 wait         fffffcd89a2d3058
0     20013           system   netbsd   96              0
0      253           system   netbsd  123 physiod      fffffcd89b1e1e08
0      174           system   netbsd   43 i915-userptr-acq fffffcd89a7d01c8
0      173           system   netbsd   43 i915_flip    fffffcd89a23db08
0      172           system   netbsd   43 i915_modeset fffffcd89a23da88
0      171           system   netbsd  125 pooldrain    ffffffff81911280
0      170           system   netbsd  124 syncer       fffffcd89a5745c0
0      169           system   netbsd  126 pgdaemon     ffffffff8190ee48
0      168           system   netbsd   43 i915-dp      fffffcd89a23d688
0      167           system   netbsd   43 i915         fffffcd89a23d288
0      164           system   netbsd   43 swwreboot    fffffcd89a239688
0      162           system   netbsd   96 npfgcw       fffffcd89a21c3c8
0      161           system   netbsd  222 rt_free      fffffcd89a12f988
0      160           system   netbsd   96 unpgc        ffffffff819823b0
0       95           system   netbsd  222 key_timehandler fffffcd89a12f8c8
0      222           system   netbsd   96 usbevt       fffffcd899ffb4b8
0      221           system   netbsd  222 icmp6_wqinput fffffcd89a19a388
0      220           system   netbsd  222 icmp6_wqinput fffffcd89a19a348
0      219           system   netbsd  222 icmp6_wqinput fffffcd89a19a308
0      218           system   netbsd  222 icmp6_wqinput fffffcd89a19a2c8
0      217           system   netbsd  222 nd6_timer    fffffcd89a12f508
0      216           system   netbsd  222 carp6_wqinput fffffcd89a19a208
0      215           system   netbsd  222 carp6_wqinput fffffcd89a19a1c8
0      214           system   netbsd  222 carp6_wqinput fffffcd89a19a188
0      213           system   netbsd  222 carp6_wqinput fffffcd89a19a148
0      212           system   netbsd  222 carp_wqinput fffffcd89a0aff48
0      211           system   netbsd  222 carp_wqinput fffffcd89a0aff08
0      210           system   netbsd  222 carp_wqinput fffffcd89a0afec8
0      209           system   netbsd  222 carp_wqinput fffffcd89a0afe88
0      208           system   netbsd  222 icmp_wqinput fffffcd89a0afc48
0      207           system   netbsd  222 icmp_wqinput fffffcd89a0afc08
0      206           system   netbsd  222 icmp_wqinput fffffcd89a0afbc8
0      205           system   netbsd  222 icmp_wqinput fffffcd89a0afb88
0      204           system   netbsd   43 acpibat0     fffffcd89a12f208
0      203           system   netbsd   43 acpibat1     fffffcd89a10cd48
0      202           system   netbsd  222 rt_timer     fffffcd89a10cb08
0      201           system   netbsd  125 vmem_rehash  fffffcd89a10c8c8
0      198           system   netbsd   43 coretemp1    fffffcd89a10c748
0      197           system   netbsd   43 coretemp0    fffffcd89a10c508
0      196           system   netbsd   43 acpitz0      fffffcd89a10c2c8
0      195           system   netbsd   43 thinkpad0    fffffcd89a053b08
0      194           system   netbsd  221 ldsdmmc      fffffcd8e4f46258
0      193           system   netbsd   96 usbevt       fffffcd8999a7978
0      192           system   netbsd   96 usbevt       fffffcd8999a74c0
0      119           system   netbsd   43 entropy      ffffffff818b24f0
0      118           system   netbsd   43 tpm0         fffffcd89a053148
0      117           system   netbsd   96 atath        ffffc8801108d3f0
0      116           system   netbsd   43 iwmns        fffffcd899aa22c8
0      115           system   netbsd  222 wm0Reset     fffffcd899994d48
0      114           system   netbsd  222 wm0TxRx      fffffcd8998eeec8
0      113           system   netbsd  222 wm0TxRx      fffffcd8998eee88
0      112           system   netbsd  222 wm0TxRx      fffffcd8998eee48
0      111           system   netbsd  222 wm0TxRx      fffffcd8998eee08
0      110           system   netbsd   96 usbtsk       ffffffff818d6e58
0      109           system   netbsd   96 usbtsk       ffffffff818d6e18
0      108           system   netbsd   43 intelfb      fffffcd899952e08
0      107           system   netbsd   96 pmsreset     fffffcd89994cb94
0      106           system   netbsd   96 ecsci        fffffcd89989a268
0      105           system   netbsd  127 xcall        ffffc882292b6010
0      104           system   netbsd  223              0
0      103           system   netbsd  220              0
0      102           system   netbsd  221              0
0      101           system   netbsd  222              0
0    > 100           system   netbsd    0              0
0       99           system   netbsd  127 xcall        ffffc88229279010
0       98           system   netbsd  223              0
0       97           system   netbsd  220              0
0       96           system   netbsd  221              0
0       30           system   netbsd  222              0
0       29           system   netbsd    0              0
0       28           system   netbsd  127 xcall        ffffc88228cde010
0       27           system   netbsd  223              0
0       26           system   netbsd  220              0
0       25           system   netbsd  221              0
0       24           system   netbsd  222              0
0    >  23           system   netbsd    0              0
0       22           system   netbsd   43 lnxsyswq     fffffcd9b588d288
0       21           system   netbsd   43 lnxubdwq     fffffcd9b588d208
0       20           system   netbsd   43 lnxpwrwq     fffffcd9b588d188
0       19           system   netbsd   43 lnxlngwq     fffffcd9b588d108
0       18           system   netbsd   43 lnxhipwq     fffffcd9b588d088
0       17           system   netbsd   43 lnxrcugc     ffffffff818b0a88
0       16           system   netbsd   96 smtaskq      ffffffff818f7ae0
0       15           system   netbsd   43 pmfsuspend   fffffcd9b6d948c8
0       14           system   netbsd   43 pmfevent     fffffcd9b6d94808
0       13           system   netbsd   96 sopendfr     ffffffff81982330
0       12           system   netbsd  222 ifwdog       fffffcd9b6d94748
0       11           system   netbsd  222 iflnkst      fffffcd9b6d94688
0       10           system   netbsd   43 nfssilly     fffffcd9b6d945c8
0        9           system   netbsd  125 vdrain       ffffffff81983530
0        8           system   netbsd  125 mod_unld     ffffffff819751b0
0        7           system   netbsd  127 xcall        ffffffff8183bd50
0        6           system   netbsd  223              0
0        5           system   netbsd  220              0
0        4           system   netbsd  221              0
0        3           system   netbsd  222              0
0    >   2           system   netbsd    0              0
0        0           system   netbsd  125 uvm          ffffffff8188abc0


Contents of crash_show_all_tstiles_output.txt:


  PID   LID          COMMAND      WAITING-FOR     WAIT-CHANNEL
 9802  9802           umount fffffcd89a0e7a80 fffffcd8e4f460a8


Contents of crash_bt_a_output.txt:


trace: pid 0 lid 194 at 0xffffc8823a45ad80
sleepq_block() at sleepq_block+0x13a
cv_wait() at cv_wait+0xb7
ld_sdmmc_ioctl() at ld_sdmmc_ioctl+0xb9
ld_flush() at ld_flush+0x49
ld_lastclose() at ld_lastclose+0xb
disk_begindetach() at disk_begindetach+0x4a
ldbegindetach() at ldbegindetach+0x2f
ld_sdmmc_detach() at ld_sdmmc_detach+0x27
config_detach() at config_detach+0xfc
sdmmc_card_detach.constprop.0() at sdmmc_card_detach.constprop.0+0x2e
sdmmc_task_thread() at sdmmc_task_thread+0x85


dmesg:


[     1.000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
[     1.000000]     2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
[     1.000000]     2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
[     1.000000]     2024
[     1.000000]     The NetBSD Foundation, Inc.  All rights reserved.
[     1.000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[     1.000000]     The Regents of the University of California.  All rights reserved.

[     1.000000] NetBSD 10.0_RC2 (GENERIC) #0: Mon Jan  1 14:04:52 UTC 2024
[     1.000000] 	mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC
[     1.000000] total memory = 8088 MB
[     1.000000] avail memory = 7796 MB
[     1.000000] timecounter: Timecounters tick every 10.000 msec
[     1.000000] Kernelized RAIDframe activated
[     1.000000] timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
[     1.000004] efi: systbl at pa cc27af18
[     1.000004] mainbus0 (root)
[     1.000004] ACPI: RSDP 0x00000000CCDFE014 000024 (v02 LENOVO)
[     1.000004] ACPI: XSDT 0x00000000CCDFE1C0 0000E4 (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: FACP 0x00000000CCDF8000 00010C (v05 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: DSDT 0x00000000CCDE3000 010FA5 (v02 LENOVO TP-JB    00001370 INTL 20120711)
[     1.000004] ACPI: FACS 0x00000000CCD68000 000040
[     1.000004] ACPI: SLIC 0x00000000CCDFD000 000176 (v01 LENOVO TP-JB    00001370 PTEC 00000001)
[     1.000004] ACPI: ASF! 0x00000000CCDFC000 0000A5 (v32 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: HPET 0x00000000CCDFB000 000038 (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: ECDT 0x00000000CCDFA000 000052 (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: APIC 0x00000000CCDF7000 000098 (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: MCFG 0x00000000CCDF6000 00003C (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: SSDT 0x00000000CCDF5000 000033 (v01 LENOVO TP-SSDT1 00000100 INTL 20120711)
[     1.000004] ACPI: SSDT 0x00000000CCDF4000 000486 (v01 LENOVO TP-SSDT2 00000200 INTL 20120711)
[     1.000004] ACPI: SSDT 0x00000000CCDE2000 0009CB (v01 LENOVO SataAhci 00001000 INTL 20120711)
[     1.000004] ACPI: SSDT 0x00000000CCDE1000 000152 (v01 LENOVO Rmv_Batt 00001000 INTL 20120711)
[     1.000004] ACPI: SSDT 0x00000000CCDE0000 0006C9 (v01 LENOVO Cpu0Ist  00003000 INTL 20120711)
[     1.000004] ACPI: SSDT 0x00000000CCDDF000 000B74 (v02 LENOVO CpuSsdt  00003000 INTL 20120711)
[     1.000004] ACPI: SSDT 0x00000000CCDDE000 000369 (v02 LENOVO CtdpB    00001000 INTL 20120711)
[     1.000004] ACPI: SSDT 0x00000000CCDDC000 001475 (v01 LENOVO SaSsdt   00003000 INTL 20120711)
[     1.000004] ACPI: SSDT 0x00000000CCDDB000 000394 (v02 LENOVO CppcTabl 00001000 INTL 20120711)
[     1.000004] ACPI: PCCT 0x00000000CCDDA000 00006E (v05 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: SSDT 0x00000000CCDD9000 000AC4 (v02 LENOVO Cpc_Tabl 00001000 INTL 20120711)
[     1.000004] ACPI: UEFI 0x00000000CCDD8000 000042 (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: MSDM 0x00000000CCD42000 000055 (v03 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: BATB 0x00000000CCDD7000 00004A (v02 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: FPDT 0x00000000CCDD6000 000064 (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: UEFI 0x00000000CCDD5000 00031E (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: DMAR 0x00000000CCDD4000 0000B0 (v01 LENOVO TP-JB    00001370 PTEC 00000002)
[     1.000004] ACPI: 11 ACPI AML tables successfully acquired and loaded
[     1.000004] ioapic0 at mainbus0 apid 2: pa 0xfec00000, version 0x20, 40 pins
[     1.000004] x2APIC available but disabled by DMAR table
[     1.000004] cpu0 at mainbus0 apid 0
[     1.000004] cpu0: Use lfence to serialize rdtsc
[     1.000004] cpu0: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz, id 0x306d4
[     1.000004] cpu0: node 0, package 0, core 0, smt 0
[     1.000004] cpu1 at mainbus0 apid 1
[     1.000004] cpu1: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz, id 0x306d4
[     1.000004] cpu1: node 0, package 0, core 0, smt 1
[     1.000004] cpu2 at mainbus0 apid 2
[     1.000004] cpu2: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz, id 0x306d4
[     1.000004] cpu2: node 0, package 0, core 1, smt 0
[     1.000004] cpu3 at mainbus0 apid 3
[     1.000004] cpu3: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz, id 0x306d4
[     1.000004] cpu3: node 0, package 0, core 1, smt 1
[     1.000004] acpi0 at mainbus0: Intel ACPICA 20221020
[     1.000004] acpi0: X/RSDT: OemId <LENOVO,TP-JB   ,00001370>, AslId <PTEC,00000002>
[     1.000004] acpiecdt0 at acpi0: ACPI Embedded Controller via ECDT
[     1.000004] acpi0: MCFG: segment 0, bus 0-63, address 0x00000000f8000000
[     1.000004] ACPI Error: Needed type [Reference], found [Integer] 0xfffffcd89990f8c8 (20221020/exresop-111)
[     1.000004] ACPI Error: AE_AML_OPERAND_TYPE, While resolving operands for [OpcodeName unavailable] (20221020/dswexec-505)
[     1.000004] ACPI Error: Aborting method \_PR.CPU0._PDC due to previous error (AE_AML_OPERAND_TYPE) (20221020/psparse-580)
[     1.000004] ACPI: Dynamic OEM Table Load:
[     1.000004] ACPI: SSDT 0xFFFFFCD89993F008 0005AA (v01 PmRef  ApIst    00003000 INTL 20120711)
[     1.000004] ACPI: Dynamic OEM Table Load:
[     1.000004] ACPI: SSDT 0xFFFFFCD8998DC608 000119 (v02 PmRef  ApCst    00003000 INTL 20120711)
[     1.000004] acpi0: SCI interrupting at int 9
[     1.000004] acpi0: fixed power button present
[     1.000004] timecounter: Timecounter "ACPI-Safe" frequency 3579545 Hz quality 900
[     1.054663] hpet0 at acpi0: high precision event timer (mem 0xfed00000-0xfed00400)
[     1.054663] timecounter: Timecounter "hpet0" frequency 14318180 Hz quality 2000
[     1.055450] acpiec0 at acpi0 (EC, PNP0C09-0): using acpiecdt0
[     1.055450] MEM (PNP0C01) at acpi0 not configured
[     1.055450] acpilid0 at acpi0 (LID, PNP0C0D): ACPI Lid Switch
[     1.055450] acpibut0 at acpi0 (SLPB, PNP0C0E): ACPI Sleep Button
[     1.055450] acpivga0 at acpi0 (VID): ACPI Display Adapter
[     1.055450] acpiout0 at acpivga0 (LCD0, 0x0400): ACPI Display Output Device
[     1.055450] acpiout0: brightness levels: [0-100]
[     1.055450] acpiout1 at acpivga0 (CRT0, 0x0100): ACPI Display Output Device
[     1.055450] acpiout2 at acpivga0 (DVI0, 0x0300): ACPI Display Output Device
[     1.055450] acpiout3 at acpivga0 (DVI1, 0x0301): ACPI Display Output Device
[     1.055450] acpiout4 at acpivga0 (DVI2, 0x0302): ACPI Display Output Device
[     1.055450] acpiout5 at acpivga0 (DVI3, 0x0303): ACPI Display Output Device
[     1.055450] acpiout6 at acpivga0 (DVI4, 0x0304): ACPI Display Output Device
[     1.055450] acpiout7 at acpivga0 (DVI5, 0x0305): ACPI Display Output Device
[     1.055450] acpivga0: connected output devices:
[     1.055450] acpivga0:   0x0400 (acpiout0): Unknown Output Device, head 0
[     1.055450] attimer1 at acpi0 (TIMR, PNP0100): io 0x40-0x43 irq 0
[     1.055450] pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
[     1.055450] spkr0 at pcppi1: PC Speaker
[     1.055450] wsbell at spkr0 not configured
[     1.055450] midi0 at pcppi1: PC speaker
[     1.055450] sysbeep0 at pcppi1
[     1.055450] pckbc1 at acpi0 (KBD, LEN0071) (kbd port): io 0x60,0x64 irq 1
[     1.055450] pckbc2 at acpi0 (MOU, LEN200E) (aux port): irq 12
[     1.055450] acpibat0 at acpi0 (BAT0, PNP0C0A-0): ACPI Battery
[     1.055450] acpibat1 at acpi0 (BAT1, PNP0C0A-1): ACPI Battery
[     1.055450] acpiacad0 at acpi0 (AC, ACPI0003-0): ACPI AC Adapter
[     1.055450] thinkpad0 at acpi0 (HKEY, LEN0068)
[     1.055450] thinkpad0: version 0100
[     1.055450] acpiwmi0 at acpi0 (WMI1, PNP0C14-1): ACPI WMI Interface
[     1.055450] acpiwmibus at acpiwmi0 not configured
[     1.055450] acpiwmi1 at acpi0 (WMI2, PNP0C14-2): ACPI WMI Interface
[     1.055450] acpiwmibus at acpiwmi1 not configured
[     1.055450] acpiwmi2 at acpi0 (WMI3, PNP0C14-3): ACPI WMI Interface
[     1.055450] acpiwmibus at acpiwmi2 not configured
[     1.055450] PCCD (INT340F) at acpi0 not configured
[     1.055450] acpitz0 at acpi0 (THM0)
[     1.055450] acpitz0: levels: critical 128.0 C, passive cooling
[     1.055450] ACPI: Enabled 4 GPEs in block 00 to 7F
[     1.055450] attimer1: attached to pcppi1
[     1.055450] pckbd0 at pckbc1 (kbd slot)
[     1.055450] pckbc1: using irq 1 for kbd slot
[     1.055450] wskbd0 at pckbd0: console keyboard
[     1.055450] pms0 at pckbc1 (aux slot)
[     1.055450] pms0: Synaptics touchpad version 8.1
[     1.055450] pms0: Extended W mode, Passthrough, Up/down buttons, Palm detect, One button click pad, Multi-finger Report, Multi-finger, Reports max, Reports min
[     1.055450] pms0: Probed max coordinates right: 5676, top: 4758
[     1.055450] pms0: Probed min coordinates left: 1266, bottom: 1096
[     1.055450] pckbc1: using irq 12 for aux slot
[     1.055450] wsmouse0 at pms0 mux 0
[     1.055450] pci0 at mainbus0 bus 0: configuration mode 1
[     1.055450] pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
[     1.055450] pchb0 at pci0 dev 0 function 0: Intel Core 5G Host Bridge (rev. 0x09)
[     1.055450] i915drmkms0 at pci0 dev 2 function 0: Intel HD Graphics 5500 (rev. 0x09)
[     1.055450] hdaudio0 at pci0 dev 3 function 0: HD Audio Controller
[     1.055450] hdaudio0: interrupting at msi0 vec 0
[     1.055450] hdaudio0: HDA ver. 1.0, OSS 3, ISS 0, BSS 0, SDO 1, 64-bit
[     1.055450] hdafg0 at hdaudio0: Intel HDMI/DP
[     1.055450] hdafg0: DP00 8ch: Digital Out [Jack]
[     1.055450] hdafg0: 8ch/0ch 48000Hz PCM16*
[     1.055450] audio0 at hdafg0: playback
[     1.055450] audio0: slinear_le:16 2ch 48000Hz, blk 1920 bytes (10ms) for playback
[     1.055450] spkr1 at audio0: PC Speaker (synthesized)
[     1.055450] wsbell at spkr1 not configured
[     1.055450] xhci0 at pci0 dev 20 function 0: Intel Core 5G (mobile) USB xHCI (rev. 0x03)
[     1.055450] xhci0: 64-bit DMA
[     1.055450] xhci0: interrupting at msi1 vec 0
[     1.055450] xhci0: xHCI version 1.0
[     1.055450] usb0 at xhci0: USB revision 3.0
[     1.055450] usb1 at xhci0: USB revision 2.0
[     1.055450] Intel Core 5G (mobile) ME Interface (miscellaneous communications, revision 0x03) at pci0 dev 22 function 0 not configured
[     1.055450] wm0 at pci0 dev 25 function 0, 64-bit DMA: I218 LM Ethernet Connection (rev. 0x03)
[     1.055450] wm0: interrupting at msi2 vec 0
[     1.055450] wm0: PCI-Express bus
[     1.055450] wm0: 2048 words FLASH, version 0.2.3
[     1.055450] wm0: Ethernet address 68:f7:28:fe:8e:cd
[     1.055450] wm0: 0x6a4080<FLASH,PCIE,ASF_FIRM,AMT,WOL,EEE>
[     1.055450] ihphy0 at wm0 phy 2: i217 10/100/1000 media interface, rev. 5
[     1.055450] ihphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
[     1.055450] hdaudio1 at pci0 dev 27 function 0: HD Audio Controller
[     1.055450] hdaudio1: interrupting at msi3 vec 0
[     1.055450] hdaudio1: HDA ver. 1.0, OSS 4, ISS 4, BSS 0, SDO 1, 64-bit
[     1.055450] hdafg1 at hdaudio1: Realtek ALC292
[     1.055450] hdafg1: DAC00 2ch: Speaker [Built-In], HP Out [Jack]
[     1.055450] hdafg1: ADC01 2ch: Mic In [Jack]
[     1.055450] hdafg1: ADC02 2ch: Mic In [Built-In]
[     1.055450] hdafg1: 2ch/2ch 32000Hz 44100Hz 48000Hz 88200Hz 96000Hz 192000Hz PCM16 PCM20 PCM24 AC3
[     1.055450] audio1 at hdafg1: playback, capture, full duplex, independent
[     1.055450] audio1: slinear_le:16 2ch 48000Hz, blk 1920 bytes (10ms) for playback
[     1.055450] audio1: slinear_le:16 2ch 48000Hz, blk 1920 bytes (10ms) for recording
[     1.055450] spkr2 at audio1: PC Speaker (synthesized)
[     1.055450] wsbell at spkr2 not configured
[     1.055450] ppb0 at pci0 dev 28 function 0: Intel Core 5G (mobile) PCIe (rev. 0xe3)
[     1.055450] ppb0: PCI Express capability version 2 <Root Port of PCI-E Root Complex> x1 @ 5.0GT/s
[     1.055450] ppb0: link is x1 @ 2.5GT/s
[     1.055450] pci1 at ppb0 bus 2
[     1.055450] pci1: i/o space, memory space enabled, rd/line, wr/inv ok
[     1.055450] rtsx0 at pci1 dev 0 function 0: Realtek Semiconductor RTS5227 PCI-E Card Reader (rev. 0x01)
[     1.055450] rtsx0: interrupting at msi4 vec 0
[     1.055450] sdmmc0 at rtsx0
[     1.055450] ppb1 at pci0 dev 28 function 1: Intel Core 5G (mobile) PCIe (rev. 0xe3)
[     1.055450] ppb1: PCI Express capability version 2 <Root Port of PCI-E Root Complex> x1 @ 5.0GT/s
[     1.055450] ppb1: link is x1 @ 2.5GT/s
[     1.055450] pci2 at ppb1 bus 3
[     1.055450] pci2: i/o space, memory space enabled, rd/line, wr/inv ok
[     1.055450] iwm0 at pci2 dev 0 function 0: Intel Dual Band Wireless AC 7265 (rev. 0x59)
[     1.055450] iwm0: interrupting at msi5 vec 0
[     1.055450] ehci0 at pci0 dev 29 function 0: Intel Core 5G (mobile) USB EHCI (rev. 0x03)
[     1.055450] ehci0: 64-bit DMA
[     1.055450] ehci0: interrupting at ioapic0 pin 23
[     1.055450] ehci0: EHCI version 1.0
[     1.055450] ehci0: Using DMA subregion for control data structures
[     1.055450] usb2 at ehci0: USB revision 2.0
[     1.055450] pcib0 at pci0 dev 31 function 0: Intel Core 5G (mobile) LPC (rev. 0x03)
[     1.055450] ahcisata0 at pci0 dev 31 function 2: Intel Core 5G (mobile) SATA Controller (AHCI) (rev. 0x03)
[     1.055450] ahcisata0: 64-bit DMA
[     1.055450] ahcisata0: AHCI revision 1.30, 3 ports, 32 slots, CAP 0xc734ff02<PSC,SSC,PMD,SAM,ISS=0x3=Gen3,SCLO,SAL,SALP,SNCQ,S64A>
[     1.055450] ahcisata0: interrupting at msi6 vec 0
[     1.055450] atabus0 at ahcisata0 channel 0
[     1.055450] ichsmb0 at pci0 dev 31 function 3: Intel Core 5G (mobile) SMBus (rev. 0x03)
[     1.055450] ichsmb0: interrupting at ioapic0 pin 18
[     1.055450] iic0 at ichsmb0: I2C bus
[     1.055450] Intel Core 5G (mobile) Thermal (miscellaneous DASP, revision 0x03) at pci0 dev 31 function 6 not configured
[     1.055450] isa0 at pcib0
[     1.055450] tpm0 at isa0 iomem 0xfed40000-0xfed40fff irq 7
[     1.055450] tpm0: device 0x0000104a rev 0x4e
[     1.055450] acpicpu0 at cpu0: ACPI CPU
[     1.055450] ACPI: Dynamic OEM Table Load:
[     1.055450] ACPI: SSDT 0xFFFFFCD899FE2808 000436 (v01 PmRef  Cpu0Cst  00003001 INTL 20120711)
[     1.055450] acpicpu0: C1: FFH, lat   1 us, pow  1000 mW
[     1.055450] acpicpu0: C2: FFH, lat 148 us, pow   200 mW
[     1.055450] acpicpu0: C3: FFH, lat 233 us, pow   200 mW
[     1.055450] acpicpu0: P0: FFH, lat  10 us, pow 15000 mW, 2301 MHz, turbo boost
[     1.055450] acpicpu0: P1: FFH, lat  10 us, pow 15000 mW, 2300 MHz
[     1.055450] acpicpu0: P2: FFH, lat  10 us, pow 14088 mW, 2200 MHz
[     1.055450] acpicpu0: P3: FFH, lat  10 us, pow 12462 mW, 2000 MHz
[     1.055450] acpicpu0: P4: FFH, lat  10 us, pow 11745 mW, 1900 MHz
[     1.055450] acpicpu0: P5: FFH, lat  10 us, pow 11042 mW, 1800 MHz
[     1.055450] acpicpu0: P6: FFH, lat  10 us, pow 10215 mW, 1700 MHz
[     1.055450] acpicpu0: P7: FFH, lat  10 us, pow  8882 mW, 1500 MHz
[     1.055450] acpicpu0: P8: FFH, lat  10 us, pow  8101 mW, 1400 MHz
[     1.055450] acpicpu0: P9: FFH, lat  10 us, pow  7471 mW, 1300 MHz
[     1.055450] acpicpu0: P10: FFH, lat  10 us, pow  6121 mW, 1100 MHz
[     1.055450] acpicpu0: P11: FFH, lat  10 us, pow  5531 mW, 1000 MHz
[     1.055450] acpicpu0: P12: FFH, lat  10 us, pow  4955 mW,  900 MHz
[     1.055450] acpicpu0: P13: FFH, lat  10 us, pow  4267 mW,  800 MHz
[     1.055450] acpicpu0: P14: FFH, lat  10 us, pow  3182 mW,  600 MHz
[     1.055450] acpicpu0: P15: FFH, lat  10 us, pow  2538 mW,  500 MHz
[     1.055450] acpicpu0: T0: I/O, lat   1 us, pow     0 mW, 100 %
[     1.055450] acpicpu0: T1: I/O, lat   1 us, pow     0 mW,  88 %
[     1.055450] acpicpu0: T2: I/O, lat   1 us, pow     0 mW,  76 %
[     1.055450] acpicpu0: T3: I/O, lat   1 us, pow     0 mW,  64 %
[     1.055450] acpicpu0: T4: I/O, lat   1 us, pow     0 mW,  52 %
[     1.055450] acpicpu0: T5: I/O, lat   1 us, pow     0 mW,  40 %
[     1.055450] acpicpu0: T6: I/O, lat   1 us, pow     0 mW,  28 %
[     1.055450] acpicpu0: T7: I/O, lat   1 us, pow     0 mW,  16 %
[     1.055450] coretemp0 at cpu0: thermal sensor, 1 C resolution, Tjmax=105
[     1.055450] acpicpu1 at cpu1: ACPI CPU
[     1.055450] acpicpu2 at cpu2: ACPI CPU
[     1.055450] coretemp1 at cpu2: thermal sensor, 1 C resolution, Tjmax=105
[     1.055450] acpicpu3 at cpu3: ACPI CPU
[     1.055450] timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
[     1.055450] timecounter: Timecounter "TSC" frequency 2294688000 Hz quality 3000
[     1.534637] uhub0 at usb0: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 3.00/1.00, addr 0
[     1.570217] uhub0: 4 ports with 4 removable, self powered
[     1.570217] uhub1 at usb1: NetBSD (0x0000) xHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 0
[     1.610217] uhub1: 11 ports with 11 removable, self powered
[     1.610217] acpiacad0: AC adapter online.
[     1.610217] acpibat1: SANYO LION rechargeable battery
[     1.649223] acpibat1: granularity: low->warn 0.001 Wh, warn->full 0.001 Wh
[     1.649223] tpm0: tpm is deactivated
[     1.649223] tpm0: deactivating entropy source
[     1.650236] uhub2 at usb2: NetBSD (0x0000) EHCI root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[     1.650236] uhub2: 3 ports with 3 removable, self powered
[     1.650236] IPsec: Initialized Security Association Processing.
[     1.730219] ahcisata0 port 0: device present, speed: 6.0Gb/s
[     2.700218] uhub3 at uhub2 port 1: vendor 8087 (0x8087) product 8001 (0x8001), class 9/0, rev 2.00/0.03, addr 2
[     2.730216] uhub3: single transaction translator
[     2.760217] uhub3: 8 ports with 8 removable, self powered
[     3.260218] wd0 at atabus0 drive 0
[     3.290216] wd0: <Samsung SSD 870 EVO 1TB>
[     3.320216] wd0: drive supports 1-sector PIO transfers, LBA48 addressing
[     3.320216] wd0: 931 GB, 1938021 cyl, 16 head, 63 sec, 512 bytes/sect x 1953525168 sectors
[     3.350216] wd0: GPT GUID: 4ccf8740-31a2-481d-bb1e-1e55e801afd4
[     3.350216] dk0 at wd0: "b36e907e-d7c3-4359-a720-50f606917425", 262144 blocks at 2048, type: msdos
[     3.380216] dk1 at wd0: "7b586741-a1d1-402c-92b8-5c93aca17dc6", 1936695296 blocks at 264192, type: ffs
[     3.420217] dk2 at wd0: "45305b05-d211-41e9-8f91-4afc451bdf54", 16565647 blocks at 1936959488, type: swap
[     3.450216] wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133), WRITE DMA FUA, NCQ (32 tags)
[     3.450216] wd0(ahcisata0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) (using DMA), NCQ (31 tags)
[     3.450216] swwdog0: software watchdog initialized
[     3.450216] boot device: wd0
[     3.450216] root on dk1 dumps on dk2
[     3.450216] root file system type: ffs
[     3.450216] kern.module.path=/stand/amd64/10.0/modules
[     3.460216] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[     3.500216] [drm] Driver supports precise vblank timestamp query.
[     3.540313] i915drmkms0: interrupting at msi7 vec 0 (i915drmkms0)
[     3.600218] iwm0: hw rev 0x210, fw ver 22.361476.0, address 5c:e0:c5:a2:54:c7
[     3.660219] [drm] Initialized i915 1.6.0 20200114 for i915drmkms0 on minor 0
[     4.250215] intelfb0 at i915drmkms0
[     4.280216] [drm] DRM_I915_DEBUG enabled
[     4.310216] [drm] DRM_I915_DEBUG_GEM enabled
[     4.340216] intelfb0: framebuffer at 0xe0001000, size 1600x900, depth 32, stride 6400
[     5.860214] wsdisplay0 at intelfb0 kbdmux 1: console (default, vt100 emulation), using wskbd0
[     5.950214] wsmux1: connecting to wsdisplay0
[    31.650206] acpibat1: normal capacity on 'charge state'
[    41.730199] wsdisplay0: screen 1 added (default, vt100 emulation)
[    41.730199] wsdisplay0: screen 2 added (default, vt100 emulation)
[    41.730199] wsdisplay0: screen 3 added (default, vt100 emulation)
[    41.740199] wsdisplay0: screen 4 added (default, vt100 emulation)
[ 124461.025970] umass0 at uhub0 port 2 configuration 1 interface 0
[ 124461.025970] umass0: Samsung (0x090c) Flash Drive FIT (0x1000), rev 3.10/11.00, addr 1
[ 124461.025970] umass0: using SCSI over Bulk-Only
[ 124461.845968] scsibus0 at umass0: 2 targets, 1 lun per target
[ 124462.065970] sd0 at scsibus0 target 0 lun 0: <Samsung, Flash Drive FIT, 1100> disk removable
[ 124462.065970] sd0: fabricating a geometry
[ 124462.065970] sd0: 30594 MB, 30594 cyl, 64 head, 32 sec, 512 bytes/sect x 62656641 sectors
[ 124462.065970] sd0: fabricating a geometry
[ 124462.075967] sd0: GPT GUID: 0c59c3e3-2978-47cf-9342-4571db68a31d
[ 124462.075967] dk3 at sd0: "EFI system", 262144 blocks at 2048, type: msdos
[ 124462.075967] dk4 at sd0: "d3e8df96-e96d-4665-b424-112a469d69b5", 4853760 blocks at 264192, type: ffs
[ 126389.375129] dk4 at sd0 (d3e8df96-e96d-4665-b424-112a469d69b5) deleted
[ 126389.375129] dk3 at sd0 (EFI system) deleted
[ 126389.375129] sd0: detached
[ 126389.375129] scsibus0: detached
[ 126389.375129] umass0: detached
[ 126389.375129] umass0: at uhub0 port 2 (addr 1) disconnected
[ 126434.245110] ld0 at sdmmc0: <0x27:0x5048:SD32G:0x60:0x017a8b90:0x152>
[ 126434.245110] ld0: 29580 MB, 7512 cyl, 128 head, 63 sec, 512 bytes/sect x 60579840 sectors
[ 126434.255108] ld0: 4-bit width, 25.000 MHz
[ 126435.475109] ld0: detached
[ 126435.475109] sdmmc0: sdmmc_select_card: error 19ld0 at sdmmc0: <0x27:0x5048:SD32G:0x60:0x017a8b90:0x152>
[ 126443.105106] ld0: 29580 MB, 7512 cyl, 128 head, 63 sec, 512 bytes/sect x 60579840 sectors
[ 126443.115104] ld0: 4-bit width, 25.000 MHz
[ 257139.518137] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 259233.387224] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 259564.367080] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 261371.146292] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 268306.603270] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 272046.091639] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 288360.164529] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 289184.484169] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 305149.317210] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 388532.790866] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 397907.936780] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35
[ 427641.283820] {drm:netbsd:intel_pipe_update_start+0x2ff} *ERROR* Potential atomic update failure on pipe A: -35

>How-To-Repeat:
It's not known exactly how the system got into the state in the first place, but what looks like the same state can be entered by removing the SD card from the slot and then putting it back. Any command that needs information from the drive, like ls /mnt, disklabel ld0 or umount /mnt, will then hang, often in an unkillable state. It's true, however, that before the first umount hang occurred, I did remove the SD card from the slot and re-insert it back into the slot. I do not remember what state the system considered the SD card to be in, but it is possible that I removed the card in an improper state like the reproducability procedure above.

Also, although there are console messages printed when the SD card is removed when it is not mounted, there are no console messages printed when the SD card is removed when it IS mounted. This suggests that the removal of the SD card is not being detected.
>Fix:
None, but Riastradh says he sees what the problem is.

>Release-Note:

>Audit-Trail:
From: Rob Whitlock <rwhitlock22@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57870: umount hang (ld/sdmmc/rtsx)
Date: Sun, 21 Jan 2024 20:23:23 -0500

 I should clarify that the problem shows up when the SD card is removed =
 and then reinserted WHILE the disk is mounted. If the SD card is not =
 mounted, no issue arises. So the following sequence

 mount /dev/ld0a /mnt
 #remove SD card
 #reinsert SD card
 umount /mnt # or disklabel sd0 or ls /mnt

 hangs, while

 #remove SD card
 #reinsert SD card

 does not.=

Responsible-Changed-From-To: kern-bug-people->riastradh
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Mon, 22 Jan 2024 01:28:46 +0000
Responsible-Changed-Why:
I'll take care of it


State-Changed-From-To: open->analyzed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Mon, 22 Jan 2024 01:28:46 +0000
State-Changed-Why:
deadlock in sdmmc task queue
happens because DIOCCACHESYNC starts task and waits for it,
and detach triggers DIOCCACHESYNC,
and discovery triggering detach runs through task queue,
so finishing discovery task requires waiting for cache sync task,
but cache sync task can't start until prior tasks finish.
Fix: separate threads for discovery and tasks.
(plus a host of other issues in attach/detach sequence)


From: Taylor R Campbell <riastradh@NetBSD.org>
To: Rob Whitlock <rwhitlock22@gmail.com>
Cc: gnats-bugs@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/57870: umount hang (ld/sdmmc/rtsx)
Date: Mon, 22 Jan 2024 22:31:54 +0000

 This is a multi-part message in MIME format.
 --=_zuuYtksK0C8RJaF9J8AwVVP/KZSlw/L+

 Can you please try to reproduce the deadlock with the attached patch?

 --=_zuuYtksK0C8RJaF9J8AwVVP/KZSlw/L+
 Content-Type: text/plain; charset="ISO-8859-1"; name="pr57870-ldsdmmcdetachflushdeadlock"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="pr57870-ldsdmmcdetachflushdeadlock.patch"

 From 9d5fcd6249b8b67687e8e5e731a507592966a40e Mon Sep 17 00:00:00 2001
 From: Taylor R Campbell <riastradh@NetBSD.org>
 Date: Mon, 22 Jan 2024 22:24:20 +0000
 Subject: [PATCH] ld@sdmmc(4): Hack around deadlock in cache sync on detach.

 Yanking a card triggers the sdmmc discovery task, which runs in the
 sdmmc task thread, to detach any attached child devices.

 Detaching ld@sdmmc triggers a cache flush (via ldbegindetach ->
 disk_begindetach -> ld_lastclose -> ld_flush -> ioctl DIOCCACHESYNC),
 which is implemented by scheduling a task to do sdmmc_mem_flush_cache
 and then waiting for it to complete.

 The sdmmc_mem_cache_flush is done by an sdmmc task so it happens
 after all previously scheduled I/O operations -- that way the cache
 flush doesn't complete until the previously scheduled I/O operations
 are complete.

 However, when the cache flush task is issued from the discovery task,
 this doesn't work, because the cache flush task can't start until the
 discovery task has returned -- but the discovery task won't return
 until the cache flush task has completed.

 To work around this deadlock, which usually happens only when the
 device has been yanked anyway so further I/O would be lost anyway,
 just do the cache flush synchronously in DIOCCACHESYNC if we're
 running in the task thread.

 This isn't quite right -- implementation details of the task thread
 shouldn't bleed into ld@sdmmc, and running the cache sync _before_
 any subsequently scheduled I/O tasks is asking for trouble -- but it
 should serve to avoid the deadlock in PR kern/57870 until we can fix
 a host of concurrency bugs in sdmmc by fixing the locking scheme and
 running discovery in a separate thread from tasks.

 XXX pullup-10
 ---
  sys/dev/sdmmc/ld_sdmmc.c | 15 +++++++++++++++
  1 file changed, 15 insertions(+)

 diff --git a/sys/dev/sdmmc/ld_sdmmc.c b/sys/dev/sdmmc/ld_sdmmc.c
 index 0c310c3fe21b..9a527ad98db5 100644
 --- a/sys/dev/sdmmc/ld_sdmmc.c
 +++ b/sys/dev/sdmmc/ld_sdmmc.c
 @@ -599,9 +599,24 @@ static int
  ld_sdmmc_cachesync(struct ld_softc *ld, bool poll)
  {
  	struct ld_sdmmc_softc *sc =3D device_private(ld->sc_dv);
 +	struct sdmmc_softc *sdmmc =3D device_private(device_parent(ld->sc_dv));
  	struct ld_sdmmc_task *task;
  	int error =3D -1;
 =20
 +	/*
 +	 * If we come here through the sdmmc discovery task, we can't
 +	 * wait for a new task because the new task can't even begin
 +	 * until the sdmmc discovery task has completed.
 +	 *
 +	 * XXX This is wrong, because there may already be queued I/O
 +	 * tasks ahead of us.  Fixing this properly requires doing
 +	 * discovery in a separate thread.  But this should avoid the
 +	 * deadlock of PR kern/57870 (https://gnats.NetBSD.org/57870)
 +	 * until we do split that up.
 +	 */
 +	if (curlwp =3D=3D sdmmc->sc_tskq_lwp)
 +		return sdmmc_mem_flush_cache(sc->sc_sf, poll);
 +
  	mutex_enter(&sc->sc_lock);
 =20
  	/* Acquire a free task, or fail with EBUSY.  */

 --=_zuuYtksK0C8RJaF9J8AwVVP/KZSlw/L+--

State-Changed-From-To: analyzed->feedback
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Tue, 23 Jan 2024 01:35:13 +0000
State-Changed-Why:
feedback requested on stop-gap measure for easy pullup


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57870 CVS commit: src/sys/dev/sdmmc
Date: Tue, 23 Jan 2024 23:13:05 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Jan 23 23:13:05 UTC 2024

 Modified Files:
 	src/sys/dev/sdmmc: ld_sdmmc.c

 Log Message:
 ld@sdmmc(4): Hack around deadlock in cache sync on detach.

 Yanking a card triggers the sdmmc discovery task, which runs in the
 sdmmc task thread, to detach any attached child devices.

 Detaching ld@sdmmc triggers a cache flush (via ldbegindetach ->
 disk_begindetach -> ld_lastclose -> ld_flush -> ioctl DIOCCACHESYNC),
 which is implemented by scheduling a task to do sdmmc_mem_flush_cache
 and then waiting for it to complete.

 The sdmmc_mem_cache_flush is done by an sdmmc task so it happens
 after all previously scheduled I/O operations -- that way the cache
 flush doesn't complete until the previously scheduled I/O operations
 are complete.

 However, when the cache flush task is issued from the discovery task,
 this doesn't work, because the cache flush task can't start until the
 discovery task has returned -- but the discovery task won't return
 until the cache flush task has completed.

 To work around this deadlock, which usually happens only when the
 device has been yanked anyway so further I/O would be lost anyway,
 just do the cache flush synchronously in DIOCCACHESYNC if we're
 running in the task thread.

 This isn't quite right -- implementation details of the task thread
 shouldn't bleed into ld@sdmmc, and running the cache sync _before_
 any subsequently scheduled I/O tasks is asking for trouble -- but it
 should serve to avoid the deadlock in PR kern/57870 until we can fix
 a host of concurrency bugs in sdmmc by fixing the locking scheme and
 running discovery in a separate thread from tasks.

 XXX pullup-10


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/sys/dev/sdmmc/ld_sdmmc.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Rob Whitlock <rwhitlock22@gmail.com>
To: gnats-bugs@netbsd.org,
 Taylor R Campbell <riastradh@NetBSD.org>
Cc: gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: kern/57870: umount hang (ld/sdmmc/rtsx)
Date: Tue, 23 Jan 2024 19:46:15 -0500

 > On Jan 22, 2024, at 5:35 PM, Taylor R Campbell <riastradh@NetBSD.org> =
 wrote:
 >=20
 > The following reply was made to PR kern/57870; it has been noted by =
 GNATS.
 >=20
 > From: Taylor R Campbell <riastradh@NetBSD.org>
 > To: Rob Whitlock <rwhitlock22@gmail.com>
 > Cc: gnats-bugs@NetBSD.org, netbsd-bugs@NetBSD.org
 > Subject: Re: kern/57870: umount hang (ld/sdmmc/rtsx)
 > Date: Mon, 22 Jan 2024 22:31:54 +0000
 >=20
 > This is a multi-part message in MIME format.
 > --=3D_zuuYtksK0C8RJaF9J8AwVVP/KZSlw/L+
 >=20
 > Can you please try to reproduce the deadlock with the attached patch?

 The patch appears to work. The process no longer hangs when the SD card =
 is removed while it is mounted. The patched kernel did hang on startup =
 the first time I booted it up but I didn't manage to reproduce that on =
 the next few boots. The last thing it printed was "Starting xdm." The =
 fan was going so it may have been dumping core, but I didn't consider =
 that and forcibly rebooted after a minute or two had passed, but perhaps =
 that was not enough time. I would guess that this boot hang is unrelated =
 to the SD card issue.

 Thanks!=

State-Changed-From-To: feedback->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Thu, 25 Jan 2024 05:08:33 +0000
State-Changed-Why:
feedback received, fix committed to HEAD, needs pullup-10 and pullup-9


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57870 CVS commit: [netbsd-10] src/sys/dev/sdmmc
Date: Sat, 3 Feb 2024 12:39:17 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Feb  3 12:39:17 UTC 2024

 Modified Files:
 	src/sys/dev/sdmmc [netbsd-10]: ld_sdmmc.c

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #566):

 	sys/dev/sdmmc/ld_sdmmc.c: revision 1.43

 ld@sdmmc(4): Hack around deadlock in cache sync on detach.

 Yanking a card triggers the sdmmc discovery task, which runs in the
 sdmmc task thread, to detach any attached child devices.

 Detaching ld@sdmmc triggers a cache flush (via ldbegindetach ->
 disk_begindetach -> ld_lastclose -> ld_flush -> ioctl DIOCCACHESYNC),
 which is implemented by scheduling a task to do sdmmc_mem_flush_cache
 and then waiting for it to complete.

 The sdmmc_mem_cache_flush is done by an sdmmc task so it happens
 after all previously scheduled I/O operations -- that way the cache
 flush doesn't complete until the previously scheduled I/O operations
 are complete.

 However, when the cache flush task is issued from the discovery task,
 this doesn't work, because the cache flush task can't start until the
 discovery task has returned -- but the discovery task won't return
 until the cache flush task has completed.

 To work around this deadlock, which usually happens only when the
 device has been yanked anyway so further I/O would be lost anyway,
 just do the cache flush synchronously in DIOCCACHESYNC if we're
 running in the task thread.

 This isn't quite right -- implementation details of the task thread
 shouldn't bleed into ld@sdmmc, and running the cache sync _before_
 any subsequently scheduled I/O tasks is asking for trouble -- but it
 should serve to avoid the deadlock in PR kern/57870 until we can fix
 a host of concurrency bugs in sdmmc by fixing the locking scheme and
 running discovery in a separate thread from tasks.


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.42.4.1 src/sys/dev/sdmmc/ld_sdmmc.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57870 CVS commit: [netbsd-9] src/sys/dev/sdmmc
Date: Sat, 3 Feb 2024 12:41:30 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Feb  3 12:41:30 UTC 2024

 Modified Files:
 	src/sys/dev/sdmmc [netbsd-9]: ld_sdmmc.c

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #1793):

 	sys/dev/sdmmc/ld_sdmmc.c: revision 1.43

 ld@sdmmc(4): Hack around deadlock in cache sync on detach.

 Yanking a card triggers the sdmmc discovery task, which runs in the
 sdmmc task thread, to detach any attached child devices.

 Detaching ld@sdmmc triggers a cache flush (via ldbegindetach ->
 disk_begindetach -> ld_lastclose -> ld_flush -> ioctl DIOCCACHESYNC),
 which is implemented by scheduling a task to do sdmmc_mem_flush_cache
 and then waiting for it to complete.

 The sdmmc_mem_cache_flush is done by an sdmmc task so it happens
 after all previously scheduled I/O operations -- that way the cache
 flush doesn't complete until the previously scheduled I/O operations
 are complete.

 However, when the cache flush task is issued from the discovery task,
 this doesn't work, because the cache flush task can't start until the
 discovery task has returned -- but the discovery task won't return
 until the cache flush task has completed.

 To work around this deadlock, which usually happens only when the
 device has been yanked anyway so further I/O would be lost anyway,
 just do the cache flush synchronously in DIOCCACHESYNC if we're
 running in the task thread.

 This isn't quite right -- implementation details of the task thread
 shouldn't bleed into ld@sdmmc, and running the cache sync _before_
 any subsequently scheduled I/O tasks is asking for trouble -- but it
 should serve to avoid the deadlock in PR kern/57870 until we can fix
 a host of concurrency bugs in sdmmc by fixing the locking scheme and
 running discovery in a separate thread from tasks.


 To generate a diff of this commit:
 cvs rdiff -u -r1.36.4.1 -r1.36.4.2 src/sys/dev/sdmmc/ld_sdmmc.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: needs-pullups->analyzed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sat, 03 Feb 2024 15:18:45 +0000
State-Changed-Why:
stop-gap measure committed and pulled up
leaving this open to address the underlying problem: discover/task
threads need to be decoupled


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.