Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/nvidia tegra124_car(4): No need for rnd lock --...



details:   https://anonhg.NetBSD.org/src/rev/58d32d91a9a8
branches:  trunk
changeset: 364360:58d32d91a9a8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Mar 19 11:36:53 2022 +0000

description:
tegra124_car(4): No need for rnd lock -- delete it.

This only ever reads from a single device register, so no need to
serialize access.

XXX This should really have a hardware-specific health test, but I
can't find any documentation on the underlying physical entropy
source.

diffstat:

 sys/arch/arm/nvidia/tegra124_car.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (50 lines):

diff -r 968fbff6f500 -r 58d32d91a9a8 sys/arch/arm/nvidia/tegra124_car.c
--- a/sys/arch/arm/nvidia/tegra124_car.c        Sat Mar 19 11:36:43 2022 +0000
+++ b/sys/arch/arm/nvidia/tegra124_car.c        Sat Mar 19 11:36:53 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra124_car.c,v 1.22 2021/01/27 03:10:19 thorpej Exp $ */
+/* $NetBSD: tegra124_car.c,v 1.23 2022/03/19 11:36:53 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.22 2021/01/27 03:10:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.23 2022/03/19 11:36:53 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -708,7 +708,6 @@
        u_int                   sc_clock_cells;
        u_int                   sc_reset_cells;
 
-       kmutex_t                sc_rndlock;
        krndsource_t            sc_rndsource;
 };
 
@@ -917,7 +916,6 @@
 {
        struct tegra124_car_softc * const sc = device_private(self);
 
-       mutex_init(&sc->sc_rndlock, MUTEX_DEFAULT, IPL_VM);
        rndsource_setcb(&sc->sc_rndsource, tegra124_car_rnd_callback, sc);
        rnd_attach_source(&sc->sc_rndsource, device_xname(sc->sc_dev),
            RND_TYPE_RNG, RND_FLAG_COLLECT_VALUE|RND_FLAG_HASCB);
@@ -930,7 +928,6 @@
        uint16_t buf[512];
        uint32_t cnt;
 
-       mutex_enter(&sc->sc_rndlock);
        while (bytes_wanted) {
                const u_int nbytes = MIN(bytes_wanted, 1024);
                for (cnt = 0; cnt < bytes_wanted / 2; cnt++) {
@@ -942,7 +939,6 @@
                bytes_wanted -= MIN(bytes_wanted, nbytes);
        }
        explicit_memset(buf, 0, sizeof(buf));
-       mutex_exit(&sc->sc_rndlock);
 }
 
 static struct tegra_clk *



Home | Main Index | Thread Index | Old Index