NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/57407: Fix for kernel freeze with "BSY never cleared, status 0x80" with 1TB Seagate SATA HDD



>Number:         57407
>Category:       kern
>Synopsis:       Fix for kernel freeze with "BSY never cleared, status 0x80" with 1TB Seagate SATA HDD
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 13 16:40:00 +0000 2023
>Originator:     Henryk Paluch
>Release:        9.3-RELEASE
>Organization:
N/A
>Environment:
>From custom kernel (stock kernel freezes on boot):

NetBSD localhost 9.3 NetBSD 9.3 (GENERIC_HP) #0: Sat May 13 08:32:51 UTC 2023  root%netbsd93.example.com@localhost:/usr/src/sys/arch/amd64/compile/GENERIC_HP amd64

>Description:
When I boot standard NetBSD 9.3 CD - tested NetBSD-9.3-amd64.iso -
with new 1TB Seagate drive: ST1000DM010-2EP102 the kernel freeze on SATA link reset with message "BSY never cleared, status 0x80".

Here are relevant messages regarding my SATA controller and that HDD:

viaide2 at pci0 dev 5 function 1: NVIDIA MCP55 Serial ATA Controller (rev. 0xa2)
viaide2: bus-master DMA support present
viaide2: primary channel wired to native-PCI mode
viaide2: using ioapic0 pin 21 for native-PCI interrupt
atabus3 at viaide2 channel 0
viaide2: secondary channel wired to native-PCI mode
atabus4 at viaide2 channel 1
viaide2 port 1: device present, speed: 3.0Gb/s
viaide2: BSY never cleared, status 0x80

I have found that other HDD (old WD 500GB SATA disk) works without problem with same NetBSD. Also OpenBSD and Linux boots on same machine without issue (installed in GPT+BIOS with few small hacks).

There one report which can be related - on Internet, for example:
- https://www.unitedbsd.com/d/605-netbsd-92-amd64-does-not-recognize-hard-disk/5
However it is not yet confirmed.

More HW details:
- MB MSI K9N Platinum
- nVidia nForce 570 chipset
- CPU AMD X2 (Dual-Core Athlon)
- 8GB of RAM
- here are details on HDD with fixed kernel:

wd0 at atabus4 drive 0
wd0: <ST1000DM010-2EP102>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 931 GB, 1938021 cyl, 16 head, 63 sec, 512 bytes/sect x 1953525168 sectors (0 bytes/physsect; first aligned sector: 8)
wd0: GPT GUID: 044fdb79-3b9c-4fff-86a9-66becdf9aebd
...

>How-To-Repeat:
Boot NetBSD 9.3 with old SATA controller (tested NVIDIA MCP55 Serial ATA) and new Seagate 1TB SATA disk (tested ST1000DM010-2EP102). 

The kernel will freeze for around 5minutes with:

BSY never cleared, status 0x80

After around 5 minutes it will continue boot, however such disk is completely ignored, so NetBSD can't be installed on it.
>Fix:
I found that this trivial patch, that forces SATA1 1.5Gb/s mode fixes the problem and I was able to installed NetBSD on that system:

--- /root/sata_subr.c	2023-05-13 07:38:30.264874166 +0000
+++ /usr/src/sys/dev/ata/sata_subr.c	2023-05-13 07:40:24.075628047 +0000
@@ -93,8 +93,10 @@
 	 * the device. It doesn't hurt for other devices.
 	 */
 	bus_space_write_4(sata_t, scontrol_r, 0, 0);
-	scontrol = SControl_IPM_NONE | SControl_SPD_ANY | SControl_DET_INIT;
+	scontrol = SControl_IPM_NONE | SControl_SPD_G1 | SControl_DET_INIT;
 	bus_space_write_4(sata_t, scontrol_r, 0, scontrol);
+	aprint_normal("%s port %d: enforcing SATA1 speed at 1.5Gb/s\n",
+		    device_xname(chp->ch_atac->atac_dev), chp->ch_channel);
 
 	ata_delay(chp, 50, "sataup", flags);
 	scontrol &= ~SControl_DET_INIT;



Home | Main Index | Thread Index | Old Index