CVS commit: src/sys/dev/usb

2015-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 22 15:12:39 UTC 2015

Modified Files:
src/sys/dev/usb: usbdi.c

Log Message:
Improve debug/comments (mostly from nhusb)


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sys/dev/usb/usbdi.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/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.166 src/sys/dev/usb/usbdi.c:1.167
--- src/sys/dev/usb/usbdi.c:1.166	Tue Dec 22 13:37:01 2015
+++ src/sys/dev/usb/usbdi.c	Tue Dec 22 15:12:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.166 2015/12/22 13:37:01 skrll Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.167 2015/12/22 15:12:39 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.166 2015/12/22 13:37:01 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.167 2015/12/22 15:12:39 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -326,17 +326,18 @@ usbd_transfer(usbd_xfer_handle xfer)
 	}
 
 	if (!(flags & USBD_SYNCHRONOUS)) {
-		USBHIST_LOG(usbdebug, "<- done xfer %p, not sync", xfer, 0, 0,
-		0);
+		USBHIST_LOG(usbdebug, "<- done xfer %p, not sync (err %d)",
+		xfer, err, 0, 0);
 		return (err);
 	}
 
-	/* Sync transfer, wait for completion. */
 	if (err != USBD_IN_PROGRESS) {
-		USBHIST_LOG(usbdebug, "<- done xfer %p, not in progress", xfer,
-		0, 0, 0);
+		USBHIST_LOG(usbdebug, "<- done xfer %p, not in progress "
+		"(err %d)", xfer, err, 0, 0);
 		return (err);
 	}
+
+	/* Sync transfer, wait for completion. */
 	usbd_lock_pipe(pipe);
 	while (!xfer->done) {
 		if (pipe->device->bus->use_polling)



CVS commit: src/sys/arch/arm/nvidia

2015-12-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 22 22:12:08 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_i2c.c tegra_var.h

Log Message:
tegra_car_* and tegra_i2c_dvc_write are no more


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/nvidia/tegra_i2c.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/nvidia/tegra_var.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/nvidia/tegra_i2c.c
diff -u src/sys/arch/arm/nvidia/tegra_i2c.c:1.11 src/sys/arch/arm/nvidia/tegra_i2c.c:1.12
--- src/sys/arch/arm/nvidia/tegra_i2c.c:1.11	Tue Dec 22 22:10:36 2015
+++ src/sys/arch/arm/nvidia/tegra_i2c.c	Tue Dec 22 22:12:08 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_i2c.c,v 1.11 2015/12/22 22:10:36 jmcneill Exp $ */
+/* $NetBSD: tegra_i2c.c,v 1.12 2015/12/22 22:12:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.11 2015/12/22 22:10:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.12 2015/12/22 22:12:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -493,20 +493,3 @@ tegra_i2c_read(struct tegra_i2c_softc *s
 
 	return tegra_i2c_wait(sc, flags);
 }
-
-void
-tegra_i2c_dvc_write(uint8_t addr, uint32_t data, size_t datalen)
-{
-	bus_space_tag_t bst = _generic_bs_tag;
-	bus_space_handle_t bsh;
-
-	bus_space_subregion(bst, tegra_apb_bsh, TEGRA_I2C5_OFFSET,
-	TEGRA_I2C5_SIZE, );
-
-	bus_space_write_4(bst, bsh, I2C_CMD_ADDR0_REG, addr << 1);
-	bus_space_write_4(bst, bsh, I2C_CMD_DATA1_REG, data);
-	bus_space_write_4(bst, bsh, I2C_CNFG_REG,
-	__SHIFTIN(datalen - 1, I2C_CNFG_LENGTH) |
-	I2C_CNFG_NEW_MASTER_FSM |
-	I2C_CNFG_SEND);
-}

Index: src/sys/arch/arm/nvidia/tegra_var.h
diff -u src/sys/arch/arm/nvidia/tegra_var.h:1.28 src/sys/arch/arm/nvidia/tegra_var.h:1.29
--- src/sys/arch/arm/nvidia/tegra_var.h:1.28	Sat Nov 21 22:55:32 2015
+++ src/sys/arch/arm/nvidia/tegra_var.h	Tue Dec 22 22:12:08 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_var.h,v 1.28 2015/11/21 22:55:32 jmcneill Exp $ */
+/* $NetBSD: tegra_var.h,v 1.29 2015/12/22 22:12:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -88,33 +88,6 @@ void	tegra_bootstrap(void);
 void	tegra_dma_bootstrap(psize_t);
 void	tegra_cpuinit(void);
 
-u_int	tegra_car_osc_rate(void);
-u_int	tegra_car_pllc_rate(void);
-u_int	tegra_car_plle_rate(void);
-u_int	tegra_car_pllx_rate(void);
-void	tegra_car_pllx_set_rate(u_int, u_int, u_int);
-u_int	tegra_car_pllu_rate(void);
-u_int	tegra_car_pllp0_rate(void);
-u_int	tegra_car_plld2_rate(void);
-u_int	tegra_car_uart_rate(u_int);
-u_int	tegra_car_periph_sdmmc_rate(u_int);
-int	tegra_car_periph_sdmmc_set_rate(u_int, u_int);
-int	tegra_car_periph_usb_enable(u_int);
-void	tegra_car_periph_hda_enable(void);
-void	tegra_car_periph_sata_enable(void);
-int	tegra_car_periph_i2c_enable(u_int, u_int);
-void	tegra_car_periph_cec_enable(void);
-void	tegra_car_utmip_init(void);
-void	tegra_car_utmip_enable(u_int);
-void	tegra_car_hdmi_enable(u_int);
-int	tegra_car_dc_enable(u_int);
-void	tegra_car_host1x_enable(void);
-void	tegra_car_wdt_enable(u_int, bool);
-void	tegra_car_gpu_enable(void);
-void	tegra_car_fuse_enable(void);
-void	tegra_car_fuse_disable(void);
-void	tegra_car_soctherm_enable(void);
-
 struct tegra_gpio_pin;
 struct tegra_gpio_pin *tegra_gpio_acquire(const char *, u_int);
 void	tegra_gpio_release(struct tegra_gpio_pin *);
@@ -147,8 +120,6 @@ void	tegra_pmc_power(u_int, bool);
 void	tegra_pmc_remove_clamping(u_int);
 void	tegra_pmc_hdmi_enable(void);
 
-void	tegra_i2c_dvc_write(uint8_t, uint32_t, size_t);
-
 psize_t	tegra_mc_memsize(void);
 
 uint32_t tegra_fuse_read(u_int);



CVS commit: src/sys/dev/usb

2015-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 22 22:26:16 UTC 2015

Modified Files:
src/sys/dev/usb: usbdi.c

Log Message:
In usbd_transfer deal with errors from the HCD transfer (and start)
methods properly by removing the failed xfer from the pipe queue.

For example, an Apple keyboard and FS hub with attached ums(4) on
dwctwo(4) (rpo0/rpi model a) needs this fix otherwise probing
usbd_new_device will never complete after first failed attempt to get
the initial device descriptor.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/dev/usb/usbdi.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/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.167 src/sys/dev/usb/usbdi.c:1.168
--- src/sys/dev/usb/usbdi.c:1.167	Tue Dec 22 15:12:39 2015
+++ src/sys/dev/usb/usbdi.c	Tue Dec 22 22:26:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.167 2015/12/22 15:12:39 skrll Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.168 2015/12/22 22:26:16 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.167 2015/12/22 15:12:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.168 2015/12/22 22:26:16 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -323,6 +323,15 @@ usbd_transfer(usbd_xfer_handle xfer)
 			bus->methods->freem(bus, >dmabuf);
 			xfer->rqflags &= ~URQ_AUTO_DMABUF;
 		}
+		/*
+		 * The transfer made it onto the pipe queue, but didn't get
+		 * accepted by the HCD for some reason.  It needs removing
+		 * from the pipe queue.
+		 */
+		usbd_lock_pipe(pipe);
+		SIMPLEQ_REMOVE_HEAD(>queue, next);
+		usbd_start_next(pipe);
+		usbd_unlock_pipe(pipe);
 	}
 
 	if (!(flags & USBD_SYNCHRONOUS)) {



CVS commit: src/sys/arch/arm/samsung

2015-12-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 22 22:34:42 UTC 2015

Modified Files:
src/sys/arch/arm/samsung: exynos_pinctrl.c

Log Message:
OF_getprop -> of_getprop_bool


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/samsung/exynos_pinctrl.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/samsung/exynos_pinctrl.c
diff -u src/sys/arch/arm/samsung/exynos_pinctrl.c:1.4 src/sys/arch/arm/samsung/exynos_pinctrl.c:1.5
--- src/sys/arch/arm/samsung/exynos_pinctrl.c:1.4	Tue Dec 22 03:36:01 2015
+++ src/sys/arch/arm/samsung/exynos_pinctrl.c	Tue Dec 22 22:34:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_pinctrl.c,v 1.4 2015/12/22 03:36:01 marty Exp $ */
+/*	$NetBSD: exynos_pinctrl.c,v 1.5 2015/12/22 22:34:42 jmcneill Exp $ */
 
 /*-
 * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "gpio.h"
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: exynos_pinctrl.c,v 1.4 2015/12/22 03:36:01 marty Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exynos_pinctrl.c,v 1.5 2015/12/22 22:34:42 jmcneill Exp $");
 
 #include 
 #include 
@@ -96,10 +96,7 @@ exynos_pinctrl_attach(device_t parent, d
 
 	for (child = OF_child(faa->faa_phandle); child;
 	 child = OF_peer(child)) {
-		char result[64];
-		error = OF_getprop(child, "gpio-controller", result,
-   sizeof(result));
-		if (error == -1)
+		if (of_getprop_bool(child, "gpio-controller") == false)
 			continue;
 		exynos_gpio_bank_config(sc,child);
 	}



CVS commit: src/sys/miscfs/specfs

2015-12-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Dec 23 00:13:57 UTC 2015

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
Revert previous


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/miscfs/specfs/spec_vnops.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/miscfs/specfs/spec_vnops.c
diff -u src/sys/miscfs/specfs/spec_vnops.c:1.158 src/sys/miscfs/specfs/spec_vnops.c:1.159
--- src/sys/miscfs/specfs/spec_vnops.c:1.158	Tue Dec 22 23:54:37 2015
+++ src/sys/miscfs/specfs/spec_vnops.c	Wed Dec 23 00:13:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec_vnops.c,v 1.158 2015/12/22 23:54:37 pgoyette Exp $	*/
+/*	$NetBSD: spec_vnops.c,v 1.159 2015/12/23 00:13:57 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.158 2015/12/22 23:54:37 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.159 2015/12/23 00:13:57 pgoyette Exp $");
 
 #include 
 #include 
@@ -573,12 +573,7 @@ spec_open(void *v)
 break;
 			
 			/* Try to autoload device module */
-			error = module_autoload(name, MODULE_CLASS_DRIVER);
-			if (error != 0) {
-error = ENXIO;
-break;
-			}
-
+			(void) module_autoload(name, MODULE_CLASS_DRIVER);
 		} while (gen != module_gen);
 
 		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
@@ -629,15 +624,9 @@ spec_open(void *v)
 			VOP_UNLOCK(vp);
 
 /* Try to autoload device module */
-			error = module_autoload(name, MODULE_CLASS_DRIVER);
-
-			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-
-			if (error != 0) {
-error = ENXIO;
-break;
-			}
+			(void) module_autoload(name, MODULE_CLASS_DRIVER);
 			
+			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 		} while (gen != module_gen);
 
 		break;



CVS commit: src/sys/arch

2015-12-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 22 22:10:36 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: files.tegra soc_tegra124.c tegra_ahcisata.c
tegra_cec.c tegra_com.c tegra_cpufreq.c tegra_drm.c tegra_drm.h
tegra_drm_mode.c tegra_ehci.c tegra_fdt.c tegra_fuse.c
tegra_hdaudio.c tegra_i2c.c tegra_nouveau.c tegra_sdhc.c
tegra_soc.c tegra_soctherm.c tegra_timer.c tegra_timerreg.h
tegra_usbphy.c
src/sys/arch/evbarm/conf: TEGRA std.tegra
src/sys/arch/evbarm/tegra: tegra_machdep.c
Added Files:
src/sys/arch/arm/nvidia: tegra124_car.c tegra124_carreg.h tegra_clock.h
Removed Files:
src/sys/arch/arm/nvidia: tegra_car.c tegra_carreg.h

Log Message:
Switch Tegra over to fdt based clocks and reset controls.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/nvidia/files.tegra
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/nvidia/soc_tegra124.c \
src/sys/arch/arm/nvidia/tegra_ehci.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/nvidia/tegra124_car.c \
src/sys/arch/arm/nvidia/tegra124_carreg.h \
src/sys/arch/arm/nvidia/tegra_clock.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nvidia/tegra_ahcisata.c \
src/sys/arch/arm/nvidia/tegra_nouveau.c
cvs rdiff -u -r1.31 -r0 src/sys/arch/arm/nvidia/tegra_car.c
cvs rdiff -u -r1.22 -r0 src/sys/arch/arm/nvidia/tegra_carreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nvidia/tegra_cec.c \
src/sys/arch/arm/nvidia/tegra_cpufreq.c \
src/sys/arch/arm/nvidia/tegra_soctherm.c \
src/sys/arch/arm/nvidia/tegra_timer.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nvidia/tegra_com.c \
src/sys/arch/arm/nvidia/tegra_drm.c \
src/sys/arch/arm/nvidia/tegra_usbphy.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/nvidia/tegra_drm.h \
src/sys/arch/arm/nvidia/tegra_hdaudio.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/nvidia/tegra_drm_mode.c \
src/sys/arch/arm/nvidia/tegra_i2c.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nvidia/tegra_fdt.c \
src/sys/arch/arm/nvidia/tegra_timerreg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_fuse.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/nvidia/tegra_sdhc.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra_soc.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/TEGRA
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/conf/std.tegra
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/tegra/tegra_machdep.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/nvidia/files.tegra
diff -u src/sys/arch/arm/nvidia/files.tegra:1.27 src/sys/arch/arm/nvidia/files.tegra:1.28
--- src/sys/arch/arm/nvidia/files.tegra:1.27	Sun Dec 13 22:55:05 2015
+++ src/sys/arch/arm/nvidia/files.tegra	Tue Dec 22 22:10:36 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.tegra,v 1.27 2015/12/13 22:55:05 jmcneill Exp $
+#	$NetBSD: files.tegra,v 1.28 2015/12/22 22:10:36 jmcneill Exp $
 #
 # Configuration info for NVIDIA Tegra ARM Peripherals
 #
@@ -43,9 +43,9 @@ attach	tegrafuse at fdt with tegra_fuse
 file	arch/arm/nvidia/tegra_fuse.c		tegra_fuse
 
 # Clock and Reset controller
-device	tegracar
-attach	tegracar at fdt with tegra_car
-file	arch/arm/nvidia/tegra_car.c		tegra_car
+device	tegra124car: clk
+attach	tegra124car at fdt with tegra124_car
+file	arch/arm/nvidia/tegra124_car.c		tegra124_car
 
 # GPIO controller
 device	tegragpio: gpiobus

Index: src/sys/arch/arm/nvidia/soc_tegra124.c
diff -u src/sys/arch/arm/nvidia/soc_tegra124.c:1.11 src/sys/arch/arm/nvidia/soc_tegra124.c:1.12
--- src/sys/arch/arm/nvidia/soc_tegra124.c:1.11	Tue Dec  1 22:08:13 2015
+++ src/sys/arch/arm/nvidia/soc_tegra124.c	Tue Dec 22 22:10:36 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: soc_tegra124.c,v 1.11 2015/12/01 22:08:13 jmcneill Exp $ */
+/* $NetBSD: soc_tegra124.c,v 1.12 2015/12/22 22:10:36 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.11 2015/12/01 22:08:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.12 2015/12/22 22:10:36 jmcneill Exp $");
 
 #include 
 #include 
@@ -39,6 +39,10 @@ __KERNEL_RCSID(0, "$NetBSD: soc_tegra124
 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 
 #include 
@@ -107,19 +111,42 @@ static struct tegra124_speedo {
 	.gpu_speedo_id = 0
 };
 
+static struct clk *tegra124_clk_pllx = NULL;
+
 void
 tegra124_cpuinit(void)
 {
-	tegra_car_periph_i2c_enable(4, 2040);
+	const int node = OF_finddevice("/i2c@0,7000d000");
+	if (node == -1) {
+		aprint_error("cpufreq: ERROR: couldn't find i2c@0,7000d000\n");
+		return;
+	}
+	i2c_tag_t ic = fdtbus_get_i2c_tag(node);
 
 	/* Set VDD_CPU voltage to 1.4V */
 	const u_int target_mv = 1400;
 	const u_int sd0_vsel = (target_mv - 600) / 10;
-	tegra_i2c_dvc_write(0x40, (sd0_vsel << 8) | 00, 2);
+	uint8_t 

CVS commit: src/usr.bin/fstat

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 23:35:21 UTC 2015

Modified Files:
src/usr.bin/fstat: fstat.c

Log Message:
print the tag symbolically if we don't support it.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/usr.bin/fstat/fstat.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.bin/fstat/fstat.c
diff -u src/usr.bin/fstat/fstat.c:1.109 src/usr.bin/fstat/fstat.c:1.110
--- src/usr.bin/fstat/fstat.c:1.109	Sun Mar  8 01:46:51 2015
+++ src/usr.bin/fstat/fstat.c	Tue Dec 22 18:35:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstat.c,v 1.109 2015/03/08 06:46:51 mlelstv Exp $	*/
+/*	$NetBSD: fstat.c,v 1.110 2015/12/22 23:35:21 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)fstat.c	8.3 (Berkeley) 5/2/95";
 #else
-__RCSID("$NetBSD: fstat.c,v 1.109 2015/03/08 06:46:51 mlelstv Exp $");
+__RCSID("$NetBSD: fstat.c,v 1.110 2015/12/22 23:35:21 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -532,6 +532,9 @@ ftrans(fdfile_t *fp, int i)
 }
 
 static const char dead[] = "dead";
+static const char *vnode_tag[] = {
+	VNODE_TAGS
+};
 
 static const char *
 vfilestat(struct vnode *vp, struct filestat *fsp)
@@ -588,8 +591,9 @@ vfilestat(struct vnode *vp, struct files
 			break;
 		default: {
 			static char unknown[10];
-			(void)snprintf(unknown, sizeof unknown,
-			"?(%x)", vp->v_tag);
+			(void)snprintf(unknown, sizeof unknown, "%s(%#x)",
+			(size_t)vp->v_tag < __arraycount(vnode_tag) ?
+			vnode_tag[vp->v_tag] : "?", vp->v_tag);
 			badtype = unknown;
 			break;
 		}



CVS commit: src/sys/miscfs/specfs

2015-12-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Dec 22 23:54:37 UTC 2015

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
If we attempt to autoload a driver module, make sure we return an error
if it fails.  Otherwise we might end up calling a builtin-but-disabled
driver module and that can generate all sorts of issues...


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/miscfs/specfs/spec_vnops.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/miscfs/specfs/spec_vnops.c
diff -u src/sys/miscfs/specfs/spec_vnops.c:1.157 src/sys/miscfs/specfs/spec_vnops.c:1.158
--- src/sys/miscfs/specfs/spec_vnops.c:1.157	Tue Dec  8 20:36:15 2015
+++ src/sys/miscfs/specfs/spec_vnops.c	Tue Dec 22 23:54:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec_vnops.c,v 1.157 2015/12/08 20:36:15 christos Exp $	*/
+/*	$NetBSD: spec_vnops.c,v 1.158 2015/12/22 23:54:37 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.157 2015/12/08 20:36:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.158 2015/12/22 23:54:37 pgoyette Exp $");
 
 #include 
 #include 
@@ -573,7 +573,12 @@ spec_open(void *v)
 break;
 			
 			/* Try to autoload device module */
-			(void) module_autoload(name, MODULE_CLASS_DRIVER);
+			error = module_autoload(name, MODULE_CLASS_DRIVER);
+			if (error != 0) {
+error = ENXIO;
+break;
+			}
+
 		} while (gen != module_gen);
 
 		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
@@ -624,9 +629,15 @@ spec_open(void *v)
 			VOP_UNLOCK(vp);
 
 /* Try to autoload device module */
-			(void) module_autoload(name, MODULE_CLASS_DRIVER);
-			
+			error = module_autoload(name, MODULE_CLASS_DRIVER);
+
 			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+
+			if (error != 0) {
+error = ENXIO;
+break;
+			}
+			
 		} while (gen != module_gen);
 
 		break;



CVS commit: src/sys

2015-12-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 22 22:19:07 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_gpio.c
src/sys/arch/arm/samsung: exynos_gpio.c
src/sys/dev/fdt: fdt_gpio.c fdtvar.h fixedregulator.c

Log Message:
Add fdtbus_gpio_{read,write}_raw, which tells the controller not to take
polarity into account. Tegra GPIO pin data includes pin polarity, but so
does a regulator-fixed node, so the end result was that the enable value
was being swapped twice. Change fregulator to use the raw APIs, and adapt
Tegra and Exynos GPIO drivers to support this flag.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/nvidia/tegra_gpio.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/samsung/exynos_gpio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/fdt_gpio.c \
src/sys/dev/fdt/fixedregulator.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/fdtvar.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/nvidia/tegra_gpio.c
diff -u src/sys/arch/arm/nvidia/tegra_gpio.c:1.5 src/sys/arch/arm/nvidia/tegra_gpio.c:1.6
--- src/sys/arch/arm/nvidia/tegra_gpio.c:1.5	Mon Dec 14 20:57:34 2015
+++ src/sys/arch/arm/nvidia/tegra_gpio.c	Tue Dec 22 22:19:07 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_gpio.c,v 1.5 2015/12/14 20:57:34 jmcneill Exp $ */
+/* $NetBSD: tegra_gpio.c,v 1.6 2015/12/22 22:19:07 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.5 2015/12/14 20:57:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.6 2015/12/22 22:19:07 jmcneill Exp $");
 
 #include 
 #include 
@@ -89,8 +89,8 @@ static void	tegra_gpio_attach(device_t, 
 static void *	tegra_gpio_fdt_acquire(device_t, const void *,
 		size_t, int);
 static void	tegra_gpio_fdt_release(device_t, void *);
-static int	tegra_gpio_fdt_read(device_t, void *);
-static void	tegra_gpio_fdt_write(device_t, void *, int);
+static int	tegra_gpio_fdt_read(device_t, void *, bool);
+static void	tegra_gpio_fdt_write(device_t, void *, int, bool);
 
 struct fdtbus_gpio_controller_func tegra_gpio_funcs = {
 	.acquire = tegra_gpio_fdt_acquire,
@@ -323,25 +323,25 @@ tegra_gpio_fdt_release(device_t dev, voi
 }
 
 static int
-tegra_gpio_fdt_read(device_t dev, void *priv)
+tegra_gpio_fdt_read(device_t dev, void *priv, bool raw)
 {
 	struct tegra_gpio_pin *gpin = priv;
 	int val;
 
 	val = tegra_gpio_read(gpin);
 
-	if (gpin->pin_actlo)
+	if (!raw && gpin->pin_actlo)
 		val = !val;
 
 	return val;
 }
 
 static void
-tegra_gpio_fdt_write(device_t dev, void *priv, int val)
+tegra_gpio_fdt_write(device_t dev, void *priv, int val, bool raw)
 {
 	struct tegra_gpio_pin *gpin = priv;
 
-	if (gpin->pin_actlo)
+	if (!raw && gpin->pin_actlo)
 		val = !val;
 
 	tegra_gpio_write(gpin, val);

Index: src/sys/arch/arm/samsung/exynos_gpio.c
diff -u src/sys/arch/arm/samsung/exynos_gpio.c:1.16 src/sys/arch/arm/samsung/exynos_gpio.c:1.17
--- src/sys/arch/arm/samsung/exynos_gpio.c:1.16	Tue Dec 22 03:36:01 2015
+++ src/sys/arch/arm/samsung/exynos_gpio.c	Tue Dec 22 22:19:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_gpio.c,v 1.16 2015/12/22 03:36:01 marty Exp $ */
+/*	$NetBSD: exynos_gpio.c,v 1.17 2015/12/22 22:19:07 jmcneill Exp $ */
 
 /*-
 * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "gpio.h"
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: exynos_gpio.c,v 1.16 2015/12/22 03:36:01 marty Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exynos_gpio.c,v 1.17 2015/12/22 22:19:07 jmcneill Exp $");
 
 #include 
 #include 
@@ -157,8 +157,8 @@ static void *exynos_gpio_fdt_acquire(dev
  size_t, int);
 static void exynos_gpio_fdt_release(device_t, void *);
 
-static int exynos_gpio_fdt_read(device_t, void *);
-static void exynos_gpio_fdt_write(device_t, void *, int);
+static int exynos_gpio_fdt_read(device_t, void *, bool);
+static void exynos_gpio_fdt_write(device_t, void *, int, bool);
 static struct exynos_gpio_bank *
 exynos_gpio_pin_lookup(const char *pinname, int *ppin);
 static int exynos_gpio_cfprint(void *, const char *);
@@ -393,7 +393,7 @@ exynos_gpio_fdt_release(device_t dev, vo
 }
 
 static int
-exynos_gpio_fdt_read(device_t dev, void *priv)
+exynos_gpio_fdt_read(device_t dev, void *priv, bool raw)
 {
 	struct exynos_gpio_pin *gpin = priv;
 	int val;
@@ -402,18 +402,18 @@ exynos_gpio_fdt_read(device_t dev, void 
  gpin->pin_sc->sc_bsh,
  EXYNOS_GPIO_DAT) >> gpin->pin_no) & 1;
 
-	if (gpin->pin_actlo)
+	if (!raw && gpin->pin_actlo)
 		val = !val;
 
 	return val;
 }
 
 static void
-exynos_gpio_fdt_write(device_t dev, void *priv, int val)
+exynos_gpio_fdt_write(device_t dev, void *priv, int val, bool raw)
 {
 	struct exynos_gpio_pin *gpin = priv;
 
-	if (gpin->pin_actlo)
+	if (!raw && gpin->pin_actlo)
 		val = !val;
 
 	val = bus_space_read_1(gpin->pin_sc->sc_bst,

Index: 

CVS commit: src/sys/arch/arm/samsung

2015-12-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 22 22:32:54 UTC 2015

Modified Files:
src/sys/arch/arm/samsung: exynos_i2c.c

Log Message:
build fix


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/samsung/exynos_i2c.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/samsung/exynos_i2c.c
diff -u src/sys/arch/arm/samsung/exynos_i2c.c:1.6 src/sys/arch/arm/samsung/exynos_i2c.c:1.7
--- src/sys/arch/arm/samsung/exynos_i2c.c:1.6	Mon Dec 21 04:58:50 2015
+++ src/sys/arch/arm/samsung/exynos_i2c.c	Tue Dec 22 22:32:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_i2c.c,v 1.6 2015/12/21 04:58:50 marty Exp $ */
+/*	$NetBSD: exynos_i2c.c,v 1.7 2015/12/22 22:32:54 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,10 +32,9 @@
 
 #include "opt_exynos.h"
 #include "opt_arm_debug.h"
-#include "exynos_iic.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.6 2015/12/21 04:58:50 marty Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.7 2015/12/22 22:32:54 jmcneill Exp $");
 
 #include 
 #include 



CVS commit: src/sys/dev/fdt

2015-12-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 22 21:42:11 UTC 2015

Modified Files:
src/sys/dev/fdt: fdt_subr.c fdtvar.h files.fdt
Added Files:
src/sys/dev/fdt: fdt_clock.c fdt_reset.c

Log Message:
Add support for fdt clock and reset controllers.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_clock.c \
src/sys/dev/fdt/fdt_reset.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/fdt/fdt_subr.c src/sys/dev/fdt/files.fdt
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/fdtvar.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/dev/fdt/fdt_subr.c
diff -u src/sys/dev/fdt/fdt_subr.c:1.4 src/sys/dev/fdt/fdt_subr.c:1.5
--- src/sys/dev/fdt/fdt_subr.c:1.4	Wed Dec 16 19:33:55 2015
+++ src/sys/dev/fdt/fdt_subr.c	Tue Dec 22 21:42:11 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.4 2015/12/16 19:33:55 jmcneill Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.5 2015/12/22 21:42:11 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.4 2015/12/16 19:33:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.5 2015/12/22 21:42:11 jmcneill Exp $");
 
 #include 
 #include 
@@ -130,11 +130,16 @@ fdtbus_get_phandle(int phandle, const ch
 	phandle_ref = fdt32_to_cpu(buf[0]);
 	kmem_free(buf, len);
 
-	const int off = fdt_node_offset_by_phandle(fdt_data, phandle_ref);
+	return fdtbus_get_phandle_from_native(phandle_ref);
+}
+
+int
+fdtbus_get_phandle_from_native(int phandle)
+{
+	const int off = fdt_node_offset_by_phandle(fdt_data, phandle);
 	if (off < 0) {
 		return -1;
 	}
-
 	return fdtbus_offset2phandle(off);
 }
 
Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.4 src/sys/dev/fdt/files.fdt:1.5
--- src/sys/dev/fdt/files.fdt:1.4	Wed Dec 16 12:22:48 2015
+++ src/sys/dev/fdt/files.fdt	Tue Dec 22 21:42:11 2015
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.4 2015/12/16 12:22:48 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.5 2015/12/22 21:42:11 jmcneill Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -24,7 +24,9 @@ file	dev/fdt/gpiokeys.c			gpiokeys
 
 file	dev/fdt/fdt_openfirm.c			fdtbus
 file	dev/fdt/fdt_subr.c			fdtbus
+file	dev/fdt/fdt_clock.c			fdtbus
 file	dev/fdt/fdt_gpio.c			fdtbus
 file	dev/fdt/fdt_i2c.c			fdtbus
 file	dev/fdt/fdt_intr.c			fdtbus
 file	dev/fdt/fdt_regulator.c			fdtbus
+file	dev/fdt/fdt_reset.c			fdtbus

Index: src/sys/dev/fdt/fdtvar.h
diff -u src/sys/dev/fdt/fdtvar.h:1.2 src/sys/dev/fdt/fdtvar.h:1.3
--- src/sys/dev/fdt/fdtvar.h:1.2	Wed Dec 16 12:17:45 2015
+++ src/sys/dev/fdt/fdtvar.h	Tue Dec 22 21:42:11 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.2 2015/12/16 12:17:45 jmcneill Exp $ */
+/* $NetBSD: fdtvar.h,v 1.3 2015/12/22 21:42:11 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -33,6 +33,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 
@@ -87,6 +88,24 @@ struct fdtbus_regulator_controller_func 
 	int	(*enable)(device_t, bool);
 };
 
+struct fdtbus_clock_controller_func {
+	struct clk *	(*decode)(device_t, const void *, size_t);
+};
+
+struct fdtbus_reset_controller;
+
+struct fdtbus_reset {
+	struct fdtbus_reset_controller *rst_rc;
+	void *rst_priv;
+};
+
+struct fdtbus_reset_controller_func {
+	void *	(*acquire)(device_t, const void *, size_t);
+	void	(*release)(device_t, void *);
+	int	(*reset_assert)(device_t, void *);
+	int	(*reset_deassert)(device_t, void *);
+};
+
 int		fdtbus_register_interrupt_controller(device_t, int,
 		const struct fdtbus_interrupt_controller_func *);
 int		fdtbus_register_i2c_controller(device_t, int,
@@ -95,9 +114,14 @@ int		fdtbus_register_gpio_controller(dev
 		const struct fdtbus_gpio_controller_func *);
 int		fdtbus_register_regulator_controller(device_t, int,
 		const struct fdtbus_regulator_controller_func *);
+int		fdtbus_register_clock_controller(device_t, int,
+		const struct fdtbus_clock_controller_func *);
+int		fdtbus_register_reset_controller(device_t, int,
+		const struct fdtbus_reset_controller_func *);
 
 int		fdtbus_get_reg(int, u_int, bus_addr_t *, bus_size_t *);
 int		fdtbus_get_phandle(int, const char *);
+int		fdtbus_get_phandle_from_native(int);
 i2c_tag_t	fdtbus_get_i2c_tag(int);
 void *		fdtbus_intr_establish(int, u_int, int, int,
 		int (*func)(void *), void *arg);
@@ -112,6 +136,15 @@ void		fdtbus_regulator_release(struct fd
 int		fdtbus_regulator_enable(struct fdtbus_regulator *);
 int		fdtbus_regulator_disable(struct fdtbus_regulator *);
 
+struct clk *	fdtbus_clock_get(int, const char *);
+struct clk *	fdtbus_clock_get_index(int, u_int);
+
+struct fdtbus_reset *fdtbus_reset_get(int, const char *);
+struct fdtbus_reset *fdtbus_reset_get_index(int, u_int);
+void		fdtbus_reset_put(struct fdtbus_reset *);
+int		fdtbus_reset_assert(struct fdtbus_reset *);
+int		

CVS commit: src/etc/rc.d

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 23 04:38:00 UTC 2015

Modified Files:
src/etc/rc.d: ip6addrctl

Log Message:
remove some stuff we don't have; rename rc command variable.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/ip6addrctl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/ip6addrctl
diff -u src/etc/rc.d/ip6addrctl:1.1 src/etc/rc.d/ip6addrctl:1.2
--- src/etc/rc.d/ip6addrctl:1.1	Sat Dec 12 21:05:15 2015
+++ src/etc/rc.d/ip6addrctl	Tue Dec 22 23:38:00 2015
@@ -9,7 +9,7 @@
 . /etc/rc.subr
 
 name="ip6addrctl"
-rcvar="ip6addrctl_enable"
+rcvar="ip6addrctl"
 start_cmd="ip6addrctl_start"
 stop_cmd="ip6addrctl_stop"
 extra_commands="status prefer_ipv6 prefer_ipv4"
@@ -61,13 +61,7 @@ ip6addrctl_start()
 			${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
 			${IP6ADDRCTL_CMD} install "${config_file}"
 		else
-			if checkyesno ipv6_activate_all_interfaces; then
-ip6addrctl_prefer_ipv6
-			elif [ -n "$(list_vars ifconfig_\*_ipv6)" ]; then
-ip6addrctl_prefer_ipv6
-			else
-ip6addrctl_prefer_ipv4
-			fi
+			ip6addrctl_prefer_ipv6
 		fi
 	;;
 	ipv4_prefer)



CVS commit: src/share/mk

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 16:46:56 UTC 2015

Modified Files:
src/share/mk: bsd.sys.mk

Log Message:
Add a prefix translation map for debugging symbols. Note the use of variable
indirection so that DW_at_producer that contains the compilation command
remains the same: readelf --debug-dump foo.debug


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/share/mk/bsd.sys.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.245 src/share/mk/bsd.sys.mk:1.246
--- src/share/mk/bsd.sys.mk:1.245	Wed Sep  3 15:22:53 2014
+++ src/share/mk/bsd.sys.mk	Tue Dec 22 11:46:56 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.245 2014/09/03 19:22:53 matt Exp $
+#	$NetBSD: bsd.sys.mk,v 1.246 2015/12/22 16:46:56 christos Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -18,6 +18,10 @@ error2:
 CPPFLAGS+=	-Wp,-iremap,${NETBSDSRCDIR}:/usr/src
 CPPFLAGS+=	-Wp,-iremap,${DESTDIR}/:/
 CPPFLAGS+=	-Wp,-iremap,${X11SRCDIR}:/usr/xsrc
+.export NETBSDSRCDIR DESTDIR X11SRCDIR
+CFLAGS+=	-fdebug-prefix-map=\$$NETBSDSRCDIR=/usr/src
+CFLAGS+=	-fdebug-prefix-map=\$$DESTDIR=/
+CFLAGS+=	-fdebug-prefix-map=\$$X11SRCDIR=/usr/xsrc
 .endif
 
 # NetBSD sources use C99 style, with some GCC extensions.



CVS commit: src/sys/dev/sdmmc

2015-12-22 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Dec 22 09:56:06 UTC 2015

Modified Files:
src/sys/dev/sdmmc: sdmmc_mem.c

Log Message:
Be graceful about command timeouts when probing.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/sdmmc/sdmmc_mem.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/sdmmc/sdmmc_mem.c
diff -u src/sys/dev/sdmmc/sdmmc_mem.c:1.49 src/sys/dev/sdmmc/sdmmc_mem.c:1.50
--- src/sys/dev/sdmmc/sdmmc_mem.c:1.49	Sun Nov 29 23:38:47 2015
+++ src/sys/dev/sdmmc/sdmmc_mem.c	Tue Dec 22 09:56:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc_mem.c,v 1.49 2015/11/29 23:38:47 jmcneill Exp $	*/
+/*	$NetBSD: sdmmc_mem.c,v 1.50 2015/12/22 09:56:06 mlelstv Exp $	*/
 /*	$OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $	*/
 
 /*
@@ -45,7 +45,7 @@
 /* Routines for SD/MMC memory cards. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.49 2015/11/29 23:38:47 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.50 2015/12/22 09:56:06 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -616,7 +616,8 @@ sdmmc_mem_send_op_cond(struct sdmmc_soft
 		memset(, 0, sizeof(cmd));
 		cmd.c_arg = !ISSET(sc->sc_caps, SMC_CAPS_SPI_MODE) ?
 		ocr : (ocr & MMC_OCR_HCS);
-		cmd.c_flags = SCF_CMD_BCR | SCF_RSP_R3 | SCF_RSP_SPI_R1;
+		cmd.c_flags = SCF_CMD_BCR | SCF_RSP_R3 | SCF_RSP_SPI_R1
+		| SCF_TOUT_OK;
 
 		if (ISSET(sc->sc_flags, SMF_SD_MODE)) {
 			cmd.c_opcode = SD_APP_OP_COND;



CVS commit: src/sys/dev/sdmmc

2015-12-22 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Dec 22 09:55:38 UTC 2015

Modified Files:
src/sys/dev/sdmmc: sdmmc.c

Log Message:
ignore timeouts for APP_CMD prefix as for the application command itself.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/sdmmc/sdmmc.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/sdmmc/sdmmc.c
diff -u src/sys/dev/sdmmc/sdmmc.c:1.32 src/sys/dev/sdmmc/sdmmc.c:1.33
--- src/sys/dev/sdmmc/sdmmc.c:1.32	Sun Nov 29 23:38:47 2015
+++ src/sys/dev/sdmmc/sdmmc.c	Tue Dec 22 09:55:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc.c,v 1.32 2015/11/29 23:38:47 jmcneill Exp $	*/
+/*	$NetBSD: sdmmc.c,v 1.33 2015/12/22 09:55:38 mlelstv Exp $	*/
 /*	$OpenBSD: sdmmc.c,v 1.18 2009/01/09 10:58:38 jsg Exp $	*/
 
 /*
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.32 2015/11/29 23:38:47 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.33 2015/12/22 09:55:38 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -798,7 +798,7 @@ sdmmc_app_command(struct sdmmc_softc *sc
 	memset(, 0, sizeof(acmd));
 	acmd.c_opcode = MMC_APP_CMD;
 	acmd.c_arg = (sf != NULL) ? (sf->rca << 16) : 0;
-	acmd.c_flags = SCF_CMD_AC | SCF_RSP_R1 | SCF_RSP_SPI_R1;
+	acmd.c_flags = SCF_CMD_AC | SCF_RSP_R1 | SCF_RSP_SPI_R1 | (cmd->c_flags & SCF_TOUT_OK);
 
 	error = sdmmc_mmc_command(sc, );
 	if (error == 0) {



CVS commit: src/tests/lib

2015-12-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec 22 08:26:16 UTC 2015

Modified Files:
src/tests/lib/libc/gen: Makefile
src/tests/lib/libc/stdlib: Makefile
src/tests/lib/libm: Makefile

Log Message:
Sync list of fenv enabled architectures again (PR 48633), this time for mips
addition.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r1.26 -r1.27 src/tests/lib/libc/stdlib/Makefile
cvs rdiff -u -r1.33 -r1.34 src/tests/lib/libm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.46 src/tests/lib/libc/gen/Makefile:1.47
--- src/tests/lib/libc/gen/Makefile:1.46	Mon Dec 21 12:11:23 2015
+++ src/tests/lib/libc/gen/Makefile	Tue Dec 22 08:26:16 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.46 2015/12/21 12:11:23 martin Exp $
+# $NetBSD: Makefile,v 1.47 2015/12/22 08:26:16 martin Exp $
 
 .include 
 
@@ -42,7 +42,8 @@ TESTS_C+=	t_vis
 .if ${MACHINE_CPU} == "aarch64" || ${MACHINE_CPU} == "arm" \
 || ${MACHINE_ARCH} == "hppa" ||  ${MACHINE_ARCH} == "powerpc" \
 || ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64" \
-|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" \
+|| ${MACHINE_ARCH} == "mips"
 CPPFLAGS.t_siginfo.c+=	-DHAVE_FENV
 LDADD.t_siginfo+=	-lm
 DPADD.t_siginfo+=	${LIBM}

Index: src/tests/lib/libc/stdlib/Makefile
diff -u src/tests/lib/libc/stdlib/Makefile:1.26 src/tests/lib/libc/stdlib/Makefile:1.27
--- src/tests/lib/libc/stdlib/Makefile:1.26	Mon Dec 21 12:11:23 2015
+++ src/tests/lib/libc/stdlib/Makefile	Tue Dec 22 08:26:16 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.26 2015/12/21 12:11:23 martin Exp $
+# $NetBSD: Makefile,v 1.27 2015/12/22 08:26:16 martin Exp $
 
 .include 
 
@@ -32,7 +32,8 @@ PROGS+=		h_getopt h_getopt_long
 .if ${MACHINE_CPU} == "aarch64" || ${MACHINE_CPU} == "arm" \
 || ${MACHINE_ARCH} == "hppa" || ${MACHINE_ARCH} == "powerpc" \
 || ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64" \
-|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" \
+|| ${MACHINE_ARCH} == "mips"
 CPPFLAGS.t_strtod.c+=	-DHAVE_FENV
 .endif
 

Index: src/tests/lib/libm/Makefile
diff -u src/tests/lib/libm/Makefile:1.33 src/tests/lib/libm/Makefile:1.34
--- src/tests/lib/libm/Makefile:1.33	Mon Dec 21 12:11:23 2015
+++ src/tests/lib/libm/Makefile	Tue Dec 22 08:26:16 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2015/12/21 12:11:23 martin Exp $
+# $NetBSD: Makefile,v 1.34 2015/12/22 08:26:16 martin Exp $
 
 .include 
 
@@ -7,7 +7,8 @@ TESTSDIR=	${TESTSBASE}/lib/libm
 .if ${MACHINE_CPU} == "aarch64" || ${MACHINE_CPU} == "arm" \
 || ${MACHINE_ARCH} == "hppa" || ${MACHINE_ARCH} == "powerpc" \
 || ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64" \
-|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" \
+|| ${MACHINE_ARCH} == "mips"
 CPPFLAGS+=	-DHAVE_FENV_H
 .endif
 



CVS commit: src/sys/netbt

2015-12-22 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Dec 22 11:40:07 UTC 2015

Modified Files:
src/sys/netbt: hci_socket.c

Log Message:
there is no longer a reason to have a separate hci_send function now
that the hci_usrreq function is disassembled, so merge hci_send_pcb
back into hci_send()


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/netbt/hci_socket.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/netbt/hci_socket.c
diff -u src/sys/netbt/hci_socket.c:1.44 src/sys/netbt/hci_socket.c:1.45
--- src/sys/netbt/hci_socket.c:1.44	Sat May  2 17:18:03 2015
+++ src/sys/netbt/hci_socket.c	Tue Dec 22 11:40:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_socket.c,v 1.44 2015/05/02 17:18:03 rtr Exp $	*/
+/*	$NetBSD: hci_socket.c,v 1.45 2015/12/22 11:40:07 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.44 2015/05/02 17:18:03 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.45 2015/12/22 11:40:07 plunky Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -348,84 +348,6 @@ hci_cmdwait_flush(struct socket *so)
 	}
 }
 
-/*
- * HCI send packet
- * This came from userland, so check it out.
- */
-static int
-hci_send_pcb(struct hci_pcb *pcb, struct mbuf *m, bdaddr_t *addr)
-{
-	struct hci_unit *unit;
-	struct mbuf *m0;
-	hci_cmd_hdr_t hdr;
-	int err;
-
-	KASSERT(m != NULL);
-	KASSERT(addr != NULL);
-
-	/* wants at least a header to start with */
-	if (m->m_pkthdr.len < sizeof(hdr)) {
-		err = EMSGSIZE;
-		goto bad;
-	}
-	m_copydata(m, 0, sizeof(hdr), );
-	hdr.opcode = le16toh(hdr.opcode);
-
-	/* only allows CMD packets to be sent */
-	if (hdr.type != HCI_CMD_PKT) {
-		err = EINVAL;
-		goto bad;
-	}
-
-	/* validates packet length */
-	if (m->m_pkthdr.len != sizeof(hdr) + hdr.length) {
-		err = EMSGSIZE;
-		goto bad;
-	}
-
-	/* finds destination */
-	unit = hci_unit_lookup(addr);
-	if (unit == NULL) {
-		err = ENETDOWN;
-		goto bad;
-	}
-
-	/* security checks for unprivileged users */
-	if (pcb->hp_cred != NULL
-	&& kauth_authorize_device(pcb->hp_cred,
-	KAUTH_DEVICE_BLUETOOTH_SEND,
-	unit, , NULL, NULL) != 0) {
-		err = EPERM;
-		goto bad;
-	}
-
-	/* makess a copy for precious to keep */
-	m0 = m_copypacket(m, M_DONTWAIT);
-	if (m0 == NULL) {
-		err = ENOMEM;
-		goto bad;
-	}
-	sbappendrecord(>hp_socket->so_snd, m0);
-	M_SETCTX(m, pcb->hp_socket);	/* enable drop callback */
-
-	DPRINTFN(2, "(%s) opcode (%03x|%04x)\n", device_xname(unit->hci_dev),
-		HCI_OGF(hdr.opcode), HCI_OCF(hdr.opcode));
-
-	/* Sendss it */
-	if (unit->hci_num_cmd_pkts == 0)
-		MBUFQ_ENQUEUE(>hci_cmdwait, m);
-	else
-		hci_output_cmd(unit, m);
-
-	return 0;
-
-bad:
-	DPRINTF("packet (%d bytes) not sent (error %d)\n",
-			m->m_pkthdr.len, err);
-	if (m) m_freem(m);
-	return err;
-}
-
 static int
 hci_attach(struct socket *so, int proto)
 {
@@ -669,30 +591,94 @@ hci_send(struct socket *so, struct mbuf 
 struct mbuf *control, struct lwp *l)
 {
 	struct hci_pcb *pcb = so->so_pcb;
-	struct sockaddr_bt * sa = (struct sockaddr_bt *)nam;
+	struct sockaddr_bt *sa = (struct sockaddr_bt *)nam;
+	struct hci_unit *unit;
+	struct mbuf *m0;
+	hci_cmd_hdr_t hdr;
 	int err = 0;
 
 	KASSERT(solocked(so));
 	KASSERT(pcb != NULL);
+	KASSERT(m != NULL);
 
 	if (control) /* have no use for this */
 		m_freem(control);
 
-	if (nam) {
+	if (sa) {
 		if (sa->bt_len != sizeof(struct sockaddr_bt)) {
 			err = EINVAL;
-			goto release;
+			goto bad;
 		}
 
 		if (sa->bt_family != AF_BLUETOOTH) {
 			err = EAFNOSUPPORT;
-			goto release;
+			goto bad;
 		}
 	}
 
-	return hci_send_pcb(pcb, m, (sa ? >bt_bdaddr : >hp_raddr));
+ 	/*
+	 * this came from userland, so we check it out first
+	 */
+
+	/* wants at least a header to start with */
+	if (m->m_pkthdr.len < sizeof(hdr)) {
+		err = EMSGSIZE;
+		goto bad;
+	}
+	m_copydata(m, 0, sizeof(hdr), );
+	hdr.opcode = le16toh(hdr.opcode);
+
+	/* only allows CMD packets to be sent */
+	if (hdr.type != HCI_CMD_PKT) {
+		err = EINVAL;
+		goto bad;
+	}
+
+	/* validates packet length */
+	if (m->m_pkthdr.len != sizeof(hdr) + hdr.length) {
+		err = EMSGSIZE;
+		goto bad;
+	}
+
+	/* finds destination */
+	unit = hci_unit_lookup((sa ? >bt_bdaddr : >hp_raddr));
+	if (unit == NULL) {
+		err = ENETDOWN;
+		goto bad;
+	}
+
+	/* security checks for unprivileged users */
+	if (pcb->hp_cred != NULL
+	&& kauth_authorize_device(pcb->hp_cred,
+	KAUTH_DEVICE_BLUETOOTH_SEND,
+	unit, , NULL, NULL) != 0) {
+		err = EPERM;
+		goto bad;
+	}
+
+	/* makess a copy for precious to keep */
+	m0 = m_copypacket(m, M_DONTWAIT);
+	if (m0 == NULL) {
+		err = ENOMEM;
+		goto bad;
+	}
+	sbappendrecord(>hp_socket->so_snd, m0);
+	M_SETCTX(m, pcb->hp_socket);	/* enable drop callback */
+
+	DPRINTFN(2, "(%s) opcode (%03x|%04x)\n", device_xname(unit->hci_dev),
+		HCI_OGF(hdr.opcode), 

CVS commit: src/external/gpl3/gcc/dist/gcc

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 16:49:08 UTC 2015

Modified Files:
src/external/gpl3/gcc/dist/gcc: final.c

Log Message:
For reproducible builds, allow the source of the map to be set from the
environment, so that DW_at_producer is the same no matter what the actual
underlying source and destination directories are. See:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01168.html


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl3/gcc/dist/gcc/final.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/final.c
diff -u src/external/gpl3/gcc/dist/gcc/final.c:1.1.1.3 src/external/gpl3/gcc/dist/gcc/final.c:1.2
--- src/external/gpl3/gcc/dist/gcc/final.c:1.1.1.3	Sat Mar  1 03:42:08 2014
+++ src/external/gpl3/gcc/dist/gcc/final.c	Tue Dec 22 11:49:08 2015
@@ -1492,6 +1492,9 @@ add_debug_prefix_map (const char *arg)
 {
   debug_prefix_map *map;
   const char *p;
+  char *env;
+  const char *old;
+  size_t oldlen;
 
   p = strchr (arg, '=');
   if (!p)
@@ -1499,9 +1502,29 @@ add_debug_prefix_map (const char *arg)
   error ("invalid argument %qs to -fdebug-prefix-map", arg);
   return;
 }
+  if (*arg == '$')
+{
+  env = xstrndup (arg+1, p - (arg+1));
+  old = getenv(env);
+  if (!old)
+	{
+	  warning (0, "environment variable %qs not set in argument to "
+		   "-fdebug-prefix-map", env);
+	  free(env);
+	  return;
+	}
+  oldlen = strlen(old);
+  free(env);
+}
+  else
+{
+  old = xstrndup (arg, p - arg);
+  oldlen = p - arg;
+}
+
   map = XNEW (debug_prefix_map);
-  map->old_prefix = xstrndup (arg, p - arg);
-  map->old_len = p - arg;
+  map->old_prefix = old;
+  map->old_len = oldlen;
   p++;
   map->new_prefix = xstrdup (p);
   map->new_len = strlen (p);



CVS commit: src/external/gpl3/gcc.old/dist/gcc

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 16:48:44 UTC 2015

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: final.c

Log Message:
For reproducible builds, allow the source of the map to be set from the
environment, so that DW_at_producer is the same no matter what the actual
underlying source and destination directories are. See:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01168.html


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc.old/dist/gcc/final.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/final.c
diff -u src/external/gpl3/gcc.old/dist/gcc/final.c:1.3 src/external/gpl3/gcc.old/dist/gcc/final.c:1.4
--- src/external/gpl3/gcc.old/dist/gcc/final.c:1.3	Tue Sep 22 23:39:10 2015
+++ src/external/gpl3/gcc.old/dist/gcc/final.c	Tue Dec 22 11:48:44 2015
@@ -1492,6 +1492,9 @@ add_debug_prefix_map (const char *arg)
 {
   debug_prefix_map *map;
   const char *p;
+  char *env;
+  const char *old;
+  size_t oldlen;
 
   p = strchr (arg, '=');
   if (!p)
@@ -1499,9 +1502,29 @@ add_debug_prefix_map (const char *arg)
   error ("invalid argument %qs to -fdebug-prefix-map", arg);
   return;
 }
+  if (*arg == '$')
+{
+  env = xstrndup (arg+1, p - (arg+1));
+  old = getenv(env);
+  if (!old)
+	{
+	  warning (0, "environment variable %qs not set in argument to "
+		   "-fdebug-prefix-map", env);
+	  free(env);
+	  return;
+	}
+  oldlen = strlen(old);
+  free(env);
+}
+  else
+{
+  old = xstrndup (arg, p - arg);
+  oldlen = p - arg;
+}
+
   map = XNEW (debug_prefix_map);
-  map->old_prefix = xstrndup (arg, p - arg);
-  map->old_len = p - arg;
+  map->old_prefix = old;
+  map->old_len = oldlen;
   p++;
   map->new_prefix = xstrdup (p);
   map->new_len = strlen (p);



CVS commit: src/tests/lib/libm

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 14:20:59 UTC 2015

Modified Files:
src/tests/lib/libm: Makefile t_fenv.c

Log Message:
put have fenv stuff elsewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tests/lib/libm/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libm/t_fenv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/Makefile
diff -u src/tests/lib/libm/Makefile:1.34 src/tests/lib/libm/Makefile:1.35
--- src/tests/lib/libm/Makefile:1.34	Tue Dec 22 03:26:16 2015
+++ src/tests/lib/libm/Makefile	Tue Dec 22 09:20:59 2015
@@ -1,17 +1,9 @@
-# $NetBSD: Makefile,v 1.34 2015/12/22 08:26:16 martin Exp $
+# $NetBSD: Makefile,v 1.35 2015/12/22 14:20:59 christos Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/lib/libm
 
-.if ${MACHINE_CPU} == "aarch64" || ${MACHINE_CPU} == "arm" \
-|| ${MACHINE_ARCH} == "hppa" || ${MACHINE_ARCH} == "powerpc" \
-|| ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64" \
-|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" \
-|| ${MACHINE_ARCH} == "mips"
-CPPFLAGS+=	-DHAVE_FENV_H
-.endif
-
 .if ${MACHINE} == "alpha"
 COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
 .endif

Index: src/tests/lib/libm/t_fenv.c
diff -u src/tests/lib/libm/t_fenv.c:1.2 src/tests/lib/libm/t_fenv.c:1.3
--- src/tests/lib/libm/t_fenv.c:1.2	Mon Dec 29 14:51:53 2014
+++ src/tests/lib/libm/t_fenv.c	Tue Dec 22 09:20:59 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fenv.c,v 1.2 2014/12/29 19:51:53 martin Exp $ */
+/* $NetBSD: t_fenv.c,v 1.3 2015/12/22 14:20:59 christos Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,15 +29,15 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fenv.c,v 1.2 2014/12/29 19:51:53 martin Exp $");
+__RCSID("$NetBSD: t_fenv.c,v 1.3 2015/12/22 14:20:59 christos Exp $");
 
 #include 
 
-#ifdef HAVE_FENV_H
+#include 
+#ifdef __HAVE_FENV
 
 #include 
 #include 
-#include 
 
 
 #if __arm__ && !__SOFTFP__



CVS commit: src/tests/lib/libm

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 14:27:51 UTC 2015

Modified Files:
src/tests/lib/libm: Makefile

Log Message:
add __TEST_FENV


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/tests/lib/libm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/Makefile
diff -u src/tests/lib/libm/Makefile:1.35 src/tests/lib/libm/Makefile:1.36
--- src/tests/lib/libm/Makefile:1.35	Tue Dec 22 09:20:59 2015
+++ src/tests/lib/libm/Makefile	Tue Dec 22 09:27:51 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2015/12/22 14:20:59 christos Exp $
+# $NetBSD: Makefile,v 1.36 2015/12/22 14:27:51 christos Exp $
 
 .include 
 
@@ -8,6 +8,7 @@ TESTSDIR=	${TESTSBASE}/lib/libm
 COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
 .endif
 
+CPPFLAGS.t_fenv.c+=	-D__TEST_FENV
 CPPFLAGS.t_fmod.c+=	-I${.CURDIR}/../libc/gen
 
 TESTS_C+=	t_acos



CVS commit: src/sys/dev/usb

2015-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 22 13:37:01 UTC 2015

Modified Files:
src/sys/dev/usb: usbdi.c

Log Message:
Can't use usbd_errstr in USBHIST_LOG as vmstat(1) doesn't like it


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/dev/usb/usbdi.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/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.165 src/sys/dev/usb/usbdi.c:1.166
--- src/sys/dev/usb/usbdi.c:1.165	Sat Sep 26 13:59:28 2015
+++ src/sys/dev/usb/usbdi.c	Tue Dec 22 13:37:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.165 2015/09/26 13:59:28 skrll Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.166 2015/12/22 13:37:01 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.165 2015/09/26 13:59:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.166 2015/12/22 13:37:01 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1114,8 +1114,7 @@ usbd_do_request_flags_pipe(usbd_device_h
 
  bad:
 	if (err) {
-		USBHIST_LOG(usbdebug, "returning err = %s",
-		usbd_errstr(err), 0, 0, 0);
+		USBHIST_LOG(usbdebug, "returning err = %d", err, 0, 0, 0);
 	}
 	usbd_free_xfer(xfer);
 	return (err);



CVS commit: src/tests/lib/libc/gen

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 14:18:35 UTC 2015

Modified Files:
src/tests/lib/libc/gen: Makefile

Log Message:
Put have fenv elsewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/tests/lib/libc/gen/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.47 src/tests/lib/libc/gen/Makefile:1.48
--- src/tests/lib/libc/gen/Makefile:1.47	Tue Dec 22 03:26:16 2015
+++ src/tests/lib/libc/gen/Makefile	Tue Dec 22 09:18:35 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.47 2015/12/22 08:26:16 martin Exp $
+# $NetBSD: Makefile,v 1.48 2015/12/22 14:18:35 christos Exp $
 
 .include 
 
@@ -39,16 +39,8 @@ TESTS_C+=	t_time
 TESTS_C+=	t_ttyname
 TESTS_C+=	t_vis
 
-.if ${MACHINE_CPU} == "aarch64" || ${MACHINE_CPU} == "arm" \
-|| ${MACHINE_ARCH} == "hppa" ||  ${MACHINE_ARCH} == "powerpc" \
-|| ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64" \
-|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" \
-|| ${MACHINE_ARCH} == "mips"
-CPPFLAGS.t_siginfo.c+=	-DHAVE_FENV
 LDADD.t_siginfo+=	-lm
 DPADD.t_siginfo+=	${LIBM}
-.endif
-
 LDADD.t_fpclassify+=	-lm
 DPADD.t_fpclassify+=	${LIBM}
 LDADD.t_fpsetround+=	-lm



CVS commit: src/tests/lib/libc/stdlib

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 14:19:25 UTC 2015

Modified Files:
src/tests/lib/libc/stdlib: t_strtod.c

Log Message:
Put have fenv elsewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/lib/libc/stdlib/t_strtod.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdlib/t_strtod.c
diff -u src/tests/lib/libc/stdlib/t_strtod.c:1.33 src/tests/lib/libc/stdlib/t_strtod.c:1.34
--- src/tests/lib/libc/stdlib/t_strtod.c:1.33	Sat Dec 27 13:03:41 2014
+++ src/tests/lib/libc/stdlib/t_strtod.c	Tue Dec 22 09:19:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_strtod.c,v 1.33 2014/12/27 18:03:41 martin Exp $ */
+/*	$NetBSD: t_strtod.c,v 1.34 2015/12/22 14:19:25 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 /* Public domain, Otto Moerbeek , 2006. */
 
 #include 
-__RCSID("$NetBSD: t_strtod.c,v 1.33 2014/12/27 18:03:41 martin Exp $");
+__RCSID("$NetBSD: t_strtod.c,v 1.34 2015/12/22 14:19:25 christos Exp $");
 
 #include 
 #include 
@@ -42,9 +42,7 @@ __RCSID("$NetBSD: t_strtod.c,v 1.33 2014
 
 #include 
 
-#ifdef HAVE_FENV
 #include 
-#endif
 
 #if !defined(__vax__)
 static const char * const inf_strings[] =
@@ -238,7 +236,7 @@ ATF_TC_HEAD(strtod_round, tc)
 
 ATF_TC_BODY(strtod_round, tc)
 {
-#ifdef HAVE_FENV
+#ifdef __HAVE_FENV
 
 	/*
 	 * Test that strtod(3) honors the current rounding mode.



CVS commit: src/include

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 14:24:56 UTC 2015

Modified Files:
src/include: fenv.h

Log Message:
Add __HAVE_FENV


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/include/fenv.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/fenv.h
diff -u src/include/fenv.h:1.15 src/include/fenv.h:1.16
--- src/include/fenv.h:1.15	Mon Dec 21 11:49:53 2015
+++ src/include/fenv.h	Tue Dec 22 09:24:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.15 2015/12/21 16:49:53 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.16 2015/12/22 14:24:55 christos Exp $	*/
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,8 +29,12 @@
 && !defined(__hppa__) && !defined(__powerpc__) && !defined(__mips__) \
 && !defined(__or1k__) && !defined(__riscv__) && !defined(__sparc__) \
 && !defined(__x86_64__)
+#ifndef __TEST_FENV
 #error	"fenv.h is currently not supported for this architecture"
 #endif
+#else
+# define __HAVE_FENV
+#endif
 
 #ifndef _FENV_H_
 #define _FENV_H_



CVS commit: src/tests/lib/libc/stdlib

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 14:27:14 UTC 2015

Modified Files:
src/tests/lib/libc/stdlib: Makefile

Log Message:
Add __TEST_FENV


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/tests/lib/libc/stdlib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdlib/Makefile
diff -u src/tests/lib/libc/stdlib/Makefile:1.27 src/tests/lib/libc/stdlib/Makefile:1.28
--- src/tests/lib/libc/stdlib/Makefile:1.27	Tue Dec 22 03:26:16 2015
+++ src/tests/lib/libc/stdlib/Makefile	Tue Dec 22 09:27:14 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2015/12/22 08:26:16 martin Exp $
+# $NetBSD: Makefile,v 1.28 2015/12/22 14:27:14 christos Exp $
 
 .include 
 
@@ -29,14 +29,7 @@ BINDIR=		${TESTSDIR}
 PROGS+=		h_atexit
 PROGS+=		h_getopt h_getopt_long
 
-.if ${MACHINE_CPU} == "aarch64" || ${MACHINE_CPU} == "arm" \
-|| ${MACHINE_ARCH} == "hppa" || ${MACHINE_ARCH} == "powerpc" \
-|| ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64" \
-|| ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" \
-|| ${MACHINE_ARCH} == "mips"
-CPPFLAGS.t_strtod.c+=	-DHAVE_FENV
-.endif
-
+CPPFLAGS.t_strtod.c+=  -D__TEST_FENV
 LDADD.t_strtod=			-lm
 DPADD.t_strtod+=		${LIBM}
 



CVS commit: src/sys/external/bsd/dwc2

2015-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 22 14:31:36 UTC 2015

Modified Files:
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
Stop the callout if the transfer didn't get enqueued


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/external/bsd/dwc2/dwc2.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/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.37 src/sys/external/bsd/dwc2/dwc2.c:1.38
--- src/sys/external/bsd/dwc2/dwc2.c:1.37	Sun Aug 30 13:02:42 2015
+++ src/sys/external/bsd/dwc2/dwc2.c	Tue Dec 22 14:31:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.37 2015/08/30 13:02:42 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.38 2015/12/22 14:31:36 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.37 2015/08/30 13:02:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.38 2015/12/22 14:31:36 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1425,6 +1425,7 @@ dwc2_device_start(usbd_xfer_handle xfer)
 	return USBD_IN_PROGRESS;
 
 fail2:
+	callout_stop(>timeout_handle);
 	dwc2_urb->priv = NULL;
 	mutex_spin_exit(>lock);
 	pool_cache_put(sc->sc_qtdpool, qtd);



Re: CVS commit: src/external/cddl/osnet/sys/sys

2015-12-22 Thread Alistair Crooks
Nice catch!

Perhaps an entry in src/doc/HACKS would be appropriate?

Thanks,
Al

On 21 December 2015 at 05:28, Joerg Sonnenberger  wrote:
> Module Name:src
> Committed By:   joerg
> Date:   Mon Dec 21 13:28:39 UTC 2015
>
> Modified Files:
> src/external/cddl/osnet/sys/sys: time.h
>
> Log Message:
> Our time.h defines clock_gettime with assembler name after including
> sys/time.h. The Solaris compat code in sys/time.h wants to use it in an
> inline function, but misses a prototype (and the relabeling). As stopgap
> for getting consistent defines of clock_gettime duplicate the prototype
> here.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/sys/sys/time.h
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>


CVS commit: src/tests/lib/libc/gen

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 14:25:58 UTC 2015

Modified Files:
src/tests/lib/libc/gen: Makefile t_siginfo.c

Log Message:
Add __TEST_FENV


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libc/gen/t_siginfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.48 src/tests/lib/libc/gen/Makefile:1.49
--- src/tests/lib/libc/gen/Makefile:1.48	Tue Dec 22 09:18:35 2015
+++ src/tests/lib/libc/gen/Makefile	Tue Dec 22 09:25:58 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.48 2015/12/22 14:18:35 christos Exp $
+# $NetBSD: Makefile,v 1.49 2015/12/22 14:25:58 christos Exp $
 
 .include 
 
@@ -39,6 +39,8 @@ TESTS_C+=	t_time
 TESTS_C+=	t_ttyname
 TESTS_C+=	t_vis
 
+CPPFLAGS.t_siginfo.c+=-D__TEST_FENV
+
 LDADD.t_siginfo+=	-lm
 DPADD.t_siginfo+=	${LIBM}
 LDADD.t_fpclassify+=	-lm

Index: src/tests/lib/libc/gen/t_siginfo.c
diff -u src/tests/lib/libc/gen/t_siginfo.c:1.29 src/tests/lib/libc/gen/t_siginfo.c:1.30
--- src/tests/lib/libc/gen/t_siginfo.c:1.29	Tue Feb 17 04:47:08 2015
+++ src/tests/lib/libc/gen/t_siginfo.c	Tue Dec 22 09:25:58 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: t_siginfo.c,v 1.29 2015/02/17 09:47:08 isaki Exp $ */
+/* $NetBSD: t_siginfo.c,v 1.30 2015/12/22 14:25:58 christos Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -44,8 +44,8 @@
 #include 
 #include 
 
-#ifdef HAVE_FENV
 #include 
+#ifdef __HAVE_FENV
 #include 	/* only need for ARM Cortex/Neon hack */
 #elif defined(_FLOAT_IEEE754)
 #include 
@@ -325,7 +325,7 @@ ATF_TC_BODY(sigfpe_flt, tc)
 		sa.sa_sigaction = sigfpe_flt_action;
 		sigemptyset(_mask);
 		sigaction(SIGFPE, , NULL);
-#ifdef HAVE_FENV
+#ifdef __HAVE_FENV
 		feenableexcept(FE_ALL_EXCEPT);
 #elif defined(_FLOAT_IEEE754)
 		fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP);
@@ -376,7 +376,7 @@ ATF_TC_BODY(sigfpe_int, tc)
 		sa.sa_sigaction = sigfpe_int_action;
 		sigemptyset(_mask);
 		sigaction(SIGFPE, , NULL);
-#ifdef HAVE_FENV
+#ifdef __HAVE_FENV
 		feenableexcept(FE_ALL_EXCEPT);
 #elif defined(_FLOAT_IEEE754)
 		fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP);



CVS commit: src/sys/external/bsd/dwc2/dist

2015-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 22 14:29:28 UTC 2015

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcd.c

Log Message:
Report an error when return -ENODEV for the unsupported setup.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/external/bsd/dwc2/dist/dwc2_hcd.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/external/bsd/dwc2/dist/dwc2_hcd.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.16 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.17
--- src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.16	Sun Aug 30 12:59:59 2015
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcd.c	Tue Dec 22 14:29:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcd.c,v 1.16 2015/08/30 12:59:59 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcd.c,v 1.17 2015/12/22 14:29:28 skrll Exp $	*/
 
 /*
  * hcd.c - DesignWare HS OTG Controller host-mode routines
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.16 2015/08/30 12:59:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.17 2015/12/22 14:29:28 skrll Exp $");
 
 #include 
 #include 
@@ -396,8 +396,11 @@ int dwc2_hcd_urb_enqueue(struct dwc2_hso
 		u32 hprt0 = DWC2_READ_4(hsotg, HPRT0);
 		u32 prtspd = (hprt0 & HPRT0_SPD_MASK) >> HPRT0_SPD_SHIFT;
 
-		if (prtspd == HPRT0_SPD_FULL_SPEED)
+		if (prtspd == HPRT0_SPD_FULL_SPEED) {
+			dev_err(hsotg->dev,
+"DWC OTG HCD URB Enqueue unsupported\n");
 			return -ENODEV;
+		}
 	}
 
 	if (!qtd)