NetBSD-Bugs archive

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

Re: kern/54289: wd1 fails to be identified properly



The following reply was made to PR kern/54289; it has been noted by GNATS.

From: "John D. Baker" <jdbaker%consolidated.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/54289: wd1 fails to be identified properly
Date: Sun, 23 Jun 2019 19:49:02 -0500 (CDT)

 Manuel's patch appears to be against netbsd-8.  The first hunk fails to
 apply in -current as the message text is changed.  The second hunk applies
 with a large offset.
 
 See below the corresponding patch for -current:
 
 +Index: sys/dev/ic/ahcisata_core.c
 +===================================================================
 +RCS file: /cvsroot/src/sys/dev/ic/ahcisata_core.c,v
 +retrieving revision 1.75
 +diff -u -p -r1.75 ahcisata_core.c
 +--- sys/dev/ic/ahcisata_core.c	7 Apr 2019 17:46:49 -0000	1.75
 ++++ sys/dev/ic/ahcisata_core.c	24 Jun 2019 00:41:26 -0000
 +@@ -786,8 +786,8 @@ ahci_exec_fis(struct ata_channel *chp, i
 + 				 */
 + 				return ERROR;
 + 			}
 +-			aprint_debug("%s port %d: error 0x%x sending FIS\n",
 +-			    AHCINAME(sc), chp->ch_channel, is);
 ++			aprint_debug("%s port %d: error 0x%x sending FIS, t %d\n",
 ++			    AHCINAME(sc), chp->ch_channel, is, timeout);
 + 			return ERR_DF;
 + 		}
 + 		ata_delay(chp, 10, "ahcifis", flags);
 +@@ -1582,9 +1582,27 @@ ahci_channel_stop(struct ahci_softc *sc,
 + 		/* XXX controller reset ? */
 + 		return;
 + 	}
 +-
 + 	if (sc->sc_channel_stop)
 + 		sc->sc_channel_stop(sc, chp);
 ++	if ((AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & AHCI_P_CMD_FRE) == 0)
 ++		return;
 ++
 ++	AHCI_WRITE(sc, AHCI_P_CMD(chp->ch_channel),
 ++	    AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & ~AHCI_P_CMD_FRE);
 ++	/* wait 1s for FIS receive to stop */
 ++	for (i = 0; i <100; i++) {
 ++		if ((AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & AHCI_P_CMD_FR)
 ++		    == 0)
 ++			break;
 ++		if (flags & AT_WAIT)
 ++			tsleep(&sc, PRIBIO, "ahcistop", mstohz(10));
 ++		else
 ++			delay(10000);
 ++	}
 ++	if (AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & AHCI_P_CMD_FR) {
 ++		printf("%s: channel FIS receive wouldn't stop\n", AHCINAME(sc));
 ++		/* XXX controller reset ? */
 ++	}
 + }
 + 
 + static void
 
 I have not compiled this yet, let alone run it.  Hope to do so soon.
 
 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]consolidated[flyspeck]net  OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645
 


Home | Main Index | Thread Index | Old Index