Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci follow the channel locking protocol during probe...
details: https://anonhg.NetBSD.org/src/rev/2a9a044017ed
branches: trunk
changeset: 464774:2a9a044017ed
user: christos <christos%NetBSD.org@localhost>
date: Mon Oct 21 19:00:11 2019 +0000
description:
follow the channel locking protocol during probe (like the other drivers)
diffstat:
sys/dev/pci/satalink.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (46 lines):
diff -r e8617cb324c1 -r 2a9a044017ed sys/dev/pci/satalink.c
--- a/sys/dev/pci/satalink.c Mon Oct 21 18:58:57 2019 +0000
+++ b/sys/dev/pci/satalink.c Mon Oct 21 19:00:11 2019 +0000
@@ -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 @@
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 @@
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 @@
"port %d: unknown SStatus: 0x%08x\n",
chp->ch_channel, sstatus);
}
+ ata_channel_unlock(chp);
}
static void
Home |
Main Index |
Thread Index |
Old Index