Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/mii urlphy(4): Fix missing mii locking in urlphy_att...
details: https://anonhg.NetBSD.org/src/rev/74fedb4380b8
branches: trunk
changeset: 359525:74fedb4380b8
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Jan 08 17:35:05 2022 +0000
description:
urlphy(4): Fix missing mii locking in urlphy_attach.
diffstat:
sys/dev/mii/urlphy.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (35 lines):
diff -r c4c63218c3a5 -r 74fedb4380b8 sys/dev/mii/urlphy.c
--- a/sys/dev/mii/urlphy.c Sat Jan 08 17:34:14 2022 +0000
+++ b/sys/dev/mii/urlphy.c Sat Jan 08 17:35:05 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: urlphy.c,v 1.38 2020/08/24 04:49:05 msaitoh Exp $ */
+/* $NetBSD: urlphy.c,v 1.39 2022/01/08 17:35:05 riastradh Exp $ */
/*
* Copyright (c) 2001, 2002
* Shingo WATANABE <nabe%nabechan.org@localhost>. All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.38 2020/08/24 04:49:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.39 2022/01/08 17:35:05 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -118,11 +118,16 @@
"ignoring this PHY, non-zero instance\n");
return;
}
+
+ mii_lock(mii);
+
PHY_RESET(sc);
PHY_READ(sc, MII_BMSR, &sc->mii_capabilities);
sc->mii_capabilities &= ma->mii_capmask;
+ mii_unlock(mii);
+
mii_phy_add_media(sc);
}
Home |
Main Index |
Thread Index |
Old Index