NetBSD-Bugs archive

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

Re: kern/52372: various SATA controllers throwing 'setting WDCTL_RST failed'



Thanks.

Can you try if attached patch makes any difference? It merely changes the timeout for the command to 1s. It's not likely the problem since the attached devices are supposed to be fast (SSD and very recent WD disks).

Other thing to check, is the controller set to 'AHCI' mode in BIOS and not RAID or 'compatible' or some such?

Jaromir



2017-12-09 15:45 GMT+01:00 Petar Bogdanovic <petar%smokva.net@localhost>:
>
> The following reply was made to PR kern/52372; it has been noted by GNATS.
>
> From: Petar Bogdanovic <petar%smokva.net@localhost>
> To: gnats-bugs%NetBSD.org@localhost
> Cc: jdolecek%NetBSD.org@localhost
> Subject: Re: kern/52372: various SATA controllers throwing 'setting WDCTL_RST
>  failed'
> Date: Sat, 9 Dec 2017 15:40:10 +0100
>
>  Same here with one HighPoint Rocket 640L adapter and four disks:
>
>      1 x Samsung SSD
>      3 x WD Blue 6TB
>
>  Fails with netbsd-8 and netbsd-current (8.12.2017),
>  works with netbsd-6-0.
>
>  Full dmesg here:
>
>      https://smokva.net/wdctl_rst/dmesg-nb8.txt
>      https://smokva.net/wdctl_rst/dmesg-nbC.txt
>
>  relevant part:
>
>      ahcisata0 port 0: device present, speed: 6.0Gb/s
>      ahcisata0 port 3: device present, speed: 6.0Gb/s
>      ahcisata0 port 1: device present, speed: 6.0Gb/s
>      ahcisata0 port 2: device present, speed: 6.0Gb/s
>      ahcisata0 port 7: device present, speed: 1.5Gb/s
>      ahcisata0 channel 0: setting WDCTL_RST failed for drive 0
>      ahcisata0 channel 3: setting WDCTL_RST failed for drive 0
>      ahcisata0 channel 7: setting WDCTL_RST failed for drive 0
>      ahcisata0 channel 1: setting WDCTL_RST failed for drive 0
>
>  Let me know if I can help; will try netbsd-7 later today.
>
>  Petar
>
>
>  P.S. I don't know what device is on port 7, maybe some proprietary
>  softraid implementation.  Appears on nb6, nb8 and current.
>
Index: ahcisata_core.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/ahcisata_core.c,v
retrieving revision 1.60
diff -u -p -r1.60 ahcisata_core.c
--- ahcisata_core.c	11 Nov 2017 16:49:13 -0000	1.60
+++ ahcisata_core.c	9 Dec 2017 16:20:06 -0000
@@ -710,21 +710,11 @@ ahci_exec_fis(struct ata_channel *chp, i
 	int i;
 	uint32_t is;
 
-	/*
-	 * Base timeout is specified in ms.
-	 * If we are allowed to sleep, wait a tick each round.
-	 * Otherwise delay for 10ms on each round.
-	 */
-	if (flags & AT_WAIT)
-		timeout = MAX(1, mstohz(timeout));
-	else
-		timeout = timeout / 10;
-
 	AHCI_CMDH_SYNC(sc, achp, slot,
 	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 	/* start command */
 	AHCI_WRITE(sc, AHCI_P_CI(chp->ch_channel), 1 << slot);
-	for (i = 0; i < timeout; i++) {
+	for (i = 0; i < (timeout / 10); i++) {
 		if ((AHCI_READ(sc, AHCI_P_CI(chp->ch_channel)) & (1 << slot)) ==
 		    0)
 			return 0;
@@ -799,7 +789,7 @@ again:
 	cmd_tbl->cmdt_cfis[fis_type] = RHD_FISTYPE;
 	cmd_tbl->cmdt_cfis[rhd_c] = drive;
 	cmd_tbl->cmdt_cfis[rhd_control] = WDCTL_RST;
-	switch(ahci_exec_fis(chp, 100, flags, xfer->c_slot)) {
+	switch(ahci_exec_fis(chp, 1000, flags, xfer->c_slot)) {
 	case ERR_DF:
 	case TIMEOUT:
 		aprint_error("%s channel %d: setting WDCTL_RST failed "


Home | Main Index | Thread Index | Old Index