Module Name:    src
Committed By:   christos
Date:           Mon Oct 21 19:00:11 UTC 2019

Modified Files:
        src/sys/dev/pci: satalink.c

Log Message:
follow the channel locking protocol during probe (like the other drivers)


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pci/satalink.c

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

Modified files:

Index: src/sys/dev/pci/satalink.c
diff -u src/sys/dev/pci/satalink.c:1.56 src/sys/dev/pci/satalink.c:1.57
--- src/sys/dev/pci/satalink.c:1.56	Sun Dec  9 06:14:02 2018
+++ src/sys/dev/pci/satalink.c	Mon Oct 21 15:00:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: satalink.c,v 1.56 2018/12/09 11:14:02 jdolecek Exp $	*/
+/*	$NetBSD: satalink.c,v 1.57 2019/10/21 19:00:11 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: satalink.c,v 1.56 2018/12/09 11:14:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: satalink.c,v 1.57 2019/10/21 19:00:11 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -787,6 +787,7 @@ sii3112_drv_probe(struct ata_channel *ch
 	uint8_t /* scnt, sn, */ cl, ch;
 	int s;
 
+	ata_channel_lock(chp);
 	/*
 	 * The 3112 is a 2-port part, and only has one drive per channel
 	 * (each port emulates a master drive).
@@ -861,8 +862,10 @@ sii3112_drv_probe(struct ata_channel *ch
 		    device_xname(sc->sc_wdcdev.sc_atac.atac_dev), chp->ch_channel,
 		    scnt, sn, cl, ch);
 #endif
-		if (atabus_alloc_drives(chp, 1) != 0)
+		if (atabus_alloc_drives(chp, 1) != 0) {
+			ata_channel_unlock(chp);
 			return;
+		}
 		/*
 		 * scnt and sn are supposed to be 0x1 for ATAPI, but in some
 		 * cases we get wrong values here, so ignore it.
@@ -885,6 +888,7 @@ sii3112_drv_probe(struct ata_channel *ch
 		    "port %d: unknown SStatus: 0x%08x\n",
 		    chp->ch_channel, sstatus);
 	}
+	ata_channel_unlock(chp);
 }
 
 static void

Reply via email to