CVS commit: src/sys/dev/pci/ixgbe
Module Name:src Committed By: msaitoh Date: Tue Sep 12 05:28:31 UTC 2017 Modified Files: src/sys/dev/pci/ixgbe: ixv.c Log Message: Fix panic caused by rev. 1.58's change. Don't if_start from interrupt context. The restart code exists in ixv_handle_que(). To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.60 src/sys/dev/pci/ixgbe/ixv.c:1.61 --- src/sys/dev/pci/ixgbe/ixv.c:1.60 Mon Sep 11 10:11:05 2017 +++ src/sys/dev/pci/ixgbe/ixv.c Tue Sep 12 05:28:31 2017 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.60 2017/09/11 10:11:05 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.61 2017/09/12 05:28:31 msaitoh Exp $*/ /** @@ -808,7 +808,6 @@ ixv_msix_que(void *arg) { struct ix_queue *que = arg; struct adapter *adapter = que->adapter; - struct ifnet*ifp = adapter->ifp; struct tx_ring *txr = que->txr; struct rx_ring *rxr = que->rxr; bool more; @@ -826,19 +825,6 @@ ixv_msix_que(void *arg) IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); - /* - * Make certain that if the stack - * has anything queued the task gets - * scheduled to handle it. - */ - if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) - if (!ixgbe_mq_ring_empty(ifp, txr->txr_interq)) - ixgbe_mq_start_locked(ifp, txr); - /* Only for queue 0 */ - /* NetBSD still needs this for CBQ */ - if ((&adapter->queues[0] == que) - && (!ixgbe_legacy_ring_empty(ifp, NULL))) - ixgbe_legacy_start_locked(ifp, txr); IXGBE_TX_UNLOCK(txr); /* Do AIM now? */ @@ -2545,6 +2531,7 @@ ixv_handle_que(void *context) if (!ixgbe_mq_ring_empty(ifp, txr->txr_interq)) ixgbe_mq_start_locked(ifp, txr); /* Only for queue 0 */ + /* NetBSD still needs this for CBQ */ if ((&adapter->queues[0] == que) && (!ixgbe_legacy_ring_empty(ifp, NULL))) ixgbe_legacy_start_locked(ifp, txr);
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: mrg Date: Tue Sep 12 01:01:25 UTC 2017 Modified Files: src/sys/arch/x86/x86: pmap.c Log Message: minor KNF. To generate a diff of this commit: cvs rdiff -u -r1.256 -r1.257 src/sys/arch/x86/x86/pmap.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/arch/x86/x86/pmap.c diff -u src/sys/arch/x86/x86/pmap.c:1.256 src/sys/arch/x86/x86/pmap.c:1.257 --- src/sys/arch/x86/x86/pmap.c:1.256 Fri Jul 28 14:13:11 2017 +++ src/sys/arch/x86/x86/pmap.c Tue Sep 12 01:01:25 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.256 2017/07/28 14:13:11 riastradh Exp $ */ +/* $NetBSD: pmap.c,v 1.257 2017/09/12 01:01:25 mrg Exp $ */ /* * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc. @@ -171,7 +171,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.256 2017/07/28 14:13:11 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.257 2017/09/12 01:01:25 mrg Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -1154,6 +1154,7 @@ pmap_kremove(vaddr_t sva, vsize_t len) void pmap_kremove_local(vaddr_t sva, vsize_t len) { + pmap_kremove1(sva, len, true); }
CVS commit: [jdolecek-ncq] src/sys/dev/ata
Module Name:src Committed By: jdolecek Date: Mon Sep 11 22:31:42 UTC 2017 Modified Files: src/sys/dev/ata [jdolecek-ncq]: TODO.ncq Log Message: doesn't seem the freeze/thaw in error recovery can cause the thread to panic, all commands within are executed as polled and hence thread is not invoked To generate a diff of this commit: cvs rdiff -u -r1.1.2.39 -r1.1.2.40 src/sys/dev/ata/TODO.ncq 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/ata/TODO.ncq diff -u src/sys/dev/ata/TODO.ncq:1.1.2.39 src/sys/dev/ata/TODO.ncq:1.1.2.40 --- src/sys/dev/ata/TODO.ncq:1.1.2.39 Mon Sep 11 22:30:05 2017 +++ src/sys/dev/ata/TODO.ncq Mon Sep 11 22:31:42 2017 @@ -2,8 +2,6 @@ Bugs test wd* at umass?, confirm the ata_channel kludge works -reconsider freeze/thaw in error recovery - can it screw up with thread? - Other random notes (do outside the NCQ branch): - do biodone() in wddone() starting the dump to not leak bufs when dumping from
CVS commit: [jdolecek-ncq] src/sys/dev/ata
Module Name:src Committed By: jdolecek Date: Mon Sep 11 22:30:05 UTC 2017 Modified Files: src/sys/dev/ata [jdolecek-ncq]: TODO.ncq Log Message: atastart() rechecked - it's okay to call it even in error path in those several cases we do, it's just optimization to skip the call; I'm not even very convinced it's useful to have this conditional, but keeping for now until proven harmful To generate a diff of this commit: cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/sys/dev/ata/TODO.ncq 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/ata/TODO.ncq diff -u src/sys/dev/ata/TODO.ncq:1.1.2.38 src/sys/dev/ata/TODO.ncq:1.1.2.39 --- src/sys/dev/ata/TODO.ncq:1.1.2.38 Sun Sep 10 19:31:15 2017 +++ src/sys/dev/ata/TODO.ncq Mon Sep 11 22:30:05 2017 @@ -2,11 +2,6 @@ Bugs test wd* at umass?, confirm the ata_channel kludge works -revise calls to atastart() - now called alsoafter ATASTART_ABORT(), call -only from intr routine -- wdc.c never calls atastart() (start always false) -- ata_wdc.c calls atastart() regardless if error - reconsider freeze/thaw in error recovery - can it screw up with thread? Other random notes (do outside the NCQ branch):
CVS commit: [jdolecek-ncq] src/sys/dev/ic
Module Name:src Committed By: jdolecek Date: Mon Sep 11 22:19:23 UTC 2017 Modified Files: src/sys/dev/ic [jdolecek-ncq]: wdc.c Log Message: fix condition for calling atastart() when command is done To generate a diff of this commit: cvs rdiff -u -r1.283.2.14 -r1.283.2.15 src/sys/dev/ic/wdc.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/ic/wdc.c diff -u src/sys/dev/ic/wdc.c:1.283.2.14 src/sys/dev/ic/wdc.c:1.283.2.15 --- src/sys/dev/ic/wdc.c:1.283.2.14 Sun Sep 10 19:31:15 2017 +++ src/sys/dev/ic/wdc.c Mon Sep 11 22:19:23 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: wdc.c,v 1.283.2.14 2017/09/10 19:31:15 jdolecek Exp $ */ +/* $NetBSD: wdc.c,v 1.283.2.15 2017/09/11 22:19:23 jdolecek Exp $ */ /* * Copyright (c) 1998, 2001, 2003 Manuel Bouyer. All rights reserved. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.283.2.14 2017/09/10 19:31:15 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.283.2.15 2017/09/11 22:19:23 jdolecek Exp $"); #include "opt_ata.h" #include "opt_wdc.h" @@ -1589,7 +1589,7 @@ __wdccommand_done(struct ata_channel *ch struct wdc_softc *wdc = CHAN_TO_WDC(chp); struct wdc_regs *wdr = &wdc->regs[chp->ch_channel]; struct ata_command *ata_c = &xfer->c_ata_c; - bool start = false; + bool start = true; ATADEBUG_PRINT(("__wdccommand_done %s:%d:%d flags 0x%x\n", device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
CVS commit: [jdolecek-ncq] src/sys/dev/ata
Module Name:src Committed By: jdolecek Date: Mon Sep 11 22:16:18 UTC 2017 Modified Files: src/sys/dev/ata [jdolecek-ncq]: ata.c Log Message: move debug printf where it belongs To generate a diff of this commit: cvs rdiff -u -r1.132.8.31 -r1.132.8.32 src/sys/dev/ata/ata.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/ata/ata.c diff -u src/sys/dev/ata/ata.c:1.132.8.31 src/sys/dev/ata/ata.c:1.132.8.32 --- src/sys/dev/ata/ata.c:1.132.8.31 Sun Sep 10 19:31:15 2017 +++ src/sys/dev/ata/ata.c Mon Sep 11 22:16:18 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ata.c,v 1.132.8.31 2017/09/10 19:31:15 jdolecek Exp $ */ +/* $NetBSD: ata.c,v 1.132.8.32 2017/09/11 22:16:18 jdolecek Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.31 2017/09/10 19:31:15 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.32 2017/09/11 22:16:18 jdolecek Exp $"); #include "opt_ata.h" @@ -1230,8 +1230,6 @@ ata_exec_xfer(struct ata_channel *chp, s else TAILQ_INSERT_HEAD(&chp->ch_queue->queue_xfer, xfer, c_xferchain); - ATADEBUG_PRINT(("atastart from ata_exec_xfer, flags 0x%x\n", - chp->ch_flags), DEBUG_XFERS); /* * if polling and can sleep, wait for the xfer to be at head of queue @@ -1256,6 +1254,8 @@ ata_exec_xfer(struct ata_channel *chp, s ata_channel_unlock(chp); + ATADEBUG_PRINT(("atastart from ata_exec_xfer, flags 0x%x\n", + chp->ch_flags), DEBUG_XFERS); atastart(chp); }
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: jmcneill Date: Mon Sep 11 22:00:05 UTC 2017 Modified Files: src/sys/arch/arm/sunxi: sunxi_mmc.c sunxi_mmc.h Log Message: Add support for sun50i new timing mode and calibration. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/sunxi_mmc.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sunxi_mmc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sunxi_mmc.c diff -u src/sys/arch/arm/sunxi/sunxi_mmc.c:1.6 src/sys/arch/arm/sunxi/sunxi_mmc.c:1.7 --- src/sys/arch/arm/sunxi/sunxi_mmc.c:1.6 Thu Sep 7 01:07:04 2017 +++ src/sys/arch/arm/sunxi/sunxi_mmc.c Mon Sep 11 22:00:05 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_mmc.c,v 1.6 2017/09/07 01:07:04 jmcneill Exp $ */ +/* $NetBSD: sunxi_mmc.c,v 1.7 2017/09/11 22:00:05 jmcneill Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.6 2017/09/07 01:07:04 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.7 2017/09/11 22:00:05 jmcneill Exp $"); #include #include @@ -67,8 +67,6 @@ static const struct sunxi_mmc_delay sunx }; #define SUNXI_MMC_NDESC 16 -#define SUNXI_MMC_DMA_XFERLEN 0x1 -#define SUNXI_MMC_DMA_FTRGLEVEL 0x20070008 struct sunxi_mmc_softc; @@ -110,6 +108,16 @@ static struct sdmmc_chip_functions sunxi .card_intr_ack = sunxi_mmc_card_intr_ack, }; +struct sunxi_mmc_config { + u_int idma_xferlen; + u_int flags; +#define SUNXI_MMC_FLAG_CALIB_REG 0x01 +#define SUNXI_MMC_FLAG_NEW_TIMINGS 0x02 +#define SUNXI_MMC_FLAG_MASK_DATA0 0x04 + const struct sunxi_mmc_delay *delays; + uint32_t dma_ftrglevel; +}; + struct sunxi_mmc_softc { device_t sc_dev; bus_space_tag_t sc_bst; @@ -127,9 +135,8 @@ struct sunxi_mmc_softc { device_t sc_sdmmc_dev; - uint32_t sc_dma_ftrglevel; + struct sunxi_mmc_config *sc_config; - uint32_t sc_idma_xferlen; bus_dma_segment_t sc_idma_segs[1]; int sc_idma_nsegs; bus_size_t sc_idma_size; @@ -164,11 +171,34 @@ CFATTACH_DECL_NEW(sunxi_mmc, sizeof(stru #define MMC_READ(sc, reg) \ bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) -static const char * const compatible[] = { - "allwinner,sun5i-a13-mmc", - "allwinner,sun7i-a20-mmc", - "allwinner,sun50i-a64-mmc", - NULL +static const struct sunxi_mmc_config sun5i_a13_mmc_config = { + .idma_xferlen = 0x1, + .dma_ftrglevel = 0x20070008, + .delays = NULL, + .flags = 0, +}; + +static const struct sunxi_mmc_config sun7i_a20_mmc_config = { + .idma_xferlen = 0x1, + .dma_ftrglevel = 0x20070008, + .delays = sunxi_mmc_delays, + .flags = 0, +}; + +static const struct sunxi_mmc_config sun50i_a64_mmc_config = { + .idma_xferlen = 0x1, + .dma_ftrglevel = 0x20070008, + .delays = NULL, + .flags = SUNXI_MMC_FLAG_CALIB_REG | + SUNXI_MMC_FLAG_NEW_TIMINGS | + SUNXI_MMC_FLAG_MASK_DATA0, +}; + +static const struct of_compat_data compat_data[] = { + { "allwinner,sun5i-a13-mmc", (uintptr_t)&sun5i_a13_mmc_config }, + { "allwinner,sun7i-a20-mmc", (uintptr_t)&sun7i_a20_mmc_config }, + { "allwinner,sun50i-a64-mmc", (uintptr_t)&sun50i_a64_mmc_config }, + { NULL } }; static int @@ -176,7 +206,7 @@ sunxi_mmc_match(device_t parent, cfdata_ { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_match_compat_data(faa->faa_phandle, compat_data); } static void @@ -228,6 +258,7 @@ sunxi_mmc_attach(device_t parent, device sc->sc_dev = self; sc->sc_phandle = phandle; + sc->sc_config = (void *)of_search_compatible(phandle, compat_data)->data; sc->sc_bst = faa->faa_bst; sc->sc_dmat = faa->faa_dmat; mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_BIO); @@ -250,8 +281,6 @@ sunxi_mmc_attach(device_t parent, device sc->sc_gpio_cd_inverted = of_hasprop(phandle, "cd-inverted") ? 0 : 1; sc->sc_gpio_wp_inverted = of_hasprop(phandle, "wp-inverted") ? 0 : 1; - sc->sc_dma_ftrglevel = SUNXI_MMC_DMA_FTRGLEVEL; - if (sunxi_mmc_idma_setup(sc) != 0) { aprint_error_dev(self, "failed to setup DMA\n"); return; @@ -279,8 +308,6 @@ sunxi_mmc_idma_setup(struct sunxi_mmc_so { int error; - sc->sc_idma_xferlen = SUNXI_MMC_DMA_XFERLEN; - sc->sc_idma_ndesc = SUNXI_MMC_NDESC; sc->sc_idma_size = sizeof(struct sunxi_mmc_idma_descriptor) * sc->sc_idma_ndesc; @@ -334,12 +361,15 @@ sunxi_mmc_set_clock(struct sunxi_mmc_sof } else return EINVAL; - delays = &sunxi_mmc_delays[timing]; - error = clk_set_rate(sc->sc_clk_mmc, (freq * 1000) << ddr); if (error != 0) return error; + if (sc->sc_config->delays == NULL) + return 0; + + delays = &sc->sc_config->delays[timing]; + if (sc->sc_clk_sample) { error = clk_set_rate(sc->sc_clk_sample, delays->sample_phase); if (error != 0) @@ -601,14 +631,22 @@ static int sunxi_mmc_bus_clock(sdmmc_chipset_handle_t sch, int freq, bool ddr) { struct sunxi_m
CVS commit: src/sys/arch/arm/dts
Module Name:src Committed By: jun Date: Mon Sep 11 20:44:14 UTC 2017 Added Files: src/sys/arch/arm/dts: sun8i-h3-orangepi-one.dts Log Message: Add local patches to sun8i-h3-orangepi-one to enable HDMI support. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/sun8i-h3-orangepi-one.dts Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/arch/arm/dts/sun8i-h3-orangepi-one.dts diff -u /dev/null src/sys/arch/arm/dts/sun8i-h3-orangepi-one.dts:1.1 --- /dev/null Mon Sep 11 20:44:14 2017 +++ src/sys/arch/arm/dts/sun8i-h3-orangepi-one.dts Mon Sep 11 20:44:14 2017 @@ -0,0 +1,31 @@ +/* $NetBSD: sun8i-h3-orangepi-one.dts,v 1.1 2017/09/11 20:44:14 jun Exp $ */ + +/*- + * Copyright (c) 2017 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "../../../external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts" +#include "sun8i-h3.dtsi" +
CVS commit: src/sys/arch
Module Name:src Committed By: palle Date: Mon Sep 11 19:25:07 UTC 2017 Modified Files: src/sys/arch/sparc/include: promlib.h src/sys/arch/sparc/sparc: promlib.c src/sys/arch/sparc64/include: autoconf.h src/sys/arch/sparc64/sparc64: autoconf.c cpu.c Log Message: sun4v: Update code to retrieve CPU clock frequency so it can handle (future?) CPU clock frequencies above the 32-bit limit. ok mrg@ To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/include/promlib.h cvs rdiff -u -r1.45 -r1.46 src/sys/arch/sparc/sparc/promlib.c cvs rdiff -u -r1.32 -r1.33 src/sys/arch/sparc64/include/autoconf.h cvs rdiff -u -r1.211 -r1.212 src/sys/arch/sparc64/sparc64/autoconf.c cvs rdiff -u -r1.131 -r1.132 src/sys/arch/sparc64/sparc64/cpu.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/arch/sparc/include/promlib.h diff -u src/sys/arch/sparc/include/promlib.h:1.24 src/sys/arch/sparc/include/promlib.h:1.25 --- src/sys/arch/sparc/include/promlib.h:1.24 Thu Jan 21 11:40:01 2010 +++ src/sys/arch/sparc/include/promlib.h Mon Sep 11 19:25:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: promlib.h,v 1.24 2010/01/21 11:40:01 martin Exp $ */ +/* $NetBSD: promlib.h,v 1.25 2017/09/11 19:25:07 palle Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -137,6 +137,7 @@ void prom_init(void); /* To setup promop /* Utility routines */ int prom_getprop(int, const char *, size_t, int *, void *); int prom_getpropint(int, const char *, int); +uint64_t prom_getpropuint64(int, const char *, uint64_t); char *prom_getpropstring(int, const char *); char *prom_getpropstringA(int, const char *, char *, size_t); void prom_printf(const char *, ...); Index: src/sys/arch/sparc/sparc/promlib.c diff -u src/sys/arch/sparc/sparc/promlib.c:1.45 src/sys/arch/sparc/sparc/promlib.c:1.46 --- src/sys/arch/sparc/sparc/promlib.c:1.45 Fri Apr 1 20:21:45 2016 +++ src/sys/arch/sparc/sparc/promlib.c Mon Sep 11 19:25:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: promlib.c,v 1.45 2016/04/01 20:21:45 palle Exp $ */ +/* $NetBSD: promlib.c,v 1.46 2017/09/11 19:25:07 palle Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.45 2016/04/01 20:21:45 palle Exp $"); +__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.46 2017/09/11 19:25:07 palle Exp $"); #if defined(_KERNEL_OPT) #include "opt_sparc_arch.h" @@ -265,6 +265,22 @@ prom_getpropint(int node, const char *na } /* + * Fetch an unsigned 64-bit integer (or pointer) property. + * The return value is the property, or the default if there was none. + */ +uint64_t +prom_getpropuint64(int node, const char *name, uint64_t deflt) +{ + uint64_t uint64buf, *uint64p = &uint64buf; + int len = 2; + + if (prom_getprop(node, name, sizeof(uint64_t), &len, &uint64p) != 0) + return deflt; + + return uint64buf; +} + +/* * Node Name Matching per IEEE 1275, section 4.3.6. */ static int Index: src/sys/arch/sparc64/include/autoconf.h diff -u src/sys/arch/sparc64/include/autoconf.h:1.32 src/sys/arch/sparc64/include/autoconf.h:1.33 --- src/sys/arch/sparc64/include/autoconf.h:1.32 Sat Oct 26 18:47:27 2013 +++ src/sys/arch/sparc64/include/autoconf.h Mon Sep 11 19:25:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.32 2013/10/26 18:47:27 jdc Exp $ */ +/* $NetBSD: autoconf.h,v 1.33 2017/09/11 19:25:07 palle Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ int matchbyname(device_t, cfdata_t, void * `clockfreq' produces a printable representation of a clock frequency * (this is just a frill). */ -char *clockfreq(long); +char *clockfreq(uint64_t); /* Kernel initialization routine. */ void bootstrap(void *, void *, void *, void *, void *); Index: src/sys/arch/sparc64/sparc64/autoconf.c diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.211 src/sys/arch/sparc64/sparc64/autoconf.c:1.212 --- src/sys/arch/sparc64/sparc64/autoconf.c:1.211 Sun Mar 26 12:59:29 2017 +++ src/sys/arch/sparc64/sparc64/autoconf.c Mon Sep 11 19:25:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.211 2017/03/26 12:59:29 martin Exp $ */ +/* $NetBSD: autoconf.c,v 1.212 2017/09/11 19:25:07 palle Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.211 2017/03/26 12:59:29 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.212 2017/09/11 19:25:07 palle Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -521,16 +521,16 @@ cpu_rootconf(void) } char * -clockfreq(long freq) +clockfreq(uint64_t freq) { static char buf[10]; size_t len; freq /= 1000; - len = snprintf(buf, sizeof(buf), "%ld", freq / 1000); + len = snprintf(buf, sizeof(buf), "%" PRIu64, freq / 1000); freq %= 1000; if (freq) - snprintf(buf + len, sizeof(buf) - len, ".%03ld", freq); + snprintf(buf + len, si
CVS commit: src/usr.sbin/sysinst/arch/i386
Module Name:src Committed By: gson Date: Mon Sep 11 15:24:28 UTC 2017 Modified Files: src/usr.sbin/sysinst/arch/i386: md.c Log Message: Clear the screen after running installboot. If we don't, there will be a leftover line saying "Status: Finished" at the top of the next screen, along with some random punctuation in the left and right margins. Inspired by ../landisk/md.c 1.3. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/arch/i386/md.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/arch/i386/md.c diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.6 src/usr.sbin/sysinst/arch/i386/md.c:1.7 --- src/usr.sbin/sysinst/arch/i386/md.c:1.6 Sun May 10 10:14:02 2015 +++ src/usr.sbin/sysinst/arch/i386/md.c Mon Sep 11 15:24:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.6 2015/05/10 10:14:02 martin Exp $ */ +/* $NetBSD: md.c,v 1.7 2017/09/11 15:24:28 gson Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -347,11 +347,11 @@ md_post_newfs(void) "console=%s,speed=%u", consoles[boottype.bp_consdev], boottype.bp_conspeed); if (pm->isspecial) { - ret = run_program(RUN_DISPLAY | RUN_NO_CLEAR, + ret = run_program(RUN_DISPLAY, "/usr/sbin/installboot -o %s /dev/r%s %s", boot_options, pm->diskdev, bootxx_filename); } else { - ret = run_program(RUN_DISPLAY | RUN_NO_CLEAR, + ret = run_program(RUN_DISPLAY, "/usr/sbin/installboot -o %s /dev/r%s%c %s", boot_options, pm->diskdev, 'a' + pm->rootpart, bootxx_filename);
CVS commit: src/usr.sbin/rtadvd
Module Name:src Committed By: christos Date: Mon Sep 11 14:12:28 UTC 2017 Modified Files: src/usr.sbin/rtadvd: rtadvd.c Log Message: Don't start another copy of rtadvd if one is running. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/rtadvd/rtadvd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rtadvd/rtadvd.c diff -u src/usr.sbin/rtadvd/rtadvd.c:1.54 src/usr.sbin/rtadvd/rtadvd.c:1.55 --- src/usr.sbin/rtadvd/rtadvd.c:1.54 Mon Sep 11 10:12:07 2017 +++ src/usr.sbin/rtadvd/rtadvd.c Mon Sep 11 10:12:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: rtadvd.c,v 1.54 2017/09/11 14:12:07 christos Exp $ */ +/* $NetBSD: rtadvd.c,v 1.55 2017/09/11 14:12:28 christos Exp $ */ /* $KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $ */ /* @@ -265,10 +265,15 @@ main(int argc, char *argv[]) #ifdef __NetBSD__ /* record the current PID */ - if (pidfile(pidfilepath) < 0) { - syslog(LOG_ERR, - "<%s> failed to open the pid log file, run anyway.", - __func__); + if (pidfile(pidfilepath) == -1) { + if (errno == EEXIST) { + syslog(LOG_ERR, "Another instance of `%s' is running " + "(pid %d); exiting.", getprogname(), + pidfile_read(pidfilepath)); + return EXIT_FAILURE; + } + syslog(LOG_ERR, "Failed to open the pid log file `%s' (%m), " + "run anyway.", pidfilepath); } #endif
CVS commit: src/usr.sbin/rtadvd
Module Name:src Committed By: christos Date: Mon Sep 11 14:12:07 UTC 2017 Modified Files: src/usr.sbin/rtadvd: rtadvd.c Log Message: KNF, fix time printing formats. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/rtadvd/rtadvd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rtadvd/rtadvd.c diff -u src/usr.sbin/rtadvd/rtadvd.c:1.53 src/usr.sbin/rtadvd/rtadvd.c:1.54 --- src/usr.sbin/rtadvd/rtadvd.c:1.53 Tue Apr 11 10:29:23 2017 +++ src/usr.sbin/rtadvd/rtadvd.c Mon Sep 11 10:12:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: rtadvd.c,v 1.53 2017/04/11 14:29:23 roy Exp $ */ +/* $NetBSD: rtadvd.c,v 1.54 2017/09/11 14:12:07 christos Exp $ */ /* $KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $ */ /* @@ -219,14 +219,13 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; if (argc == 0) { - fprintf(stderr, - "usage: rtadvd [-DdfRs] [-c conffile]" - " [-M ifname] [-p pidfile] interface ...\n"); - exit(1); + fprintf(stderr, "Ysage: %s [-DdfRs] [-c conffile]" + " [-M ifname] [-p pidfile] interface ...\n", getprogname()); + return EXIT_FAILURE; } if (prog_init && prog_init() == -1) { - err(1, "init failed"); + err(EXIT_FAILURE, "init failed"); } logopt = LOG_NDELAY | LOG_PID; @@ -248,7 +247,7 @@ main(int argc, char *argv[]) RTADVD_USER); else syslog(LOG_ERR, "getpwnam: %s: %m", RTADVD_USER); - exit(1); + return EXIT_FAILURE; } /* timer initialization */ @@ -285,18 +284,18 @@ main(int argc, char *argv[]) syslog(LOG_INFO, "dropping privileges to %s", RTADVD_USER); if (prog_chroot(pw->pw_dir) == -1) { syslog(LOG_ERR, "chroot: %s: %m", pw->pw_dir); - exit(1); + return EXIT_FAILURE; } if (prog_chdir("/") == -1) { syslog(LOG_ERR, "chdir: /: %m"); - exit(1); + return EXIT_FAILURE; } if (prog_setgroups(1, &pw->pw_gid) == -1 || prog_setgid(pw->pw_gid) == -1 || prog_setuid(pw->pw_uid) == -1) { syslog(LOG_ERR, "failed to drop privileges: %m"); - exit(1); + return EXIT_FAILURE; } signal(SIGINT, set_die); @@ -330,10 +329,10 @@ main(int argc, char *argv[]) if (timeout != NULL) { syslog(LOG_DEBUG, - "<%s> set timer to %ld:%ld. waiting for " + "<%s> set timer to %jd:%jd. waiting for " "inputs or timeout", __func__, - (long int)timeout->tv_sec, - (long int)timeout->tv_nsec); + (intmax_t)timeout->tv_sec, + (intmax_t)timeout->tv_nsec); } else { syslog(LOG_DEBUG, "<%s> there's no timer. waiting for inputs", @@ -355,7 +354,7 @@ main(int argc, char *argv[]) if (set[0].revents & POLLIN) rtadvd_input(); } - exit(0); /* NOTREACHED */ + return EXIT_SUCCESS; /* NOTREACHED */ } static void @@ -397,13 +396,13 @@ die(void) syslog(LOG_NOTICE, "<%s> gracefully terminated", __func__); free(rcvcmsgbuf); free(sndcmsgbuf); - exit(0); + exit(EXIT_SUCCESS); /* NOT REACHED */ } if (TAILQ_FIRST(&ralist) == NULL) { syslog(LOG_NOTICE, "<%s> gracefully terminated", __func__); - exit(0); + exit(EXIT_SUCCESS); /* NOT REACHED */ } @@ -432,7 +431,7 @@ die(void) rai->maxinterval = MIN_DELAY_BETWEEN_RAS; rai->leaving_adv = MAX_FINAL_RTR_ADVERTISEMENTS; ra_output(rai); - ra_timer_update((void *)rai, &rai->timer->tm); + ra_timer_update(rai, &rai->timer->tm); rtadvd_set_timer(&rai->timer->tm, rai->timer); } } @@ -688,7 +687,7 @@ rtmsg_input(void) rtadvd_remove_timer(&rai->timer); rai->timer = rtadvd_add_timer(ra_timeout, ra_timer_update, rai, rai); - ra_timer_update((void *)rai, &rai->timer->tm); + ra_timer_update(rai, &rai->timer->tm); rtadvd_set_timer(&rai->timer->tm, rai->timer); } else if (prefixchange && rai->ifflags & IFF_UP) { /* @@ -901,8 +900,6 @@ rtadvd_input(void) __func__, icp->icmp6_type); return; } - - return; } static void @@ -993,7 +990,6 @@ rs_input(int len, struct nd_router_solic done: free_ndopts(&ndopts); - return; } void @@ -1196,7 +1192,6 @@ ra_input(int len, struct nd_router_adver done: free_ndopts(&ndopts); - return; } /* return a non-zero value if the received prefix is inconsitent with ours */ @@ -1212,7 +1207,7 @@ prefix_check(struct nd_opt_prefix_info * #if 0/* impossible */ if (pinfo->nd_opt_pi_type != ND_OPT_PREFIX_INFORMATION) - return(0); + return 0; #endif /* @@ -1242,7 +1237,7 @@ prefix_check(struct nd_opt_prefix_info * inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), rai->ifname); - return(0); + return 0; } preferred_time = ntohl(pinfo->nd_opt_pi_preferred_time); @@ -1325,7 +1320,7 @@ prefix_check(struct nd_opt_prefix_info * inconsistent++; } - return(inconsistent); + return inconsistent; } struct prefix * @@ -1341,16 +1336,16 @@ find_prefix(struct rainfo *rai, struct i bytelen = plen / 8; bitle
CVS commit: src/sys/dev/pci/ixgbe
Module Name:src Committed By: msaitoh Date: Mon Sep 11 10:11:05 UTC 2017 Modified Files: src/sys/dev/pci/ixgbe: ixv.c Log Message: Print Mailbox API version. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.59 src/sys/dev/pci/ixgbe/ixv.c:1.60 --- src/sys/dev/pci/ixgbe/ixv.c:1.59 Mon Sep 11 09:52:13 2017 +++ src/sys/dev/pci/ixgbe/ixv.c Mon Sep 11 10:11:05 2017 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.59 2017/09/11 09:52:13 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.60 2017/09/11 10:11:05 msaitoh Exp $*/ /** @@ -290,7 +290,7 @@ ixv_attach(device_t parent, device_t dev pcireg_t id, subid; ixgbe_vendor_info_t *ent; const struct pci_attach_args *pa = aux; - + const char *apivstr; INIT_DEBUGOUT("ixv_attach: begin"); /* @@ -414,6 +414,27 @@ ixv_attach(device_t parent, device_t dev if (error) aprint_normal_dev(dev, "MBX API negotiation failed during attach!\n"); + switch (hw->api_version) { + case ixgbe_mbox_api_10: + apivstr = "1.0"; + break; + case ixgbe_mbox_api_20: + apivstr = "2.0"; + break; + case ixgbe_mbox_api_11: + apivstr = "1.1"; + break; + case ixgbe_mbox_api_12: + apivstr = "1.2"; + break; + case ixgbe_mbox_api_13: + apivstr = "1.3"; + break; + default: + apivstr = "unknown"; + break; + } + aprint_normal_dev(dev, "Mailbox API %s\n", apivstr); /* If no mac address was assigned, make a random one */ if (!ixv_check_ether_addr(hw->mac.addr)) {
CVS commit: src/sys/dev/pci/ixgbe
Module Name:src Committed By: msaitoh Date: Mon Sep 11 09:52:13 UTC 2017 Modified Files: src/sys/dev/pci/ixgbe: ixv.c Log Message: Use cprng_strong64() insread of cprng_fast64() to prevent panic. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.58 src/sys/dev/pci/ixgbe/ixv.c:1.59 --- src/sys/dev/pci/ixgbe/ixv.c:1.58 Wed Aug 30 08:49:18 2017 +++ src/sys/dev/pci/ixgbe/ixv.c Mon Sep 11 09:52:13 2017 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.58 2017/08/30 08:49:18 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.59 2017/09/11 09:52:13 msaitoh Exp $*/ /** @@ -418,7 +418,7 @@ ixv_attach(device_t parent, device_t dev /* If no mac address was assigned, make a random one */ if (!ixv_check_ether_addr(hw->mac.addr)) { u8 addr[ETHER_ADDR_LEN]; - uint64_t rndval = cprng_fast64(); + uint64_t rndval = cprng_strong64(); memcpy(addr, &rndval, sizeof(addr)); addr[0] &= 0xFE;
CVS commit: src/sys/arch/arm/fdt
Module Name:src Committed By: jmcneill Date: Mon Sep 11 09:21:56 UTC 2017 Modified Files: src/sys/arch/arm/fdt: psci_fdt.c Log Message: Use PSCI for reset and poweroff when available. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/fdt/psci_fdt.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/arch/arm/fdt/psci_fdt.c diff -u src/sys/arch/arm/fdt/psci_fdt.c:1.2 src/sys/arch/arm/fdt/psci_fdt.c:1.3 --- src/sys/arch/arm/fdt/psci_fdt.c:1.2 Sat Aug 5 11:58:19 2017 +++ src/sys/arch/arm/fdt/psci_fdt.c Mon Sep 11 09:21:56 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: psci_fdt.c,v 1.2 2017/08/05 11:58:19 jmcneill Exp $ */ +/* $NetBSD: psci_fdt.c,v 1.3 2017/09/11 09:21:56 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.2 2017/08/05 11:58:19 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.3 2017/09/11 09:21:56 jmcneill Exp $"); #include #include @@ -59,6 +59,25 @@ static const char * const compatible[] = CFATTACH_DECL_NEW(psci_fdt, 0, psci_fdt_match, psci_fdt_attach, NULL, NULL); +static void +psci_fdt_reset(device_t dev) +{ + delay(50); + psci_system_reset(); +} + +static void +psci_fdt_poweroff(device_t dev) +{ + delay(50); + psci_system_off(); +} + +static const struct fdtbus_power_controller_func psci_power_funcs = { + .reset = psci_fdt_reset, + .poweroff = psci_fdt_poweroff, +}; + static int psci_fdt_match(device_t parent, cfdata_t cf, void *aux) { @@ -81,6 +100,9 @@ psci_fdt_attach(device_t parent, device_ aprint_naive("\n"); aprint_normal(": PSCI %u.%u\n", ver_maj, ver_min); + + fdtbus_register_power_controller(self, phandle, + &psci_power_funcs); } static int
CVS commit: src/sys/external/bsd
Module Name:src Committed By: maya Date: Mon Sep 11 07:33:45 UTC 2017 Modified Files: src/sys/external/bsd/common/include/asm: barrier.h src/sys/external/bsd/vchiq/dist/interface/compat: vchi_bsd.h Log Message: keep dsb in vchiq code. dsb refers to an arm instruction, so it won't be used on MI code. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/common/include/asm/barrier.h cvs rdiff -u -r1.12 -r1.13 \ src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/asm/barrier.h diff -u src/sys/external/bsd/common/include/asm/barrier.h:1.2 src/sys/external/bsd/common/include/asm/barrier.h:1.3 --- src/sys/external/bsd/common/include/asm/barrier.h:1.2 Mon Sep 11 05:22:10 2017 +++ src/sys/external/bsd/common/include/asm/barrier.h Mon Sep 11 07:33:45 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: barrier.h,v 1.2 2017/09/11 05:22:10 maya Exp $ */ +/* $NetBSD: barrier.h,v 1.3 2017/09/11 07:33:45 maya Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -41,7 +41,6 @@ #define mb membar_sync #define wmb membar_producer #define rmb membar_consumer -#define dsb membar_producer #ifdef __alpha__ /* XXX As if... */ # define read_barrier_depends membar_sync Index: src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h diff -u src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.12 src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.13 --- src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.12 Mon Sep 11 05:25:53 2017 +++ src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h Mon Sep 11 07:33:45 2017 @@ -328,6 +328,8 @@ typedef off_t loff_t; #define BCM2835_MBOX_CHAN_VCHIQ 3 #define bcm_mbox_write bcmmbox_write +#define dsb membar_producer + #define device_print_prettyname(dev) device_printf((dev), "") #endif /* __VCHI_NETBSD_H__ */