Bug 267190 - 12.4-PRERELEASE fails to attach to one external USB drive: CAM status 0x44 (internal target failure)
Summary: 12.4-PRERELEASE fails to attach to one external USB drive: CAM status 0x44 (i...
Status: Closed Unable to Reproduce
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 12.3-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
URL: https://github.com/freebsd/freebsd-sr...
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2022-10-19 02:48 UTC by ota
Modified: 2022-10-30 18:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ota 2022-10-19 02:48:01 UTC
12.4-PRERELEASE fails to connect *an* external USB drive.
12.3-RELEASE i386/amd64 and 13.1-RELEASE i386/amd64 detect and mount okay.

12.4-PRELEASE detects 3 other external drives okay, though.

FreeBSD *** 12.4-PRERELEASE FreeBSD 12.4-PRERELEASE #77 r372625M: Mon Oct 17 21:37:50 EDT 2022     ***:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

ugen0.5: <BUFFALO INC. BUFFALO INC. USB-SATA Bridge> at usbus0
umass2 on uhub3
umass2: <Bulk Only Interface> on usbus0
umass2:  SCSI over Bulk-Only; quirks = 0x0100
umass2:6:2: Attached to scbus6
(da2:umass-sim2:2:0:0): got CAM status 0x44
(da2:umass-sim2:2:0:0): fatal error, failed to attach to device
g_access(961): provider da2 has error 6 set
g_access(961): provider da2 has error 6 set
g_access(961): provider da2 has error 6 set
g_access(961): provider da2 has error 6 set
g_access(961): provider da2 has error 6 set
g_access(961): provider da2 has error 6 set

I think this only happens with amd64 while i386 detects the devise (I need to double check about u386.)
I will post after getting dmesg from 12.3-RELEASE later.
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-10-19 05:40:44 UTC
From comments at 4899b94bacfc5a0fdd8bfa05aacf2f3c8370d6e1 <https://codeberg.org/FreeBSD/freebsd-src/src/commit/4899b94bacfc5a0fdd8bfa05aacf2f3c8370d6e1/sys/cam/scsi/scsi_da.c#L4708-L4718> (2018-05-01): 

> … "Internal Target Failure" (0x44) is also special and typically means that 
> the device is a SATA drive behind a SATL translation that's fallen into a 
> terminally fatal state.
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-10-19 05:57:28 UTC
If required, there's a hint at bug 247727 comment 1 about use of usbdump(8).
Comment 3 ota 2022-10-20 03:56:48 UTC
I tested on 12.4-PRERELEASE i386 again and this detects the same device, okay.

I will check the link for USB commands.
Comment 4 ota 2022-10-23 03:39:55 UTC
I got below output.
I captured some of these as below:

# usbdump -i usbus0 -f 2 -s 65536 -vvv
23:38:13.191671 usbus0.2 DONE-CTRL-EP=00000080,SPD=HIGH,NFR=2,SLEN=4,IVAL=0,ERR=
0
 frame[0] WRITE 8 bytes
 frame[1] READ 4 bytes
 0000  00 01 00 00 -- -- -- --  -- -- -- -- -- -- -- --  |....            |
 flags 0x10 <PROXY_BUFFER|0>
 status 0xea1a1 <OPEN|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|BDMA_SETUP|CUR
R_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
23:38:13.191679 usbus0.2 SUBM-CTRL-EP=00000080,SPD=HIGH,NFR=2,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
 0000  A3 00 00 00 04 00 04 00  -- -- -- -- -- -- -- --  |........        |
 frame[1] READ 4 bytes
 flags 0x10 <PROXY_BUFFER|0>
 status 0xea1a3 <OPEN|TRANSFERRING|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|B
DMA_SETUP|CURR_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>

23:38:13.191797 usbus0.2 DONE-CTRL-EP=00000080,SPD=HIGH,NFR=2,SLEN=4,IVAL=0,ERR=
0
 frame[0] WRITE 8 bytes
 frame[1] READ 4 bytes
 0000  00 01 00 00 -- -- -- --  -- -- -- -- -- -- -- --  |....            |
 flags 0x10 <PROXY_BUFFER|0>
 status 0xca1a1 <OPEN|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|BDMA_SETUP|CAN
_CANCEL_IMMED|DOING_CALLBACK|0>
23:38:13.191803 usbus0.2 SUBM-CTRL-EP=00000080,SPD=HIGH,NFR=2,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
 0000  A3 00 00 00 05 00 04 00  -- -- -- -- -- -- -- --  |........        |
 frame[1] READ 4 bytes
 flags 0x10 <PROXY_BUFFER|0>
 status 0xca1a3 <OPEN|TRANSFERRING|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|B
DMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
23:38:13.191921 usbus0.2 DONE-CTRL-EP=00000080,SPD=HIGH,NFR=2,SLEN=4,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 frame[1] READ 4 bytes
 0000  03 05 00 00 -- -- -- --  -- -- -- -- -- -- -- --  |....            |
 flags 0x10 <PROXY_BUFFER|0>
 status 0xea1a1 <OPEN|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|BDMA_SETUP|CURR_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
23:38:13.191928 usbus0.2 SUBM-CTRL-EP=00000080,SPD=HIGH,NFR=2,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
 0000  A3 00 00 00 06 00 04 00  -- -- -- -- -- -- -- --  |........        |
 frame[1] READ 4 bytes
 flags 0x10 <PROXY_BUFFER|0>
 status 0xea1a3 <OPEN|TRANSFERRING|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|BDMA_SETUP|CURR_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
23:38:13.192044 usbus0.2 DONE-CTRL-EP=00000080,SPD=HIGH,NFR=2,SLEN=4,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 frame[1] READ 4 bytes
 0000  00 01 00 00 -- -- -- --  -- -- -- -- -- -- -- --  |....            |
 flags 0x10 <PROXY_BUFFER|0>
 status 0xca1a1 <OPEN|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
Comment 5 ota 2022-10-30 18:19:35 UTC
I started binary-search to find a problem commit with a different build space.
However, kernel detects the USB device okay for all revisions I tested.

I decided to clean re-build kernel and clean build version detects the USB device fine as well.

It looks some broken object file caused the issue.