From 8569198c3953b59eaff2be95a12aab9f946e0d8c Mon Sep 17 00:00:00 2001 From: riastradh Date: Sat, 9 May 2015 21:57:56 +0000 Subject: [PATCH] Defer to a callout in hifn_rng_get. Fixes lock-against-self. Still can't call rnd_add_data directly from an rndsource callback. (Still plan to fix this with further rnd rototilling.) XXX pullup netbsd-7 --- sys/dev/pci/hifn7751.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index 71aa020629f3..042bafb9c8a0 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $NetBSD: hifn7751.c,v 1.59 2015/05/09 08:08:50 mrg Exp $ */ +/* $NetBSD: hifn7751.c,v 1.60 2015/05/09 21:57:56 riastradh Exp $ */ /* $FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */ /* $OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $ */ @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.59 2015/05/09 08:08:50 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.60 2015/05/09 21:57:56 riastradh Exp $"); #include #include @@ -538,8 +538,7 @@ hifn_rng_get(size_t bytes, void *priv) mutex_enter(&sc->sc_mtx); sc->sc_rng_need = bytes; - - hifn_rng_locked(sc); + callout_reset(&sc->sc_rngto, 0, hifn_rng, sc); mutex_exit(&sc->sc_mtx); }