CVS commit: src

2019-12-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Dec 23 06:45:38 UTC 2019

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/man: mi
src/etc: MAKEDEV.tmpl
src/etc/mtree: NetBSD.dist.base
src/share/man/man4: Makefile
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL
src/sys/conf: files majors
src/sys/dev: Makefile
src/sys/modules: Makefile
src/usr.sbin/makemandb: nostem.txt
Added Files:
src/share/man/man4: filemon.4
src/sys/dev/filemon: Makefile filemon.c filemon.h filemon_wrapper.c
mknod-sh
src/sys/modules/filemon: Makefile filemon.ioconf

Log Message:
Revert the removal of filemon.


To generate a diff of this commit:
cvs rdiff -u -r1.1223 -r1.1224 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2298 -r1.2299 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1666 -r1.1667 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.211 -r1.212 src/etc/MAKEDEV.tmpl
cvs rdiff -u -r1.207 -r1.208 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.691 -r1.692 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.21 src/share/man/man4/filemon.4
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.477 -r1.478 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1247 -r1.1248 src/sys/conf/files
cvs rdiff -u -r1.91 -r1.92 src/sys/conf/majors
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/Makefile
cvs rdiff -u -r0 -r1.3 src/sys/dev/filemon/Makefile \
src/sys/dev/filemon/mknod-sh
cvs rdiff -u -r0 -r1.33 src/sys/dev/filemon/filemon.c
cvs rdiff -u -r0 -r1.11 src/sys/dev/filemon/filemon.h
cvs rdiff -u -r0 -r1.14 src/sys/dev/filemon/filemon_wrapper.c
cvs rdiff -u -r1.232 -r1.233 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.6 src/sys/modules/filemon/Makefile
cvs rdiff -u -r0 -r1.3 src/sys/modules/filemon/filemon.ioconf
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makemandb/nostem.txt

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



CVS commit: src

2019-12-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Dec 23 06:45:38 UTC 2019

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/man: mi
src/etc: MAKEDEV.tmpl
src/etc/mtree: NetBSD.dist.base
src/share/man/man4: Makefile
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL
src/sys/conf: files majors
src/sys/dev: Makefile
src/sys/modules: Makefile
src/usr.sbin/makemandb: nostem.txt
Added Files:
src/share/man/man4: filemon.4
src/sys/dev/filemon: Makefile filemon.c filemon.h filemon_wrapper.c
mknod-sh
src/sys/modules/filemon: Makefile filemon.ioconf

Log Message:
Revert the removal of filemon.


To generate a diff of this commit:
cvs rdiff -u -r1.1223 -r1.1224 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2298 -r1.2299 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1666 -r1.1667 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.211 -r1.212 src/etc/MAKEDEV.tmpl
cvs rdiff -u -r1.207 -r1.208 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.691 -r1.692 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.21 src/share/man/man4/filemon.4
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.477 -r1.478 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1247 -r1.1248 src/sys/conf/files
cvs rdiff -u -r1.91 -r1.92 src/sys/conf/majors
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/Makefile
cvs rdiff -u -r0 -r1.3 src/sys/dev/filemon/Makefile \
src/sys/dev/filemon/mknod-sh
cvs rdiff -u -r0 -r1.33 src/sys/dev/filemon/filemon.c
cvs rdiff -u -r0 -r1.11 src/sys/dev/filemon/filemon.h
cvs rdiff -u -r0 -r1.14 src/sys/dev/filemon/filemon_wrapper.c
cvs rdiff -u -r1.232 -r1.233 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.6 src/sys/modules/filemon/Makefile
cvs rdiff -u -r0 -r1.3 src/sys/modules/filemon/filemon.ioconf
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makemandb/nostem.txt

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1223 src/distrib/sets/lists/base/mi:1.1224
--- src/distrib/sets/lists/base/mi:1.1223	Wed Dec 18 07:37:17 2019
+++ src/distrib/sets/lists/base/mi	Mon Dec 23 06:45:36 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1223 2019/12/18 07:37:17 maxv Exp $
+# $NetBSD: mi,v 1.1224 2019/12/23 06:45:36 maxv Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -1114,7 +1114,7 @@
 ./usr/include/dev/dmover			base-c-usr
 ./usr/include/dev/dtvbase-c-usr
 ./usr/include/dev/eisabase-obsolete		obsolete
-./usr/include/dev/filemon			base-obsolete		obsolete
+./usr/include/dev/filemon			base-c-usr
 ./usr/include/dev/hdaudio			base-c-usr
 ./usr/include/dev/hdmicec			base-c-usr
 ./usr/include/dev/hidbase-c-usr

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2298 src/distrib/sets/lists/comp/mi:1.2299
--- src/distrib/sets/lists/comp/mi:1.2298	Wed Dec 18 07:37:17 2019
+++ src/distrib/sets/lists/comp/mi	Mon Dec 23 06:45:36 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2298 2019/12/18 07:37:17 maxv Exp $
+#	$NetBSD: mi,v 1.2299 2019/12/23 06:45:36 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -411,7 +411,7 @@
 ./usr/include/dev/eisa/eisadevs_data.h		comp-obsolete		obsolete
 ./usr/include/dev/eisa/eisareg.h		comp-obsolete		obsolete
 ./usr/include/dev/eisa/eisavar.h		comp-obsolete		obsolete
-./usr/include/dev/filemon/filemon.h		comp-obsolete		obsolete
+./usr/include/dev/filemon/filemon.h		comp-c-include
 ./usr/include/dev/fssvar.h			comp-c-include
 ./usr/include/dev/hdaudio/hdaudioio.h		comp-c-include
 ./usr/include/dev/hdaudio/hdaudioreg.h		comp-c-include

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1666 src/distrib/sets/lists/man/mi:1.1667
--- src/distrib/sets/lists/man/mi:1.1666	Wed Dec 18 07:37:17 2019
+++ src/distrib/sets/lists/man/mi	Mon Dec 23 06:45:37 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1666 2019/12/18 07:37:17 maxv Exp $
+# $NetBSD: mi,v 1.1667 2019/12/23 06:45:37 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1104,7 +1104,7 @@
 ./usr/share/man/cat4/fast_ipsec.0		man-obsolete		obsolete
 ./usr/share/man/cat4/fd.0			man-sys-catman		.cat
 ./usr/share/man/cat4/fea.0			man-sys-catman		.cat
-./usr/share/man/cat4/filemon.0			man-obsolete		obsolete
+./usr/share/man/cat4/filemon.0			man-sys-catman		.cat
 ./usr/share/man/cat4/finsio.0			man-sys-catman		.cat
 ./usr/share/man/cat4/flash.0			man-sys-catman		.cat
 ./usr/share/man/cat4/fms.0			man-sys-catman		.cat
@@ -4288,7 +4288,7 @@
 ./usr/share/man/html4/fast_ipsec.html		man-obsolete		obsolete
 ./usr/share/man/html4/fd.html			man-sys-htmlman		html
 

Re: CVS commit: src

2019-12-22 Thread Taylor R Campbell
> Date: Sun, 22 Dec 2019 10:24:01 +0100
> From: Maxime Villard 
> 
> You, Martin Christos and Taylor, are trying to change subject, find
> excuses, and are sending me irrelevant responses vaguely insinuating that
> I should revert my change only without addressing the additional concerns
> expressed repeatedly. I fail to see whether I should take these as official
> core answers.
> 
> If they are, please clearly say so.

Please revert your filemon deletion and leave the existing mitigation
in place for the moment pending discussion.  We can address the
additional concerns afterward.

Thanks,
-Riastradh, on behalf of core


CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:57:32 UTC 2019

Modified Files:
src/sys/dev/i2c: axppmic.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/i2c/axppmic.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/i2c/axppmic.c
diff -u src/sys/dev/i2c/axppmic.c:1.26 src/sys/dev/i2c/axppmic.c:1.27
--- src/sys/dev/i2c/axppmic.c:1.26	Tue Oct  1 23:32:52 2019
+++ src/sys/dev/i2c/axppmic.c	Mon Dec 23 02:57:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: axppmic.c,v 1.26 2019/10/01 23:32:52 jmcneill Exp $ */
+/* $NetBSD: axppmic.c,v 1.27 2019/12/23 02:57:32 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014-2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.26 2019/10/01 23:32:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.27 2019/12/23 02:57:32 thorpej Exp $");
 
 #include 
 #include 
@@ -779,12 +779,12 @@ axppmic_attach_battery(struct axppmic_so
 	envsys_data_t *e;
 	uint8_t val;
 
-	iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+	iic_acquire_bus(sc->sc_i2c, 0);
 	if (axppmic_read(sc->sc_i2c, sc->sc_addr, AXP_BATT_CAP_WARN_REG, , I2C_F_POLL) == 0) {
 		sc->sc_warn_thres = __SHIFTOUT(val, AXP_BATT_CAP_WARN_LV1) + 5;
 		sc->sc_shut_thres = __SHIFTOUT(val, AXP_BATT_CAP_WARN_LV2);
 	}
-	iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+	iic_release_bus(sc->sc_i2c, 0);
 
 	e = >sc_sensor[AXP_SENSOR_BATT_PRESENT];
 	e->private = AXP_SENSOR_BATT_PRESENT;
@@ -928,15 +928,15 @@ axppmic_attach(device_t parent, device_t
 		const bool master_mode = of_hasprop(sc->sc_phandle, "x-powers,self-working-mode") ||
 		of_hasprop(sc->sc_phandle, "x-powers,master-mode");
 
-		iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+		iic_acquire_bus(sc->sc_i2c, 0);
 		axppmic_write(sc->sc_i2c, sc->sc_addr, AXP_ADDR_EXT_REG,
-		master_mode ? AXP_ADDR_EXT_MASTER : AXP_ADDR_EXT_SLAVE, I2C_F_POLL);
-		iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+		master_mode ? AXP_ADDR_EXT_MASTER : AXP_ADDR_EXT_SLAVE, 0);
+		iic_release_bus(sc->sc_i2c, 0);
 	}
 
-	iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
-	error = axppmic_read(sc->sc_i2c, sc->sc_addr, AXP_CHIP_ID_REG, , I2C_F_POLL);
-	iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+	iic_acquire_bus(sc->sc_i2c, 0);
+	error = axppmic_read(sc->sc_i2c, sc->sc_addr, AXP_CHIP_ID_REG, , 0);
+	iic_release_bus(sc->sc_i2c, 0);
 	if (error != 0) {
 		aprint_error_dev(self, "couldn't read chipid\n");
 		return;
@@ -948,7 +948,7 @@ axppmic_attach(device_t parent, device_t
 	sysmon_pswitch_register(>sc_smpsw);
 
 	if (c->irq_regs > 0) {
-		iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+		iic_acquire_bus(sc->sc_i2c, 0);
 		for (i = 1; i <= c->irq_regs; i++) {
 			irq_mask = 0;
 			if (i == c->poklirq.reg)
@@ -963,9 +963,9 @@ axppmic_attach(device_t parent, device_t
 irq_mask |= c->chargeirq.mask;
 			if (i == c->chargestirq.reg)
 irq_mask |= c->chargestirq.mask;
-			axppmic_write(sc->sc_i2c, sc->sc_addr, AXP_IRQ_ENABLE_REG(i), irq_mask, I2C_F_POLL);
+			axppmic_write(sc->sc_i2c, sc->sc_addr, AXP_IRQ_ENABLE_REG(i), irq_mask, 0);
 		}
-		iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+		iic_release_bus(sc->sc_i2c, 0);
 
 		ih = fdtbus_intr_establish(sc->sc_phandle, 0, IPL_VM, FDT_INTR_MPSAFE,
 		axppmic_intr, sc);



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:57:32 UTC 2019

Modified Files:
src/sys/dev/i2c: axppmic.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/i2c/axppmic.c

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



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:50:50 UTC 2019

Modified Files:
src/sys/dev/i2c: axp20x.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/i2c/axp20x.c

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



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:50:50 UTC 2019

Modified Files:
src/sys/dev/i2c: axp20x.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/i2c/axp20x.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/i2c/axp20x.c
diff -u src/sys/dev/i2c/axp20x.c:1.13 src/sys/dev/i2c/axp20x.c:1.14
--- src/sys/dev/i2c/axp20x.c:1.13	Tue Jun 26 06:03:57 2018
+++ src/sys/dev/i2c/axp20x.c	Mon Dec 23 02:50:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: axp20x.c,v 1.13 2018/06/26 06:03:57 thorpej Exp $ */
+/* $NetBSD: axp20x.c,v 1.14 2019/12/23 02:50:50 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: axp20x.c,v 1.13 2018/06/26 06:03:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: axp20x.c,v 1.14 2019/12/23 02:50:50 thorpej Exp $");
 
 #include 
 #include 
@@ -248,13 +248,13 @@ axp20x_attach(device_t parent, device_t 
 	sc->sc_phandle = ia->ia_cookie;
 
 	error = axp20x_read(sc, AXP_INPUT_STATUS,
-	>sc_inputstatus, 1, I2C_F_POLL);
+	>sc_inputstatus, 1, 0);
 	if (error) {
 		aprint_error(": can't read status: %d\n", error);
 		return;
 	}
 	error = axp20x_read(sc, AXP_POWER_MODE,
-	>sc_powermode, 1, I2C_F_POLL);
+	>sc_powermode, 1, 0);
 	if (error) {
 		aprint_error(": can't read power mode: %d\n", error);
 		return;
@@ -262,18 +262,18 @@ axp20x_attach(device_t parent, device_t 
 	value = AXP_ADC_EN1_ACV | AXP_ADC_EN1_ACI | AXP_ADC_EN1_VBUSV | AXP_ADC_EN1_VBUSI | AXP_ADC_EN1_APSV | AXP_ADC_EN1_TS;
 	if (sc->sc_powermode & AXP_POWER_MODE_BATTOK)
 		value |= AXP_ADC_EN1_BATTV | AXP_ADC_EN1_BATTI;
-	error = axp20x_write(sc, AXP_ADC_EN1, , 1, I2C_F_POLL);
+	error = axp20x_write(sc, AXP_ADC_EN1, , 1, 0);
 	if (error) {
 		aprint_error(": can't set AXP_ADC_EN1\n");
 		return;
 	}
-	error = axp20x_read(sc, AXP_ADC_EN2, , 1, I2C_F_POLL);
+	error = axp20x_read(sc, AXP_ADC_EN2, , 1, 0);
 	if (error) {
 		aprint_error(": can't read AXP_ADC_EN2\n");
 		return;
 	}
 	value |= AXP_ADC_EN2_TEMP;
-	error = axp20x_write(sc, AXP_ADC_EN2, , 1, I2C_F_POLL);
+	error = axp20x_write(sc, AXP_ADC_EN2, , 1, 0);
 	if (error) {
 		aprint_error(": can't set AXP_ADC_EN2\n");
 		return;
@@ -381,22 +381,22 @@ axp20x_attach(device_t parent, device_t 
 
 	sysmon_envsys_register(sc->sc_sme);
 
-	if (axp20x_read(sc, AXP_DCDC2, , 1, I2C_F_POLL) == 0) {
+	if (axp20x_read(sc, AXP_DCDC2, , 1, 0) == 0) {
 		aprint_verbose_dev(sc->sc_dev, "DCDC2 %dmV\n",
 		(int)(700 + (value & AXP_DCDC2_VOLT_MASK) * 25));
 	}
-	if (axp20x_read(sc, AXP_DCDC3, , 1, I2C_F_POLL) == 0) {
+	if (axp20x_read(sc, AXP_DCDC3, , 1, 0) == 0) {
 		aprint_verbose_dev(sc->sc_dev, "DCDC3 %dmV\n",
 		(int)(700 + (value & AXP_DCDC3_VOLT_MASK) * 25));
 	}
-	if (axp20x_read(sc, AXP_LDO2_4, , 1, I2C_F_POLL) == 0) {
+	if (axp20x_read(sc, AXP_LDO2_4, , 1, 0) == 0) {
 		aprint_verbose_dev(sc->sc_dev, "LDO2 %dmV, LDO4 %dmV\n",
 		(int)(1800 +
 		((value & AXP_LDO2_VOLT_MASK) >> AXP_LDO2_VOLT_SHIFT) * 100
 		),
 		ldo4_mvV[(value & AXP_LDO4_VOLT_MASK) >> AXP_LDO4_VOLT_SHIFT]);
 	}
-	if (axp20x_read(sc, AXP_LDO3, , 1, I2C_F_POLL) == 0) {
+	if (axp20x_read(sc, AXP_LDO3, , 1, 0) == 0) {
 		if (value & AXP_LDO3_TRACK) {
 			aprint_verbose_dev(sc->sc_dev, "LDO3: tracking\n");
 		} else {
@@ -405,7 +405,7 @@ axp20x_attach(device_t parent, device_t 
 		}
 	}
 
-	if (axp20x_read(sc, AXP_BKUP_CTRL, , 1, I2C_F_POLL) == 0) {
+	if (axp20x_read(sc, AXP_BKUP_CTRL, , 1, 0) == 0) {
 		if (value & AXP_BKUP_CTRL_ENABLE) {
 			aprint_verbose_dev(sc->sc_dev,
 			"RTC supercap charger enabled: %dmV at %duA\n",



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:39:47 UTC 2019

Modified Files:
src/sys/dev/i2c: at24cxx.c

Log Message:
seeprom_bootstrap_read(): no need to hard-code I2C_F_POLL here because
the i2c code will ensure it's there if the system is cold.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/i2c/at24cxx.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/i2c/at24cxx.c
diff -u src/sys/dev/i2c/at24cxx.c:1.33 src/sys/dev/i2c/at24cxx.c:1.34
--- src/sys/dev/i2c/at24cxx.c:1.33	Fri Nov 29 04:59:15 2019
+++ src/sys/dev/i2c/at24cxx.c	Mon Dec 23 02:39:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: at24cxx.c,v 1.33 2019/11/29 04:59:15 hkenken Exp $	*/
+/*	$NetBSD: at24cxx.c,v 1.34 2019/12/23 02:39:47 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.33 2019/11/29 04:59:15 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.34 2019/12/23 02:39:47 thorpej Exp $");
 
 #include 
 #include 
@@ -416,7 +416,7 @@ seeprom_bootstrap_read(i2c_tag_t tag, in
 	/* We are very forgiving about devsize during bootstrap. */
 	cmdlen = (devsize >= 4096) ? 2 : 1;
 
-	if (iic_acquire_bus(tag, I2C_F_POLL) != 0)
+	if (iic_acquire_bus(tag, 0) != 0)
 		return (-1);
 
 	while (len) {
@@ -432,7 +432,7 @@ seeprom_bootstrap_read(i2c_tag_t tag, in
 		/* Read a single byte. */
 		if (iic_exec(tag, I2C_OP_READ_WITH_STOP, addr,
 			 cmdbuf, cmdlen, rvp, 1, I2C_F_POLL)) {
-			iic_release_bus(tag, I2C_F_POLL);
+			iic_release_bus(tag, 0);
 			return (-1);
 		}
 
@@ -441,6 +441,6 @@ seeprom_bootstrap_read(i2c_tag_t tag, in
 		offset++;
 	}
 
-	iic_release_bus(tag, I2C_F_POLL);
+	iic_release_bus(tag, 0);
 	return (0);
 }



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:39:47 UTC 2019

Modified Files:
src/sys/dev/i2c: at24cxx.c

Log Message:
seeprom_bootstrap_read(): no need to hard-code I2C_F_POLL here because
the i2c code will ensure it's there if the system is cold.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/i2c/at24cxx.c

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



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:35:18 UTC 2019

Modified Files:
src/sys/dev/i2c: as3722.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/as3722.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/i2c/as3722.c
diff -u src/sys/dev/i2c/as3722.c:1.16 src/sys/dev/i2c/as3722.c:1.17
--- src/sys/dev/i2c/as3722.c:1.16	Sat Jul 27 16:02:27 2019
+++ src/sys/dev/i2c/as3722.c	Mon Dec 23 02:35:18 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: as3722.c,v 1.16 2019/07/27 16:02:27 thorpej Exp $ */
+/* $NetBSD: as3722.c,v 1.17 2019/12/23 02:35:18 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.16 2019/07/27 16:02:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.17 2019/12/23 02:35:18 thorpej Exp $");
 
 #include 
 #include 
@@ -240,11 +240,11 @@ as3722_match(device_t parent, cfdata_t m
 	if (ia->ia_addr != AS3722_I2C_ADDR)
 		return 0;
 	
-	iic_acquire_bus(ia->ia_tag, I2C_F_POLL);
+	iic_acquire_bus(ia->ia_tag, 0);
 	reg = AS3722_ASIC_ID1_REG;
 	error = iic_exec(ia->ia_tag, I2C_OP_READ_WITH_STOP, ia->ia_addr,
-	, 1, , 1, I2C_F_POLL);
-	iic_release_bus(ia->ia_tag, I2C_F_POLL);
+	, 1, , 1, 0);
+	iic_release_bus(ia->ia_tag, 0);
 
 	if (error == 0 && id1 == 0x0c)
 		return I2C_MATCH_ADDRESS_AND_PROBE;
@@ -281,16 +281,16 @@ as3722_wdt_attach(struct as3722_softc *s
 {
 	int error;
 
-	iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+	iic_acquire_bus(sc->sc_i2c, 0);
 	error = as3722_write(sc, AS3722_GPIO0_CTRL_REG,
 	__SHIFTIN(AS3722_GPIO0_CTRL_IOSF_GPIO,
 		  AS3722_GPIO0_CTRL_IOSF) |
 	__SHIFTIN(AS3722_GPIO0_CTRL_MODE_PULLDOWN,
 		  AS3722_GPIO0_CTRL_MODE),
-	I2C_F_POLL);
+	0);
 	error += as3722_set_clear(sc, AS3722_WATCHDOG_CTRL_REG,
-	__SHIFTIN(1, AS3722_WATCHDOG_CTRL_MODE), 0, I2C_F_POLL);
-	iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+	__SHIFTIN(1, AS3722_WATCHDOG_CTRL_MODE), 0, 0);
+	iic_release_bus(sc->sc_i2c, 0);
 
 	if (error) {
 		aprint_error_dev(sc->sc_dev, "couldn't setup watchdog\n");
@@ -315,10 +315,10 @@ as3722_rtc_attach(struct as3722_softc *s
 {
 	int error;
 
-	iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+	iic_acquire_bus(sc->sc_i2c, 0);
 	error = as3722_set_clear(sc, AS3722_RTC_CONTROL_REG,
-	AS3722_RTC_CONTROL_RTC_ON, 0, I2C_F_POLL);
-	iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+	AS3722_RTC_CONTROL_RTC_ON, 0, 0);
+	iic_release_bus(sc->sc_i2c, 0);
 
 	if (error) {
 		aprint_error_dev(sc->sc_dev, "couldn't setup RTC\n");



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:35:18 UTC 2019

Modified Files:
src/sys/dev/i2c: as3722.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/as3722.c

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



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:25:28 UTC 2019

Modified Files:
src/sys/dev/i2c: adm1026.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/adm1026.c

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



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:25:28 UTC 2019

Modified Files:
src/sys/dev/i2c: adm1026.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/adm1026.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/i2c/adm1026.c
diff -u src/sys/dev/i2c/adm1026.c:1.6 src/sys/dev/i2c/adm1026.c:1.7
--- src/sys/dev/i2c/adm1026.c:1.6	Wed Dec 11 21:00:11 2019
+++ src/sys/dev/i2c/adm1026.c	Mon Dec 23 02:25:28 2019
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adm1026.c,v 1.6 2019/12/11 21:00:11 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adm1026.c,v 1.7 2019/12/23 02:25:28 thorpej Exp $");
 
 #include 
 #include 
@@ -87,7 +87,6 @@ struct adm1026_softc {
 	device_t sc_dev;
 	i2c_tag_t sc_tag;
 	int sc_address;
-	int sc_iic_flags;
 	bool sc_multi_read;
 
 	uint8_t sc_rev, sc_cfg[2];
@@ -136,7 +135,6 @@ adm1026_match(device_t parent, cfdata_t 
 
 	sc.sc_tag = ia->ia_tag;
 	sc.sc_address = ia->ia_addr;
-	sc.sc_iic_flags = 0;
 
 	if (iic_use_direct_match(ia, cf, compat_data, _result))
 		return match_result;
@@ -183,7 +181,6 @@ adm1026_attach(device_t parent, device_t
 	sc->sc_tag = ia->ia_tag;
 	sc->sc_address = ia->ia_addr;
 	sc->sc_dev = self;
-	sc->sc_iic_flags = I2C_F_POLL;	/* Use polling during autoconf */
 
 	sc->sc_multi_read = false;
 	prop_dictionary_get_bool(props, "multi_read", >sc_multi_read);
@@ -239,8 +236,6 @@ adm1026_attach(device_t parent, device_t
 	if (!pmf_device_register(self, adm1026_pmf_suspend, adm1026_pmf_resume))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
-	sc->sc_iic_flags = 0;	/* Drop polling flag */
-
 	return;
 }
 
@@ -493,7 +488,7 @@ adm1026_read_reg(struct adm1026_softc *s
 	int i, j, err = 0;
 	uint8_t creg, cval, tmp[ADM1026_READ_RETRIES + 1];
 
-	if ((err = iic_acquire_bus(sc->sc_tag, sc->sc_iic_flags)) != 0)
+	if ((err = iic_acquire_bus(sc->sc_tag, 0)) != 0)
 		return err;
 	/* Standard ADM1026 */
 	if (sc->sc_multi_read == false) {
@@ -512,7 +507,7 @@ adm1026_read_reg(struct adm1026_softc *s
 			creg = ADM1026_CONF1;
 		if ((err = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,
 		sc->sc_address, , 1, [0], 1, 0)) != 0) {
-			iic_release_bus(sc->sc_tag, sc->sc_iic_flags);
+			iic_release_bus(sc->sc_tag, 0);
 			return err;
 		}
 		for (i = 1; i <= ADM1026_READ_RETRIES; i++) {
@@ -522,8 +517,7 @@ adm1026_read_reg(struct adm1026_softc *s
 			for (j = 0; j < i; j++)
 if (abs(tmp[j] - tmp[i]) < 3) {
 	*val = tmp[i];
-	iic_release_bus(sc->sc_tag,
-	sc->sc_iic_flags);
+	iic_release_bus(sc->sc_tag, 0);
 	return 0;
 }
 			if ((err = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,
@@ -532,7 +526,7 @@ adm1026_read_reg(struct adm1026_softc *s
 			err = -1;	/* Return error if we don't match. */
 		}
 	}
-	iic_release_bus(sc->sc_tag, sc->sc_iic_flags);
+	iic_release_bus(sc->sc_tag, 0);
 	return err;
 }
 
@@ -541,10 +535,10 @@ adm1026_write_reg(struct adm1026_softc *
 {
 	int err = 0;
 
-	if ((err = iic_acquire_bus(sc->sc_tag, sc->sc_iic_flags)) != 0)
+	if ((err = iic_acquire_bus(sc->sc_tag, 0)) != 0)
 		return err;
 	err = iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP, sc->sc_address,
 	, 1, , 1, 0);
-	iic_release_bus(sc->sc_tag, sc->sc_iic_flags);
+	iic_release_bus(sc->sc_tag, 0);
 	return err;
 }



CVS commit: src/sys/arch/mips/ingenic

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:16:43 UTC 2019

Modified Files:
src/sys/arch/mips/ingenic: jziic.c

Log Message:
No need to check cold ourselves; iic_exec() does it for us.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/ingenic/jziic.c

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



CVS commit: src/sys/arch/mips/ingenic

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 02:16:43 UTC 2019

Modified Files:
src/sys/arch/mips/ingenic: jziic.c

Log Message:
No need to check cold ourselves; iic_exec() does it for us.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/ingenic/jziic.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/mips/ingenic/jziic.c
diff -u src/sys/arch/mips/ingenic/jziic.c:1.6 src/sys/arch/mips/ingenic/jziic.c:1.7
--- src/sys/arch/mips/ingenic/jziic.c:1.6	Sun Dec 22 23:23:31 2019
+++ src/sys/arch/mips/ingenic/jziic.c	Mon Dec 23 02:16:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: jziic.c,v 1.6 2019/12/22 23:23:31 thorpej Exp $ */
+/*	$NetBSD: jziic.c,v 1.7 2019/12/23 02:16:43 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: jziic.c,v 1.6 2019/12/22 23:23:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jziic.c,v 1.7 2019/12/23 02:16:43 thorpej Exp $");
 
 /*
  * a preliminary driver for JZ4780's on-chip SMBus controllers
@@ -266,7 +266,7 @@ jziic_i2c_exec(void *cookie, i2c_op_t op
 {
 	struct jziic_softc *sc = cookie;
 
-	if (cold || (flags & I2C_F_POLL)) {
+	if (flags & I2C_F_POLL) {
 		return jziic_i2c_exec_poll(sc, op, addr, vcmd, cmdlen, vbuf,
 		buflen, flags);
 	} else {



CVS commit: src/lib/libc/sys

2019-12-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Dec 23 01:46:09 UTC 2019

Modified Files:
src/lib/libc/sys: kqueue.2

Log Message:
Explain in kevent(2) the semantics of EINTR

All changes contained in the changelist are applied before returning this
error.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libc/sys/kqueue.2

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.49 src/lib/libc/sys/kqueue.2:1.50
--- src/lib/libc/sys/kqueue.2:1.49	Sun Dec 22 17:01:15 2019
+++ src/lib/libc/sys/kqueue.2	Mon Dec 23 01:46:09 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.49 2019/12/22 17:01:15 kamil Exp $
+.\"	$NetBSD: kqueue.2,v 1.50 2019/12/23 01:46:09 kamil Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -621,6 +621,9 @@ structure.
 .It Bq Er EINTR
 A signal was delivered before the timeout expired and before any
 events were placed on the kqueue for return.
+All changes contained in the
+.Fa changelist
+are applied before returning this error.
 .It Bq Er EINVAL
 The specified time limit or filter is invalid.
 .It Bq Er ENOENT



CVS commit: src/lib/libc/sys

2019-12-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Dec 23 01:46:09 UTC 2019

Modified Files:
src/lib/libc/sys: kqueue.2

Log Message:
Explain in kevent(2) the semantics of EINTR

All changes contained in the changelist are applied before returning this
error.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libc/sys/kqueue.2

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



Re: CVS commit: src/sys/sys

2019-12-22 Thread Kamil Rytarowski
On 23.12.2019 01:54, Roy Marples wrote:
> On 22/12/2019 22:24, Andrew Doran wrote:
>> NetBSD 9.99.29 - struct mount changed.
> 
> Just curious - does our build software cope with 3 digit for the last
> number?
> 
> Roy

At least from the __NetBSD_Version__ point of view there are 4 digits
unused, but it is more valuable to branch -10 earlier than going to
3-digit patchlevel.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/sys/sys

2019-12-22 Thread Alexander Nasonov
Roy Marples wrote:
> On 22/12/2019 22:24, Andrew Doran wrote:
> > NetBSD 9.99.29 - struct mount changed.
> 
> Just curious - does our build software cope with 3 digit for the last number?

https://twitter.com/needydev/status/1205585787095519234?s=20

-- 
Alex


Re: CVS commit: src/sys/sys

2019-12-22 Thread Roy Marples

On 22/12/2019 22:24, Andrew Doran wrote:

NetBSD 9.99.29 - struct mount changed.


Just curious - does our build software cope with 3 digit for the last number?

Roy


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

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 00:24:02 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_hdmi.c

Log Message:
When deciding to delay (rather than kpause), pay attention to
I2C_F_POLL, not 'cold'.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/sunxi/sunxi_hdmi.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/sunxi/sunxi_hdmi.c
diff -u src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.8 src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.9
--- src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.8	Sun Dec 22 23:23:30 2019
+++ src/sys/arch/arm/sunxi/sunxi_hdmi.c	Mon Dec 23 00:24:02 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_hdmi.c,v 1.8 2019/12/22 23:23:30 thorpej Exp $ */
+/* $NetBSD: sunxi_hdmi.c,v 1.9 2019/12/23 00:24:02 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c,v 1.8 2019/12/22 23:23:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c,v 1.9 2019/12/23 00:24:02 thorpej Exp $");
 
 #include 
 #include 
@@ -408,7 +408,7 @@ sunxi_hdmi_i2c_xfer_1_4(void *priv, i2c_
 		val = HDMI_READ(sc, SUNXI_A31_HDMI_DDC_CTRL_REG);
 		if ((val & SUNXI_A31_HDMI_DDC_CTRL_ACCESS_CMD_START) == 0)
 			break;
-		if (cold)
+		if (flags & I2C_F_POLL)
 			delay(1000);
 		else
 			kpause("hdmiddc", false, mstohz(10), >sc_exec_lock);



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

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 23 00:24:02 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_hdmi.c

Log Message:
When deciding to delay (rather than kpause), pay attention to
I2C_F_POLL, not 'cold'.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/sunxi/sunxi_hdmi.c

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



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

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 23:50:43 UTC 2019

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

Log Message:
Use a separate lock (not the i2c bus lock) to synchronize with the
interrupt handler.  Refactor the code slightly to make the lock use
consistent.

Also includes the changes for:

Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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.17 src/sys/arch/arm/samsung/exynos_i2c.c:1.18
--- src/sys/arch/arm/samsung/exynos_i2c.c:1.17	Fri Oct 18 06:13:38 2019
+++ src/sys/arch/arm/samsung/exynos_i2c.c	Sun Dec 22 23:50:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_i2c.c,v 1.17 2019/10/18 06:13:38 skrll Exp $ */
+/*	$NetBSD: exynos_i2c.c,v 1.18 2019/12/22 23:50:43 thorpej Exp $ */
 
 /*
  * Copyright (c) 2015 Jared D. McNeill 
@@ -31,7 +31,7 @@
 #include "opt_arm_debug.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.17 2019/10/18 06:13:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.18 2019/12/22 23:50:43 thorpej Exp $");
 
 #include 
 #include 
@@ -65,15 +65,12 @@ struct exynos_i2c_softc {
 	bool			sc_sda_is_output;
 
 	struct i2c_controller 	sc_ic;
-	kmutex_t		sc_lock;
-	kcondvar_t		sc_cv;
+	kmutex_t		sc_intr_lock;
+	kcondvar_t		sc_intr_wait;
 };
 
 static int	exynos_i2c_intr(void *);
 
-static int	exynos_i2c_acquire_bus(void *, int);
-static void	exynos_i2c_release_bus(void *, int);
-
 static int	exynos_i2c_send_start(void *, int);
 static int	exynos_i2c_send_stop(void *, int);
 static int	exynos_i2c_initiate_xfer(void *, i2c_addr_t, int);
@@ -155,8 +152,8 @@ exynos_i2c_attach(device_t parent, devic
 		return;
 	}
 
-	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_VM);
-	cv_init(>sc_cv, device_xname(self));
+	mutex_init(>sc_intr_lock, MUTEX_DEFAULT, IPL_VM);
+	cv_init(>sc_intr_wait, device_xname(self));
 	aprint_normal(" @ 0x%08x\n", (uint)addr);
 
 	if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
@@ -173,9 +170,8 @@ exynos_i2c_attach(device_t parent, devic
 	}
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 	
+	iic_tag_init(>sc_ic);
 	sc->sc_ic.ic_cookie = sc;
-	sc->sc_ic.ic_acquire_bus = exynos_i2c_acquire_bus;
-	sc->sc_ic.ic_release_bus = exynos_i2c_release_bus;
 	sc->sc_ic.ic_send_start  = exynos_i2c_send_start;
 	sc->sc_ic.ic_send_stop   = exynos_i2c_send_stop;
 	sc->sc_ic.ic_initiate_xfer = exynos_i2c_initiate_xfer;
@@ -206,31 +202,14 @@ exynos_i2c_intr(void *priv)
 	istatus &= ~IRQPEND;
 	I2C_WRITE(sc, IICCON, istatus);
 
-	mutex_enter(>sc_lock);
-	cv_broadcast(>sc_cv);
-	mutex_exit(>sc_lock);
+	mutex_enter(>sc_intr_lock);
+	cv_broadcast(>sc_intr_wait);
+	mutex_exit(>sc_intr_lock);
 
 	return 1;
 }
 
 static int
-exynos_i2c_acquire_bus(void *cookie, int flags)
-{
-	struct exynos_i2c_softc *i2c_sc = cookie;
-
-	mutex_enter(_sc->sc_lock);
-	return 0;
-}
-
-static void
-exynos_i2c_release_bus(void *cookie, int flags)
-{
-	struct exynos_i2c_softc *i2c_sc = cookie;
-
-	mutex_exit(_sc->sc_lock);
-}
-
-static int
 exynos_i2c_wait(struct exynos_i2c_softc *sc, int flags)
 {
 	int error, retry;
@@ -240,8 +219,9 @@ exynos_i2c_wait(struct exynos_i2c_softc 
 
 	while (--retry > 0) {
 		if ((flags & I2C_F_POLL) == 0) {
-			error = cv_timedwait_sig(>sc_cv, >sc_lock,
-			uimax(mstohz(10), 1));
+			error = cv_timedwait_sig(>sc_intr_wait,
+		 >sc_intr_lock,
+		 uimax(mstohz(10), 1));
 			if (error) {
 return error;
 			}
@@ -265,46 +245,90 @@ exynos_i2c_wait(struct exynos_i2c_softc 
 
 
 static int
-exynos_i2c_send_start(void *cookie, int flags)
+exynos_i2c_send_start_locked(struct exynos_i2c_softc *sc, int flags)
 {
-	struct exynos_i2c_softc *sc = cookie;
 	I2C_WRITE(sc, IICSTAT, 0xF0);
 	return 0;
 }
 
 static int
-exynos_i2c_send_stop(void *cookie, int flags)
+exynos_i2c_send_stop_locked(struct exynos_i2c_softc *sc, int flags)
 {
-	struct exynos_i2c_softc *sc = cookie;
 	I2C_WRITE(sc, IICSTAT, 0xD0);
 	return 0;
 }
 
 static int
+exynos_i2c_write_byte_locked(struct exynos_i2c_softc *sc, uint8_t byte,
+int flags)
+{
+	int error = exynos_i2c_wait(sc, flags);
+	if (error) {
+		return error;
+	}
+	I2C_WRITE(sc, IICDS, byte);
+	return 0;
+}
+
+static int
+exynos_i2c_send_start(void *cookie, int flags)
+{
+	struct exynos_i2c_softc *sc = cookie;
+
+	

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

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 23:50:43 UTC 2019

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

Log Message:
Use a separate lock (not the i2c bus lock) to synchronize with the
interrupt handler.  Refactor the code slightly to make the lock use
consistent.

Also includes the changes for:

Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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.



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

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 23:40:49 UTC 2019

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

Log Message:
Use a separate lock (not the i2c bus lock) to synchronize with the
interrupt handler.  This in all liklihood fixes a deadlock bug that
necessitated forcing I2C_F_POLL in tegra_i2c_exec() (someone who has
the hardware should test removing that line).

Also includes the changes for:

Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/nvidia/tegra_i2c.c

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



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

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 23:40:49 UTC 2019

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

Log Message:
Use a separate lock (not the i2c bus lock) to synchronize with the
interrupt handler.  This in all liklihood fixes a deadlock bug that
necessitated forcing I2C_F_POLL in tegra_i2c_exec() (someone who has
the hardware should test removing that line).

Also includes the changes for:

Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/nvidia/tegra_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/nvidia/tegra_i2c.c
diff -u src/sys/arch/arm/nvidia/tegra_i2c.c:1.22 src/sys/arch/arm/nvidia/tegra_i2c.c:1.23
--- src/sys/arch/arm/nvidia/tegra_i2c.c:1.22	Tue Sep 25 22:23:22 2018
+++ src/sys/arch/arm/nvidia/tegra_i2c.c	Sun Dec 22 23:40:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_i2c.c,v 1.22 2018/09/25 22:23:22 jmcneill Exp $ */
+/* $NetBSD: tegra_i2c.c,v 1.23 2019/12/22 23:40:49 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.22 2018/09/25 22:23:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.23 2019/12/22 23:40:49 thorpej Exp $");
 
 #include 
 #include 
@@ -63,15 +63,13 @@ struct tegra_i2c_softc {
 	u_int			sc_cid;
 
 	struct i2c_controller	sc_ic;
-	kmutex_t		sc_lock;
-	kcondvar_t		sc_cv;
+	kmutex_t		sc_intr_lock;
+	kcondvar_t		sc_intr_wait;
 };
 
 static void	tegra_i2c_init(struct tegra_i2c_softc *);
 static int	tegra_i2c_intr(void *);
 
-static int	tegra_i2c_acquire_bus(void *, int);
-static void	tegra_i2c_release_bus(void *, int);
 static int	tegra_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *,
 			   size_t, void *, size_t, int);
 
@@ -140,8 +138,8 @@ tegra_i2c_attach(device_t parent, device
 		addr, error);
 		return;
 	}
-	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_VM);
-	cv_init(>sc_cv, device_xname(self));
+	mutex_init(>sc_intr_lock, MUTEX_DEFAULT, IPL_VM);
+	cv_init(>sc_intr_wait, device_xname(self));
 
 	aprint_naive("\n");
 	aprint_normal(": I2C\n");
@@ -177,11 +175,12 @@ tegra_i2c_attach(device_t parent, device
 	}
 	fdtbus_reset_deassert(sc->sc_rst);
 
+	mutex_enter(>sc_intr_lock);
 	tegra_i2c_init(sc);
+	mutex_exit(>sc_intr_lock);
 
+	iic_tag_init(>sc_ic);
 	sc->sc_ic.ic_cookie = sc;
-	sc->sc_ic.ic_acquire_bus = tegra_i2c_acquire_bus;
-	sc->sc_ic.ic_release_bus = tegra_i2c_release_bus;
 	sc->sc_ic.ic_exec = tegra_i2c_exec;
 
 	fdtbus_register_i2c_controller(self, phandle, _i2c_funcs);
@@ -236,48 +235,34 @@ tegra_i2c_intr(void *priv)
 		return 0;
 	I2C_WRITE(sc, I2C_INTERRUPT_STATUS_REG, istatus);
 
-	mutex_enter(>sc_lock);
-	cv_broadcast(>sc_cv);
-	mutex_exit(>sc_lock);
+	mutex_enter(>sc_intr_lock);
+	cv_broadcast(>sc_intr_wait);
+	mutex_exit(>sc_intr_lock);
 
 	return 1;
 }
 
 static int
-tegra_i2c_acquire_bus(void *priv, int flags)
-{
-	struct tegra_i2c_softc * const sc = priv;
-
-	mutex_enter(>sc_lock);
-
-	return 0;
-}
-
-static void
-tegra_i2c_release_bus(void *priv, int flags)
-{
-	struct tegra_i2c_softc * const sc = priv;
-
-	mutex_exit(>sc_lock);
-}
-
-static int
 tegra_i2c_exec(void *priv, i2c_op_t op, i2c_addr_t addr, const void *cmdbuf,
 size_t cmdlen, void *buf, size_t buflen, int flags)
 {
 	struct tegra_i2c_softc * const sc = priv;
 	int retry, error;
 
-#if notyet
-	if (cold)
-#endif
-		flags |= I2C_F_POLL;
-
-	KASSERT(mutex_owned(>sc_lock));
+	/*
+	 * XXXJRT This is probably no longer necessary?  Before these
+	 * changes, the bus lock was also used for the interrupt handler,
+	 * and there would be a deadlock when the interrupt handler tried to
+	 * acquire it again.  The bus lock is now owned by the mid-layer and
+	 * we have our own interrupt lock.
+	 */
+	flags |= I2C_F_POLL;
 
 	if (buflen == 0 && cmdlen == 0)
 		return EINVAL;
 
+	mutex_enter(>sc_intr_lock);
+
 	if ((flags & I2C_F_POLL) == 0) {
 		I2C_WRITE(sc, I2C_INTERRUPT_MASK_REG,
 		I2C_INTERRUPT_MASK_NOACK | I2C_INTERRUPT_MASK_ARB_LOST |
@@ -296,6 +281,7 @@ tegra_i2c_exec(void *priv, i2c_op_t op, 
 		delay(1);
 	}
 	if (retry == 0) {
+		mutex_exit(>sc_intr_lock);
 		device_printf(sc->sc_dev, "timeout flushing FIFO\n");
 		return EIO;
 	}
@@ -325,6 +311,8 @@ done:
 		tegra_i2c_init(sc);
 	}
 
+	mutex_exit(>sc_intr_lock);
+
 	return error;
 }
 
@@ -338,8 +326,9 @@ tegra_i2c_wait(struct tegra_i2c_softc *s
 
 	while (--retry 

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

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 23:24:56 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c

Log Message:
Rewrite the bcm2835 i2c driver as an interrupt-driven state machine.  This
improves general system responsiveness when tranferring large amounts of
data on a single-core Pi board.  This also includes:

Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/broadcom/bcm2835_bsc.c

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



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

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 23:24:56 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c

Log Message:
Rewrite the bcm2835 i2c driver as an interrupt-driven state machine.  This
improves general system responsiveness when tranferring large amounts of
data on a single-core Pi board.  This also includes:

Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/broadcom/bcm2835_bsc.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/broadcom/bcm2835_bsc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.13 src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.14
--- src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.13	Sun Jul  1 21:23:16 2018
+++ src/sys/arch/arm/broadcom/bcm2835_bsc.c	Sun Dec 22 23:24:56 2019
@@ -1,6 +1,7 @@
-/*	$NetBSD: bcm2835_bsc.c,v 1.13 2018/07/01 21:23:16 jmcneill Exp $	*/
+/*	$NetBSD: bcm2835_bsc.c,v 1.14 2019/12/22 23:24:56 thorpej Exp $	*/
 
 /*
+ * Copyright (c) 2019 Jason R. Thorpe
  * Copyright (c) 2012 Jonathan A. Kollasch
  * All rights reserved.
  *
@@ -27,11 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.13 2018/07/01 21:23:16 jmcneill Exp $");
-
-#if defined(_KERNEL_OPT)
-#include "opt_kernhist.h"
-#endif
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.14 2019/12/22 23:24:56 thorpej Exp $");
 
 #include 
 #include 
@@ -39,7 +36,6 @@ __KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -49,42 +45,118 @@ __KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.
 
 #include 
 
-KERNHIST_DEFINE(bsciichist);
+typedef enum {
+	BSC_EXEC_STATE_IDLE		= 0,
+	BSC_EXEC_STATE_SEND_ADDR	= 1,
+	BSC_EXEC_STATE_SEND_CMD		= 2,
+	BSC_EXEC_STATE_SEND_DATA	= 3,
+	BSC_EXEC_STATE_RECV_DATA	= 4,
+	BSC_EXEC_STATE_DONE		= 5,
+	BSC_EXEC_STATE_ERROR		= 6,
+} bsc_exec_state_t;
+
+#define	BSC_EXEC_STATE_SENDING(sc)	\
+	((sc)->sc_exec_state >= BSC_EXEC_STATE_SEND_ADDR && \
+	 (sc)->sc_exec_state <= BSC_EXEC_STATE_SEND_DATA)
+
+#define	BSC_EXEC_STATE_RECEIVING(sc)	\
+	((sc)->sc_exec_state == BSC_EXEC_STATE_RECV_DATA)
 
 struct bsciic_softc {
 	device_t sc_dev;
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_ioh;
 	struct i2c_controller sc_i2c;
-	kmutex_t sc_buslock;
 	void *sc_inth;
 
 	struct clk *sc_clk;
 	u_int sc_frequency;
 	u_int sc_clkrate;
+
+	kmutex_t sc_intr_lock;
+	kcondvar_t sc_intr_wait;
+
+	struct {
+		i2c_op_t op;
+		i2c_addr_t addr;
+		const void *cmdbuf;
+		size_t cmdlen;
+		void *databuf;
+		size_t datalen;
+		int flags;
+	} sc_exec;
+
+	/*
+	 * Everything below here protected by the i2c controller lock
+	 * /and/ sc_intr_lock (if we're using interrupts).
+	 */
+
+	bsc_exec_state_t sc_exec_state;
+
+	uint8_t *sc_buf;
+	size_t sc_bufpos;
+	size_t sc_buflen;
+
+	uint32_t sc_c_bits;
+	bool sc_expecting_interrupt;
+};
+
+static void	bsciic_exec_func_idle(struct bsciic_softc * const);
+static void	bsciic_exec_func_send_addr(struct bsciic_softc * const);
+static void	bsciic_exec_func_send_cmd(struct bsciic_softc * const);
+static void	bsciic_exec_func_send_data(struct bsciic_softc * const);
+static void	bsciic_exec_func_recv_data(struct bsciic_softc * const);
+static void	bsciic_exec_func_done(struct bsciic_softc * const);
+static void	bsciic_exec_func_error(struct bsciic_softc * const);
+
+const struct {
+	void			(*func)(struct bsciic_softc * const);
+	uint32_t		c_bits;
+	uint32_t		s_bits;
+} bsciic_exec_state_data[] = {
+	[BSC_EXEC_STATE_IDLE] = {
+		.func = bsciic_exec_func_idle,
+	},
+	[BSC_EXEC_STATE_SEND_ADDR] = {
+		.func = bsciic_exec_func_send_addr,
+	},
+	[BSC_EXEC_STATE_SEND_CMD] = {
+		.func = bsciic_exec_func_send_cmd,
+		.c_bits = BSC_C_INTT,
+		.s_bits = BSC_S_TXW,
+	},
+	[BSC_EXEC_STATE_SEND_DATA] = {
+		.func = bsciic_exec_func_send_data,
+		.c_bits = BSC_C_INTT,
+		.s_bits = BSC_S_TXW,
+	},
+	[BSC_EXEC_STATE_RECV_DATA] = {
+		.func = bsciic_exec_func_recv_data,
+		.c_bits = BSC_C_READ | BSC_C_INTR,
+		.s_bits = BSC_S_RXR,
+	},
+	[BSC_EXEC_STATE_DONE] = {
+		.func = bsciic_exec_func_done,
+	},
+	[BSC_EXEC_STATE_ERROR] = {
+		.func = bsciic_exec_func_error,
+	},
 };
 
 static int bsciic_match(device_t, cfdata_t, void *);
 static void bsciic_attach(device_t, device_t, void *);
 
-void bsciic_dump_regs(struct bsciic_softc * const);
-
 static int  bsciic_acquire_bus(void *, int);
 static void bsciic_release_bus(void *, int);
 static int  bsciic_exec(void *, i2c_op_t, 

CVS commit: src/sys

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 23:23:32 UTC 2019

Modified Files:
src/sys/arch/alpha/pci: tsciic.c tsvar.h
src/sys/arch/arm/at91: at91twi.c at91twivar.h
src/sys/arch/arm/iomd: iomdiic.c
src/sys/arch/arm/omap: omap3_i2c.c ti_iic.c
src/sys/arch/arm/rockchip: rk_i2c.c
src/sys/arch/arm/sunxi: sunxi_hdmi.c sunxi_rsb.c
src/sys/arch/arm/xscale: i80312_i2c.c i80321_i2c.c iopi2c.c iopi2cvar.h
src/sys/arch/evbarm/armadillo: armadillo9_iic.c
src/sys/arch/evbarm/gumstix: gxiic.c
src/sys/arch/evbarm/nslu2: nslu2_iic.c
src/sys/arch/hpcarm/dev: nbpiic.c
src/sys/arch/i386/pci: viapcib.c
src/sys/arch/macppc/dev: cuda.c ki2c.c pmu.c smu.c
src/sys/arch/macppc/macppc: memory.c
src/sys/arch/mips/alchemy/dev: ausmbus_psc.c
src/sys/arch/mips/ingenic: jziic.c
src/sys/arch/mips/ralink: ralink_i2c.c
src/sys/arch/mmeye/dev: rtciic.c
src/sys/arch/powerpc/ibm4xx/dev: gpiic_opb.c
src/sys/arch/sgimips/dev: crmfb.c
src/sys/arch/sparc64/dev: ffb.c jbus-i2c.c
src/sys/arch/x86/pci/imcsmb: imcsmb.c
src/sys/arch/zaurus/dev: ziic.c
src/sys/dev/acpi: smbus_acpi.c
src/sys/dev/gpio: gpioiic.c
src/sys/dev/i2c: gttwsi_core.c i2c.c i2c_exec.c i2cvar.h motoi2c.c
motoi2cvar.h
src/sys/dev/ic: dw_hdmi.c dw_hdmi.h dwiic.c pca9564.c pca9564var.h
pcf8584.c pcf8584var.h
src/sys/dev/pci: alipm.c amdpm_smbus.c amdpmvar.h coram.c cxdtv.c
ichsmb.c if_tl.c igma.c ismt.c nfsmb.c piixpm.c pm2fb.c pm3fb.c
radeonfb_i2c.c voodoofb.c voyager.c
src/sys/dev/usb: auvitek_i2c.c emdtv_i2c.c

Log Message:
Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/alpha/pci/tsciic.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/alpha/pci/tsvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/at91/at91twi.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/at91/at91twivar.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/iomd/iomdiic.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/omap3_i2c.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/omap/ti_iic.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/rockchip/rk_i2c.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sunxi_hdmi.c \
src/sys/arch/arm/sunxi/sunxi_rsb.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/i80312_i2c.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/i80321_i2c.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/xscale/iopi2c.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/iopi2cvar.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/armadillo/armadillo9_iic.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/gumstix/gxiic.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/nslu2/nslu2_iic.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hpcarm/dev/nbpiic.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/pci/viapcib.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/macppc/dev/cuda.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/macppc/dev/ki2c.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/macppc/dev/pmu.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/macppc/dev/smu.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/macppc/macppc/memory.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/alchemy/dev/ausmbus_psc.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/ingenic/jziic.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/ralink/ralink_i2c.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mmeye/dev/rtciic.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/ibm4xx/dev/gpiic_opb.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/sgimips/dev/crmfb.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sparc64/dev/ffb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc64/dev/jbus-i2c.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/imcsmb/imcsmb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/dev/ziic.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/acpi/smbus_acpi.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/gpio/gpioiic.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/gttwsi_core.c
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/i2c/i2c_exec.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/i2c/i2cvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/motoi2c.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/motoi2cvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/dw_hdmi.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/dw_hdmi.h src/sys/dev/ic/dwiic.c \
src/sys/dev/ic/pcf8584var.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/pca9564.c
cvs rdiff -u -r1.1 -r1.2 

CVS commit: src/sys

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 23:23:32 UTC 2019

Modified Files:
src/sys/arch/alpha/pci: tsciic.c tsvar.h
src/sys/arch/arm/at91: at91twi.c at91twivar.h
src/sys/arch/arm/iomd: iomdiic.c
src/sys/arch/arm/omap: omap3_i2c.c ti_iic.c
src/sys/arch/arm/rockchip: rk_i2c.c
src/sys/arch/arm/sunxi: sunxi_hdmi.c sunxi_rsb.c
src/sys/arch/arm/xscale: i80312_i2c.c i80321_i2c.c iopi2c.c iopi2cvar.h
src/sys/arch/evbarm/armadillo: armadillo9_iic.c
src/sys/arch/evbarm/gumstix: gxiic.c
src/sys/arch/evbarm/nslu2: nslu2_iic.c
src/sys/arch/hpcarm/dev: nbpiic.c
src/sys/arch/i386/pci: viapcib.c
src/sys/arch/macppc/dev: cuda.c ki2c.c pmu.c smu.c
src/sys/arch/macppc/macppc: memory.c
src/sys/arch/mips/alchemy/dev: ausmbus_psc.c
src/sys/arch/mips/ingenic: jziic.c
src/sys/arch/mips/ralink: ralink_i2c.c
src/sys/arch/mmeye/dev: rtciic.c
src/sys/arch/powerpc/ibm4xx/dev: gpiic_opb.c
src/sys/arch/sgimips/dev: crmfb.c
src/sys/arch/sparc64/dev: ffb.c jbus-i2c.c
src/sys/arch/x86/pci/imcsmb: imcsmb.c
src/sys/arch/zaurus/dev: ziic.c
src/sys/dev/acpi: smbus_acpi.c
src/sys/dev/gpio: gpioiic.c
src/sys/dev/i2c: gttwsi_core.c i2c.c i2c_exec.c i2cvar.h motoi2c.c
motoi2cvar.h
src/sys/dev/ic: dw_hdmi.c dw_hdmi.h dwiic.c pca9564.c pca9564var.h
pcf8584.c pcf8584var.h
src/sys/dev/pci: alipm.c amdpm_smbus.c amdpmvar.h coram.c cxdtv.c
ichsmb.c if_tl.c igma.c ismt.c nfsmb.c piixpm.c pm2fb.c pm3fb.c
radeonfb_i2c.c voodoofb.c voyager.c
src/sys/dev/usb: auvitek_i2c.c emdtv_i2c.c

Log Message:
Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/alpha/pci/tsciic.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/alpha/pci/tsvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/at91/at91twi.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/at91/at91twivar.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/iomd/iomdiic.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/omap3_i2c.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/omap/ti_iic.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/rockchip/rk_i2c.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sunxi_hdmi.c \
src/sys/arch/arm/sunxi/sunxi_rsb.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/i80312_i2c.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/i80321_i2c.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/xscale/iopi2c.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/iopi2cvar.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/armadillo/armadillo9_iic.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/gumstix/gxiic.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/nslu2/nslu2_iic.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hpcarm/dev/nbpiic.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/pci/viapcib.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/macppc/dev/cuda.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/macppc/dev/ki2c.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/macppc/dev/pmu.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/macppc/dev/smu.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/macppc/macppc/memory.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/alchemy/dev/ausmbus_psc.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/ingenic/jziic.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/ralink/ralink_i2c.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mmeye/dev/rtciic.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/ibm4xx/dev/gpiic_opb.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/sgimips/dev/crmfb.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sparc64/dev/ffb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc64/dev/jbus-i2c.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/imcsmb/imcsmb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/dev/ziic.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/acpi/smbus_acpi.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/gpio/gpioiic.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/gttwsi_core.c
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/i2c/i2c_exec.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/i2c/i2cvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/motoi2c.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/motoi2cvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/dw_hdmi.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/dw_hdmi.h src/sys/dev/ic/dwiic.c \
src/sys/dev/ic/pcf8584var.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/pca9564.c
cvs rdiff -u -r1.1 -r1.2 

Re: CVS commit: src/sys/sys

2019-12-22 Thread Kamil Rytarowski
On 22.12.2019 23:27, Andrew Doran wrote:
> On Sat, Dec 21, 2019 at 05:23:23PM +, Alexander Nasonov wrote:
> 
>> Andrew Doran wrote:
>>> Log Message:
>>> NetBSD 9.99.28 - cpu_data & UVM changes.
>>
>> Wow, you bump versions faster than I compile new releases. At this
>> pace, we'll get to 9.99.99 in a month or two ;-)
> 
> There are quite a few people using modules and I don't want to screw them
> over.  We got into the MP game properly with NetBSD 5.0 but we're lagging
> badly and as someone else observed we've been in need of many of these
> changes for 10 years now.
> 
> Andrew
> 

Great work!

Personally, I am looking forward to NUMA support, it is today in ARM
embedded/servers and we are pretty marginalized. In larger x86 it is a
standard for a long time now.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/sys/sys

2019-12-22 Thread Andrew Doran
On Sat, Dec 21, 2019 at 05:23:23PM +, Alexander Nasonov wrote:

> Andrew Doran wrote:
> > Log Message:
> > NetBSD 9.99.28 - cpu_data & UVM changes.
> 
> Wow, you bump versions faster than I compile new releases. At this
> pace, we'll get to 9.99.99 in a month or two ;-)

There are quite a few people using modules and I don't want to screw them
over.  We got into the MP game properly with NetBSD 5.0 but we're lagging
badly and as someone else observed we've been in need of many of these
changes for 10 years now.

Andrew


CVS commit: src/sys/sys

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 22:24:37 UTC 2019

Modified Files:
src/sys/sys: param.h

Log Message:
NetBSD 9.99.29 - struct mount changed.


To generate a diff of this commit:
cvs rdiff -u -r1.629 -r1.630 src/sys/sys/param.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/sys/param.h
diff -u src/sys/sys/param.h:1.629 src/sys/sys/param.h:1.630
--- src/sys/sys/param.h:1.629	Sat Dec 21 15:12:34 2019
+++ src/sys/sys/param.h	Sun Dec 22 22:24:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.629 2019/12/21 15:12:34 ad Exp $	*/
+/*	$NetBSD: param.h,v 1.630 2019/12/22 22:24:37 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999002800	/* NetBSD 9.99.28 */
+#define	__NetBSD_Version__	999002900	/* NetBSD 9.99.29 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 22:24:37 UTC 2019

Modified Files:
src/sys/sys: param.h

Log Message:
NetBSD 9.99.29 - struct mount changed.


To generate a diff of this commit:
cvs rdiff -u -r1.629 -r1.630 src/sys/sys/param.h

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



Re: CVS commit: src/sys

2019-12-22 Thread Andrew Doran
Hi Joerg,

On Sun, Dec 22, 2019 at 01:27:44AM +0100, Joerg Sonnenberger wrote:
> On Fri, Dec 20, 2019 at 09:05:34PM +, Andrew Doran wrote:
> > Module Name:src
> > Committed By:   ad
> > Date:   Fri Dec 20 21:05:34 UTC 2019
> > 
> > Modified Files:
> > src/sys/arch/aarch64/aarch64: cpu.c cpufunc.c
> > src/sys/arch/arm/arm32: arm32_boot.c cpu.c
> > src/sys/arch/macppc/macppc: cpu.c
> > src/sys/arch/mips/mips: cpu_subr.c
> > src/sys/arch/x86/x86: cpu.c cpu_topology.c identcpu.c
> > src/sys/kern: kern_cpu.c
> > src/sys/sys: cpu.h cpu_data.h sched.h
> > 
> > Log Message:
> > Some more CPU topology stuff:
> > 
> > - Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
> >   CPU as it is attached.
> 
> My build system panics on boot with this due to zero sized allocations
> in acpisrat_refresh.

I missed this last night, oops.

Rev 1.7 of src/sys/dev/acpi/acpi_srat.c should fix.

Cheers,
Andrew


CVS commit: src/sys/dev/acpi

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 22:18:04 UTC 2019

Modified Files:
src/sys/dev/acpi: acpi_srat.c

Log Message:
Avoid doing zero sized allocations if we get bad data.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpi_srat.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/acpi/acpi_srat.c
diff -u src/sys/dev/acpi/acpi_srat.c:1.6 src/sys/dev/acpi/acpi_srat.c:1.7
--- src/sys/dev/acpi/acpi_srat.c:1.6	Tue Oct  1 18:00:08 2019
+++ src/sys/dev/acpi/acpi_srat.c	Sun Dec 22 22:18:04 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_srat.c,v 1.6 2019/10/01 18:00:08 chs Exp $ */
+/* $NetBSD: acpi_srat.c,v 1.7 2019/12/22 22:18:04 ad Exp $ */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_srat.c,v 1.6 2019/10/01 18:00:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_srat.c,v 1.7 2019/12/22 22:18:04 ad Exp $");
 
 #include 
 #include 
@@ -334,6 +334,11 @@ acpisrat_refresh(void)
 
 	nnodes = MAX(cnodes, mnodes) + 1;
 
+	if (nnodes == 0 || nmems == 0 || ncpus == 0) {
+		rc = ENOENT;
+		goto fail;
+	}
+
 	node_array = kmem_zalloc(nnodes * sizeof(struct acpisrat_node),
 	KM_SLEEP);
 	cpu_array = kmem_zalloc(ncpus * sizeof(struct acpisrat_cpu),
@@ -358,15 +363,20 @@ acpisrat_refresh(void)
 	for (i = 0; i < nnodes; i++) {
 		node_array[i].nodeid = i;
 
-		node_array[i].cpu = kmem_zalloc(node_array[i].ncpus *
-		sizeof(struct acpisrat_cpu *), KM_SLEEP);
-		node_array[i].mem = kmem_zalloc(node_array[i].nmems *
-		sizeof(struct acpisrat_mem *), KM_SLEEP);
+		if (node_array[i].ncpus != 0) {
+			node_array[i].cpu = kmem_zalloc(node_array[i].ncpus *
+			sizeof(struct acpisrat_cpu *), KM_SLEEP);
+		}
+		if (node_array[i].nmems != 0) {
+			node_array[i].mem = kmem_zalloc(node_array[i].nmems *
+			sizeof(struct acpisrat_mem *), KM_SLEEP);
+		}
 
 		k = 0;
 		for (j = 0; j < ncpus; j++) {
 			if (cpu_array[j].nodeid != i)
 continue;
+			KASSERT(node_array[i].cpu != NULL);
 			node_array[i].cpu[k] = _array[j];
 			k++;
 		}
@@ -375,11 +385,13 @@ acpisrat_refresh(void)
 		for (j = 0; j < nmems; j++) {
 			if (mem_array[j].nodeid != i)
 continue;
+			KASSERT(node_array[i].mem != NULL);
 			node_array[i].mem[k] = _array[j];
 			k++;
 		}
 	}
 
+ fail:
 	while ((citer = CPU_FIRST()) != NULL) {
 		CPU_REM(citer);
 		cpu_free(citer);
@@ -390,7 +402,7 @@ acpisrat_refresh(void)
 		mem_free(miter);
 	}
 
-	return 0;
+	return rc;
 }
 
 /*



CVS commit: src/sys/dev/acpi

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 22:18:04 UTC 2019

Modified Files:
src/sys/dev/acpi: acpi_srat.c

Log Message:
Avoid doing zero sized allocations if we get bad data.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpi_srat.c

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



CVS commit: src/sys/dev/ic

2019-12-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec 22 20:59:42 UTC 2019

Modified Files:
src/sys/dev/ic: mvsata.c

Log Message:
don't treat the EDMA self disable as autoconfig error, it's perfectly
normal at least during boot when device connection is reported by controller


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/ic/mvsata.c

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



CVS commit: src/sys/dev/ic

2019-12-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec 22 20:59:42 UTC 2019

Modified Files:
src/sys/dev/ic: mvsata.c

Log Message:
don't treat the EDMA self disable as autoconfig error, it's perfectly
normal at least during boot when device connection is reported by controller


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/ic/mvsata.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/mvsata.c
diff -u src/sys/dev/ic/mvsata.c:1.50 src/sys/dev/ic/mvsata.c:1.51
--- src/sys/dev/ic/mvsata.c:1.50	Sun Dec 22 20:54:00 2019
+++ src/sys/dev/ic/mvsata.c	Sun Dec 22 20:59:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata.c,v 1.50 2019/12/22 20:54:00 jdolecek Exp $	*/
+/*	$NetBSD: mvsata.c,v 1.51 2019/12/22 20:59:42 jdolecek Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.50 2019/12/22 20:54:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.51 2019/12/22 20:59:42 jdolecek Exp $");
 
 #include "opt_mvsata.h"
 
@@ -525,10 +525,10 @@ mvsata_error(struct mvsata_port *mvport)
 
 		case nodma:
 		default:
-			aprint_error(
-			"%s:%d:%d: EDMA self disable happen 0x%x\n",
+			DPRINTF(DEBUG_INTR,
+			("%s:%d:%d: EDMA self disable happen 0x%x\n",
 			device_xname(MVSATA_DEV2(mvport)),
-			mvport->port_hc->hc, mvport->port, cause);
+			mvport->port_hc->hc, mvport->port, cause));
 			break;
 		}
 	}



CVS commit: src/sys/dev/ic

2019-12-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec 22 20:54:00 UTC 2019

Modified Files:
src/sys/dev/ic: mvsata.c

Log Message:
remove check for idle status when disabling EDMA, and always toggle
the disable regardless of current state - this particularly seems
to fail during error recovery, and on my system this also fails
during regular boot

this matches both FreeBSD and Linux drivers - neither of those checks
the idle status

should help with PR kern/52419 and maybe also the lock spinout part
of PR kern/52126


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/ic/mvsata.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/mvsata.c
diff -u src/sys/dev/ic/mvsata.c:1.49 src/sys/dev/ic/mvsata.c:1.50
--- src/sys/dev/ic/mvsata.c:1.49	Sun Nov 10 21:16:35 2019
+++ src/sys/dev/ic/mvsata.c	Sun Dec 22 20:54:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata.c,v 1.49 2019/11/10 21:16:35 chs Exp $	*/
+/*	$NetBSD: mvsata.c,v 1.50 2019/12/22 20:54:00 jdolecek Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.49 2019/11/10 21:16:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.50 2019/12/22 20:54:00 jdolecek Exp $");
 
 #include "opt_mvsata.h"
 
@@ -198,7 +198,7 @@ static uint32_t mvsata_softreset(struct 
 #ifndef MVSATA_WITHOUTDMA
 static void mvsata_edma_reset_qptr(struct mvsata_port *);
 static inline void mvsata_edma_enable(struct mvsata_port *);
-static int mvsata_edma_disable(struct mvsata_port *, int, int);
+static void mvsata_edma_disable(struct mvsata_port *, int, int);
 static void mvsata_edma_config(struct mvsata_port *, enum mvsata_edmamode);
 
 static void mvsata_edma_setup_crqb(struct mvsata_port *, int,
@@ -3425,54 +3425,32 @@ mvsata_edma_enable(struct mvsata_port *m
 	MVSATA_EDMA_WRITE_4(mvport, EDMA_CMD, EDMA_CMD_EENEDMA);
 }
 
-static int
+static void
 mvsata_edma_disable(struct mvsata_port *mvport, int timeout, int wflags)
 {
 	struct ata_channel *chp = >port_ata_channel;
-	uint32_t status, command;
-	uint32_t idlestatus = EDMA_S_EDMAIDLE | EDMA_S_ECACHEEMPTY;
+	uint32_t command;
 	int t;
 
 	ata_channel_lock_owned(chp);
 
-	if (MVSATA_EDMA_READ_4(mvport, EDMA_CMD) & EDMA_CMD_EENEDMA) {
-
-		timeout = mstohz(timeout + hztoms(1) - 1);
-
-		for (t = 0; ; ++t) {
-			status = MVSATA_EDMA_READ_4(mvport, EDMA_S);
-			if ((status & idlestatus) == idlestatus)
-break;
-			if (t >= timeout)
-break;
-			ata_delay(chp, hztoms(1), "mvsata_edma1", wflags);
-		}
-		if (t >= timeout) {
-			aprint_error("%s:%d:%d: unable to stop EDMA\n",
-			device_xname(MVSATA_DEV2(mvport)),
-			mvport->port_hc->hc, mvport->port);
-			return EBUSY;
-		}
+	/* The disable bit (eDsEDMA) is self negated. */
+	MVSATA_EDMA_WRITE_4(mvport, EDMA_CMD, EDMA_CMD_EDSEDMA);
 
-		/* The disable bit (eDsEDMA) is self negated. */
-		MVSATA_EDMA_WRITE_4(mvport, EDMA_CMD, EDMA_CMD_EDSEDMA);
+	timeout = mstohz(timeout + hztoms(1) - 1);
 
-		for (t = 0; ; ++t) {
-			command = MVSATA_EDMA_READ_4(mvport, EDMA_CMD);
-			if (!(command & EDMA_CMD_EENEDMA))
-break;
-			if (t >= timeout)
-break;
-			ata_delay(chp, hztoms(1), "mvsata_edma2", wflags);
-		}
-		if (t >= timeout) {
-			aprint_error("%s:%d:%d: unable to re-enable EDMA\n",
-			device_xname(MVSATA_DEV2(mvport)),
-			mvport->port_hc->hc, mvport->port);
-			return EBUSY;
-		}
+	for (t = 0; ; ++t) {
+		command = MVSATA_EDMA_READ_4(mvport, EDMA_CMD);
+		if (!(command & EDMA_CMD_EENEDMA))
+			return;
+		if (t >= timeout)
+			break;
+		ata_delay(chp, hztoms(1), "mvsata_edma2", wflags);
 	}
-	return 0;
+
+	aprint_error("%s:%d:%d: unable to disable EDMA\n",
+	device_xname(MVSATA_DEV2(mvport)),
+	mvport->port_hc->hc, mvport->port);
 }
 
 /*



CVS commit: src/sys/dev/ic

2019-12-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec 22 20:54:00 UTC 2019

Modified Files:
src/sys/dev/ic: mvsata.c

Log Message:
remove check for idle status when disabling EDMA, and always toggle
the disable regardless of current state - this particularly seems
to fail during error recovery, and on my system this also fails
during regular boot

this matches both FreeBSD and Linux drivers - neither of those checks
the idle status

should help with PR kern/52419 and maybe also the lock spinout part
of PR kern/52126


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/ic/mvsata.c

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



CVS commit: src

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 19:47:35 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ctldir.c
src/sys/kern: vfs_mount.c vfs_subr.c vfs_syscalls.c
src/sys/miscfs/genfs: genfs_vfsops.c
src/sys/nfs: nfs_export.c
src/sys/sys: mount.h vnode.h vnode_impl.h
src/sys/ufs/lfs: ulfs_vfsops.c
src/sys/ufs/ufs: ufs_vfsops.c ufs_wapbl.c

Log Message:
Make mntvnode_lock per-mount, and address false sharing of struct mount.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.477 -r1.478 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.537 -r1.538 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.9 -r1.10 src/sys/miscfs/genfs/genfs_vfsops.c
cvs rdiff -u -r1.60 -r1.61 src/sys/nfs/nfs_export.c
cvs rdiff -u -r1.234 -r1.235 src/sys/sys/mount.h
cvs rdiff -u -r1.285 -r1.286 src/sys/sys/vnode.h
cvs rdiff -u -r1.18 -r1.19 src/sys/sys/vnode_impl.h
cvs rdiff -u -r1.14 -r1.15 src/sys/ufs/lfs/ulfs_vfsops.c
cvs rdiff -u -r1.57 -r1.58 src/sys/ufs/ufs/ufs_vfsops.c
cvs rdiff -u -r1.24 -r1.25 src/sys/ufs/ufs/ufs_wapbl.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/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.9 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.10
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.9	Mon Mar 18 09:22:14 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c	Sun Dec 22 19:47:34 2019
@@ -1329,7 +1329,7 @@ sfs_snapshot_mount(vnode_t *vp, const ch
 	vfsp->mnt_stat.f_owner = 0;
 	vfsp->mnt_flag = MNT_RDONLY | MNT_NOSUID | MNT_IGNORE;
 
-	mutex_enter(>mnt_updating);
+	mutex_enter(vfsp->mnt_updating);
 
 	error = zfs_domount(vfsp, osname);
 	if (error)
@@ -1349,12 +1349,12 @@ sfs_snapshot_mount(vnode_t *vp, const ch
 	vref(vp);
 	vp->v_mountedhere = vfsp;
 
-	mutex_exit(>mnt_updating);
+	mutex_exit(vfsp->mnt_updating);
 	(void) VFS_STATVFS(vfsp, >mnt_stat);
 
 out:;
 	if (error && vfsp) {
-		mutex_exit(>mnt_updating);
+		mutex_exit(vfsp->mnt_updating);
 		vfs_rele(vfsp);
 	}
 	PNBUF_PUT(osname);

Index: src/sys/kern/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.72 src/sys/kern/vfs_mount.c:1.73
--- src/sys/kern/vfs_mount.c:1.72	Sat Nov 16 10:07:53 2019
+++ src/sys/kern/vfs_mount.c	Sun Dec 22 19:47:34 2019
@@ -1,7 +1,7 @@
-/*	$NetBSD: vfs_mount.c,v 1.72 2019/11/16 10:07:53 maxv Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.73 2019/12/22 19:47:34 ad Exp $	*/
 
 /*-
- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.72 2019/11/16 10:07:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.73 2019/12/22 19:47:34 ad Exp $");
 
 #include 
 #include 
@@ -116,17 +116,16 @@ vnode_t *			rootvnode;
 
 /* Mounted filesystem list. */
 static TAILQ_HEAD(mountlist, mountlist_entry) mountlist;
-static kmutex_t			mountlist_lock;
+static kmutex_t			mountlist_lock __cacheline_aligned;
 int vnode_offset_next_by_lru	/* XXX: ugly hack for pstat.c */
 = offsetof(vnode_impl_t, vi_lrulist.tqe_next);
 
-kmutex_t			mntvnode_lock;
-kmutex_t			vfs_list_lock;
+kmutex_t			vfs_list_lock __cacheline_aligned;
 
 static specificdata_domain_t	mount_specificdata_domain;
 static kmutex_t			mntid_lock;
 
-static kmutex_t			mountgen_lock;
+static kmutex_t			mountgen_lock __cacheline_aligned;
 static uint64_t			mountgen;
 
 void
@@ -135,7 +134,6 @@ vfs_mount_sysinit(void)
 
 	TAILQ_INIT();
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
-	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(_list_lock, MUTEX_DEFAULT, IPL_NONE);
 
 	mount_specificdata_domain = specificdata_domain_create();
@@ -154,8 +152,9 @@ vfs_mountalloc(struct vfsops *vfsops, vn
 	mp->mnt_op = vfsops;
 	mp->mnt_refcnt = 1;
 	TAILQ_INIT(>mnt_vnodelist);
-	mutex_init(>mnt_renamelock, MUTEX_DEFAULT, IPL_NONE);
-	mutex_init(>mnt_updating, MUTEX_DEFAULT, IPL_NONE);
+	mp->mnt_renamelock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
+	mp->mnt_vnodelock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
+	mp->mnt_updating = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
 	mp->mnt_vnodecovered = vp;
 	mount_initspecific(mp);
 
@@ -292,8 +291,9 @@ vfs_rele(struct mount *mp)
 	 */
 	KASSERT(mp->mnt_refcnt == 0);
 	specificdata_fini(mount_specificdata_domain, >mnt_specdataref);
-	mutex_destroy(>mnt_updating);
-	mutex_destroy(>mnt_renamelock);
+	mutex_obj_free(mp->mnt_updating);
+	mutex_obj_free(mp->mnt_renamelock);
+	mutex_obj_free(mp->mnt_vnodelock);
 	if (mp->mnt_op != NULL) {
 		

CVS commit: src

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 19:47:35 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ctldir.c
src/sys/kern: vfs_mount.c vfs_subr.c vfs_syscalls.c
src/sys/miscfs/genfs: genfs_vfsops.c
src/sys/nfs: nfs_export.c
src/sys/sys: mount.h vnode.h vnode_impl.h
src/sys/ufs/lfs: ulfs_vfsops.c
src/sys/ufs/ufs: ufs_vfsops.c ufs_wapbl.c

Log Message:
Make mntvnode_lock per-mount, and address false sharing of struct mount.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.477 -r1.478 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.537 -r1.538 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.9 -r1.10 src/sys/miscfs/genfs/genfs_vfsops.c
cvs rdiff -u -r1.60 -r1.61 src/sys/nfs/nfs_export.c
cvs rdiff -u -r1.234 -r1.235 src/sys/sys/mount.h
cvs rdiff -u -r1.285 -r1.286 src/sys/sys/vnode.h
cvs rdiff -u -r1.18 -r1.19 src/sys/sys/vnode_impl.h
cvs rdiff -u -r1.14 -r1.15 src/sys/ufs/lfs/ulfs_vfsops.c
cvs rdiff -u -r1.57 -r1.58 src/sys/ufs/ufs/ufs_vfsops.c
cvs rdiff -u -r1.24 -r1.25 src/sys/ufs/ufs/ufs_wapbl.c

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



CVS commit: src/sys/dev/ic

2019-12-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Dec 22 19:19:43 UTC 2019

Modified Files:
src/sys/dev/ic: ahcisata_core.c

Log Message:
When resetting a drive, if the command list is running and CLO is not
supported, attempt to stop the drive first and fail gracefully if that
fails instead of triggering a KASSERT on DIAGNOSTIC kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/ic/ahcisata_core.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/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.78 src/sys/dev/ic/ahcisata_core.c:1.79
--- src/sys/dev/ic/ahcisata_core.c:1.78	Sun Sep 29 21:28:20 2019
+++ src/sys/dev/ic/ahcisata_core.c	Sun Dec 22 19:19:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.78 2019/09/29 21:28:20 jakllsch Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.79 2019/12/22 19:19:43 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.78 2019/09/29 21:28:20 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.79 2019/12/22 19:19:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -808,7 +808,7 @@ ahci_do_reset_drive(struct ata_channel *
 	struct ahci_cmd_tbl *cmd_tbl;
 	struct ahci_cmd_header *cmd_h;
 	int i, error = 0;
-	uint32_t sig;
+	uint32_t sig, cmd;
 	int noclo_retry = 0;
 
 	ata_channel_lock_owned(chp);
@@ -826,6 +826,19 @@ again:
 		ahci_channel_start(sc, chp, flags, 1);
 	} else {
 		/* Can't handle command still running without CLO */
+		cmd = AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel));
+		if ((cmd & AHCI_P_CMD_CR) != 0) {
+			ahci_channel_stop(sc, chp, flags);
+			cmd = AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel));
+			if ((cmd & AHCI_P_CMD_CR) != 0) {
+aprint_error("%s port %d: DMA engine busy "
+"for drive %d\n", AHCINAME(sc),
+chp->ch_channel, drive);
+error = EBUSY;
+goto end;
+			}
+		}
+
 		KASSERT((AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & AHCI_P_CMD_CR) == 0);
 
 		ahci_channel_start(sc, chp, flags, 0);



CVS commit: src/sys/dev/ic

2019-12-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Dec 22 19:19:43 UTC 2019

Modified Files:
src/sys/dev/ic: ahcisata_core.c

Log Message:
When resetting a drive, if the command list is running and CLO is not
supported, attempt to stop the drive first and fail gracefully if that
fails instead of triggering a KASSERT on DIAGNOSTIC kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/ic/ahcisata_core.c

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



CVS commit: src/usr.sbin/postinstall

2019-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 22 18:41:37 UTC 2019

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
PR/54730: Izumi Tsutsui: obsolete etc files are not being cleaned up on
an upgrade build.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.10 src/usr.sbin/postinstall/postinstall.in:1.11
--- src/usr.sbin/postinstall/postinstall.in:1.10	Tue Dec  3 23:45:42 2019
+++ src/usr.sbin/postinstall/postinstall.in	Sun Dec 22 13:41:36 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.10 2019/12/04 04:45:42 christos Exp $
+# $NetBSD: postinstall.in,v 1.11 2019/12/22 18:41:36 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1468,9 +1468,21 @@ select_obsolete_files()
 	if $SOURCEMODE; then
 		${SED} -n -e "/obsolete/s@\.$1$2[[:space:]].*@\1@p" \
 		${SRC_DIR}/distrib/sets/lists/$3/mi
+		return
+	fi
+
+	# On upgrade builds we don't extract the "etc" set so we
+	# try to use the source set instead. See PR/54730 for
+	# ways to better handle this.
+
+	local obsolete_dir
+
+	if [ $3 = "etc" ] ;then
+		obsolete_dir=${SRC_DIR}/var/db/obsolete
 	else
-		${SED} -n -e "s@\.$1$2\$@\1@p" "${DEST_DIR}/var/db/obsolete/$3"
+		obsolete_dir=${DEST_DIR}/var/db/obsolete
 	fi
+	${SED} -n -e "s@\.$1$2\$@\1@p" "${obsolete_dir}/$3"
 }
 
 getetcsets()



CVS commit: src/usr.sbin/postinstall

2019-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 22 18:41:37 UTC 2019

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
PR/54730: Izumi Tsutsui: obsolete etc files are not being cleaned up on
an upgrade build.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/usr.bin/vmstat

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 17:27:54 UTC 2019

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

Log Message:
Have vmstat -H report on vcache_hashtab.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/usr.bin/vmstat/vmstat.c

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



CVS commit: src/usr.bin/vmstat

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 17:27:54 UTC 2019

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

Log Message:
Have vmstat -H report on vcache_hashtab.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.228 src/usr.bin/vmstat/vmstat.c:1.229
--- src/usr.bin/vmstat/vmstat.c:1.228	Fri Sep 13 13:56:05 2019
+++ src/usr.bin/vmstat/vmstat.c	Sun Dec 22 17:27:53 2019
@@ -1,7 +1,7 @@
-/* $NetBSD: vmstat.c,v 1.228 2019/09/13 13:56:05 christos Exp $ */
+/* $NetBSD: vmstat.c,v 1.229 2019/12/22 17:27:53 ad Exp $ */
 
 /*-
- * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2000, 2001, 2007, 2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation by:
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.228 2019/09/13 13:56:05 christos Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.229 2019/12/22 17:27:53 ad Exp $");
 #endif
 #endif /* not lint */
 
@@ -96,6 +96,8 @@ __RCSID("$NetBSD: vmstat.c,v 1.228 2019/
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -223,7 +225,11 @@ struct nlist hashnl[] =
 	{ .n_name = "_ncvhash" },
 #define	X_NCVHASHTBL	13
 	{ .n_name = "_ncvhashtbl" },
-#define X_HASHNL_SIZE	14	/* must be last */
+#define	X_NCVCACHEHASH	14
+	{ .n_name = "_vcache_hashmask" },
+#define	X_NCVCACHETBL	15
+	{ .n_name = "_vcache_hashtab" },
+#define X_HASHNL_SIZE	16	/* must be last */
 	{ .n_name = NULL },
 };
 
@@ -1842,7 +1848,9 @@ dopoolcache(int verbose)
 
 enum hashtype {			/* from  */
 	HASH_LIST,
-	HASH_TAILQ
+	HASH_SLIST,
+	HASH_TAILQ,
+	HASH_PSLIST
 };
 
 struct uidinfo {		/* XXX: no kernel header file */
@@ -1880,6 +1888,10 @@ struct kernel_hash {
 		X_UIHASH, X_UIHASHTBL,
 		HASH_LIST, offsetof(struct uidinfo, ui_hash),
 	}, {
+		"vnode cache hash",
+		X_NCVCACHEHASH, X_NCVCACHETBL,
+		HASH_SLIST, offsetof(struct vnode_impl, vi_hash),
+	}, {
 		NULL, -1, -1, 0, 0,
 	}
 };
@@ -1888,6 +1900,7 @@ void
 dohashstat(int verbose, int todo, const char *hashname)
 {
 	LIST_HEAD(, generic)	*hashtbl_list;
+	SLIST_HEAD(, generic)	*hashtbl_slist;
 	TAILQ_HEAD(, generic)	*hashtbl_tailq;
 	struct kernel_hash	*curhash;
 	void	*hashaddr, *hashbuf, *nhashbuf, *nextaddr;
@@ -1969,14 +1982,22 @@ dohashstat(int verbose, int todo, const 
 		items = maxchain = 0;
 		if (curhash->type == HASH_LIST) {
 			hashtbl_list = hashbuf;
+			hashtbl_slist = NULL;
+			hashtbl_tailq = NULL;
+		} else if (curhash->type == HASH_SLIST) {
+			hashtbl_list = NULL;
+			hashtbl_slist = hashbuf;
 			hashtbl_tailq = NULL;
 		} else {
 			hashtbl_list = NULL;
+			hashtbl_slist = NULL;
 			hashtbl_tailq = hashbuf;
 		}
 		for (i = 0; i < hashsize; i++) {
 			if (curhash->type == HASH_LIST)
 nextaddr = LIST_FIRST(_list[i]);
+			else if (curhash->type == HASH_SLIST)
+nextaddr = SLIST_FIRST(_slist[i]);
 			else
 nextaddr = TAILQ_FIRST(_tailq[i]);
 			if (nextaddr == NULL)



CVS commit: src/lib/libc/sys

2019-12-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Dec 22 17:01:15 UTC 2019

Modified Files:
src/lib/libc/sys: kqueue.2

Log Message:
Document udata type switch in struct kevent in the kqueue(2)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/lib/libc/sys/kqueue.2

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.48 src/lib/libc/sys/kqueue.2:1.49
--- src/lib/libc/sys/kqueue.2:1.48	Fri Apr 12 10:57:27 2019
+++ src/lib/libc/sys/kqueue.2	Sun Dec 22 17:01:15 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.48 2019/04/12 10:57:27 abhinav Exp $
+.\"	$NetBSD: kqueue.2,v 1.49 2019/12/22 17:01:15 kamil Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" $FreeBSD: src/lib/libc/sys/kqueue.2,v 1.22 2001/06/27 19:55:57 dd Exp $
 .\"
-.Dd January 8, 2018
+.Dd December 22, 2019
 .Dt KQUEUE 2
 .Os
 .Sh NAME
@@ -168,7 +168,7 @@ struct kevent {
 	uint32_t  flags;	/* action flags for kqueue */
 	uint32_t  fflags;	/* filter flag value */
 	int64_t   data;		/* filter data value */
-	intptr_t  udata;	/* opaque user data identifier */
+	void *udata;	/* opaque user data identifier */
 };
 .Ed
 .Pp
@@ -677,3 +677,8 @@ The
 .Fn EV_SET
 macro was protected from evaluating multiple times the first argument in
 .Nx 8.0 .
+.Pp
+The
+.Va udata
+type was changed from intptr_t to void * in
+.Nx 10.0 .



CVS commit: src/lib/libc/sys

2019-12-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Dec 22 17:01:15 UTC 2019

Modified Files:
src/lib/libc/sys: kqueue.2

Log Message:
Document udata type switch in struct kevent in the kqueue(2)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/lib/libc/sys/kqueue.2

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



CVS commit: src/sys/arch/x86/x86

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 16:50:03 UTC 2019

Modified Files:
src/sys/arch/x86/x86: intr.c

Log Message:
Fix compile on !DIAGNOSTIC.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/arch/x86/x86/intr.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/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.148 src/sys/arch/x86/x86/intr.c:1.149
--- src/sys/arch/x86/x86/intr.c:1.148	Sun Dec 22 15:09:39 2019
+++ src/sys/arch/x86/x86/intr.c	Sun Dec 22 16:50:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.148 2019/12/22 15:09:39 thorpej Exp $	*/
+/*	$NetBSD: intr.c,v 1.149 2019/12/22 16:50:03 ad Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.148 2019/12/22 15:09:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.149 2019/12/22 16:50:03 ad Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -1102,8 +1102,7 @@ intr_mask(struct intrhand *ih)
 		 * We can't take the cpu_lock in this case, and we must
 		 * therefore be extra careful.
 		 */
-		struct cpu_info * const ci = ih->ih_cpu;
-		KASSERT(ci == curcpu() || !mp_online);
+		KASSERT(ih->ih_cpu == curcpu() || !mp_online);
 		intr_mask_xcall(ih, (void *)(uintptr_t)true);
 		return;
 	}



CVS commit: src/sys/arch/x86/x86

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 16:50:03 UTC 2019

Modified Files:
src/sys/arch/x86/x86: intr.c

Log Message:
Fix compile on !DIAGNOSTIC.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/arch/x86/x86/intr.c

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



CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 16:44:35 UTC 2019

Modified Files:
src/sys/dev/i2c: ihidev.c ihidev.h

Log Message:
The hid-over-i2c spec specifies that compliant devices use level-sensitive
interrupts.  However, it's not safe to do i2c bus access in hard interrupt
context, and we must read the event data off the device in order to clear
the interrupt condition.

Address this by using acpi_intr_mask() to mask off the interrupt source
while a softint is pending to service the events, re-enabling it once
servicing is completed.

While here, re-factor the interrupt setup / tear-down code a bit to
eventually once day simplify supporting the FDT bindings for hid-over-i2c.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/ihidev.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/ihidev.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/i2c/ihidev.c
diff -u src/sys/dev/i2c/ihidev.c:1.9 src/sys/dev/i2c/ihidev.c:1.10
--- src/sys/dev/i2c/ihidev.c:1.9	Tue Oct  1 18:00:08 2019
+++ src/sys/dev/i2c/ihidev.c	Sun Dec 22 16:44:35 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ihidev.c,v 1.9 2019/10/01 18:00:08 chs Exp $ */
+/* $NetBSD: ihidev.c,v 1.10 2019/12/22 16:44:35 thorpej Exp $ */
 /* $OpenBSD ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */
 
 /*-
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.9 2019/10/01 18:00:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.10 2019/12/22 16:44:35 thorpej Exp $");
 
 #include 
 #include 
@@ -71,6 +71,7 @@ __KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1
 #  include "acpica.h"
 #endif
 #if NACPICA > 0
+#include 
 #include 
 #endif
 
@@ -109,10 +110,14 @@ static int	ihidev_detach(device_t, int);
 CFATTACH_DECL_NEW(ihidev, sizeof(struct ihidev_softc),
 ihidev_match, ihidev_attach, ihidev_detach, NULL);
 
+static bool	ihiddev_intr_init(struct ihidev_softc *);
+static void	ihiddev_intr_fini(struct ihidev_softc *);
+
 static bool	ihidev_suspend(device_t, const pmf_qual_t *);
 static bool	ihidev_resume(device_t, const pmf_qual_t *);
 static int	ihidev_hid_command(struct ihidev_softc *, int, void *, bool);
 static int	ihidev_intr(void *);
+static void	ihidev_softintr(void *);
 static int	ihidev_reset(struct ihidev_softc *, bool);
 static int	ihidev_hid_desc_parse(struct ihidev_softc *);
 
@@ -200,20 +205,9 @@ ihidev_attach(device_t parent, device_t 
 		repsz));
 	}
 	sc->sc_ibuf = kmem_zalloc(sc->sc_isize, KM_SLEEP);
-#if NACPICA > 0
-	{
-		char buf[100];
-
-		sc->sc_ih = acpi_intr_establish(self, sc->sc_phandle, IPL_TTY,
-		false, ihidev_intr, sc, device_xname(self));
-		if (sc->sc_ih == NULL) {
-			aprint_error_dev(self, "can't establish interrupt\n");
-			return;
-		}
-		aprint_normal_dev(self, "interrupting at %s\n",
-		acpi_intr_string(sc->sc_ih, buf, sizeof(buf)));
+	if (! ihiddev_intr_init(sc)) {
+		return;
 	}
-#endif
 
 	iha.iaa = ia;
 	iha.parent = sc;
@@ -260,10 +254,7 @@ ihidev_detach(device_t self, int flags)
 	struct ihidev_softc *sc = device_private(self);
 
 	mutex_enter(>sc_intr_lock);
-#if NACPICA > 0
-	if (sc->sc_ih != NULL)
-		acpi_intr_disestablish(sc->sc_ih);
-#endif
+	ihiddev_intr_fini(sc);
 	if (ihidev_hid_command(sc, I2C_HID_CMD_SET_POWER,
 	_HID_POWER_OFF, true))
 	aprint_error_dev(sc->sc_dev, "failed to power down\n");
@@ -649,31 +640,110 @@ ihidev_hid_desc_parse(struct ihidev_soft
 	return (0);
 }
 
+static bool
+ihiddev_intr_init(struct ihidev_softc *sc)
+{
+#if NACPICA > 0
+	ACPI_HANDLE hdl = (void *)(uintptr_t)sc->sc_phandle;
+	struct acpi_resources res;
+	ACPI_STATUS rv;
+	char buf[100];
+
+	rv = acpi_resource_parse(sc->sc_dev, hdl, "_CRS", ,
+	_resource_parse_ops_quiet);
+	if (ACPI_FAILURE(rv)) {
+		aprint_error_dev(sc->sc_dev, "can't parse '_CRS'\n");
+		return false;
+	}
+
+	const struct acpi_irq * const irq = acpi_res_irq(, 0);
+	if (irq == NULL) {
+		aprint_error_dev(sc->sc_dev, "no IRQ resource\n");
+		acpi_resource_cleanup();
+		return false;
+	}
+
+	sc->sc_intr_type =
+	irq->ar_type == ACPI_EDGE_SENSITIVE ? IST_EDGE : IST_LEVEL;
+
+	acpi_resource_cleanup();
+
+	sc->sc_ih = acpi_intr_establish(sc->sc_dev, sc->sc_phandle, IPL_TTY,
+	false, ihidev_intr, sc, device_xname(sc->sc_dev));
+	if (sc->sc_ih == NULL) {
+		aprint_error_dev(sc->sc_dev, "can't establish interrupt\n");
+		return false;
+	}
+	aprint_normal_dev(sc->sc_dev, "interrupting at %s\n",
+	acpi_intr_string(sc->sc_ih, buf, sizeof(buf)));
+
+	sc->sc_sih = softint_establish(SOFTINT_SERIAL, ihidev_softintr, sc);
+	if (sc->sc_sih == NULL) {
+		aprint_error_dev(sc->sc_dev,
+		"can't establish soft interrupt\n");
+		return false;
+	}
+
+	return true;
+#else
+	aprint_error_dev(sc->sc_dev, "can't establish interrupt\n");
+	return false;
+#endif
+}
+
+static void
+ihiddev_intr_fini(struct ihidev_softc *sc)
+{
+#if NACPICA > 0
+	if (sc->sc_ih != NULL) {
+		

CVS commit: src/sys/dev/i2c

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 16:44:35 UTC 2019

Modified Files:
src/sys/dev/i2c: ihidev.c ihidev.h

Log Message:
The hid-over-i2c spec specifies that compliant devices use level-sensitive
interrupts.  However, it's not safe to do i2c bus access in hard interrupt
context, and we must read the event data off the device in order to clear
the interrupt condition.

Address this by using acpi_intr_mask() to mask off the interrupt source
while a softint is pending to service the events, re-enabling it once
servicing is completed.

While here, re-factor the interrupt setup / tear-down code a bit to
eventually once day simplify supporting the FDT bindings for hid-over-i2c.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/ihidev.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/ihidev.h

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



CVS commit: src/sys/uvm

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 16:37:36 UTC 2019

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
uvm_pagealloc_strat(): Tweak the locking to allow for lazy dequeue of pages
in the pdpolicy code.  This means taking pg->interlock if assigning to
an object.  The remaining barrier to lazy dequeue is having a dedicated
TAILQ_ENTRY in the page (it's currently shared with the page allocator).


To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.212 src/sys/uvm/uvm_page.c

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



CVS commit: src/sys/uvm

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 16:37:36 UTC 2019

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
uvm_pagealloc_strat(): Tweak the locking to allow for lazy dequeue of pages
in the pdpolicy code.  This means taking pg->interlock if assigning to
an object.  The remaining barrier to lazy dequeue is having a dedicated
TAILQ_ENTRY in the page (it's currently shared with the page allocator).


To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.212 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.211 src/sys/uvm/uvm_page.c:1.212
--- src/sys/uvm/uvm_page.c:1.211	Sat Dec 21 15:16:14 2019
+++ src/sys/uvm/uvm_page.c	Sun Dec 22 16:37:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.211 2019/12/21 15:16:14 ad Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.212 2019/12/22 16:37:36 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.211 2019/12/21 15:16:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.212 2019/12/22 16:37:36 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -829,10 +829,6 @@ uvm_pagealloc_pgfl(struct uvm_cpu *ucpu,
 	LIST_REMOVE(pg, listq.list);	/* per-cpu list */
 	uvmexp.free--;
 
-	/* update zero'd page count */
-	if (pg->flags & PG_ZERO)
-		CPU_COUNT(CPU_COUNT_ZEROPAGES, -1);
-
 	if (color == trycolor)
 		CPU_COUNT(CPU_COUNT_COLORHIT, 1);
 	else {
@@ -996,34 +992,43 @@ uvm_pagealloc_strat(struct uvm_object *o
 			ucpu->page_idle_zero = vm_page_zero_enable;
 		}
 	}
+	if (pg->flags & PG_ZERO) {
+		CPU_COUNT(CPU_COUNT_ZEROPAGES, -1);
+	}
+	if (anon) {
+		CPU_COUNT(CPU_COUNT_ANONPAGES, 1);
+	}
 	KASSERT((pg->flags & ~(PG_ZERO|PG_FREE)) == 0);
 
-	/*
-	 * For now check this - later on we may do lazy dequeue, but need
-	 * to get page.queue used only by the pagedaemon policy first.
-	 */
-	KASSERT(!uvmpdpol_pageisqueued_p(pg));
+	/* mark the page as allocated and then drop uvm_fpageqlock. */
+	pg->flags &= ~PG_FREE;
+	mutex_spin_exit(_fpageqlock);
 
 	/*
-	 * assign the page to the object.  we don't need to lock the page's
-	 * identity to do this, as the caller holds the objects locked, and
-	 * the page is not on any paging queues at this time.
+	 * assign the page to the object.  as the page was free, we know
+	 * that pg->uobject and pg->uanon are NULL.  we only need to take
+	 * the page's interlock if we are changing the values.
 	 */
+	if (anon != NULL || obj != NULL) {
+		mutex_enter(>interlock);
+	}
 	pg->offset = off;
 	pg->uobject = obj;
 	pg->uanon = anon;
 	KASSERT(uvm_page_locked_p(pg));
 	pg->flags = PG_BUSY|PG_CLEAN|PG_FAKE;
-	mutex_spin_exit(_fpageqlock);
 	if (anon) {
 		anon->an_page = pg;
 		pg->flags |= PG_ANON;
-		cpu_count(CPU_COUNT_ANONPAGES, 1);
+		mutex_exit(>interlock);
 	} else if (obj) {
 		uvm_pageinsert_object(obj, pg);
+		mutex_exit(>interlock);
 		error = uvm_pageinsert_tree(obj, pg);
 		if (error != 0) {
+			mutex_enter(>interlock);
 			uvm_pageremove_object(obj, pg);
+			mutex_exit(>interlock);
 			uvm_pagefree(pg);
 			return NULL;
 		}



CVS commit: src/sys

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 15:57:07 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpi_machdep.c
src/sys/arch/arm/include: acpi_machdep.h
src/sys/arch/ia64/acpi: acpi_machdep.c
src/sys/arch/ia64/include: acpi_machdep.h
src/sys/arch/x86/acpi: acpi_machdep.c
src/sys/arch/x86/include: acpi_machdep.h
src/sys/dev/acpi: acpi_intr.h acpi_util.c

Log Message:
Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/acpi/acpi_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/include/acpi_machdep.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/acpi/acpi_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/include/acpi_machdep.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/include/acpi_machdep.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/acpi/acpi_intr.h
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/acpi/acpi_util.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/acpi/acpi_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_machdep.c:1.10 src/sys/arch/arm/acpi/acpi_machdep.c:1.11
--- src/sys/arch/arm/acpi/acpi_machdep.c:1.10	Mon Aug 12 15:37:26 2019
+++ src/sys/arch/arm/acpi/acpi_machdep.c	Sun Dec 22 15:57:06 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.10 2019/08/12 15:37:26 skrll Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.11 2019/12/22 15:57:06 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.10 2019/08/12 15:37:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.11 2019/12/22 15:57:06 thorpej Exp $");
 
 #include 
 #include 
@@ -257,6 +257,20 @@ acpi_md_intr_establish(uint32_t irq, int
 }
 
 void
+acpi_md_intr_mask(void *ih)
+{
+	/* XXX */
+	panic("acpi_md_intr_mask(%p): not implemented", ih);
+}
+
+void
+acpi_md_intr_unmask(void *ih)
+{
+	/* XXX */
+	panic("acpi_md_intr_unmask(%p): not implemented", ih);
+}
+
+void
 acpi_md_intr_disestablish(void *ih)
 {
 	intr_disestablish(ih);

Index: src/sys/arch/arm/include/acpi_machdep.h
diff -u src/sys/arch/arm/include/acpi_machdep.h:1.2 src/sys/arch/arm/include/acpi_machdep.h:1.3
--- src/sys/arch/arm/include/acpi_machdep.h:1.2	Fri Nov 16 23:03:55 2018
+++ src/sys/arch/arm/include/acpi_machdep.h	Sun Dec 22 15:57:06 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.h,v 1.2 2018/11/16 23:03:55 jmcneill Exp $ */
+/* $NetBSD: acpi_machdep.h,v 1.3 2019/12/22 15:57:06 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -48,6 +48,8 @@ void			acpi_md_OsEnableInterrupt(void);
 void			acpi_md_OsDisableInterrupt(void);
 void *			acpi_md_intr_establish(uint32_t, int, int, int (*)(void *),
 	   void *, bool, const char *);
+void			acpi_md_intr_mask(void *);
+void			acpi_md_intr_unmask(void *);
 void			acpi_md_intr_disestablish(void *);
 int			acpi_md_sleep(int);
 uint32_t		acpi_md_pdc(void);

Index: src/sys/arch/ia64/acpi/acpi_machdep.c
diff -u src/sys/arch/ia64/acpi/acpi_machdep.c:1.9 src/sys/arch/ia64/acpi/acpi_machdep.c:1.10
--- src/sys/arch/ia64/acpi/acpi_machdep.c:1.9	Sat Nov 17 20:53:35 2018
+++ src/sys/arch/ia64/acpi/acpi_machdep.c	Sun Dec 22 15:57:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_machdep.c,v 1.9 2018/11/17 20:53:35 scole Exp $	*/
+/*	$NetBSD: acpi_machdep.c,v 1.10 2019/12/22 15:57:06 thorpej Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -28,7 +28,7 @@
  * Machine-dependent routines for ACPICA.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.9 2018/11/17 20:53:35 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.10 2019/12/22 15:57:06 thorpej Exp $");
 
 #include 
 
@@ -126,6 +126,20 @@ acpi_md_intr_establish(uint32_t irq, int
 }
 
 void
+acpi_md_intr_mask(void *ih)
+{
+	/* XXX */
+	panic("acpi_md_intr_mask(%p): not implemented", ih);
+}
+
+void
+acpi_md_intr_unmask(void *ih)
+{
+	/* XXX */
+	panic("acpi_md_intr_unmask(%p): not implemented", ih);
+}
+
+void
 acpi_md_intr_disestablish(void *ih)
 {
 	intr_disestablish(ih);

Index: src/sys/arch/ia64/include/acpi_machdep.h
diff -u src/sys/arch/ia64/include/acpi_machdep.h:1.8 src/sys/arch/ia64/include/acpi_machdep.h:1.9
--- src/sys/arch/ia64/include/acpi_machdep.h:1.8	Fri Nov 16 23:03:55 2018
+++ src/sys/arch/ia64/include/acpi_machdep.h	Sun Dec 22 15:57:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_machdep.h,v 1.8 2018/11/16 23:03:55 jmcneill Exp $	*/
+/*	$NetBSD: acpi_machdep.h,v 1.9 

CVS commit: src/sys

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 15:57:07 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpi_machdep.c
src/sys/arch/arm/include: acpi_machdep.h
src/sys/arch/ia64/acpi: acpi_machdep.c
src/sys/arch/ia64/include: acpi_machdep.h
src/sys/arch/x86/acpi: acpi_machdep.c
src/sys/arch/x86/include: acpi_machdep.h
src/sys/dev/acpi: acpi_intr.h acpi_util.c

Log Message:
Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/acpi/acpi_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/include/acpi_machdep.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/acpi/acpi_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/include/acpi_machdep.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/include/acpi_machdep.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/acpi/acpi_intr.h
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/acpi/acpi_util.c

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



CVS commit: src/sys/arch/x86/x86

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 15:15:20 UTC 2019

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
pmap_get_ptp(): the uvm_pagefree() call in the failure case can block too.
Pacify the assertion in pmap_unmap_ptes().

XXX Revisit and solve this chicken-and-egg problem in a more elegant way.

Reported-by: syzbot+24967905b8d173445...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.347 -r1.348 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.347 src/sys/arch/x86/x86/pmap.c:1.348
--- src/sys/arch/x86/x86/pmap.c:1.347	Sat Dec 21 13:00:24 2019
+++ src/sys/arch/x86/x86/pmap.c	Sun Dec 22 15:15:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.347 2019/12/21 13:00:24 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.348 2019/12/22 15:15:20 ad Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.347 2019/12/21 13:00:24 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.348 2019/12/22 15:15:20 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -2120,8 +2120,6 @@ pmap_get_ptp(struct pmap *pmap, vaddr_t 
 			pt[i].new = true;
 			if (__predict_false(ncsw != lwp_pctr())) {
 /* uvm_pagealloc can block. */
-/* XXX silence assertion in pmap_unmap_ptes */
-pmap->pm_ncsw = lwp_pctr();
 error = EAGAIN;
 goto fail;
 			}
@@ -2195,9 +2193,10 @@ fail:
 		if (!pt[i].new) {
 			continue;
 		}
-		obj = >pm_obj[i - 2];
 		uvm_pagefree(pt[i].pg);
 	}
+	/* XXX silence assertion in pmap_unmap_ptes */
+	pmap->pm_ncsw = lwp_pctr();
 	return error;
 }
 



CVS commit: src/sys/arch/x86/x86

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 15:15:20 UTC 2019

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
pmap_get_ptp(): the uvm_pagefree() call in the failure case can block too.
Pacify the assertion in pmap_unmap_ptes().

XXX Revisit and solve this chicken-and-egg problem in a more elegant way.

Reported-by: syzbot+24967905b8d173445...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.347 -r1.348 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.



CVS commit: src/sys/arch

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 15:09:39 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf vector.S
src/sys/arch/i386/i386: genassym.cf vector.S
src/sys/arch/x86/include: intr.h
src/sys/arch/x86/x86: intr.c

Log Message:
Add intr_mask() and corresponding intr_unmask() calls that allow specific
interrupt lines / sources to be masked as needed (rather than making a
set of sources by IPL as with spl*()).


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/x86/include/intr.h
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/x86/x86/intr.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/amd64/amd64/genassym.cf
diff -u src/sys/arch/amd64/amd64/genassym.cf:1.78 src/sys/arch/amd64/amd64/genassym.cf:1.79
--- src/sys/arch/amd64/amd64/genassym.cf:1.78	Thu Nov 21 19:27:54 2019
+++ src/sys/arch/amd64/amd64/genassym.cf	Sun Dec 22 15:09:39 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.78 2019/11/21 19:27:54 ad Exp $
+#	$NetBSD: genassym.cf,v 1.79 2019/12/22 15:09:39 thorpej Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -321,7 +321,8 @@ define	IS_FLAGS	offsetof(struct intrsour
 define	IS_PIN		offsetof(struct intrsource, is_pin)
 define	IS_TYPE		offsetof(struct intrsource, is_type)
 define	IS_MAXLEVEL	offsetof(struct intrsource, is_maxlevel)
-define	IS_LWP			offsetof(struct intrsource, is_lwp)
+define	IS_LWP		offsetof(struct intrsource, is_lwp)
+define	IS_MASK_COUNT	offsetof(struct intrsource, is_mask_count)
 
 define	IPL_NONE		IPL_NONE
 define	IPL_PREEMPT		IPL_PREEMPT

Index: src/sys/arch/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.71 src/sys/arch/amd64/amd64/vector.S:1.72
--- src/sys/arch/amd64/amd64/vector.S:1.71	Sun Nov 17 14:07:00 2019
+++ src/sys/arch/amd64/amd64/vector.S	Sun Dec 22 15:09:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.71 2019/11/17 14:07:00 maxv Exp $	*/
+/*	$NetBSD: vector.S,v 1.72 2019/12/22 15:09:39 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -391,6 +391,8 @@ IDTVEC(handle_ ## name ## num)		;\
 	sti;\
 	incl	CPUVAR(IDEPTH)		;\
 	movq	IS_HANDLERS(%r14),%rbx	;\
+	cmpl	$0,IS_MASK_COUNT(%r14)	/* source currently masked? */	;\
+	jne	7f			/* yes, hold it */		;\
 6:	\
 	movl	IH_LEVEL(%rbx),%r12d	;\
 	cmpl	%r13d,%r12d		;\
@@ -403,6 +405,8 @@ IDTVEC(handle_ ## name ## num)		;\
 	testq	%rbx,%rbx		;\
 	jnz	6b			;\
 5:	\
+	cmpl	$0,IS_MASK_COUNT(%r14)	/* source now masked? */	;\
+	jne	7f			/* yes, deal */			;\
 	cli;\
 	unmask(num)			/* unmask it in hardware */	;\
 	late_ack(num)			;\

Index: src/sys/arch/i386/i386/genassym.cf
diff -u src/sys/arch/i386/i386/genassym.cf:1.115 src/sys/arch/i386/i386/genassym.cf:1.116
--- src/sys/arch/i386/i386/genassym.cf:1.115	Thu Nov 21 19:27:54 2019
+++ src/sys/arch/i386/i386/genassym.cf	Sun Dec 22 15:09:39 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.115 2019/11/21 19:27:54 ad Exp $
+#	$NetBSD: genassym.cf,v 1.116 2019/12/22 15:09:39 thorpej Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -322,6 +322,7 @@ define	IS_PIN			offsetof(struct intrsour
 define	IS_TYPE			offsetof(struct intrsource, is_type)
 define	IS_MAXLEVEL		offsetof(struct intrsource, is_maxlevel)
 define	IS_LWP			offsetof(struct intrsource, is_lwp)
+define	IS_MASK_COUNT		offsetof(struct intrsource, is_mask_count)
 
 define	IPL_NONE		IPL_NONE
 define	IPL_PREEMPT		IPL_PREEMPT

Index: src/sys/arch/i386/i386/vector.S
diff -u src/sys/arch/i386/i386/vector.S:1.83 src/sys/arch/i386/i386/vector.S:1.84
--- src/sys/arch/i386/i386/vector.S:1.83	Fri Feb 15 08:54:01 2019
+++ src/sys/arch/i386/i386/vector.S	Sun Dec 22 15:09:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.83 2019/02/15 08:54:01 nonaka Exp $	*/
+/*	$NetBSD: vector.S,v 1.84 2019/12/22 15:09:39 thorpej Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.83 2019/02/15 08:54:01 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.84 2019/12/22 15:09:39 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -408,6 +408,8 @@ IDTVEC(intr_ ## name ## num)		;\
 	IDEPTH_INCR			;\
 	sti;\
 	movl	IS_HANDLERS(%ebp),%ebx	;\
+	cmpl	$0,IS_MASK_COUNT(%ebp)	/* source currently masked? */	;\
+	jne	7f			/* yes, hold it */		;\
 6:	\
 	movl	IH_LEVEL(%ebx),%edi	;\
 	cmpl	%esi,%edi		;\
@@ -420,6 +422,8 @@ IDTVEC(intr_ ## name ## num)		;\
 	addl	$4,%esp			/* toss the arg */		;\
 	

CVS commit: src/sys/arch

2019-12-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Dec 22 15:09:39 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf vector.S
src/sys/arch/i386/i386: genassym.cf vector.S
src/sys/arch/x86/include: intr.h
src/sys/arch/x86/x86: intr.c

Log Message:
Add intr_mask() and corresponding intr_unmask() calls that allow specific
interrupt lines / sources to be masked as needed (rather than making a
set of sources by IPL as with spl*()).


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/x86/include/intr.h
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/x86/x86/intr.c

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



CVS commit: src/sys/kern

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 15:00:42 UTC 2019

Modified Files:
src/sys/kern: init_main.c

Log Message:
Fix integer overflow when printing available memory size (resulting from
a cast lost during merges).

Reported-by: syzbot+f02ca5f83ac7196b8...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.511 -r1.512 src/sys/kern/init_main.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/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.511 src/sys/kern/init_main.c:1.512
--- src/sys/kern/init_main.c:1.511	Sat Dec 21 13:00:24 2019
+++ src/sys/kern/init_main.c	Sun Dec 22 15:00:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.511 2019/12/21 13:00:24 ad Exp $	*/
+/*	$NetBSD: init_main.c,v 1.512 2019/12/22 15:00:42 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.511 2019/12/21 13:00:24 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.512 2019/12/22 15:00:42 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -1174,6 +1174,6 @@ banner(void)
 	(*pr)("%s%s", copyright, version);
 	format_bytes(pbuf, MEM_PBUFSIZE, ctob((uint64_t)physmem));
 	(*pr)("total memory = %s\n", pbuf);
-	format_bytes(pbuf, MEM_PBUFSIZE, ctob(uvm_free()));
+	format_bytes(pbuf, MEM_PBUFSIZE, ctob((uint64_t)uvm_free()));
 	(*pr)("avail memory = %s\n", pbuf);
 }



CVS commit: src/sys/kern

2019-12-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Dec 22 15:00:42 UTC 2019

Modified Files:
src/sys/kern: init_main.c

Log Message:
Fix integer overflow when printing available memory size (resulting from
a cast lost during merges).

Reported-by: syzbot+f02ca5f83ac7196b8...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.511 -r1.512 src/sys/kern/init_main.c

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



CVS commit: src/sys/dev/dm

2019-12-22 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sun Dec 22 13:16:10 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c dm_table.c

Log Message:
dm: Make numsec/secsize arguments in dm_table_disksize() optional


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/dm/device-mapper.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/dm/dm_table.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/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.58 src/sys/dev/dm/device-mapper.c:1.59
--- src/sys/dev/dm/device-mapper.c:1.58	Sun Dec 22 12:28:54 2019
+++ src/sys/dev/dm/device-mapper.c	Sun Dec 22 13:16:09 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: device-mapper.c,v 1.58 2019/12/22 12:28:54 tkusumi Exp $ */
+/*$NetBSD: device-mapper.c,v 1.59 2019/12/22 13:16:09 tkusumi Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -431,7 +431,6 @@ disk_ioctl_switch(dev_t dev, unsigned lo
 	case DIOCGWEDGEINFO:
 	{
 		struct dkwedge_info *dkw = (void *) data;
-		unsigned int secsize;
 
 		if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
 			return ENODEV;
@@ -443,7 +442,7 @@ disk_ioctl_switch(dev_t dev, unsigned lo
 		strlcpy(dkw->dkw_parent, dmv->name, 16);
 
 		dkw->dkw_offset = 0;
-		dm_table_disksize(>table_head, >dkw_size, );
+		dm_table_disksize(>table_head, >dkw_size, NULL);
 		strcpy(dkw->dkw_ptype, DKW_PTYPE_FFS);
 
 		dm_dev_unbusy(dmv);
@@ -494,7 +493,6 @@ disk_ioctl_switch(dev_t dev, unsigned lo
 	}
 	case DIOCGSECTORSIZE:
 	{
-		uint64_t numsec;
 		unsigned int secsize, *valp = data;
 
 		if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
@@ -502,7 +500,7 @@ disk_ioctl_switch(dev_t dev, unsigned lo
 
 		aprint_debug("DIOCGSECTORSIZE ioctl called\n");
 
-		dm_table_disksize(>table_head, , );
+		dm_table_disksize(>table_head, NULL, );
 		*valp = secsize;
 
 		dm_dev_unbusy(dmv);
@@ -512,14 +510,13 @@ disk_ioctl_switch(dev_t dev, unsigned lo
 	{
 		off_t *valp = data;
 		uint64_t numsec;
-		unsigned int secsize;
 
 		if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
 			return ENODEV;
 
 		aprint_debug("DIOCGMEDIASIZE ioctl called\n");
 
-		dm_table_disksize(>table_head, , );
+		dm_table_disksize(>table_head, , NULL);
 		*valp = numsec;
 
 		dm_dev_unbusy(dmv);

Index: src/sys/dev/dm/dm_table.c
diff -u src/sys/dev/dm/dm_table.c:1.17 src/sys/dev/dm/dm_table.c:1.18
--- src/sys/dev/dm/dm_table.c:1.17	Sat Dec 21 11:59:03 2019
+++ src/sys/dev/dm/dm_table.c	Sun Dec 22 13:16:09 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_table.c,v 1.17 2019/12/21 11:59:03 tkusumi Exp $  */
+/*$NetBSD: dm_table.c,v 1.18 2019/12/22 13:16:09 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.17 2019/12/21 11:59:03 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.18 2019/12/22 13:16:09 tkusumi Exp $");
 
 #include 
 #include 
@@ -262,8 +262,11 @@ dm_table_disksize(dm_table_head_t *head,
 		if (secsize < tsecsize)
 			secsize = tsecsize;
 	}
-	*numsecp = secsize > 0 ? dbtob(length) / secsize : 0;
-	*secsizep = secsize;
+
+	if (numsecp)
+		*numsecp = secsize > 0 ? dbtob(length) / secsize : 0;
+	if (secsizep)
+		*secsizep = secsize;
 
 	dm_table_unbusy(head);
 }



CVS commit: src/sys/dev/dm

2019-12-22 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sun Dec 22 13:16:10 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c dm_table.c

Log Message:
dm: Make numsec/secsize arguments in dm_table_disksize() optional


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/dm/device-mapper.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/dm/dm_table.c

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



CVS commit: src/doc

2019-12-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Dec 22 12:59:13 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
update entry for dtc & libfdt after update.


To generate a diff of this commit:
cvs rdiff -u -r1.1680 -r1.1681 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1680 src/doc/3RDPARTY:1.1681
--- src/doc/3RDPARTY:1.1680	Fri Dec 20 22:26:16 2019
+++ src/doc/3RDPARTY	Sun Dec 22 12:59:12 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1680 2019/12/20 22:26:16 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1681 2019/12/22 12:59:12 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1682,9 +1682,9 @@ Location:	usr.bin/dc
 Notes:
 		Uses OpenSSL's bignum
 
-Package:	dtc,libfdt
-Version:	1.4.4
-Current Vers:	1.4.7
+Package:	dtc, libfdt
+Version:	1.5.1
+Current Vers:	1.5.1
 Maintainer:	David Gibson , Jon Loeliger 
 Archive Site:	https://git.kernel.org/pub/scm/utils/dtc/dtc.git
 Home Page:	https://git.kernel.org/pub/scm/utils/dtc/dtc.git



CVS commit: src/doc

2019-12-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Dec 22 12:59:13 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
update entry for dtc & libfdt after update.


To generate a diff of this commit:
cvs rdiff -u -r1.1680 -r1.1681 src/doc/3RDPARTY

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



CVS commit: src/external/gpl2/dtc

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:42:23 UTC 2019

Modified Files:
src/external/gpl2/dtc/dist: Makefile.dtc
src/external/gpl2/dtc/usr.bin/dtc: Makefile

Log Message:
Update for new DTC


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/gpl2/dtc/dist/Makefile.dtc
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/dtc/usr.bin/dtc/Makefile

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

Modified files:

Index: src/external/gpl2/dtc/dist/Makefile.dtc
diff -u src/external/gpl2/dtc/dist/Makefile.dtc:1.1.1.2 src/external/gpl2/dtc/dist/Makefile.dtc:1.2
--- src/external/gpl2/dtc/dist/Makefile.dtc:1.1.1.2	Sun Dec 22 12:34:03 2019
+++ src/external/gpl2/dtc/dist/Makefile.dtc	Sun Dec 22 12:42:23 2019
@@ -15,9 +15,9 @@ DTC_SRCS = \
 	treesource.c \
 	util.c
 
-ifneq ($(NO_YAML),1)
-DTC_SRCS += yamltree.c
-endif
+#ifneq ($(NO_YAML),1)
+#DTC_SRCS += yamltree.c
+#endif
 
 DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c
 DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)

Index: src/external/gpl2/dtc/usr.bin/dtc/Makefile
diff -u src/external/gpl2/dtc/usr.bin/dtc/Makefile:1.3 src/external/gpl2/dtc/usr.bin/dtc/Makefile:1.4
--- src/external/gpl2/dtc/usr.bin/dtc/Makefile:1.3	Thu May 31 09:08:25 2018
+++ src/external/gpl2/dtc/usr.bin/dtc/Makefile	Sun Dec 22 12:42:23 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2018/05/31 09:08:25 mrg Exp $
+#	$NetBSD: Makefile,v 1.4 2019/12/22 12:42:23 skrll Exp $
 
 NOMAN=	# defined
 
@@ -12,6 +12,7 @@ PROG=	dtc
 CPPFLAGS+=	-I${.CURDIR}
 CPPFLAGS+=	-I${DTCDIST}
 CPPFLAGS+=	-I${LIBFDTDIST}
+CPPFLAGS+=	-DNO_YAML
 
 SRCS+=	${DTC_SRCS} dtc-lexer.l dtc-parser.y
 YFLAGS+= -d -L



CVS commit: src/external/gpl2/dtc

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:42:23 UTC 2019

Modified Files:
src/external/gpl2/dtc/dist: Makefile.dtc
src/external/gpl2/dtc/usr.bin/dtc: Makefile

Log Message:
Update for new DTC


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/gpl2/dtc/dist/Makefile.dtc
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/dtc/usr.bin/dtc/Makefile

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



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

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:41:33 UTC 2019

Modified Files:
src/sys/external/bsd/libfdt/dist: fdt.c

Log Message:
Avoid shadowing global variable


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/sys/external/bsd/libfdt/dist/fdt.c

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



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

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:41:33 UTC 2019

Modified Files:
src/sys/external/bsd/libfdt/dist: fdt.c

Log Message:
Avoid shadowing global variable


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/sys/external/bsd/libfdt/dist/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/external/bsd/libfdt/dist/fdt.c
diff -u src/sys/external/bsd/libfdt/dist/fdt.c:1.1.1.3 src/sys/external/bsd/libfdt/dist/fdt.c:1.2
--- src/sys/external/bsd/libfdt/dist/fdt.c:1.1.1.3	Sun Dec 22 12:30:36 2019
+++ src/sys/external/bsd/libfdt/dist/fdt.c	Sun Dec 22 12:41:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdt.c,v 1.1.1.3 2019/12/22 12:30:36 skrll Exp $	*/
+/*	$NetBSD: fdt.c,v 1.2 2019/12/22 12:41:33 skrll Exp $	*/
 
 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
@@ -58,15 +58,15 @@ static int check_block_(uint32_t hdrsize
 	return 1;
 }
 
-size_t fdt_header_size_(uint32_t version)
+size_t fdt_header_size_(uint32_t vers)
 {
-	if (version <= 1)
+	if (vers <= 1)
 		return FDT_V1_SIZE;
-	else if (version <= 2)
+	else if (vers <= 2)
 		return FDT_V2_SIZE;
-	else if (version <= 3)
+	else if (vers <= 3)
 		return FDT_V3_SIZE;
-	else if (version <= 16)
+	else if (vers <= 16)
 		return FDT_V16_SIZE;
 	else
 		return FDT_V17_SIZE;



CVS commit: src/external/gpl2/dtc/usr.bin/dtc

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:41:52 UTC 2019

Modified Files:
src/external/gpl2/dtc/usr.bin/dtc: version_gen.h

Log Message:
Update version


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/dtc/usr.bin/dtc/version_gen.h

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

Modified files:

Index: src/external/gpl2/dtc/usr.bin/dtc/version_gen.h
diff -u src/external/gpl2/dtc/usr.bin/dtc/version_gen.h:1.2 src/external/gpl2/dtc/usr.bin/dtc/version_gen.h:1.3
--- src/external/gpl2/dtc/usr.bin/dtc/version_gen.h:1.2	Fri Jun 16 22:47:22 2017
+++ src/external/gpl2/dtc/usr.bin/dtc/version_gen.h	Sun Dec 22 12:41:52 2019
@@ -1 +1 @@
-#define DTC_VERSION "DTC 1.4.4"
+#define DTC_VERSION "DTC 1.5.1"



CVS commit: src/external/gpl2/dtc/usr.bin/dtc

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:41:52 UTC 2019

Modified Files:
src/external/gpl2/dtc/usr.bin/dtc: version_gen.h

Log Message:
Update version


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/dtc/usr.bin/dtc/version_gen.h

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



CVS commit: src/external/gpl2/dtc/dist

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:38:24 UTC 2019

Modified Files:
src/external/gpl2/dtc/dist: data.c dtc-lexer.l dtc-parser.y dtc.h
fdtdump.c fdtput.c flattree.c srcpos.c util.h
src/external/gpl2/dtc/dist/tests: mangle-layout.c move_and_save.c
tests.h
Removed Files:
src/external/gpl2/dtc/dist/tests: mangle-layout.supp open_pack.supp
sw_tree1.supp tests.sh

Log Message:
Merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/dtc/dist/data.c \
src/external/gpl2/dtc/dist/dtc-lexer.l \
src/external/gpl2/dtc/dist/dtc-parser.y src/external/gpl2/dtc/dist/dtc.h \
src/external/gpl2/dtc/dist/fdtdump.c src/external/gpl2/dtc/dist/fdtput.c \
src/external/gpl2/dtc/dist/srcpos.c src/external/gpl2/dtc/dist/util.h
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/dtc/dist/flattree.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/dtc/dist/tests/mangle-layout.c \
src/external/gpl2/dtc/dist/tests/move_and_save.c \
src/external/gpl2/dtc/dist/tests/tests.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/gpl2/dtc/dist/tests/mangle-layout.supp \
src/external/gpl2/dtc/dist/tests/open_pack.supp \
src/external/gpl2/dtc/dist/tests/sw_tree1.supp \
src/external/gpl2/dtc/dist/tests/tests.sh

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

Modified files:

Index: src/external/gpl2/dtc/dist/data.c
diff -u src/external/gpl2/dtc/dist/data.c:1.3 src/external/gpl2/dtc/dist/data.c:1.4
--- src/external/gpl2/dtc/dist/data.c:1.3	Thu Jun  8 16:00:40 2017
+++ src/external/gpl2/dtc/dist/data.c	Sun Dec 22 12:38:24 2019
@@ -1,23 +1,8 @@
-/*	$NetBSD: data.c,v 1.3 2017/06/08 16:00:40 skrll Exp $	*/
+/*	$NetBSD: data.c,v 1.4 2019/12/22 12:38:24 skrll Exp $	*/
 
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * (C) Copyright David Gibson , IBM Corporation.  2005.
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- *   USA
  */
 
 #include "dtc.h"
@@ -76,7 +61,8 @@ struct data data_copy_escape_string(cons
 	struct data d;
 	char *q;
 
-	d = data_grow_for(empty_data, len + 1);
+	d = data_add_marker(empty_data, TYPE_STRING, NULL);
+	d = data_grow_for(d, len + 1);
 
 	q = d.val;
 	while (i < len) {
@@ -96,6 +82,7 @@ struct data data_copy_file(FILE *f, size
 {
 	struct data d = empty_data;
 
+	d = data_add_marker(d, TYPE_NONE, NULL);
 	while (!feof(f) && (d.len < maxlen)) {
 		size_t chunksize, ret;
 
Index: src/external/gpl2/dtc/dist/dtc-lexer.l
diff -u src/external/gpl2/dtc/dist/dtc-lexer.l:1.3 src/external/gpl2/dtc/dist/dtc-lexer.l:1.4
--- src/external/gpl2/dtc/dist/dtc-lexer.l:1.3	Thu Jun  8 16:00:40 2017
+++ src/external/gpl2/dtc/dist/dtc-lexer.l	Sun Dec 22 12:38:24 2019
@@ -1,23 +1,8 @@
-/*	$NetBSD: dtc-lexer.l,v 1.3 2017/06/08 16:00:40 skrll Exp $	*/
+/*	$NetBSD: dtc-lexer.l,v 1.4 2019/12/22 12:38:24 skrll Exp $	*/
 
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * (C) Copyright David Gibson , IBM Corporation.  2005.
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- *   USA
  */
 
 %option noyywrap nounput noinput never-interactive
@@ -155,6 +140,13 @@ static void PRINTF(1, 2) lexical_error(c
 			return DT_DEL_NODE;
 		}
 
+<*>"/omit-if-no-ref/"	{
+			DPRINT("Keyword: /omit-if-no-ref/\n");
+			DPRINT("\n");
+			BEGIN(PROPNODENAME);
+			return DT_OMIT_NO_REF;
+		}
+
 <*>{LABEL}:	{
 			DPRINT("Label: %s\n", yytext);
 			yylval.labelref = 

CVS commit: src/external/gpl2/dtc/dist

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:38:24 UTC 2019

Modified Files:
src/external/gpl2/dtc/dist: data.c dtc-lexer.l dtc-parser.y dtc.h
fdtdump.c fdtput.c flattree.c srcpos.c util.h
src/external/gpl2/dtc/dist/tests: mangle-layout.c move_and_save.c
tests.h
Removed Files:
src/external/gpl2/dtc/dist/tests: mangle-layout.supp open_pack.supp
sw_tree1.supp tests.sh

Log Message:
Merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/dtc/dist/data.c \
src/external/gpl2/dtc/dist/dtc-lexer.l \
src/external/gpl2/dtc/dist/dtc-parser.y src/external/gpl2/dtc/dist/dtc.h \
src/external/gpl2/dtc/dist/fdtdump.c src/external/gpl2/dtc/dist/fdtput.c \
src/external/gpl2/dtc/dist/srcpos.c src/external/gpl2/dtc/dist/util.h
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/dtc/dist/flattree.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/dtc/dist/tests/mangle-layout.c \
src/external/gpl2/dtc/dist/tests/move_and_save.c \
src/external/gpl2/dtc/dist/tests/tests.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/gpl2/dtc/dist/tests/mangle-layout.supp \
src/external/gpl2/dtc/dist/tests/open_pack.supp \
src/external/gpl2/dtc/dist/tests/sw_tree1.supp \
src/external/gpl2/dtc/dist/tests/tests.sh

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



CVS import: src/external/gpl2/dtc/dist

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:34:08 UTC 2019

Update of /cvsroot/src/external/gpl2/dtc/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv26924

Log Message:
Import dtc 1.5.1

Status:

Vendor Tag: DTC
Release Tags:   dtc-1-5-1

U src/external/gpl2/dtc/dist/README
U src/external/gpl2/dtc/dist/Makefile
U src/external/gpl2/dtc/dist/README.license
C src/external/gpl2/dtc/dist/util.h
C src/external/gpl2/dtc/dist/fdtput.c
U src/external/gpl2/dtc/dist/checks.c
C src/external/gpl2/dtc/dist/data.c
U src/external/gpl2/dtc/dist/Makefile.dtc
U src/external/gpl2/dtc/dist/livetree.c
C src/external/gpl2/dtc/dist/srcpos.c
U src/external/gpl2/dtc/dist/Makefile.convert-dtsv0
U src/external/gpl2/dtc/dist/util.c
U src/external/gpl2/dtc/dist/dtc.c
C src/external/gpl2/dtc/dist/dtc.h
U src/external/gpl2/dtc/dist/TODO
U src/external/gpl2/dtc/dist/fdtget.c
U src/external/gpl2/dtc/dist/Makefile.utils
N src/external/gpl2/dtc/dist/yamltree.c
N src/external/gpl2/dtc/dist/fdtoverlay.c
U src/external/gpl2/dtc/dist/treesource.c
C src/external/gpl2/dtc/dist/flattree.c
U src/external/gpl2/dtc/dist/GPL
U src/external/gpl2/dtc/dist/fstree.c
U src/external/gpl2/dtc/dist/convert-dtsv0-lexer.l
U src/external/gpl2/dtc/dist/dtdiff
U src/external/gpl2/dtc/dist/srcpos.h
C src/external/gpl2/dtc/dist/fdtdump.c
C src/external/gpl2/dtc/dist/dtc-lexer.l
N src/external/gpl2/dtc/dist/BSD-2-Clause
C src/external/gpl2/dtc/dist/dtc-parser.y
U src/external/gpl2/dtc/dist/scripts/setlocalversion
U src/external/gpl2/dtc/dist/scripts/kup-dtc
U src/external/gpl2/dtc/dist/Documentation/dts-format.txt
U src/external/gpl2/dtc/dist/Documentation/dt-object-internal.txt
U src/external/gpl2/dtc/dist/Documentation/dtc-paper.bib
U src/external/gpl2/dtc/dist/Documentation/dtc-paper.tex
U src/external/gpl2/dtc/dist/Documentation/manual.txt
N src/external/gpl2/dtc/dist/pylibfdt/.gitignore
N src/external/gpl2/dtc/dist/pylibfdt/libfdt.i
N src/external/gpl2/dtc/dist/pylibfdt/setup.py
N src/external/gpl2/dtc/dist/pylibfdt/Makefile.pylibfdt
U src/external/gpl2/dtc/dist/tests/addresses.dts
U src/external/gpl2/dtc/dist/tests/path_offset.c
U src/external/gpl2/dtc/dist/tests/overlay_bad_fixup_index_trailing.dts
U src/external/gpl2/dtc/dist/tests/include7.dts
U src/external/gpl2/dtc/dist/tests/nopulate.c
U src/external/gpl2/dtc/dist/tests/test_tree1_wrong5.dts
U src/external/gpl2/dtc/dist/tests/add_subnode_with_nops.c
N src/external/gpl2/dtc/dist/tests/overlay_overlay_nosugar.dts
U src/external/gpl2/dtc/dist/tests/incbin.bin
U src/external/gpl2/dtc/dist/tests/prop-after-subnode.dts
U src/external/gpl2/dtc/dist/tests/overlay_overlay_no_fixups.dts
U src/external/gpl2/dtc/dist/tests/node_check_compatible.c
N src/external/gpl2/dtc/dist/tests/unit-addr-leading-0s.dts
U src/external/gpl2/dtc/dist/tests/del_property.c
N src/external/gpl2/dtc/dist/tests/stacked_overlay_baz.dts
U src/external/gpl2/dtc/dist/tests/root_node.c
U src/external/gpl2/dtc/dist/tests/overlay_base.dts
U src/external/gpl2/dtc/dist/tests/reuse-label6.dts
U src/external/gpl2/dtc/dist/tests/include5a.dts
U src/external/gpl2/dtc/dist/tests/find_property.c
U src/external/gpl2/dtc/dist/tests/dependencies.cmp
U src/external/gpl2/dtc/dist/tests/appendprop.dts
U src/external/gpl2/dtc/dist/tests/reuse-label.dts
N src/external/gpl2/dtc/dist/tests/bad-phandle-cells.dts
U src/external/gpl2/dtc/dist/tests/test_tree1_merge.dts
U src/external/gpl2/dtc/dist/tests/propname_escapes.c
U src/external/gpl2/dtc/dist/tests/dependencies.dts
U src/external/gpl2/dtc/dist/tests/del_node.c
U src/external/gpl2/dtc/dist/tests/fdtdump.dts
U src/external/gpl2/dtc/dist/tests/test_tree1_wrong3.dts
U src/external/gpl2/dtc/dist/tests/run_tests.sh
U src/external/gpl2/dtc/dist/tests/include3.dts
U src/external/gpl2/dtc/dist/tests/reg-without-unit-addr.dts
U src/external/gpl2/dtc/dist/tests/stringlist.dts
U src/external/gpl2/dtc/dist/tests/references.dts
N src/external/gpl2/dtc/dist/tests/rw_oom.c
N src/external/gpl2/dtc/dist/tests/stacked_overlay_base.dts
N src/external/gpl2/dtc/dist/tests/truncated_string.c
U src/external/gpl2/dtc/dist/tests/truncated_property.c
N src/external/gpl2/dtc/dist/tests/get_prop_offset.c
N src/external/gpl2/dtc/dist/tests/bad-gpio.dts
N src/external/gpl2/dtc/dist/tests/testutils.sh
U src/external/gpl2/dtc/dist/tests/supernode_atdepth_offset.c
U src/external/gpl2/dtc/dist/tests/empty.dts
U src/external/gpl2/dtc/dist/tests/overlay_bad_fixup_path_only_sep.dts
U src/external/gpl2/dtc/dist/tests/include4.dts
U src/external/gpl2/dtc/dist/tests/boot-cpuid.dts
U src/external/gpl2/dtc/dist/tests/bad-octal-literal.dts
U src/external/gpl2/dtc/dist/tests/nul-in-escape.dts
C src/external/gpl2/dtc/dist/tests/tests.h
U src/external/gpl2/dtc/dist/tests/overlay_bad_fixup_empty.dts
U src/external/gpl2/dtc/dist/tests/dtbs_equal_unordered.c
N src/external/gpl2/dtc/dist/tests/bad-interrupt-cells.dts
U src/external/gpl2/dtc/dist/tests/overlay_bad_fixup_path_prop.dts
N 

CVS import: src/external/gpl2/dtc/dist

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:34:08 UTC 2019

Update of /cvsroot/src/external/gpl2/dtc/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv26924

Log Message:
Import dtc 1.5.1

Status:

Vendor Tag: DTC
Release Tags:   dtc-1-5-1

U src/external/gpl2/dtc/dist/README
U src/external/gpl2/dtc/dist/Makefile
U src/external/gpl2/dtc/dist/README.license
C src/external/gpl2/dtc/dist/util.h
C src/external/gpl2/dtc/dist/fdtput.c
U src/external/gpl2/dtc/dist/checks.c
C src/external/gpl2/dtc/dist/data.c
U src/external/gpl2/dtc/dist/Makefile.dtc
U src/external/gpl2/dtc/dist/livetree.c
C src/external/gpl2/dtc/dist/srcpos.c
U src/external/gpl2/dtc/dist/Makefile.convert-dtsv0
U src/external/gpl2/dtc/dist/util.c
U src/external/gpl2/dtc/dist/dtc.c
C src/external/gpl2/dtc/dist/dtc.h
U src/external/gpl2/dtc/dist/TODO
U src/external/gpl2/dtc/dist/fdtget.c
U src/external/gpl2/dtc/dist/Makefile.utils
N src/external/gpl2/dtc/dist/yamltree.c
N src/external/gpl2/dtc/dist/fdtoverlay.c
U src/external/gpl2/dtc/dist/treesource.c
C src/external/gpl2/dtc/dist/flattree.c
U src/external/gpl2/dtc/dist/GPL
U src/external/gpl2/dtc/dist/fstree.c
U src/external/gpl2/dtc/dist/convert-dtsv0-lexer.l
U src/external/gpl2/dtc/dist/dtdiff
U src/external/gpl2/dtc/dist/srcpos.h
C src/external/gpl2/dtc/dist/fdtdump.c
C src/external/gpl2/dtc/dist/dtc-lexer.l
N src/external/gpl2/dtc/dist/BSD-2-Clause
C src/external/gpl2/dtc/dist/dtc-parser.y
U src/external/gpl2/dtc/dist/scripts/setlocalversion
U src/external/gpl2/dtc/dist/scripts/kup-dtc
U src/external/gpl2/dtc/dist/Documentation/dts-format.txt
U src/external/gpl2/dtc/dist/Documentation/dt-object-internal.txt
U src/external/gpl2/dtc/dist/Documentation/dtc-paper.bib
U src/external/gpl2/dtc/dist/Documentation/dtc-paper.tex
U src/external/gpl2/dtc/dist/Documentation/manual.txt
N src/external/gpl2/dtc/dist/pylibfdt/.gitignore
N src/external/gpl2/dtc/dist/pylibfdt/libfdt.i
N src/external/gpl2/dtc/dist/pylibfdt/setup.py
N src/external/gpl2/dtc/dist/pylibfdt/Makefile.pylibfdt
U src/external/gpl2/dtc/dist/tests/addresses.dts
U src/external/gpl2/dtc/dist/tests/path_offset.c
U src/external/gpl2/dtc/dist/tests/overlay_bad_fixup_index_trailing.dts
U src/external/gpl2/dtc/dist/tests/include7.dts
U src/external/gpl2/dtc/dist/tests/nopulate.c
U src/external/gpl2/dtc/dist/tests/test_tree1_wrong5.dts
U src/external/gpl2/dtc/dist/tests/add_subnode_with_nops.c
N src/external/gpl2/dtc/dist/tests/overlay_overlay_nosugar.dts
U src/external/gpl2/dtc/dist/tests/incbin.bin
U src/external/gpl2/dtc/dist/tests/prop-after-subnode.dts
U src/external/gpl2/dtc/dist/tests/overlay_overlay_no_fixups.dts
U src/external/gpl2/dtc/dist/tests/node_check_compatible.c
N src/external/gpl2/dtc/dist/tests/unit-addr-leading-0s.dts
U src/external/gpl2/dtc/dist/tests/del_property.c
N src/external/gpl2/dtc/dist/tests/stacked_overlay_baz.dts
U src/external/gpl2/dtc/dist/tests/root_node.c
U src/external/gpl2/dtc/dist/tests/overlay_base.dts
U src/external/gpl2/dtc/dist/tests/reuse-label6.dts
U src/external/gpl2/dtc/dist/tests/include5a.dts
U src/external/gpl2/dtc/dist/tests/find_property.c
U src/external/gpl2/dtc/dist/tests/dependencies.cmp
U src/external/gpl2/dtc/dist/tests/appendprop.dts
U src/external/gpl2/dtc/dist/tests/reuse-label.dts
N src/external/gpl2/dtc/dist/tests/bad-phandle-cells.dts
U src/external/gpl2/dtc/dist/tests/test_tree1_merge.dts
U src/external/gpl2/dtc/dist/tests/propname_escapes.c
U src/external/gpl2/dtc/dist/tests/dependencies.dts
U src/external/gpl2/dtc/dist/tests/del_node.c
U src/external/gpl2/dtc/dist/tests/fdtdump.dts
U src/external/gpl2/dtc/dist/tests/test_tree1_wrong3.dts
U src/external/gpl2/dtc/dist/tests/run_tests.sh
U src/external/gpl2/dtc/dist/tests/include3.dts
U src/external/gpl2/dtc/dist/tests/reg-without-unit-addr.dts
U src/external/gpl2/dtc/dist/tests/stringlist.dts
U src/external/gpl2/dtc/dist/tests/references.dts
N src/external/gpl2/dtc/dist/tests/rw_oom.c
N src/external/gpl2/dtc/dist/tests/stacked_overlay_base.dts
N src/external/gpl2/dtc/dist/tests/truncated_string.c
U src/external/gpl2/dtc/dist/tests/truncated_property.c
N src/external/gpl2/dtc/dist/tests/get_prop_offset.c
N src/external/gpl2/dtc/dist/tests/bad-gpio.dts
N src/external/gpl2/dtc/dist/tests/testutils.sh
U src/external/gpl2/dtc/dist/tests/supernode_atdepth_offset.c
U src/external/gpl2/dtc/dist/tests/empty.dts
U src/external/gpl2/dtc/dist/tests/overlay_bad_fixup_path_only_sep.dts
U src/external/gpl2/dtc/dist/tests/include4.dts
U src/external/gpl2/dtc/dist/tests/boot-cpuid.dts
U src/external/gpl2/dtc/dist/tests/bad-octal-literal.dts
U src/external/gpl2/dtc/dist/tests/nul-in-escape.dts
C src/external/gpl2/dtc/dist/tests/tests.h
U src/external/gpl2/dtc/dist/tests/overlay_bad_fixup_empty.dts
U src/external/gpl2/dtc/dist/tests/dtbs_equal_unordered.c
N src/external/gpl2/dtc/dist/tests/bad-interrupt-cells.dts
U src/external/gpl2/dtc/dist/tests/overlay_bad_fixup_path_prop.dts
N 

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

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:33:17 UTC 2019

Modified Files:
src/sys/external/bsd/libfdt/dist: libfdt_env.h

Log Message:
Merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/libfdt/dist/libfdt_env.h

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



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

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:33:17 UTC 2019

Modified Files:
src/sys/external/bsd/libfdt/dist: libfdt_env.h

Log Message:
Merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/libfdt/dist/libfdt_env.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/libfdt/dist/libfdt_env.h
diff -u src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.4 src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.5
--- src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.4	Thu Aug 23 01:25:22 2018
+++ src/sys/external/bsd/libfdt/dist/libfdt_env.h	Sun Dec 22 12:33:17 2019
@@ -1,57 +1,12 @@
-/*	$NetBSD: libfdt_env.h,v 1.4 2018/08/23 01:25:22 jmcneill Exp $	*/
+/*	$NetBSD: libfdt_env.h,v 1.5 2019/12/22 12:33:17 skrll Exp $	*/
 
-#ifndef _LIBFDT_ENV_H
-#define _LIBFDT_ENV_H
+/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
+#ifndef LIBFDT_ENV_H
+#define LIBFDT_ENV_H
 /*
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  * Copyright 2012 Kim Phillips, Freescale Semiconductor.
- *
- * libfdt is dual licensed: you can use it either under the terms of
- * the GPL, or the BSD license, at your option.
- *
- *  a) This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- *
- * Alternatively,
- *
- *  b) 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 COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "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 COPYRIGHT OWNER OR
- * CONTRIBUTORS 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.
  */
 
 #if defined(_KERNEL) || defined(_STANDALONE)
@@ -59,10 +14,12 @@
 #include 
 #include 
 #else
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #endif
 
 #ifdef __CHECKER__
@@ -117,4 +74,31 @@ static inline fdt64_t cpu_to_fdt64(uint6
 #undef CPU_TO_FDT16
 #undef EXTRACT_BYTE
 
-#endif /* _LIBFDT_ENV_H */
+#ifdef __APPLE__
+#include 
+
+/* strnlen() is not available on Mac OS < 10.7 */
+# if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < \
+ MAC_OS_X_VERSION_10_7)
+
+#define strnlen fdt_strnlen
+
+/*
+ * fdt_strnlen: returns the length of a string or max_count - which ever is
+ * smallest.
+ * Input 1 string: the string whose size is to be determined
+ * Input 2 max_count: the maximum value returned by this function
+ * Output: length of the string or max_count (the smallest of the two)
+ */
+static inline size_t fdt_strnlen(const char *string, size_t max_count)
+{
+const char *p = memchr(string, 0, max_count);
+return p ? p - string : max_count;
+}
+
+#endif /* !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED <
+  MAC_OS_X_VERSION_10_7) */
+
+#endif /* __APPLE__ */
+
+#endif /* LIBFDT_ENV_H */



CVS import: src/sys/external/bsd/libfdt/dist

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:30:38 UTC 2019

Update of /cvsroot/src/sys/external/bsd/libfdt/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv7278

Log Message:
Import libfdt 1.5.1

Status:

Vendor Tag: DTC
Release Tags:   dtc-1-5-1

U src/sys/external/bsd/libfdt/dist/fdt_wip.c
U src/sys/external/bsd/libfdt/dist/fdt.c
U src/sys/external/bsd/libfdt/dist/fdt_strerror.c
U src/sys/external/bsd/libfdt/dist/Makefile.libfdt
U src/sys/external/bsd/libfdt/dist/fdt.h
N src/sys/external/bsd/libfdt/dist/.gitignore
U src/sys/external/bsd/libfdt/dist/version.lds
U src/sys/external/bsd/libfdt/dist/fdt_ro.c
U src/sys/external/bsd/libfdt/dist/TODO
U src/sys/external/bsd/libfdt/dist/fdt_addresses.c
C src/sys/external/bsd/libfdt/dist/libfdt_env.h
U src/sys/external/bsd/libfdt/dist/fdt_empty_tree.c
U src/sys/external/bsd/libfdt/dist/libfdt_internal.h
U src/sys/external/bsd/libfdt/dist/fdt_rw.c
U src/sys/external/bsd/libfdt/dist/libfdt.h
U src/sys/external/bsd/libfdt/dist/fdt_overlay.c
U src/sys/external/bsd/libfdt/dist/fdt_sw.c

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jDTC:yesterday -jDTC src/sys/external/bsd/libfdt/dist



CVS import: src/sys/external/bsd/libfdt/dist

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:30:38 UTC 2019

Update of /cvsroot/src/sys/external/bsd/libfdt/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv7278

Log Message:
Import libfdt 1.5.1

Status:

Vendor Tag: DTC
Release Tags:   dtc-1-5-1

U src/sys/external/bsd/libfdt/dist/fdt_wip.c
U src/sys/external/bsd/libfdt/dist/fdt.c
U src/sys/external/bsd/libfdt/dist/fdt_strerror.c
U src/sys/external/bsd/libfdt/dist/Makefile.libfdt
U src/sys/external/bsd/libfdt/dist/fdt.h
N src/sys/external/bsd/libfdt/dist/.gitignore
U src/sys/external/bsd/libfdt/dist/version.lds
U src/sys/external/bsd/libfdt/dist/fdt_ro.c
U src/sys/external/bsd/libfdt/dist/TODO
U src/sys/external/bsd/libfdt/dist/fdt_addresses.c
C src/sys/external/bsd/libfdt/dist/libfdt_env.h
U src/sys/external/bsd/libfdt/dist/fdt_empty_tree.c
U src/sys/external/bsd/libfdt/dist/libfdt_internal.h
U src/sys/external/bsd/libfdt/dist/fdt_rw.c
U src/sys/external/bsd/libfdt/dist/libfdt.h
U src/sys/external/bsd/libfdt/dist/fdt_overlay.c
U src/sys/external/bsd/libfdt/dist/fdt_sw.c

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jDTC:yesterday -jDTC src/sys/external/bsd/libfdt/dist



CVS commit: src/sys/dev/dm

2019-12-22 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sun Dec 22 12:28:54 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c

Log Message:
dm: Add missing "ioctl called" debug prints


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/dm/device-mapper.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/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.57 src/sys/dev/dm/device-mapper.c:1.58
--- src/sys/dev/dm/device-mapper.c:1.57	Thu Dec 19 15:57:46 2019
+++ src/sys/dev/dm/device-mapper.c	Sun Dec 22 12:28:54 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: device-mapper.c,v 1.57 2019/12/19 15:57:46 tkusumi Exp $ */
+/*$NetBSD: device-mapper.c,v 1.58 2019/12/22 12:28:54 tkusumi Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -456,6 +456,8 @@ disk_ioctl_switch(dev_t dev, unsigned lo
 		if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
 			return ENODEV;
 
+		aprint_debug("DIOCGDISKINFO ioctl called\n");
+
 		if (dmv->diskp->dk_info == NULL) {
 			dm_dev_unbusy(dmv);
 			return ENOTSUP;
@@ -474,6 +476,8 @@ disk_ioctl_switch(dev_t dev, unsigned lo
 		if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
 			return ENODEV;
 
+		aprint_debug("DIOCCACHESYNC ioctl called\n");
+
 		/* Select active table */
 		tbl = dm_table_get_entry(>table_head, DM_TABLE_ACTIVE);
 



CVS commit: src/sys/dev/dm

2019-12-22 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sun Dec 22 12:28:54 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c

Log Message:
dm: Add missing "ioctl called" debug prints


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/dm/device-mapper.c

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



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

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:21:45 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm283x_platform.c

Log Message:
Add brcm,bcm2711 as an alias for brcm,bcm2838


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/broadcom/bcm283x_platform.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/broadcom/bcm283x_platform.c
diff -u src/sys/arch/arm/broadcom/bcm283x_platform.c:1.26 src/sys/arch/arm/broadcom/bcm283x_platform.c:1.27
--- src/sys/arch/arm/broadcom/bcm283x_platform.c:1.26	Sat Sep 28 07:39:30 2019
+++ src/sys/arch/arm/broadcom/bcm283x_platform.c	Sun Dec 22 12:21:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm283x_platform.c,v 1.26 2019/09/28 07:39:30 skrll Exp $	*/
+/*	$NetBSD: bcm283x_platform.c,v 1.27 2019/12/22 12:21:45 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.26 2019/09/28 07:39:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.27 2019/12/22 12:21:45 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -1516,4 +1516,5 @@ static const struct arm_platform bcm2838
 ARM_PLATFORM(bcm2836, "brcm,bcm2836", _platform);
 ARM_PLATFORM(bcm2837, "brcm,bcm2837", _platform);
 ARM_PLATFORM(bcm2838, "brcm,bcm2838", _platform);
+ARM_PLATFORM(bcm2711, "brcm,bcm2711", _platform);
 #endif



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

2019-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 22 12:21:45 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm283x_platform.c

Log Message:
Add brcm,bcm2711 as an alias for brcm,bcm2838


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/broadcom/bcm283x_platform.c

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



Re: CVS commit: src

2019-12-22 Thread Maxime Villard

Le 21/12/2019 à 23:48, Christos Zoulas a écrit :

In article <15520611-7273-9567-33a4-ff2490b2e...@m00nbsd.net>,
Maxime Villard   wrote:

Le 21/12/2019 à 00:05, Taylor R Campbell a écrit :

Security-team is not perfect.  We're happy to discuss a better way to
disable filemon provisionally, and/or how to better address the
existing users if we are to delete it -- after you do as core asked
you to do to resolve the interim dispute by restoring the tree.

This is a social process.  We can work together to make it better for
everyone, but you have to be willing to work with the community,
including accepting rulings by core to resolve disputes.


I'm afraid you, Taylor, don't have a monopoly on representing the community.


He does represent the community since he represents core. If you
are unhappy with core@ talk to board@. If you are unhappy with
core@ and board@, get the community to vote for you in the next
elections, or get signatures to impeach them. They are the elected
leadership of the project.


It appears you didn't read correctly the line of mine you just quoted.


To resolve this dispute, I have proposed to revert both my removal, and
secteam's broken disabling. This gives a clear basis to start a discussion
on what to do with filemon exactly.

Is core fine with that? Or are there double standards at play here?


Core has been very clear. They've asked you to revert your commits, not
other commits. If they had been unhappy with other commits they would
have asked the committers of the other commits to revert them.


"If". Except that I haven't received any formal email from core. Why can't
core just send a simple official email to say whether yes, or no, they are
fine with me reverting secteam's change, in addition to mine?

I have accepted core's ruling, but have since pointed out additional
serious deficiencies with how filemon was dealt with, hence the concern on
how to proceed. Core, however, has been unwilling to provide an answer and
to work with the community.

It's been two days of this, and I fail to see where the difficulty is.

You, Martin Christos and Taylor, are trying to change subject, find
excuses, and are sending me irrelevant responses vaguely insinuating that
I should revert my change only without addressing the additional concerns
expressed repeatedly. I fail to see whether I should take these as official
core answers.

If they are, please clearly say so.

Maxime