svn commit: r283181 - in head/sys: arm/amlogic/aml8726 boot/fdt/dts/arm

2015-05-21 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Thu May 21 07:01:08 2015
New Revision: 283181
URL: https://svnweb.freebsd.org/changeset/base/283181

Log:
  The RTC initialization values are based on the SoC which can be
  determined at runtime so there's no need to set the values in
  each DTS.
  Tested on YYHD18 (aml8726-m3), VSATV102 (aml8726-m6), and
  ODROIDC1 (aml8726-m8b).
  
  Differential Revision:https://reviews.freebsd.org/D2588
  Submitted by: John Wehle

Modified:
  head/sys/arm/amlogic/aml8726/aml8726_rtc.c
  head/sys/boot/fdt/dts/arm/odroidc1.dts
  head/sys/boot/fdt/dts/arm/vsatv102-m6.dts

Modified: head/sys/arm/amlogic/aml8726/aml8726_rtc.c
==
--- head/sys/arm/amlogic/aml8726/aml8726_rtc.c  Thu May 21 06:58:50 2015
(r283180)
+++ head/sys/arm/amlogic/aml8726/aml8726_rtc.c  Thu May 21 07:01:08 2015
(r283181)
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #include "clock_if.h"
 
 /*
@@ -372,44 +374,27 @@ static int
 aml8726_rtc_attach(device_t dev)
 {
struct aml8726_rtc_softc *sc = device_get_softc(dev);
-   boolean_t init_always_valid;
-   char *init_always;
-   pcell_t prop;
-   phandle_t node;
-   ssize_t len;
 
sc->dev = dev;
 
-   node = ofw_bus_get_node(dev);
-
-   len = OF_getprop_alloc(node, "init-always",
-   sizeof(char), (void **)&init_always);
-   sc->init.always = FALSE;
-   init_always_valid = FALSE;
-   if (len > 0) {
-   if (strncmp(init_always, "true", len) == 0) {
-   sc->init.always = TRUE;
-   init_always_valid = TRUE;
-   } else if (strncmp(init_always, "false", len) == 0)
-   init_always_valid = TRUE;
-   free(init_always, M_OFWPROP);
-   }
-   if (init_always_valid == FALSE) {
-   device_printf(dev, "missing init-always attribute in FDT\n");
-   return (ENXIO);
-   }
-
-   if (OF_getencprop(node, "xo-init", &prop, sizeof(prop)) <= 0) {
-   device_printf(dev, "missing xo-init attribute in FDT\n");
-   return (ENXIO);
-   }
-   sc->init.xo = prop;
-
-   if (OF_getencprop(node, "gpo-init", &prop, sizeof(prop)) <= 0) {
-   device_printf(dev, "missing gpo-init attribute in FDT\n");
+   switch (aml8726_soc_hw_rev) {
+   case AML_SOC_HW_REV_M3:
+   sc->init.always = true;
+   sc->init.xo = 0x3c0a;
+   sc->init.gpo = 0x10;
+   break;
+   case AML_SOC_HW_REV_M6:
+   case AML_SOC_HW_REV_M8:
+   case AML_SOC_HW_REV_M8B:
+   sc->init.always = false;
+   sc->init.xo = 0x180a;
+   sc->init.gpo = 0x50;
+   break;
+   default:
+   device_printf(dev, "unsupported SoC\n");
return (ENXIO);
+   /* NOTREACHED */
}
-   sc->init.gpo = prop;
 
if (bus_alloc_resources(dev, aml8726_rtc_spec, sc->res)) {
device_printf(dev, "can not allocate resources for device\n");

Modified: head/sys/boot/fdt/dts/arm/odroidc1.dts
==
--- head/sys/boot/fdt/dts/arm/odroidc1.dts  Thu May 21 06:58:50 2015
(r283180)
+++ head/sys/boot/fdt/dts/arm/odroidc1.dts  Thu May 21 07:01:08 2015
(r283181)
@@ -194,10 +194,6 @@
compatible = "amlogic,aml8726-rtc";
reg = <0xc8100740 20>;  /* aobus 0x1d0 */
interrupts = <0 72 1>;
-
-   init-always = "false";
-   xo-init = <0x180a>;
-   gpo-init = <0x50>;
};
 
clkmsr: clkmsr@c1108758 {

Modified: head/sys/boot/fdt/dts/arm/vsatv102-m6.dts
==
--- head/sys/boot/fdt/dts/arm/vsatv102-m6.dts   Thu May 21 06:58:50 2015
(r283180)
+++ head/sys/boot/fdt/dts/arm/vsatv102-m6.dts   Thu May 21 07:01:08 2015
(r283181)
@@ -153,10 +153,6 @@
compatible = "amlogic,aml8726-rtc";
reg = <0xda004340 20>;  /* secbus2 0xd0 */
interrupts = <0 72 1>;  /* AM_IRQ2(8) */
-
-   init-always = "false";
-   xo-init = <0x180a>;
-   gpo-init = <0x50>;
};
 
clkmsr: clkmsr@c1108758 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283183 - head/sys/arm/amlogic/aml8726

2015-05-21 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Thu May 21 07:09:01 2015
New Revision: 283183
URL: https://svnweb.freebsd.org/changeset/base/283183

Log:
  Remove unnecessary break statements.
  
  Submitted by:John Wehle

Modified:
  head/sys/arm/amlogic/aml8726/aml8726_ccm.c
  head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c
  head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c

Modified: head/sys/arm/amlogic/aml8726/aml8726_ccm.c
==
--- head/sys/arm/amlogic/aml8726/aml8726_ccm.c  Thu May 21 07:07:28 2015
(r283182)
+++ head/sys/arm/amlogic/aml8726/aml8726_ccm.c  Thu May 21 07:09:01 2015
(r283183)
@@ -185,7 +185,6 @@ aml8726_ccm_attach(device_t dev)
device_printf(dev, "unsupported SoC\n");
return (ENXIO);
/* NOTREACHED */
-   break;
}
 
if (bus_alloc_resources(dev, aml8726_ccm_spec, sc->res)) {

Modified: head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c
==
--- head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c  Thu May 21 07:07:28 
2015(r283182)
+++ head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c  Thu May 21 07:09:01 
2015(r283183)
@@ -146,7 +146,6 @@ aml8726_pinctrl_attach(device_t dev)
device_printf(dev, "unsupported SoC\n");
return (ENXIO);
/* NOTREACHED */
-   break;
}
 
if (bus_alloc_resources(dev, aml8726_pinctrl_spec, sc->res)) {

Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c
==
--- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c  Thu May 21 07:07:28 
2015(r283182)
+++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c  Thu May 21 07:09:01 
2015(r283183)
@@ -758,7 +758,6 @@ aml8726_sdxc_attach(device_t dev)
device_printf(dev, "unsupported SoC\n");
return (ENXIO);
/* NOTREACHED */
-   break;
}
 
node = ofw_bus_get_node(dev);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283186 - head/sys/arm/amlogic/aml8726

2015-05-21 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Thu May 21 07:23:50 2015
New Revision: 283186
URL: https://svnweb.freebsd.org/changeset/base/283186

Log:
  Add driver for usbclock generator for earlier amlogic chip.
  
  Differential Revision:https://reviews.freebsd.org/D2590
  Submitted by: John Wehle

Added:
  head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c   (contents, props changed)
Modified:
  head/sys/arm/amlogic/aml8726/files.aml8726

Added: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c   Thu May 21 07:23:50 
2015(r283186)
@@ -0,0 +1,428 @@
+/*-
+ * Copyright 2014-2015 John Wehle 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+ */
+
+/*
+ * Amlogic aml8726-m3 USB physical layer driver.
+ *
+ * Both USB physical interfaces share the same configuration register.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "gpio_if.h"
+
+struct aml8726_usb_phy_gpio {
+   device_tdev;
+   uint32_tpin;
+   uint32_tpol;
+};
+
+struct aml8726_usb_phy_softc {
+   device_tdev;
+   struct resource *res[1];
+   uint32_tnpwr_en;
+   struct aml8726_usb_phy_gpio *pwr_en;
+};
+
+static struct resource_spec aml8726_usb_phy_spec[] = {
+   { SYS_RES_MEMORY,   0,  RF_ACTIVE },
+   { -1, 0 }
+};
+
+#defineAML_USB_PHY_CFG_REG 0
+#defineAML_USB_PHY_CFG_A_CLK_DETECTED  (1U << 31)
+#defineAML_USB_PHY_CFG_CLK_DIV_MASK(0x7f << 24)
+#defineAML_USB_PHY_CFG_CLK_DIV_SHIFT   24
+#defineAML_USB_PHY_CFG_B_CLK_DETECTED  (1 << 22)
+#defineAML_USB_PHY_CFG_A_PLL_RST   (1 << 19)
+#defineAML_USB_PHY_CFG_A_PHYS_RST  (1 << 18)
+#defineAML_USB_PHY_CFG_A_RST   (1 << 17)
+#defineAML_USB_PHY_CFG_B_PLL_RST   (1 << 13)
+#defineAML_USB_PHY_CFG_B_PHYS_RST  (1 << 12)
+#defineAML_USB_PHY_CFG_B_RST   (1 << 11)
+#defineAML_USB_PHY_CFG_CLK_EN  (1 << 8)
+#defineAML_USB_PHY_CFG_CLK_SEL_MASK(7 << 5)
+#defineAML_USB_PHY_CFG_CLK_SEL_XTAL(0 << 5)
+#defineAML_USB_PHY_CFG_CLK_SEL_XTAL_DIV2   (1 << 5)
+#defineAML_USB_PHY_CFG_B_POR   (1 << 1)
+#defineAML_USB_PHY_CFG_A_POR   (1 << 0)
+
+#defineAML_USB_PHY_CFG_CLK_DETECTED \
+(AML_USB_PHY_CFG_A_CLK_DETECTED | AML_USB_PHY_CFG_B_CLK_DETECTED)
+
+#defineAML_USB_PHY_MISC_A_REG  12
+#defineAML_USB_PHY_MISC_B_REG  16
+#defineAML_USB_PHY_MISC_ID_OVERIDE_EN  (1 << 23)
+#defineAML_USB_PHY_MISC_ID_OVERIDE_DEVICE  (1 << 22)
+#defineAML_USB_PHY_MISC_ID_OVERIDE_HOST(0 << 22)
+
+#defineCSR_WRITE_4(sc, reg, val)   bus_write_4((sc)->res[0], reg, 
(val))
+#defineCSR_READ_4(sc, reg) bus_read_4((sc)->res[0], reg)
+#defineCSR_BARRIER(sc, reg)bus_barrier((sc)->res[0], reg, 
4, \
+(BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE))
+
+#definePIN_ON_FLAG(pol)((pol) == 0 ?   \
+GPIO_PIN_LOW : GPIO_PIN_HIGH)
+#definePIN_OFF_FLAG(pol) 

svn commit: r283188 - head/sys/arm/amlogic/aml8726

2015-05-21 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Thu May 21 07:35:20 2015
New Revision: 283188
URL: https://svnweb.freebsd.org/changeset/base/283188

Log:
  Add missing break statement.
  
  Submitted by:   John Wehle

Modified:
  head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c

Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c
==
--- head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c   Thu May 21 07:34:08 
2015(r283187)
+++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c   Thu May 21 07:35:20 
2015(r283188)
@@ -181,8 +181,10 @@ aml8726_usb_phy_attach(device_t dev)
sc->pwr_en[i].pin = prop[i * 3 + 1];
sc->pwr_en[i].pol = prop[i * 3 + 2];
 
-   if (sc->pwr_en[i].dev == NULL)
+   if (sc->pwr_en[i].dev == NULL) {
err = 1;
+   break;
+   }
}
 
free(prop, M_OFWPROP);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283195 - head/usr.bin/soelim

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 08:20:42 2015
New Revision: 283195
URL: https://svnweb.freebsd.org/changeset/base/283195

Log:
  sort headers

Modified:
  head/usr.bin/soelim/soelim.c

Modified: head/usr.bin/soelim/soelim.c
==
--- head/usr.bin/soelim/soelim.cThu May 21 07:50:56 2015
(r283194)
+++ head/usr.bin/soelim/soelim.cThu May 21 08:20:42 2015
(r283195)
@@ -29,15 +29,15 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
+#include 
+#include 
 #define _WITH_GETLINE
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
-#include 
-#include 
+#include 
 
 #define C_OPTION 0x1
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283196 - head/usr.bin/soelim

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 08:23:45 2015
New Revision: 283196
URL: https://svnweb.freebsd.org/changeset/base/283196

Log:
  Use the POSIX PATH_MAX macro from limits.h instead of non standard MAXPATHLEN
  
  Submitted by: schwarze at OpenBSD

Modified:
  head/usr.bin/soelim/soelim.c

Modified: head/usr.bin/soelim/soelim.c
==
--- head/usr.bin/soelim/soelim.cThu May 21 08:20:42 2015
(r283195)
+++ head/usr.bin/soelim/soelim.cThu May 21 08:23:45 2015
(r283196)
@@ -27,10 +27,9 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
-
 #include 
 #include 
+#include 
 #include 
 #define _WITH_GETLINE
 #include 
@@ -56,7 +55,7 @@ static FILE *
 soelim_fopen(const char *name)
 {
FILE *f;
-   char path[MAXPATHLEN];
+   char path[PATH_MAX];
size_t i;
 
if (strcmp(name, "-") == 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283197 - head/usr.bin/soelim

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 08:26:24 2015
New Revision: 283197
URL: https://svnweb.freebsd.org/changeset/base/283197

Log:
  add an include on sys/types.h because we do explicitly use size_t
  remove unused stdbool.h
  
  Suggested by: schwarze at OpenBSD

Modified:
  head/usr.bin/soelim/soelim.c

Modified: head/usr.bin/soelim/soelim.c
==
--- head/usr.bin/soelim/soelim.cThu May 21 08:23:45 2015
(r283196)
+++ head/usr.bin/soelim/soelim.cThu May 21 08:26:24 2015
(r283197)
@@ -27,10 +27,11 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+
 #include 
 #include 
 #include 
-#include 
 #define _WITH_GETLINE
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283199 - head/usr.bin/soelim

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 08:28:48 2015
New Revision: 283199
URL: https://svnweb.freebsd.org/changeset/base/283199

Log:
  * fix roff terminology in .Nd
  * remove .Xr to self
  * add AUTHORS section
  
  Submitted by: schwarze at OpenBSD

Modified:
  head/usr.bin/soelim/soelim.1

Modified: head/usr.bin/soelim/soelim.1
==
--- head/usr.bin/soelim/soelim.1Thu May 21 08:28:35 2015
(r283198)
+++ head/usr.bin/soelim/soelim.1Thu May 21 08:28:48 2015
(r283199)
@@ -29,7 +29,7 @@
 .Os
 .Sh NAME
 .Nm soelim
-.Nd interpret .so directive in manpages
+.Nd interpret .so requests in manpages
 .Sh SYNOPSIS
 .Nm
 .Op Fl Crtv
@@ -78,5 +78,9 @@ The files are always searched first in t
 A file specified with an absolute path will be opened directly without
 performing a search.
 .Sh SEE ALSO
-.Xr mandoc 1 ,
-.Xr soelim 1
+.Xr mandoc 1
+.Sh AUTHORS
+This version of the
+.Nm
+utility was written by
+.An Baptiste Daroussin Aq Mt b...@freebsd.org .
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283201 - in head: include lib/libc/gen

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 08:38:25 2015
New Revision: 283201
URL: https://svnweb.freebsd.org/changeset/base/283201

Log:
  Remove clause 3 and 4 from the license
  
  Obtained from:NetBSD

Modified:
  head/include/stringlist.h
  head/lib/libc/gen/stringlist.c

Modified: head/include/stringlist.h
==
--- head/include/stringlist.h   Thu May 21 08:32:52 2015(r283200)
+++ head/include/stringlist.h   Thu May 21 08:38:25 2015(r283201)
@@ -12,11 +12,6 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by Christos Zoulas.
- * 4. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

Modified: head/lib/libc/gen/stringlist.c
==
--- head/lib/libc/gen/stringlist.c  Thu May 21 08:32:52 2015
(r283200)
+++ head/lib/libc/gen/stringlist.c  Thu May 21 08:38:25 2015
(r283201)
@@ -10,8 +10,6 @@
  * 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.
- * 4. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r283197 - head/usr.bin/soelim

2015-05-21 Thread Bruce Evans

On Thu, 21 May 2015, Baptiste Daroussin wrote:


Log:
 add an include on sys/types.h because we do explicitly use size_t
 remove unused stdbool.h


sys/types.h may be needed for some other typedef, but not for size_t.
size_t is already declared in at least 3 other of the included headers:
-  and  (C90 standard)
-  (POSIX.1-2001 standard)

 is a prerequisite for  in POSIX.1-1990, and
most section 2 man pages still document it as a prerequiste for their
syscalls.  They place it before the include of  but are too
fuzzy to document if it is a prerequisite for  includes
 and thus gets size_t and lots of pollution.  
was cleaned up a bit in 2002, but the ifdefs for things like
_SIZE_T_DECLARED in this cleanup are still nonsense, because 
still includes  before these ifdefs and thus gets size_t
and lots of pollution, much the same as in FreeBSD-1.

Some of the section 2 headers were bogusly changed to say that
sys/types.h is a prerequisite for their syscalls _after_ POSIX.1-2001
standardized it not being a prerequisite for  for the syscalls
declared there.  It is needed for portability to pre-POSIX.1-2001
systems that are not polluted like FreeBSD, if any.  IIRC, even
POSIX.1-1990 permits  (or any POSIX header) to declare any
typedef ending in _t, so  can declare size_t for itself and
might even work without its prerequisite.  Applications just cannot
depend on this.

In the previous change, the use of MAXPATHLEN regressed to use of
PATH_MAX.  MAXPATHLEN was honestly unportable.  It defined in all (?)
BSD systems.  PATH_MAX only defined if {PATH_MAX} is constant.  It
is better to be honestly unportable than to use PATH_MAX incorrectly.

MAXPATHLEN required the include of .  That gave 
and lots of undocumented pollution.  Apparently, none of the pollution
was needed, not even .

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283220 - in head: lib lib/libmandoc share/mk usr.bin/mandoc

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 12:51:56 2015
New Revision: 283220
URL: https://svnweb.freebsd.org/changeset/base/283220

Log:
  Drop libmandoc and incorporate it into the main mandoc Makefile
  
  This simplifies maintainance of mandoc(1).
  Note that the same direction was taken on OpenBSD

Deleted:
  head/lib/libmandoc/
Modified:
  head/lib/Makefile
  head/share/mk/src.libnames.mk
  head/usr.bin/mandoc/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Thu May 21 10:40:18 2015(r283219)
+++ head/lib/Makefile   Thu May 21 12:51:56 2015(r283220)
@@ -65,7 +65,6 @@ SUBDIR=   ${SUBDIR_ORDERED} \
${_libldns} \
liblzma \
${_libmagic} \
-   libmandoc \
libmemstat \
libmd \
${_libmilter} \

Modified: head/share/mk/src.libnames.mk
==
--- head/share/mk/src.libnames.mk   Thu May 21 10:40:18 2015
(r283219)
+++ head/share/mk/src.libnames.mk   Thu May 21 12:51:56 2015
(r283220)
@@ -32,7 +32,6 @@ _INTERNALLIBS=\
fifolog \
ipf \
lpr \
-   mandoc \
netbsd \
ntp \
ntpevent \
@@ -108,7 +107,6 @@ _LIBRARIES= \
lzma \
m \
magic \
-   mandoc \
md \
memstat \
mp \
@@ -314,9 +312,6 @@ LIBREADLINE?=   ${LIBREADLINEDIR}/libreadl
 LIBOHASHDIR=   ${ROOTOBJDIR}/lib/libohash
 LIBOHASH?= ${LIBOHASHDIR}/libohash.a
 
-LIBMANDOCDIR=  ${ROOTOBJDIR}/lib/libmandoc
-LIBMANDOC?=${LIBMANDOCDIR}/libmandoc.a
-
 LIBSMDIR=  ${ROOTOBJDIR}/lib/libsm
 LIBSM?=${LIBSMDIR}/libsm.a
 

Modified: head/usr.bin/mandoc/Makefile
==
--- head/usr.bin/mandoc/MakefileThu May 21 10:40:18 2015
(r283219)
+++ head/usr.bin/mandoc/MakefileThu May 21 12:51:56 2015
(r283220)
@@ -9,6 +9,37 @@ FILESDIR=  ${SHAREDIR}/mdocml
 MAN=   mandoc.1 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 # roff.7
 MLINKS= mandoc.1 mdocml.1
 
+LIBMAN_SRCS=   man.c \
+   man_hash.c \
+   man_macro.c \
+   man_validate.c
+
+LIBMDOC_SRCS=  att.c \
+   lib.c \
+   mdoc.c \
+   mdoc_argv.c \
+   mdoc_hash.c \
+   mdoc_macro.c \
+   mdoc_validate.c \
+   st.c \
+
+LIBROFF_SRCS=  eqn.c \
+   roff.c \
+   tbl.c \
+   tbl_data.c \
+   tbl_layout.c \
+   tbl_opts.c \
+
+LIB_SRCS=  ${LIBMAN_SRCS} \
+   ${LIBMDOC_SRCS} \
+   ${LIBROFF_SRCS} \
+   chars.c \
+   mandoc.c \
+   mandoc_aux.c \
+   msec.c \
+   preconv.c \
+   read.c
+
 HTML_SRCS= eqn_html.c \
html.c \
man_html.c \
@@ -30,7 +61,8 @@ DB_SRCS=  mandocdb.c \
mansearch_const.c \
manpath.c
 
-SRCS=  ${HTML_SRCS} \
+SRCS=  ${LIB_SRCS} \
+   ${HTML_SRCS} \
${MAN_SRCS} \
${TERM_SRCS} \
main.c \
@@ -43,6 +75,6 @@ WARNS?=   2
 CFLAGS+= -DHAVE_CONFIG_H \
 -I${.CURDIR}/../../lib/libohash/ \
 -I${.CURDIR}/../../contrib/sqlite3
-LIBADD=mandoc ohash sqlite3
+LIBADD=ohash sqlite3
 
 .include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283221 - in head/usr.bin: . demandoc

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 13:02:43 2015
New Revision: 283221
URL: https://svnweb.freebsd.org/changeset/base/283221

Log:
  Remove demandoc(1) from the build

Deleted:
  head/usr.bin/demandoc/
Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Thu May 21 12:51:56 2015(r283220)
+++ head/usr.bin/Makefile   Thu May 21 13:02:43 2015(r283221)
@@ -37,7 +37,6 @@ SUBDIR=   ${_addr2line} \
ctlstat \
cut \
${_cxxfilt} \
-   demandoc \
dirname \
dpv \
du \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283222 - head

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 13:04:14 2015
New Revision: 283222
URL: https://svnweb.freebsd.org/changeset/base/283222

Log:
  Removed files not installed anymore with mandoc

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu May 21 13:02:43 2015(r283221)
+++ head/ObsoleteFiles.inc  Thu May 21 13:04:14 2015(r283222)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20150521
+OLD_FILES+=usr/bin/demandoc
+OLD_FILES+=usr/share/man/man1/demandoc.1.gz
+OLD_FILES+=usr/share/man/man3/mandoc.3.gz
+OLD_FILES+=usr/share/man/man3/mandoc_headers.3.gz
 # 20150520
 OLD_FILES+=usr/lib/libheimsqlite.a
 OLD_FILES+=usr/lib/libheimsqlite.so
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283245 - head/usr.bin/tar

2015-05-21 Thread Warner Losh
Author: imp
Date: Thu May 21 14:36:14 2015
New Revision: 283245
URL: https://svnweb.freebsd.org/changeset/base/283245

Log:
  Remove stray DEBUG_FLAGS=-g that snuck in with r184761.

Modified:
  head/usr.bin/tar/Makefile

Modified: head/usr.bin/tar/Makefile
==
--- head/usr.bin/tar/Makefile   Thu May 21 14:36:12 2015(r283244)
+++ head/usr.bin/tar/Makefile   Thu May 21 14:36:14 2015(r283245)
@@ -31,7 +31,6 @@ CFLAGS+=  -I${LIBARCHIVEDIR}/tar -I${LIBA
 CFLAGS+=   -I${LIBARCHIVEDIR}/libarchive_fe
 SYMLINKS=  bsdtar ${BINDIR}/tar
 MLINKS=bsdtar.1 tar.1
-DEBUG_FLAGS=-g
 
 .PHONY: check test clean-test
 check test: $(PROG) bsdtar.1.gz
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283244 - head/cddl/usr.bin/ctfconvert

2015-05-21 Thread Warner Losh
Author: imp
Date: Thu May 21 14:36:12 2015
New Revision: 283244
URL: https://svnweb.freebsd.org/changeset/base/283244

Log:
  Remove stray DEBUG_FLAGS=-g that's been here since the initial import.

Modified:
  head/cddl/usr.bin/ctfconvert/Makefile

Modified: head/cddl/usr.bin/ctfconvert/Makefile
==
--- head/cddl/usr.bin/ctfconvert/Makefile   Thu May 21 14:36:11 2015
(r283243)
+++ head/cddl/usr.bin/ctfconvert/Makefile   Thu May 21 14:36:12 2015
(r283244)
@@ -3,8 +3,6 @@
 .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common
 .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt
 
-DEBUG_FLAGS=   -g
-
 PROG=  ctfconvert
 SRCS=  alist.c \
ctf.c \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283246 - head/usr.sbin/bluetooth/bthidd

2015-05-21 Thread Warner Losh
Author: imp
Date: Thu May 21 14:36:15 2015
New Revision: 283246
URL: https://svnweb.freebsd.org/changeset/base/283246

Log:
  Remove stray DEBUG_FLAGS=-g that snuck in with r137868

Modified:
  head/usr.sbin/bluetooth/bthidd/Makefile

Modified: head/usr.sbin/bluetooth/bthidd/Makefile
==
--- head/usr.sbin/bluetooth/bthidd/Makefile Thu May 21 14:36:14 2015
(r283245)
+++ head/usr.sbin/bluetooth/bthidd/Makefile Thu May 21 14:36:15 2015
(r283246)
@@ -8,7 +8,6 @@ SRCS=   bthidd.c client.c hid.c kbd.c lex
session.c
 
 CFLAGS+=   -I${.CURDIR}
-DEBUG_FLAGS=   -g
 
 LIBADD+=   bluetooth usbhid
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283243 - head/lib/libufs

2015-05-21 Thread Warner Losh
Author: imp
Date: Thu May 21 14:36:11 2015
New Revision: 283243
URL: https://svnweb.freebsd.org/changeset/base/283243

Log:
  Remove the stray DEBUG_FLAGS=-g line that snuck in with the
  soft-updates journaling project merge in r207141.

Modified:
  head/lib/libufs/Makefile

Modified: head/lib/libufs/Makefile
==
--- head/lib/libufs/MakefileThu May 21 13:42:37 2015(r283242)
+++ head/lib/libufs/MakefileThu May 21 14:36:11 2015(r283243)
@@ -21,7 +21,6 @@ MLINKS+= ufs_disk_close.3 ufs_disk_write
 
 WARNS?=2
 
-DEBUG_FLAGS = -g
 CFLAGS+= -D_LIBUFS
 .if defined(LIBUFS_DEBUG)
 CFLAGS+= -D_LIBUFS_DEBUGGING
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283247 - head/tools/build/mk

2015-05-21 Thread Baptiste Daroussin
Author: bapt
Date: Thu May 21 15:05:46 2015
New Revision: 283247
URL: https://svnweb.freebsd.org/changeset/base/283247

Log:
  Mark libgomp.so.1 as an old lib not an old file

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu May 21 14:36:15 
2015(r283246)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu May 21 15:05:46 
2015(r283247)
@@ -1751,7 +1751,7 @@ OLD_FILES+=usr/include/omp.h
 OLD_FILES+=usr/lib/libgcov.a
 OLD_FILES+=usr/lib/libgomp.a
 OLD_FILES+=usr/lib/libgomp.so
-OLD_FILES+=usr/lib/libgomp.so.1
+OLD_LIBS+=usr/lib/libgomp.so.1
 OLD_FILES+=usr/lib/libgomp_p.a
 OLD_FILES+=usr/libexec/cc1
 OLD_FILES+=usr/libexec/cc1plus
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283248 - in head/sys: amd64/amd64 arm/arm arm64/arm64 ddb i386/i386 kern mips/mips powerpc/powerpc sparc64/sparc64

2015-05-21 Thread Pedro F. Giffuni
Author: pfg
Date: Thu May 21 15:16:18 2015
New Revision: 283248
URL: https://svnweb.freebsd.org/changeset/base/283248

Log:
  ddb: finish converting boolean values.
  
  The replacement started at r283088 was necessarily incomplete without
  replacing boolean_t with bool.  This also involved cleaning some type
  mismatches and ansifying old C function declarations.
  
  Pointed out by:   bde
  Discussed with:   bde, ian, jhb

Modified:
  head/sys/amd64/amd64/db_disasm.c
  head/sys/arm/arm/db_disasm.c
  head/sys/arm64/arm64/db_disasm.c
  head/sys/ddb/db_access.c
  head/sys/ddb/db_access.h
  head/sys/ddb/db_break.c
  head/sys/ddb/db_capture.c
  head/sys/ddb/db_command.c
  head/sys/ddb/db_examine.c
  head/sys/ddb/db_expr.c
  head/sys/ddb/db_main.c
  head/sys/ddb/db_print.c
  head/sys/ddb/db_ps.c
  head/sys/ddb/db_run.c
  head/sys/ddb/db_script.c
  head/sys/ddb/db_sym.c
  head/sys/ddb/db_sym.h
  head/sys/ddb/db_textdump.c
  head/sys/ddb/db_thread.c
  head/sys/ddb/db_variables.c
  head/sys/ddb/db_watch.c
  head/sys/ddb/db_write_cmd.c
  head/sys/ddb/ddb.h
  head/sys/i386/i386/db_disasm.c
  head/sys/kern/subr_turnstile.c
  head/sys/kern/subr_witness.c
  head/sys/mips/mips/db_disasm.c
  head/sys/mips/mips/pmap.c
  head/sys/mips/mips/vm_machdep.c
  head/sys/powerpc/powerpc/db_disasm.c
  head/sys/sparc64/sparc64/db_disasm.c

Modified: head/sys/amd64/amd64/db_disasm.c
==
--- head/sys/amd64/amd64/db_disasm.cThu May 21 15:05:46 2015
(r283247)
+++ head/sys/amd64/amd64/db_disasm.cThu May 21 15:16:18 2015
(r283248)
@@ -1223,9 +1223,7 @@ db_disasm_esc(loc, inst, rex, short_addr
  * next instruction.
  */
 db_addr_t
-db_disasm(loc, altfmt)
-   db_addr_t   loc;
-   boolean_t   altfmt;
+db_disasm(db_addr_t loc, bool altfmt)
 {
int inst;
int size;

Modified: head/sys/arm/arm/db_disasm.c
==
--- head/sys/arm/arm/db_disasm.cThu May 21 15:05:46 2015
(r283247)
+++ head/sys/arm/arm/db_disasm.cThu May 21 15:16:18 2015
(r283248)
@@ -70,7 +70,7 @@ db_disasm_printaddr(u_int address)
 }
 
 vm_offset_t
-db_disasm(vm_offset_t loc, boolean_t altfmt)
+db_disasm(vm_offset_t loc, bool altfmt)
 {
 
return disasm(&db_disasm_interface, loc, altfmt);

Modified: head/sys/arm64/arm64/db_disasm.c
==
--- head/sys/arm64/arm64/db_disasm.cThu May 21 15:05:46 2015
(r283247)
+++ head/sys/arm64/arm64/db_disasm.cThu May 21 15:16:18 2015
(r283248)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 vm_offset_t
-db_disasm(vm_offset_t loc, boolean_t altfmt)
+db_disasm(vm_offset_t loc, bool altfmt)
 {
return 0;
 }

Modified: head/sys/ddb/db_access.c
==
--- head/sys/ddb/db_access.cThu May 21 15:05:46 2015(r283247)
+++ head/sys/ddb/db_access.cThu May 21 15:16:18 2015(r283248)
@@ -54,7 +54,7 @@ static unsigned db_extend[] = {   /* table
 #endif
 
 db_expr_t
-db_get_value(db_addr_t addr, int size, boolean_t is_signed)
+db_get_value(db_addr_t addr, int size, bool is_signed)
 {
chardata[sizeof(u_int64_t)];
register db_expr_t value;

Modified: head/sys/ddb/db_access.h
==
--- head/sys/ddb/db_access.hThu May 21 15:05:46 2015(r283247)
+++ head/sys/ddb/db_access.hThu May 21 15:16:18 2015(r283248)
@@ -36,7 +36,7 @@
 /*
  * Data access functions for debugger.
  */
-db_expr_t  db_get_value(db_addr_t addr, int size, boolean_t is_signed);
+db_expr_t  db_get_value(db_addr_t addr, int size, bool is_signed);
 void   db_put_value(db_addr_t addr, int size, db_expr_t value);
 
 #endif /* !_DDB_DB_ACCESS_H_ */

Modified: head/sys/ddb/db_break.c
==
--- head/sys/ddb/db_break.c Thu May 21 15:05:46 2015(r283247)
+++ head/sys/ddb/db_break.c Thu May 21 15:16:18 2015(r283248)
@@ -155,7 +155,7 @@ db_find_breakpoint_here(db_addr_t addr)
return db_find_breakpoint(db_map_addr(addr), addr);
 }
 
-static boolean_t   db_breakpoints_inserted = true;
+static booldb_breakpoints_inserted = true;
 
 #ifndef BKPT_WRITE
 #defineBKPT_WRITE(addr, storage)   \
@@ -267,7 +267,7 @@ db_list_breakpoints(void)
 /* Delete breakpoint */
 /*ARGSUSED*/
 void
-db_delete_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char 
*modif)
+db_delete_cmd(db_expr_t addr, bool have_addr, db_expr_t count, char *modif)
 {
db_delete_breakpoint(db_map_addr(addr), (db_addr_t)addr);
 }
@@ -275,8 +275,7 @@ db_delete_cmd(db_expr_t addr, boolean_t 
 /* Set bre

svn commit: r283249 - head/sys/sys

2015-05-21 Thread John-Mark Gurney
Author: jmg
Date: Thu May 21 15:38:43 2015
New Revision: 283249
URL: https://svnweb.freebsd.org/changeset/base/283249

Log:
  remove stray ; that came in r272673...

Modified:
  head/sys/sys/systm.h

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hThu May 21 15:16:18 2015(r283248)
+++ head/sys/sys/systm.hThu May 21 15:38:43 2015(r283249)
@@ -237,7 +237,7 @@ voidhexdump(const void *ptr, int length
 #define ovbcopy(f, t, l) bcopy((f), (t), (l))
 void   bcopy(const void *from, void *to, size_t len) __nonnull(1) __nonnull(2);
 void   bzero(void *buf, size_t len) __nonnull(1);
-void   explicit_bzero(void *, size_t) __nonnull(1);;
+void   explicit_bzero(void *, size_t) __nonnull(1);
 
 void   *memcpy(void *to, const void *from, size_t len) __nonnull(1) 
__nonnull(2);
 void   *memmove(void *dest, const void *src, size_t n) __nonnull(1) 
__nonnull(2);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283250 - in head/sys: kern sys

2015-05-21 Thread John Baldwin
Author: jhb
Date: Thu May 21 16:43:26 2015
New Revision: 283250
URL: https://svnweb.freebsd.org/changeset/base/283250

Log:
  Revert r282971.  It depends on condvar consumers not destroying condvars
  until all threads sleeping on a condvar have resumed execution after being
  awakened.  However, there are cases where that guarantee is very hard to
  provide.

Modified:
  head/sys/kern/kern_condvar.c
  head/sys/sys/condvar.h

Modified: head/sys/kern/kern_condvar.c
==
--- head/sys/kern/kern_condvar.cThu May 21 15:38:43 2015
(r283249)
+++ head/sys/kern/kern_condvar.cThu May 21 16:43:26 2015
(r283250)
@@ -122,7 +122,7 @@ _cv_wait(struct cv *cvp, struct lock_obj
 
sleepq_lock(cvp);
 
-   atomic_add_int(&cvp->cv_waiters, 1);
+   cvp->cv_waiters++;
if (lock == &Giant.lock_object)
mtx_assert(&Giant, MA_OWNED);
DROP_GIANT();
@@ -137,7 +137,6 @@ _cv_wait(struct cv *cvp, struct lock_obj
sleepq_lock(cvp);
}
sleepq_wait(cvp, 0);
-   atomic_subtract_int(&cvp->cv_waiters, 1);
 
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
@@ -185,7 +184,7 @@ _cv_wait_unlock(struct cv *cvp, struct l
 
sleepq_lock(cvp);
 
-   atomic_add_int(&cvp->cv_waiters, 1);
+   cvp->cv_waiters++;
DROP_GIANT();
 
sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0);
@@ -195,7 +194,6 @@ _cv_wait_unlock(struct cv *cvp, struct l
if (class->lc_flags & LC_SLEEPABLE)
sleepq_lock(cvp);
sleepq_wait(cvp, 0);
-   atomic_subtract_int(&cvp->cv_waiters, 1);
 
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
@@ -242,7 +240,7 @@ _cv_wait_sig(struct cv *cvp, struct lock
 
sleepq_lock(cvp);
 
-   atomic_add_int(&cvp->cv_waiters, 1);
+   cvp->cv_waiters++;
if (lock == &Giant.lock_object)
mtx_assert(&Giant, MA_OWNED);
DROP_GIANT();
@@ -258,7 +256,6 @@ _cv_wait_sig(struct cv *cvp, struct lock
sleepq_lock(cvp);
}
rval = sleepq_wait_sig(cvp, 0);
-   atomic_subtract_int(&cvp->cv_waiters, 1);
 
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
@@ -310,7 +307,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct
 
sleepq_lock(cvp);
 
-   atomic_add_int(&cvp->cv_waiters, 1);
+   cvp->cv_waiters++;
if (lock == &Giant.lock_object)
mtx_assert(&Giant, MA_OWNED);
DROP_GIANT();
@@ -326,7 +323,6 @@ _cv_timedwait_sbt(struct cv *cvp, struct
sleepq_lock(cvp);
}
rval = sleepq_timedwait(cvp, 0);
-   atomic_subtract_int(&cvp->cv_waiters, 1);
 
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
@@ -380,7 +376,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st
 
sleepq_lock(cvp);
 
-   atomic_add_int(&cvp->cv_waiters, 1);
+   cvp->cv_waiters++;
if (lock == &Giant.lock_object)
mtx_assert(&Giant, MA_OWNED);
DROP_GIANT();
@@ -397,7 +393,6 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st
sleepq_lock(cvp);
}
rval = sleepq_timedwait_sig(cvp, 0);
-   atomic_subtract_int(&cvp->cv_waiters, 1);
 
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
@@ -426,8 +421,10 @@ cv_signal(struct cv *cvp)
 
wakeup_swapper = 0;
sleepq_lock(cvp);
-   if (cvp->cv_waiters > 0)
+   if (cvp->cv_waiters > 0) {
+   cvp->cv_waiters--;
wakeup_swapper = sleepq_signal(cvp, SLEEPQ_CONDVAR, 0, 0);
+   }
sleepq_release(cvp);
if (wakeup_swapper)
kick_proc0();
@@ -450,8 +447,10 @@ cv_broadcastpri(struct cv *cvp, int pri)
if (pri == -1)
pri = 0;
sleepq_lock(cvp);
-   if (cvp->cv_waiters > 0)
+   if (cvp->cv_waiters > 0) {
+   cvp->cv_waiters = 0;
wakeup_swapper = sleepq_broadcast(cvp, SLEEPQ_CONDVAR, pri, 0);
+   }
sleepq_release(cvp);
if (wakeup_swapper)
kick_proc0();

Modified: head/sys/sys/condvar.h
==
--- head/sys/sys/condvar.h  Thu May 21 15:38:43 2015(r283249)
+++ head/sys/sys/condvar.h  Thu May 21 16:43:26 2015(r283250)
@@ -45,7 +45,7 @@ TAILQ_HEAD(cv_waitq, thread);
  */
 struct cv {
const char  *cv_description;
-   volatile intcv_waiters;
+   int cv_waiters;
 };
 
 #ifdef _KERNEL
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r282971 - in head/sys: kern sys

2015-05-21 Thread John Baldwin
On Wednesday, May 20, 2015 02:26:18 PM Xin Li wrote:
> I think we should also assert that no waiter remains when a conditional
> variable is destroyed (which also suggests that the memory may be freed
> shortly).  Otherwise we would either have modify after free or lost wakeups.

We already assert for this.  That is what the call to sleepq_lookup() is
checking for.  If there are any sleepers then there will be a sleepq
allocated for this cvp.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r282971 - in head/sys: kern sys

2015-05-21 Thread John Baldwin
On Wednesday, May 20, 2015 12:00:46 PM Alexander Kabaev wrote:
> On Fri, 15 May 2015 13:50:38 + (UTC)
> John Baldwin  wrote:
> 
> > Author: jhb
> > Date: Fri May 15 13:50:37 2015
> > New Revision: 282971
> > URL: https://svnweb.freebsd.org/changeset/base/282971
> > 
> > Log:
> >   Previously, cv_waiters was only updated by cv_signal or cv_wait. If
> > a thread awakened due to a time out, then cv_waiters was not
> > decremented. If INT_MAX threads timed out on a cv without an
> > intervening cv_broadcast, then cv_waiters could overflow. To fix
> > this, have each sleeping thread decrement cv_waiters when it resumes.
> >   
> >   Note that previously cv_waiters was protected by the sleepq chain
> > lock. However, that lock is not held when threads resume from sleep.
> > In addition, the interlock is also not always reacquired after
> > resuming (cv_wait_unlock), nor is it always held by callers of
> > cv_signal() or cv_broadcast(). Instead, use atomic ops to update
> > cv_waiters. Since the sleepq chain lock is still held on every
> > increment, it should still be safe to compare cv_waiters against zero
> > while holding the lock in the wakeup routines as the only way the
> > race should be lost would result in extra calls to sleepq_signal() or
> > sleepq_broadcast(). 
> >   Differential Revision:https://reviews.freebsd.org/D2427
> >   Reviewed by:  benno
> >   Reported by:  benno (wrap of cv_waiters in the field)
> >   MFC after:2 weeks
> > 
> > Modified:
> >   head/sys/kern/kern_condvar.c
> >   head/sys/sys/condvar.h
> > 
> 
> This breaks ZFS range locking code, which expects to be able to wakeup
> everyone on the condition variable and then free the structure that
> contains it. Having woken up threads modify cv_waiters results in a
> race that leads to already freed memory to be accessed.
> 
> It is debatable just how correct ZFS code in its expectations, but I
> think this commit should probably be reverted until either ZFS is
> changed not to expect cv modifiable by waking threads or until
> alternative solution is found to the cv_waiters overflow issue fixed by
> this commit.

Yes, this is fine to revert for now.  I'll have to think about which way
to fix the bug in question.  The simplest route is probably to remove
cv_waiters entirely, though hacking up sleepq_timeout to recognize cv's
and decrement the count is another option (but hackier).

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r282971 - in head/sys: kern sys

2015-05-21 Thread Mateusz Guzik
On Thu, May 21, 2015 at 11:33:02AM -0400, John Baldwin wrote:
> On Wednesday, May 20, 2015 12:00:46 PM Alexander Kabaev wrote:
> > On Fri, 15 May 2015 13:50:38 + (UTC)
> > John Baldwin  wrote:
> > 
> > > Author: jhb
> > > Date: Fri May 15 13:50:37 2015
> > > New Revision: 282971
> > > URL: https://svnweb.freebsd.org/changeset/base/282971
> > > 
> > > Log:
> > >   Previously, cv_waiters was only updated by cv_signal or cv_wait. If
> > > a thread awakened due to a time out, then cv_waiters was not
> > > decremented. If INT_MAX threads timed out on a cv without an
> > > intervening cv_broadcast, then cv_waiters could overflow. To fix
> > > this, have each sleeping thread decrement cv_waiters when it resumes.
> > >   
> > >   Note that previously cv_waiters was protected by the sleepq chain
> > > lock. However, that lock is not held when threads resume from sleep.
> > > In addition, the interlock is also not always reacquired after
> > > resuming (cv_wait_unlock), nor is it always held by callers of
> > > cv_signal() or cv_broadcast(). Instead, use atomic ops to update
> > > cv_waiters. Since the sleepq chain lock is still held on every
> > > increment, it should still be safe to compare cv_waiters against zero
> > > while holding the lock in the wakeup routines as the only way the
> > > race should be lost would result in extra calls to sleepq_signal() or
> > > sleepq_broadcast(). 
> > >   Differential Revision:  https://reviews.freebsd.org/D2427
> > >   Reviewed by:benno
> > >   Reported by:benno (wrap of cv_waiters in the field)
> > >   MFC after:  2 weeks
> > > 
> > > Modified:
> > >   head/sys/kern/kern_condvar.c
> > >   head/sys/sys/condvar.h
> > > 
> > 
> > This breaks ZFS range locking code, which expects to be able to wakeup
> > everyone on the condition variable and then free the structure that
> > contains it. Having woken up threads modify cv_waiters results in a
> > race that leads to already freed memory to be accessed.
> > 
> > It is debatable just how correct ZFS code in its expectations, but I
> > think this commit should probably be reverted until either ZFS is
> > changed not to expect cv modifiable by waking threads or until
> > alternative solution is found to the cv_waiters overflow issue fixed by
> > this commit.
> 
> Yes, this is fine to revert for now.  I'll have to think about which way
> to fix the bug in question.  The simplest route is probably to remove
> cv_waiters entirely, though hacking up sleepq_timeout to recognize cv's
> and decrement the count is another option (but hackier).
> 

The code was buggy even prior to this.

_cv_wait does:
#ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
ktrcsw(0, 0, cv_wmesg(cvp));
#endif

So with ktrace enabled cvp is possibly accessed after it gets freed.

I checked "solaris compatiblity layer" from "zfs on linux" project and it looks
like they are screwed by this as well.

In other words, I would argue modifying native privmitives to accomodate for
zfs use may not be the best course of action.

Hacking up zfs or cv_ primitives seems better and opens up posibilities for
minor optimisations.

I'm not up to it though.
-- 
Mateusz Guzik 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283253 - in head/sys: arm/allwinner arm/conf boot/fdt/dts/arm dev/mmc

2015-05-21 Thread Luiz Otavio O Souza
Author: loos
Date: Thu May 21 17:39:42 2015
New Revision: 283253
URL: https://svnweb.freebsd.org/changeset/base/283253

Log:
  Add the MMC/SD driver for Allwinner SoCs.
  
  This is based on the patch sent by Alexander Fedorov with the following
  fixes/improvements:
  
   - Better error handling;
   - Clock is derived from PLL6 (obtained from netbsd);
   - No more unnecessary busy loops on interrupt handler;
   - style(9) fixes and code cleanup.
  
  I also want to thanks Martin Galvan who has sent an alternative
  implementation with some interesting fixes.
  
  Tested on CubieBoard2, Banana-Pi (thanks to netgate!) and Cubieboard1
  (Pratik Singhal).
  
  This is intended to pave the way for the upcoming GSoC work (and make
  easier the build of images for the supported boards).
  
  PR:   196081
  Submitted by: Alexander Fedorov 

Added:
  head/sys/arm/allwinner/a10_mmc.c   (contents, props changed)
  head/sys/arm/allwinner/a10_mmc.h   (contents, props changed)
Modified:
  head/sys/arm/allwinner/a10_clk.c
  head/sys/arm/allwinner/a10_clk.h
  head/sys/arm/allwinner/files.allwinner
  head/sys/arm/conf/CUBIEBOARD
  head/sys/arm/conf/CUBIEBOARD2
  head/sys/boot/fdt/dts/arm/cubieboard.dts
  head/sys/boot/fdt/dts/arm/cubieboard2.dts
  head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi
  head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi
  head/sys/dev/mmc/mmc.c

Modified: head/sys/arm/allwinner/a10_clk.c
==
--- head/sys/arm/allwinner/a10_clk.cThu May 21 17:39:42 2015
(r283252)
+++ head/sys/arm/allwinner/a10_clk.cThu May 21 17:39:42 2015
(r283253)
@@ -174,7 +174,8 @@ a10_clk_usb_deactivate(void)
 }
 
 int
-a10_clk_emac_activate(void) {
+a10_clk_emac_activate(void)
+{
struct a10_ccm_softc *sc = a10_ccm_sc;
uint32_t reg_value;
 
@@ -189,3 +190,110 @@ a10_clk_emac_activate(void) {
return (0);
 }
 
+static void
+a10_clk_pll6_enable(void)
+{
+   struct a10_ccm_softc *sc;
+   uint32_t reg_value;
+
+   /*
+* SATA needs PLL6 to be a 100MHz clock.
+* The SATA output frequency is 24MHz * n * k / m / 6.
+* To get to 100MHz, k & m must be equal and n must be 25.
+* For other uses the output frequency is 24MHz * n * k / 2.
+*/
+   sc = a10_ccm_sc;
+   reg_value = ccm_read_4(sc, CCM_PLL6_CFG);
+   reg_value &= ~CCM_PLL_CFG_BYPASS;
+   reg_value &= ~(CCM_PLL_CFG_FACTOR_K | CCM_PLL_CFG_FACTOR_M |
+   CCM_PLL_CFG_FACTOR_N);
+   reg_value |= (25 << CCM_PLL_CFG_FACTOR_N_SHIFT);
+   reg_value |= CCM_PLL6_CFG_SATA_CLKEN;
+   reg_value |= CCM_PLL_CFG_ENABLE;
+   ccm_write_4(sc, CCM_PLL6_CFG, reg_value);
+}
+
+static unsigned int
+a10_clk_pll6_get_rate(void)
+{
+   struct a10_ccm_softc *sc;
+   uint32_t k, n, reg_value;
+
+   sc = a10_ccm_sc;
+   reg_value = ccm_read_4(sc, CCM_PLL6_CFG);
+   n = ((reg_value & CCM_PLL_CFG_FACTOR_N) >> CCM_PLL_CFG_FACTOR_N_SHIFT);
+   k = ((reg_value & CCM_PLL_CFG_FACTOR_K) >> CCM_PLL_CFG_FACTOR_K_SHIFT) +
+   1;
+
+   return ((CCM_CLK_REF_FREQ * n * k) / 2);
+}
+
+int
+a10_clk_mmc_activate(int devid)
+{
+   struct a10_ccm_softc *sc;
+   uint32_t reg_value;
+
+   sc = a10_ccm_sc;
+   if (sc == NULL)
+   return (ENXIO);
+
+   a10_clk_pll6_enable();
+
+   /* Gating AHB clock for SD/MMC */
+   reg_value = ccm_read_4(sc, CCM_AHB_GATING0);
+   reg_value |= CCM_AHB_GATING_SDMMC0 << devid;
+   ccm_write_4(sc, CCM_AHB_GATING0, reg_value);
+
+   return (0);
+}
+
+int
+a10_clk_mmc_cfg(int devid, int freq)
+{
+   struct a10_ccm_softc *sc;
+   uint32_t clksrc, m, n, ophase, phase, reg_value;
+   unsigned int pll_freq;
+
+   sc = a10_ccm_sc;
+   if (sc == NULL)
+   return (ENXIO);
+
+   freq /= 1000;
+   if (freq <= 400) {
+   pll_freq = CCM_CLK_REF_FREQ / 1000;
+   clksrc = CCM_SD_CLK_SRC_SEL_OSC24M;
+   ophase = 0;
+   phase = 0;
+   n = 2;
+   } else if (freq <= 25000) {
+   pll_freq = a10_clk_pll6_get_rate() / 1000;
+   clksrc = CCM_SD_CLK_SRC_SEL_PLL6;
+   ophase = 0;
+   phase = 5;
+   n = 2;
+   } else if (freq <= 5) {
+   pll_freq = a10_clk_pll6_get_rate() / 1000;
+   clksrc = CCM_SD_CLK_SRC_SEL_PLL6;
+   ophase = 3;
+   phase = 5;
+   n = 0;
+   } else
+   return (EINVAL);
+   m = ((pll_freq / (1 << n)) / (freq)) - 1;
+   reg_value = ccm_read_4(sc, CCM_MMC0_SCLK_CFG + (devid * 4));
+   reg_value &= ~CCM_SD_CLK_SRC_SEL;
+   reg_value |= (clksrc << CCM_SD_CLK_SRC_SEL_SHIFT);
+   reg_value &= ~CCM_SD_CLK_PHASE_CTR;
+   reg_value |= (phase << CCM_SD_CLK_PHASE_CTR_SHIFT);
+   reg_value &= ~CCM_SD_CLK_DIV_RATIO_N;
+   reg_value |= (n << CCM_SD_CLK_DI

svn commit: r283252 - head/release

2015-05-21 Thread Glen Barber
Author: gjb
Date: Thu May 21 17:39:42 2015
New Revision: 283252
URL: https://svnweb.freebsd.org/changeset/base/283252

Log:
  Include the TARGET in the EC2 AMI name.
  
  Without this, AWS rejects subsequent image uploads of a different
  architecture because the name conflicts.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.ec2

Modified: head/release/Makefile.ec2
==
--- head/release/Makefile.ec2   Thu May 21 16:44:31 2015(r283251)
+++ head/release/Makefile.ec2   Thu May 21 17:39:42 2015(r283252)
@@ -53,7 +53,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
 .endif
/usr/local/bin/bsdec2-image-upload ${PUBLISH}   \
${.OBJDIR}/ec2.raw  \
-   "${TYPE} ${REVISION}-${BRANCH}${AMINAMESUFFIX}" \
-   "${TYPE} ${REVISION}-${BRANCH}" \
+   "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}"   \
+   "${TYPE} ${REVISION}-${BRANCH}-${TARGET}"   \
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE}
@touch ${.TARGET}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283254 - head/sys/sys

2015-05-21 Thread Dimitry Andric
Author: dim
Date: Thu May 21 17:40:53 2015
New Revision: 283254
URL: https://svnweb.freebsd.org/changeset/base/283254

Log:
  Ensure that the static structs emitted by the MODULE_DEPEND() and
  MODULE_VERSION() macros don't end up as .comm symbols, when all the
  version fields are zero.
  
  Normally, such symbols will end up in .bss, but for kernel module
  version objects, this can lead to "garbage" version numbers.
  
  Fix this by instructing the compiler to always put these structs in the
  .data segment instead.
  
  Reported by:  delphij, ae
  MFC after:1 week

Modified:
  head/sys/sys/module.h

Modified: head/sys/sys/module.h
==
--- head/sys/sys/module.h   Thu May 21 17:39:42 2015(r283253)
+++ head/sys/sys/module.h   Thu May 21 17:40:53 2015(r283254)
@@ -107,7 +107,8 @@ struct mod_metadata {
DATA_SET(modmetadata_set, _mod_metadata##uniquifier)
 
 #defineMODULE_DEPEND(module, mdepend, vmin, vpref, vmax)   
\
-   static struct mod_depend _##module##_depend_on_##mdepend = {\
+   static struct mod_depend _##module##_depend_on_##mdepend\
+   __section(".data") = {  \
vmin,   \
vpref,  \
vmax\
@@ -147,7 +148,8 @@ struct mod_metadata {
DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version)
 
 #defineMODULE_VERSION(module, version) 
\
-   static struct mod_version _##module##_version = {   \
+   static struct mod_version _##module##_version   \
+   __section(".data") = {  \
version \
};  \
MODULE_METADATA(_##module##_version, MDT_VERSION,   \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283255 - head/sys/amd64/vmm

2015-05-21 Thread Neel Natu
Author: neel
Date: Thu May 21 18:23:37 2015
New Revision: 283255
URL: https://svnweb.freebsd.org/changeset/base/283255

Log:
  Emulate the "CMP r/m, reg" instruction (opcode 39H).
  
  Reported and tested by:   Leon Dang (ld...@nahannisys.com)
  MFC after:1 week

Modified:
  head/sys/amd64/vmm/vmm_instruction_emul.c

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==
--- head/sys/amd64/vmm/vmm_instruction_emul.c   Thu May 21 17:40:53 2015
(r283254)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c   Thu May 21 18:23:37 2015
(r283255)
@@ -113,6 +113,10 @@ static const struct vie_op one_byte_opco
.op_byte = 0x2B,
.op_type = VIE_OP_TYPE_SUB,
},
+   [0x39] = {
+   .op_byte = 0x39,
+   .op_type = VIE_OP_TYPE_CMP,
+   },
[0x3B] = {
.op_byte = 0x3B,
.op_type = VIE_OP_TYPE_CMP,
@@ -1050,34 +1054,46 @@ emulate_cmp(void *vm, int vcpuid, uint64
mem_region_read_t memread, mem_region_write_t memwrite, void *arg)
 {
int error, size;
-   uint64_t op1, op2, rflags, rflags2;
+   uint64_t regop, memop, op1, op2, rflags, rflags2;
enum vm_reg_name reg;
 
size = vie->opsize;
switch (vie->op.op_byte) {
+   case 0x39:
case 0x3B:
/*
+* 39/r CMP r/m16, r16
+* 39/r CMP r/m32, r32
+* REX.W 39/r   CMP r/m64, r64
+*
 * 3B/r CMP r16, r/m16
 * 3B/r CMP r32, r/m32
 * REX.W + 3B/r CMP r64, r/m64
 *
-* Compare first operand (reg) with second operand (r/m) and
+* Compare the first operand with the second operand and
 * set status flags in EFLAGS register. The comparison is
 * performed by subtracting the second operand from the first
 * operand and then setting the status flags.
 */
 
-   /* Get the first operand */
+   /* Get the register operand */
reg = gpr_map[vie->reg];
-   error = vie_read_register(vm, vcpuid, reg, &op1);
+   error = vie_read_register(vm, vcpuid, reg, ®op);
if (error)
return (error);
 
-   /* Get the second operand */
-   error = memread(vm, vcpuid, gpa, &op2, size, arg);
+   /* Get the memory operand */
+   error = memread(vm, vcpuid, gpa, &memop, size, arg);
if (error)
return (error);
 
+   if (vie->op.op_byte == 0x3B) {
+   op1 = regop;
+   op2 = memop;
+   } else {
+   op1 = memop;
+   op2 = regop;
+   }
rflags2 = getcc(size, op1, op2);
break;
case 0x80:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283256 - head/usr.sbin/bhyvectl

2015-05-21 Thread Neel Natu
Author: neel
Date: Thu May 21 18:29:11 2015
New Revision: 283256
URL: https://svnweb.freebsd.org/changeset/base/283256

Log:
  Add an option "--get-vmcs-exit-inst-length" to display the instruction length
  of the instruction that caused the VM-exit.
  
  MFC after:1 week

Modified:
  head/usr.sbin/bhyvectl/bhyvectl.c

Modified: head/usr.sbin/bhyvectl/bhyvectl.c
==
--- head/usr.sbin/bhyvectl/bhyvectl.c   Thu May 21 18:23:37 2015
(r283255)
+++ head/usr.sbin/bhyvectl/bhyvectl.c   Thu May 21 18:29:11 2015
(r283256)
@@ -293,6 +293,7 @@ static int get_guest_pat, get_host_pat;
 static int get_guest_sysenter, get_vmcs_link;
 static int get_exit_reason, get_vmcs_exit_qualification;
 static int get_vmcs_exit_interruption_info, get_vmcs_exit_interruption_error;
+static int get_vmcs_exit_inst_length;
 
 static uint64_t desc_base;
 static uint32_t desc_limit, desc_access;
@@ -1145,7 +1146,15 @@ get_misc_vmcs(struct vmctx *ctx, int vcp
vcpu, u64);
}
}
-   
+
+   if (!error && (get_vmcs_exit_inst_length || get_all)) {
+   error = vm_get_vmcs_field(ctx, vcpu,
+   VMCS_EXIT_INSTRUCTION_LENGTH, &u64);
+   if (error == 0)
+   printf("vmcs_exit_inst_length[%d]\t0x%08x\n", vcpu,
+   (uint32_t)u64);
+   }
+
if (!error && (get_vmcs_exit_qualification || get_all)) {
error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_QUALIFICATION,
  &u64);
@@ -1405,6 +1414,8 @@ setup_options(bool cpu_intel)
REQ_ARG, 0, SET_VMCS_ENTRY_INTERRUPTION_INFO },
{ "get-vmcs-exit-qualification",
NO_ARG, &get_vmcs_exit_qualification, 1 },
+   { "get-vmcs-exit-inst-length",
+   NO_ARG, &get_vmcs_exit_inst_length, 1 },
{ "get-vmcs-interruptibility",
NO_ARG, &get_vmcs_interruptibility, 1 },
{ "get-vmcs-exit-interruption-error",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283257 - head/bin/pax

2015-05-21 Thread Xin LI
Author: delphij
Date: Thu May 21 18:29:36 2015
New Revision: 283257
URL: https://svnweb.freebsd.org/changeset/base/283257

Log:
  Eliminate unneeded includes.
  
  MFC after:2 weeks

Modified:
  head/bin/pax/ar_subs.c
  head/bin/pax/buf_subs.c
  head/bin/pax/cache.c
  head/bin/pax/cpio.c
  head/bin/pax/file_subs.c
  head/bin/pax/gen_subs.c
  head/bin/pax/getoldopt.c
  head/bin/pax/pat_rep.c
  head/bin/pax/pax.c
  head/bin/pax/sel_subs.c
  head/bin/pax/tar.c
  head/bin/pax/tty_subs.c

Modified: head/bin/pax/ar_subs.c
==
--- head/bin/pax/ar_subs.c  Thu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/ar_subs.c  Thu May 21 18:29:36 2015(r283257)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include "pax.h"
 #include "extern.h"
 

Modified: head/bin/pax/buf_subs.c
==
--- head/bin/pax/buf_subs.c Thu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/buf_subs.c Thu May 21 18:29:36 2015(r283257)
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "pax.h"
 #include "extern.h"

Modified: head/bin/pax/cache.c
==
--- head/bin/pax/cache.cThu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/cache.cThu May 21 18:29:36 2015(r283257)
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "pax.h"
 #include "cache.h"

Modified: head/bin/pax/cpio.c
==
--- head/bin/pax/cpio.c Thu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/cpio.c Thu May 21 18:29:36 2015(r283257)
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include "pax.h"
 #include "cpio.h"
 #include "extern.h"

Modified: head/bin/pax/file_subs.c
==
--- head/bin/pax/file_subs.cThu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/file_subs.cThu May 21 18:29:36 2015(r283257)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include "pax.h"
 #include "options.h"
 #include "extern.h"

Modified: head/bin/pax/gen_subs.c
==
--- head/bin/pax/gen_subs.c Thu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/gen_subs.c Thu May 21 18:29:36 2015(r283257)
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include "pax.h"
 #include "extern.h"

Modified: head/bin/pax/getoldopt.c
==
--- head/bin/pax/getoldopt.cThu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/getoldopt.cThu May 21 18:29:36 2015(r283257)
@@ -19,8 +19,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "pax.h"
-#include "extern.h"
+int getoldopt(int, char **, const char *);
 
 int
 getoldopt(int argc, char **argv, const char *optstring)

Modified: head/bin/pax/pat_rep.c
==
--- head/bin/pax/pat_rep.c  Thu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/pat_rep.c  Thu May 21 18:29:36 2015(r283257)
@@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #ifdef NET2_REGEX
 #include 
 #else

Modified: head/bin/pax/pax.c
==
--- head/bin/pax/pax.c  Thu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/pax.c  Thu May 21 18:29:36 2015(r283257)
@@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include "pax.h"
 #include "extern.h"
 static int gen_init(void);

Modified: head/bin/pax/sel_subs.c
==
--- head/bin/pax/sel_subs.c Thu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/sel_subs.c Thu May 21 18:29:36 2015(r283257)
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "pax.h"
 #include "sel_subs.h"

Modified: head/bin/pax/tar.c
==
--- head/bin/pax/tar.c  Thu May 21 18:29:11 2015(r283256)
+++ head/bin/pax/tar.c  Thu May 21 18:29:36 2015(r283257)
@@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include "pax.h"
 #include "extern.h"
 #include "tar.h"

Modified: head/bin/pax/tty_subs.c

svn commit: r283261 - head/sys/dev/acpica

2015-05-21 Thread Jung-uk Kim
Author: jkim
Date: Thu May 21 19:31:10 2015
New Revision: 283261
URL: https://svnweb.freebsd.org/changeset/base/283261

Log:
  Do not probe Intel PIIX4 south bridge quirks on amd64.  These quirky south
  bridges only supported Intel Pentium and Pentium II era processors and there
  is no reason for hardware virtualizations to emulate these quirks.
  
  MFC after:1 week

Modified:
  head/sys/dev/acpica/acpi_cpu.c
  head/sys/dev/acpica/acpi_throttle.c

Modified: head/sys/dev/acpica/acpi_cpu.c
==
--- head/sys/dev/acpica/acpi_cpu.c  Thu May 21 19:16:28 2015
(r283260)
+++ head/sys/dev/acpica/acpi_cpu.c  Thu May 21 19:31:10 2015
(r283261)
@@ -185,7 +185,8 @@ static void acpi_cpu_startup_cx(struct a
 static voidacpi_cpu_cx_list(struct acpi_cpu_softc *sc);
 static voidacpi_cpu_idle(sbintime_t sbt);
 static voidacpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context);
-static int acpi_cpu_quirks(void);
+static voidacpi_cpu_quirks(void);
+static voidacpi_cpu_quirks_piix4(void);
 static int acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARGS);
 static int acpi_cpu_usage_counters_sysctl(SYSCTL_HANDLER_ARGS);
 static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc);
@@ -1239,12 +1240,9 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no
 acpi_UserNotify("PROCESSOR", sc->cpu_handle, notify);
 }
 
-static int
+static void
 acpi_cpu_quirks(void)
 {
-device_t acpi_dev;
-uint32_t val;
-
 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
 /*
@@ -1278,6 +1276,16 @@ acpi_cpu_quirks(void)
 }
 
 /* Look for various quirks of the PIIX4 part. */
+acpi_cpu_quirks_piix4();
+}
+
+static void
+acpi_cpu_quirks_piix4(void)
+{
+#ifdef __i386__
+device_t acpi_dev;
+uint32_t val;
+
 acpi_dev = pci_find_device(PCI_VENDOR_INTEL, PCI_DEVICE_82371AB_3);
 if (acpi_dev != NULL) {
switch (pci_get_revid(acpi_dev)) {
@@ -1326,8 +1334,7 @@ acpi_cpu_quirks(void)
break;
}
 }
-
-return (0);
+#endif
 }
 
 static int

Modified: head/sys/dev/acpica/acpi_throttle.c
==
--- head/sys/dev/acpica/acpi_throttle.c Thu May 21 19:16:28 2015
(r283260)
+++ head/sys/dev/acpica/acpi_throttle.c Thu May 21 19:31:10 2015
(r283261)
@@ -96,7 +96,7 @@ static void   acpi_throttle_identify(drive
 static int acpi_throttle_probe(device_t dev);
 static int acpi_throttle_attach(device_t dev);
 static int acpi_throttle_evaluate(struct acpi_throttle_softc *sc);
-static int acpi_throttle_quirks(struct acpi_throttle_softc *sc);
+static voidacpi_throttle_quirks(struct acpi_throttle_softc *sc);
 static int acpi_thr_settings(device_t dev, struct cf_setting *sets,
int *count);
 static int acpi_thr_set(device_t dev, const struct cf_setting *set);
@@ -314,9 +314,10 @@ acpi_throttle_evaluate(struct acpi_throt
return (0);
 }
 
-static int
+static void
 acpi_throttle_quirks(struct acpi_throttle_softc *sc)
 {
+#ifdef __i386__
device_t acpi_dev;
 
/* Look for various quirks of the PIIX4 part. */
@@ -339,8 +340,7 @@ acpi_throttle_quirks(struct acpi_throttl
break;
}
}
-
-   return (0);
+#endif
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r283136 - head/sys/netinet

2015-05-21 Thread Hiren Panchasara
On 05/21/15 at 03:27P, Lawrence Stewart wrote:
> On 05/20/15 23:19, Eric van Gyzen wrote:
> > On 05/20/2015 02:33, Lawrence Stewart wrote:
> >> On 05/20/15 14:24, Hiren Panchasara wrote:
> >>> On 05/20/15 at 02:13P, Lawrence Stewart wrote:
>  Hi Hiren,
> 
>  On 05/20/15 11:08, Hiren Panchasara wrote:
> > Author: hiren Date: Wed May 20 01:08:01 2015 New Revision:
> > 283136 URL: https://svnweb.freebsd.org/changeset/base/283136
> >
> > Log: Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to
> > expire and purge all entries in hostcache immediately.
> >
> > In collaboration with:  bz, rwatson MFC after:  1 week Relnotes:
> > yes Sponsored by:   Limelight Networks
> 
>  Why introduce a new sysctl and not change the existing behaviour
>  of net.inet.tcp.hostcache.purge?
> >>>
> >>> I thought it'd make more sense to keep the existing behavior as is
> >>> and provide new knob for the new behavior.
> >>
> >> Don't think so - why would deferring a purge to the next purge run be
> >> useful compared to purging immediately? I'd strongly suggest you adapt
> >> this change to the existing purge sysctl. I can't see why anyone would
> >> miss the old functionality.
> > 
> > I am generally wary of a question such as "Why would anyone want...", 
> > because as soon as the code is released, someone answers it.
> > 
> > That being said, I have always wanted Hiren's purgenow behavior, and I've 
> > always been annoyed by the lazy-purge behavior.  I would suggest 
> > implementing Lawrence's suggestion, but NOT MFC'ing it, since that would be 
> > a disruptive change.
> > 
> > Thanks for your work, Hiren.
> 
> I see no reason not to MFC it - it's not a POLA violation for a stable
> branch. When the user requests a purge, it's surely equally as good (and
> I think anyone of right mind would argue better ;) to purge immediately
> than some number of seconds "n" in the future, where "n" is between 1
> and the value of net.inet.tcp.hostcache.prune.

I *do* want to MFC the change. And if there are no major objections, I'll go
ahead with what Lawrence is suggesting: changing current purge behavior in -head
and 10.

cheers,
Hiren


pgpTDEv6LWElf.pgp
Description: PGP signature


svn commit: r283263 - head/sys/dev/sdhci

2015-05-21 Thread Luiz Otavio O Souza
Author: loos
Date: Thu May 21 20:09:36 2015
New Revision: 283263
URL: https://svnweb.freebsd.org/changeset/base/283263

Log:
  Raise the SDHCI timeout to 10 seconds and add a sysctl to allow changing
  this value at runtime.
  
  The SD card specification says that a block write or a block erase can take
  up to 250ms to complete and thus, under some circumstances, the existent 2
  seconds timeout was triggering with normal usage.
  
  This change fixes the sporadic controller timeout that happens on RPi and
  RPi 2.
  
  Discussed with:   ian (some time ago)

Modified:
  head/sys/dev/sdhci/sdhci.c
  head/sys/dev/sdhci/sdhci.h

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Thu May 21 19:40:31 2015(r283262)
+++ head/sys/dev/sdhci/sdhci.c  Thu May 21 20:09:36 2015(r283263)
@@ -615,10 +615,16 @@ sdhci_init_slot(device_t dev, struct sdh
(slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO");
sdhci_dumpregs(slot);
}
-   
+
+   slot->timeout = 10;
+   SYSCTL_ADD_INT(device_get_sysctl_ctx(slot->bus),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(slot->bus)), OID_AUTO,
+   "timeout", CTLFLAG_RW, &slot->timeout, 0,
+   "Maximum timeout for SDHCI transfers (in secs)");
TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot);
callout_init(&slot->card_callout, 1);
callout_init_mtx(&slot->timeout_callout, &slot->mtx, 0);
+
return (0);
 }
 
@@ -872,7 +878,8 @@ sdhci_start_command(struct sdhci_slot *s
/* Start command. */
WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff));
/* Start timeout callout. */
-   callout_reset(&slot->timeout_callout, 2*hz, sdhci_timeout, slot);
+   callout_reset(&slot->timeout_callout, slot->timeout * hz,
+   sdhci_timeout, slot);
 }
 
 static void

Modified: head/sys/dev/sdhci/sdhci.h
==
--- head/sys/dev/sdhci/sdhci.h  Thu May 21 19:40:31 2015(r283262)
+++ head/sys/dev/sdhci/sdhci.h  Thu May 21 20:09:36 2015(r283263)
@@ -271,6 +271,7 @@ struct sdhci_slot {
 #define SDHCI_HAVE_DMA 1
 #define SDHCI_PLATFORM_TRANSFER2
u_char  version;
+   int timeout;/* Transfer timeout */
uint32_tmax_clk;/* Max possible freq */
uint32_ttimeout_clk;/* Timeout freq */
bus_dma_tag_t   dmatag;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283264 - head/usr.sbin/bhyve

2015-05-21 Thread Tycho Nightingale
Author: tychon
Date: Thu May 21 20:11:52 2015
New Revision: 283264
URL: https://svnweb.freebsd.org/changeset/base/283264

Log:
  The 'hostbridge' device exists to allow guests to infer msi/msix
  capablity by advertising pcie capability.
  
  Since the 'hostbridge' device isn't a true pci-to-pci bridge, and
  doesn't actaully use the bridge configuration space layout, change
  the header-type from type 1 to type 0 to avoid confusion.
  
  Reviewed by:  neel

Modified:
  head/usr.sbin/bhyve/pci_hostbridge.c

Modified: head/usr.sbin/bhyve/pci_hostbridge.c
==
--- head/usr.sbin/bhyve/pci_hostbridge.cThu May 21 20:09:36 2015
(r283263)
+++ head/usr.sbin/bhyve/pci_hostbridge.cThu May 21 20:11:52 2015
(r283264)
@@ -38,7 +38,7 @@ pci_hostbridge_init(struct vmctx *ctx, s
/* config space */
pci_set_cfgdata16(pi, PCIR_VENDOR, 0x1275); /* NetApp */
pci_set_cfgdata16(pi, PCIR_DEVICE, 0x1275); /* NetApp */
-   pci_set_cfgdata8(pi, PCIR_HDRTYPE, PCIM_HDRTYPE_BRIDGE);
+   pci_set_cfgdata8(pi, PCIR_HDRTYPE, PCIM_HDRTYPE_NORMAL);
pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_BRIDGE);
pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_BRIDGE_HOST);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r283136 - head/sys/netinet

2015-05-21 Thread Ed Maste
On 21 May 2015 at 16:03, Hiren Panchasara  wrote:
>
> I *do* want to MFC the change. And if there are no major objections, I'll go
> ahead with what Lawrence is suggesting: changing current purge behavior in 
> -head
> and 10.

For the record, that sounds reasonable to me.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283265 - head/release

2015-05-21 Thread Glen Barber
Author: gjb
Date: Thu May 21 20:18:13 2015
New Revision: 283265
URL: https://svnweb.freebsd.org/changeset/base/283265

Log:
  cd(1) to .CURDIR before calling stat(1) to fix the path
  to sh(1).
  
  Include xz(1)-compressed images when renaming snapshot
  builds.
  
  Use OSRELEASE in place of REVISION-BRANCH for checksum
  filenames.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.mirrors

Modified: head/release/Makefile.mirrors
==
--- head/release/Makefile.mirrors   Thu May 21 20:11:52 2015
(r283264)
+++ head/release/Makefile.mirrors   Thu May 21 20:18:13 2015
(r283265)
@@ -22,7 +22,7 @@ STAGE_TARGETS?=   iso-images-stage
 .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
 SNAPSHOT=  1
 TLD?=  ${FTPDIR}/snapshots
-BUILDDATE!=date -j -f '%s' $$(stat -f "%c" 
${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
+BUILDDATE!=cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" 
${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
 . if ${TARGET} == "arm" && ${TARGET_ARCH} == "armv6"
 .  if !defined(BOARDNAME) || empty(BOARDNAME)
 BOARDNAME= ${KERNCONF}
@@ -70,10 +70,8 @@ iso-images-stage:
 . for IMAGE in ${IMAGES}
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \
${ISO_DIR}/${OSRELEASE}-${IMAGE}
-.  if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \
${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz
-.  endif
 .  if exists(${RELEASEDIR}/CHECKSUM.${CHECKSUM})
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM} \
${ISO_DIR}/CHECKSUM.${CHECKSUM}
@@ -85,25 +83,30 @@ iso-images-stage:
 . for IMAGE in ${IMAGES}
cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE} \
${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
+   cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE}.xz \
+   ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \

../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
+   cd ${TLD}/ISO-IMAGES/${REVISION} && \
+   ln -s \
+   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
 . endfor
 . for CHECKSUM in ${CHECKSUM_FILES}
 .  if exists(${ISO_DIR}/CHECKSUM.${CHECKSUM})
rm -f ${ISO_DIR}/CHECKSUM.${CHECKSUM}
 .  endif
cd ${ISO_DIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
-   CHECKSUM.${CHECKSUM}-${REVISION}-${BRANCH}-${SNAP_SUFFIX}
+   CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
-   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${REVISION}-${BRANCH}-${SNAP_SUFFIX}
+   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
 . endfor
 .else  # !snapshot
cd ${TLD}/ISO-IMAGES/${REVISION} && ln -s \

../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE} .
cd ${ISO_DIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
-   CHECKSUM.${CHECKSUM}-${REVISION}-${BRANCH}-${SNAP_SUFFIX}
+   CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
 .endif
 .if exists(${RELEASEDIR}/ftp)
mkdir -p ${FTP_DIR}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283266 - head/release

2015-05-21 Thread Glen Barber
Author: gjb
Date: Thu May 21 20:22:55 2015
New Revision: 283266
URL: https://svnweb.freebsd.org/changeset/base/283266

Log:
  Include xz(1)-compressed images when not a snapshot build.
  
  Do not suffix non-snapshot checksum files with SNAP_SUFFIX.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.mirrors

Modified: head/release/Makefile.mirrors
==
--- head/release/Makefile.mirrors   Thu May 21 20:18:13 2015
(r283265)
+++ head/release/Makefile.mirrors   Thu May 21 20:22:55 2015
(r283266)
@@ -104,9 +104,11 @@ iso-images-stage:
 . endfor
 .else  # !snapshot
cd ${TLD}/ISO-IMAGES/${REVISION} && ln -s \
-   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE} .
+   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}
+   cd ${TLD}/ISO-IMAGES/${REVISION} && ln -s \
+   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}.xz
cd ${ISO_DIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
-   CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
+   CHECKSUM.${CHECKSUM}-${OSRELEASE}
 .endif
 .if exists(${RELEASEDIR}/ftp)
mkdir -p ${FTP_DIR}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283268 - head/release

2015-05-21 Thread Glen Barber
Author: gjb
Date: Thu May 21 20:43:02 2015
New Revision: 283268
URL: https://svnweb.freebsd.org/changeset/base/283268

Log:
  Remove the arm/armv6 bits from Makefile.mirrors, which needs
  some re-thinking.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.mirrors

Modified: head/release/Makefile.mirrors
==
--- head/release/Makefile.mirrors   Thu May 21 20:39:39 2015
(r283267)
+++ head/release/Makefile.mirrors   Thu May 21 20:43:02 2015
(r283268)
@@ -23,14 +23,7 @@ STAGE_TARGETS?=  iso-images-stage
 SNAPSHOT=  1
 TLD?=  ${FTPDIR}/snapshots
 BUILDDATE!=cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" 
${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
-. if ${TARGET} == "arm" && ${TARGET_ARCH} == "armv6"
-.  if !defined(BOARDNAME) || empty(BOARDNAME)
-BOARDNAME= ${KERNCONF}
-.  endif
-_SNAP_SUFFIX:= -${BOARDNAME}-${BUILDDATE}
-. else # not arm/armv6
 _SNAP_SUFFIX:= -${BUILDDATE}
-. endif
 . for _D in /usr/bin /usr/local/bin
 .  for _S in svnversion svnliteversion
 .   if exists(${_D}/${_S})
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283269 - head/sys/dev/bxe

2015-05-21 Thread David C Somayajulu
Author: davidcs
Date: Thu May 21 20:47:19 2015
New Revision: 283269
URL: https://svnweb.freebsd.org/changeset/base/283269

Log:
  Limit the size of the posted receive buffers in Rx Rings to MJUMPAGESIZE. 
Previously for jumbo MTUs, the rx ring buffers were
   MTU + any required pad. Now when this size greater than MJUMPAGESIZE, the 
packet is spanned across multiple buffers and the
  mbufs are stiched together.
  
  Submitted by:gary.zambr...@qlogic.com
  Approved by:davi...@freebsd.org

Modified:
  head/sys/dev/bxe/bxe.c

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Thu May 21 20:43:02 2015(r283268)
+++ head/sys/dev/bxe/bxe.c  Thu May 21 20:47:19 2015(r283269)
@@ -3100,7 +3100,7 @@ static inline void
 bxe_update_sge_prod(struct bxe_softc  *sc,
 struct bxe_fastpath   *fp,
 uint16_t  sge_len,
-struct eth_end_agg_rx_cqe *cqe)
+union eth_sgl_or_raw_data *cqe)
 {
 uint16_t last_max, last_elem, first_elem;
 uint16_t delta = 0;
@@ -3113,17 +3113,17 @@ bxe_update_sge_prod(struct bxe_softc
 /* first mark all used pages */
 for (i = 0; i < sge_len; i++) {
 BIT_VEC64_CLEAR_BIT(fp->sge_mask,
-RX_SGE(le16toh(cqe->sgl_or_raw_data.sgl[i])));
+RX_SGE(le16toh(cqe->sgl[i])));
 }
 
 BLOGD(sc, DBG_LRO,
   "fp[%02d] fp_cqe->sgl[%d] = %d\n",
   fp->index, sge_len - 1,
-  le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1]));
+  le16toh(cqe->sgl[sge_len - 1]));
 
 /* assume that the last SGE index is the biggest */
 bxe_update_last_max_sge(fp,
-le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1]));
+le16toh(cqe->sgl[sge_len - 1]));
 
 last_max = RX_SGE(fp->last_max_sge);
 last_elem = last_max >> BIT_VEC64_ELEM_SHIFT;
@@ -3239,6 +3239,53 @@ bxe_tpa_stop_exit:
 }
 
 static uint8_t
+bxe_service_rxsgl(
+ struct bxe_fastpath *fp,
+ uint16_t len,
+ uint16_t lenonbd,
+ struct mbuf *m,
+ struct eth_fast_path_rx_cqe *cqe_fp)
+{
+struct mbuf *m_frag;
+uint16_t frags, frag_len;
+uint16_t sge_idx = 0;
+uint16_t j;
+uint8_t i, rc = 0;
+uint32_t frag_size;
+
+/* adjust the mbuf */
+m->m_len = lenonbd;
+
+frag_size =  len - lenonbd;
+frags = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT;
+
+for (i = 0, j = 0; i < frags; i += PAGES_PER_SGE, j++) {
+sge_idx = RX_SGE(le16toh(cqe_fp->sgl_or_raw_data.sgl[j]));
+
+m_frag = fp->rx_sge_mbuf_chain[sge_idx].m;
+frag_len = min(frag_size, (uint32_t)(SGE_PAGE_SIZE));
+m_frag->m_len = frag_len;
+
+   /* allocate a new mbuf for the SGE */
+rc = bxe_alloc_rx_sge_mbuf(fp, sge_idx);
+if (rc) {
+/* Leave all remaining SGEs in the ring! */
+return (rc);
+}
+fp->eth_q_stats.mbuf_alloc_sge--;
+
+/* concatenate the fragment to the head mbuf */
+m_cat(m, m_frag);
+
+frag_size -= frag_len;
+}
+
+bxe_update_sge_prod(fp->sc, fp, frags, &cqe_fp->sgl_or_raw_data);
+
+return rc;
+}
+
+static uint8_t
 bxe_rxeof(struct bxe_softc*sc,
   struct bxe_fastpath *fp)
 {
@@ -3278,7 +3325,7 @@ bxe_rxeof(struct bxe_softc*sc,
 struct eth_fast_path_rx_cqe *cqe_fp;
 uint8_t cqe_fp_flags;
 enum eth_rx_cqe_type cqe_fp_type;
-uint16_t len, pad;
+uint16_t len, lenonbd,  pad;
 struct mbuf *m = NULL;
 
 comp_ring_cons = RCQ(sw_cq_cons);
@@ -3293,7 +3340,7 @@ bxe_rxeof(struct bxe_softc*sc,
 BLOGD(sc, DBG_RX,
   "fp[%02d] Rx hw_cq_cons=%d hw_sw_cons=%d "
   "BD prod=%d cons=%d CQE type=0x%x err=0x%x "
-  "status=0x%x rss_hash=0x%x vlan=0x%x len=%u\n",
+  "status=0x%x rss_hash=0x%x vlan=0x%x len=%u lenonbd=%u\n",
   fp->index,
   hw_cq_cons,
   sw_cq_cons,
@@ -3304,7 +3351,8 @@ bxe_rxeof(struct bxe_softc*sc,
   cqe_fp->status_flags,
   le32toh(cqe_fp->rss_hash_result),
   le16toh(cqe_fp->vlan_tag),
-  le16toh(cqe_fp->pkt_len_or_gro_seg_len));
+  le16toh(cqe_fp->pkt_len_or_gro_seg_len),
+  le16toh(cqe_fp->len_on_bd));
 
 /* is this a slowpath msg? */
 if (__predict_false(CQE_TYPE_SLOW(cqe_fp_type))) {
@@ -3351,7 +3399,7 @@ bxe_rxeof(struct bxe_softc*sc,
 bxe_tpa_stop(sc, fp, tpa_info, queue, pages,
  &cqe->end_agg_cqe, comp_ring_cons);
 
-bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe);
+bxe_update_sge_prod(sc, fp, pages, 
&cqe->end_agg_cqe.sgl_or_raw_data);
 
 g

Re: svn commit: r283136 - head/sys/netinet

2015-05-21 Thread Eric van Gyzen
On 05/21/2015 16:03, Hiren Panchasara wrote:
> On 05/21/15 at 03:27P, Lawrence Stewart wrote:
>> On 05/20/15 23:19, Eric van Gyzen wrote:
>>> On 05/20/2015 02:33, Lawrence Stewart wrote:
 On 05/20/15 14:24, Hiren Panchasara wrote:
> On 05/20/15 at 02:13P, Lawrence Stewart wrote:
>> Hi Hiren,
>>
>> On 05/20/15 11:08, Hiren Panchasara wrote:
>>> Author: hiren Date: Wed May 20 01:08:01 2015 New Revision:
>>> 283136 URL: https://svnweb.freebsd.org/changeset/base/283136
>>>
>>> Log: Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to
>>> expire and purge all entries in hostcache immediately.
>>>
>>> In collaboration with:  bz, rwatson MFC after:  1 week Relnotes:
>>> yes Sponsored by:   Limelight Networks
>>
>> Why introduce a new sysctl and not change the existing behaviour
>> of net.inet.tcp.hostcache.purge?
>
> I thought it'd make more sense to keep the existing behavior as is
> and provide new knob for the new behavior.

 Don't think so - why would deferring a purge to the next purge run be
 useful compared to purging immediately? I'd strongly suggest you adapt
 this change to the existing purge sysctl. I can't see why anyone would
 miss the old functionality.
>>>
>>> I am generally wary of a question such as "Why would anyone want...", 
>>> because as soon as the code is released, someone answers it.
>>>
>>> That being said, I have always wanted Hiren's purgenow behavior, and I've 
>>> always been annoyed by the lazy-purge behavior.  I would suggest 
>>> implementing Lawrence's suggestion, but NOT MFC'ing it, since that would be 
>>> a disruptive change.
>>>
>>> Thanks for your work, Hiren.
>>
>> I see no reason not to MFC it - it's not a POLA violation for a stable
>> branch. When the user requests a purge, it's surely equally as good (and
>> I think anyone of right mind would argue better ;) to purge immediately
>> than some number of seconds "n" in the future, where "n" is between 1
>> and the value of net.inet.tcp.hostcache.prune.
> 
> I *do* want to MFC the change. And if there are no major objections, I'll go
> ahead with what Lawrence is suggesting: changing current purge behavior in 
> -head
> and 10.

I don't strongly object.  I like the new behavior, and I expect most people 
would, as long as it's clearly stated in the Release Notes (as it will be, 
since you tagged it thus).

Thanks for your work,

Eric



signature.asc
Description: OpenPGP digital signature


svn commit: r283271 - head/release

2015-05-21 Thread Glen Barber
Author: gjb
Date: Thu May 21 22:11:57 2015
New Revision: 283271
URL: https://svnweb.freebsd.org/changeset/base/283271

Log:
  If TARGET or EMBEDDED_TARGET == arm, set EMBEDDED variable,
  which helps control some of the arm-specific bits a bit more
  cleanly (but not really 'clean').
  
  If BOARDNAME is defined (as is in the WANDBOARD configuration
  RE uses), do some magic to work with the KERNCONF and BOARDNAME
  to rename the file, making it a bit more intuitive for the
  consumer to determine which they need.
  
  Yes, it is ugly, that is why there is a big warning at the top.
  It is, however, still much cleaner than the now 474-line shell
  script, and this Makefile produces the hierarchy needed without
  much evil.
  
  MFC after:1 week
  X-MFC-Note:   needs all previous Makefile.mirror commits
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.mirrors

Modified: head/release/Makefile.mirrors
==
--- head/release/Makefile.mirrors   Thu May 21 21:45:37 2015
(r283270)
+++ head/release/Makefile.mirrors   Thu May 21 22:11:57 2015
(r283271)
@@ -18,12 +18,14 @@ RELEASEDIR?=/R
 FTPDIR?=   ${RELEASEDIR}/ftp-stage
 STAGE_TARGETS?=iso-images-stage
 
+.if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm"
+EMBEDDED=  1
+.endif
+
 # snapshot
 .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
 SNAPSHOT=  1
 TLD?=  ${FTPDIR}/snapshots
-BUILDDATE!=cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" 
${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
-_SNAP_SUFFIX:= -${BUILDDATE}
 . for _D in /usr/bin /usr/local/bin
 .  for _S in svnversion svnliteversion
 .   if exists(${_D}/${_S})
@@ -31,9 +33,16 @@ SVNVERSION?= ${_D}/${_S}
 .   endif
 .  endfor
 . endfor
+. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh)
+BUILDDATE!=cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" 
${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
+. else
+BUILDDATE!=date +%Y%m%d
+. endif
 . if exists(${SVNVERSION}) && !empty(SVNVERSION)
 SVNREVISION!=  ${SVNVERSION} ${WORLDDIR}/Makefile
-_SNAP_SUFFIX:= ${_SNAP_SUFFIX}-r${SVNREVISION}
+_SNAP_SUFFIX:= -r${SVNREVISION}-${BUILDDATE}
+. else
+_SNAP_SUFFIX:= -${BUILDDATE}
 . endif
 .else
 # release
@@ -41,6 +50,20 @@ SNAPSHOT=
 TLD?=  ${FTPDIR}/releases
 .endif
 
+.if defined(EMBEDDED) && !empty(EMBEDDED)
+. if ${TARGET} == "arm" && ${TARGET_ARCH} == "armv6"
+.  if !defined(BOARDNAME) && empty(BOARDNAME)
+BOARDNAME:=${KERNCONF}
+.  else
+OLDNAME:=  ${KERNCONF}
+.  endif
+.  if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
+SNAPSHOT=  1
+.  endif
+IMAGES:=   ${BOARDNAME}.img
+. endif # arm/armv6
+.endif # embedded
+
 .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
 STAGE_TARGETS+=vm-images-stage
 VM_DIR=
${TLD}/VM-IMAGES/${REVISION}-${BRANCH}/${TARGET_ARCH}
@@ -61,10 +84,19 @@ iso-images-stage:
 .if exists(${RELEASEDIR})
@# Assume we have images to copy.
 . for IMAGE in ${IMAGES}
+   @# arm/armv6 IMX6 -> WANDBOARD, for example.
+.  if defined(OLDNAME) && !empty(OLDNAME)
+   cd ${RELEASEDIR} && mv 
${OSRELEASE}-${IMAGE:S,${BOARDNAME},${OLDNAME},}.xz \
+   ${OSRELEASE}-${IMAGE}.xz
+.  endif
+.  if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \
${ISO_DIR}/${OSRELEASE}-${IMAGE}
+.  endif
+.  if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \
${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz
+.  endif
 .  if exists(${RELEASEDIR}/CHECKSUM.${CHECKSUM})
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM} \
${ISO_DIR}/CHECKSUM.${CHECKSUM}
@@ -75,31 +107,40 @@ iso-images-stage:
 .if defined(SNAPSHOT) && !empty(SNAPSHOT)
 . for IMAGE in ${IMAGES}
cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE} \
-   ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
+   ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} || true
cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE}.xz \
-   ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
+   ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz || true
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
-   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
+   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
 || true
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
-   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
+   
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
 || true
+   cd ${TLD}

svn commit: r283272 - head/release

2015-05-21 Thread Glen Barber
Author: gjb
Date: Thu May 21 22:50:39 2015
New Revision: 283272
URL: https://svnweb.freebsd.org/changeset/base/283272

Log:
  Fix make(1) syntax error for non-embedded targets.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.mirrors

Modified: head/release/Makefile.mirrors
==
--- head/release/Makefile.mirrors   Thu May 21 22:11:57 2015
(r283271)
+++ head/release/Makefile.mirrors   Thu May 21 22:50:39 2015
(r283272)
@@ -18,8 +18,10 @@ RELEASEDIR?= /R
 FTPDIR?=   ${RELEASEDIR}/ftp-stage
 STAGE_TARGETS?=iso-images-stage
 
-.if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm"
+.if defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)
+. if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm"
 EMBEDDED=  1
+. endif
 .endif
 
 # snapshot
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283273 - head/sys/fs/nfsclient

2015-05-21 Thread Rick Macklem
Author: rmacklem
Date: Thu May 21 23:14:18 2015
New Revision: 283273
URL: https://svnweb.freebsd.org/changeset/base/283273

Log:
  The NFS client wasn't handling getdirentries(2) requests for sizes
  that are not an exact multiple of DIRBLKSIZ correctly. Fortunately
  readdir(3) always uses an exact multiple of DIRBLKSIZ, so few applications
  were affected. This patch fixes this problem by reducing the size
  of the directory read to an exact multiple of DIRBLKSIZ.
  
  Tested by:trasz
  Reported by:  trasz
  Reviewed by:  trasz
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==
--- head/sys/fs/nfsclient/nfs_clvnops.c Thu May 21 22:50:39 2015
(r283272)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Thu May 21 23:14:18 2015
(r283273)
@@ -2210,7 +2210,7 @@ nfs_readdir(struct vop_readdir_args *ap)
struct vnode *vp = ap->a_vp;
struct nfsnode *np = VTONFS(vp);
struct uio *uio = ap->a_uio;
-   ssize_t tresid;
+   ssize_t tresid, left;
int error = 0;
struct vattr vattr;

@@ -2239,6 +2239,17 @@ nfs_readdir(struct vop_readdir_args *ap)
}
 
/*
+* NFS always guarantees that directory entries don't straddle
+* DIRBLKSIZ boundaries.  As such, we need to limit the size
+* to an exact multiple of DIRBLKSIZ, to avoid copying a partial
+* directory entry.
+*/
+   left = uio->uio_resid % DIRBLKSIZ;
+   if (left == uio->uio_resid)
+   return (EINVAL);
+   uio->uio_resid -= left;
+
+   /*
 * Call ncl_bioread() to do the real work.
 */
tresid = uio->uio_resid;
@@ -2249,6 +2260,9 @@ nfs_readdir(struct vop_readdir_args *ap)
if (ap->a_eofflag != NULL)
*ap->a_eofflag = 1;
}
+   
+   /* Add the partial DIRBLKSIZ (left) back in. */
+   uio->uio_resid += left;
return (error);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283274 - head/sys/dev/bxe

2015-05-21 Thread David C Somayajulu
Author: davidcs
Date: Fri May 22 01:44:07 2015
New Revision: 283274
URL: https://svnweb.freebsd.org/changeset/base/283274

Log:
  Add stat counters for Jumbo Frames using SGE ring.
  Also remove the checks for IFCAP_LRO in bxe_alloc_fp_buffers() and 
bxe_pf_rx_q_prep() since both TPA and Jumbo can use SGE ring.
  
  Submitted by:gary.zambr...@qlogic.com
  Approved by:davi...@freebsd.org
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe_stats.c
  head/sys/dev/bxe/bxe_stats.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Thu May 21 23:14:18 2015(r283273)
+++ head/sys/dev/bxe/bxe.c  Fri May 22 01:44:07 2015(r283274)
@@ -27,7 +27,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#define BXE_DRIVER_VERSION "1.78.78"
+#define BXE_DRIVER_VERSION "1.78.79"
 
 #include "bxe.h"
 #include "ecore_sp.h"
@@ -472,6 +472,8 @@ static const struct {
 4, STATS_FLAGS_FUNC, "rx_pkts"},
 { STATS_OFFSET32(rx_tpa_pkts),
 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"},
+{ STATS_OFFSET32(rx_jumbo_sge_pkts),
+4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"},
 { STATS_OFFSET32(rx_soft_errors),
 4, STATS_FLAGS_FUNC, "rx_soft_errors"},
 { STATS_OFFSET32(rx_hw_csum_errors),
@@ -583,6 +585,8 @@ static const struct {
 4, "rx_pkts"},
 { Q_STATS_OFFSET32(rx_tpa_pkts),
 4, "rx_tpa_pkts"},
+{ Q_STATS_OFFSET32(rx_jumbo_sge_pkts),
+4, "rx_jumbo_sge_pkts"},
 { Q_STATS_OFFSET32(rx_soft_errors),
 4, "rx_soft_errors"},
 { Q_STATS_OFFSET32(rx_hw_csum_errors),
@@ -3466,6 +3470,7 @@ bxe_rxeof(struct bxe_softc*sc,
 rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp);
 if (rc)
 break;
+fp->eth_q_stats.rx_jumbo_sge_pkts++;
 }
 
 /* assign packet to this interface interface */
@@ -6844,42 +6849,40 @@ bxe_alloc_fp_buffers(struct bxe_softc *s
 fp->rx_cq_prod = cqe_ring_prod;
 fp->eth_q_stats.rx_calls = fp->eth_q_stats.rx_pkts = 0;
 
-if (if_getcapenable(sc->ifp) & IFCAP_LRO) {
-max_agg_queues = MAX_AGG_QS(sc);
+max_agg_queues = MAX_AGG_QS(sc);
 
-fp->tpa_enable = TRUE;
+fp->tpa_enable = TRUE;
 
-/* fill the TPA pool */
-for (j = 0; j < max_agg_queues; j++) {
-rc = bxe_alloc_rx_tpa_mbuf(fp, j);
-if (rc != 0) {
-BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n",
+/* fill the TPA pool */
+for (j = 0; j < max_agg_queues; j++) {
+rc = bxe_alloc_rx_tpa_mbuf(fp, j);
+if (rc != 0) {
+BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n",
   i, j);
-fp->tpa_enable = FALSE;
-goto bxe_alloc_fp_buffers_error;
-}
-
-fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP;
+fp->tpa_enable = FALSE;
+goto bxe_alloc_fp_buffers_error;
 }
 
-if (fp->tpa_enable) {
-/* fill the RX SGE chain */
-ring_prod = 0;
-for (j = 0; j < RX_SGE_USABLE; j++) {
-rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod);
-if (rc != 0) {
-BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n",
-  i, ring_prod);
-fp->tpa_enable = FALSE;
-ring_prod = 0;
-goto bxe_alloc_fp_buffers_error;
-}
+fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP;
+}
 
-ring_prod = RX_SGE_NEXT(ring_prod);
+if (fp->tpa_enable) {
+/* fill the RX SGE chain */
+ring_prod = 0;
+for (j = 0; j < RX_SGE_USABLE; j++) {
+rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod);
+if (rc != 0) {
+BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n",
+  i, ring_prod);
+fp->tpa_enable = FALSE;
+ring_prod = 0;
+goto bxe_alloc_fp_buffers_error;
 }
 
-fp->rx_sge_prod = ring_prod;
+ring_prod = RX_SGE_NEXT(ring_prod);
 }
+
+fp->rx_sge_prod = ring_prod;
 }
 }
 
@@ -11763,28 +11766,26 @@ bxe_pf_rx_q_prep(struct bxe_softc   
 uint16_t sge_sz = 0;
 uint16_t tpa_agg_size = 0;
 
-if (if_getcapenable(sc->ifp)  & IFCAP_LRO) {
-pause->sge_th_lo = SGE_TH_LO(sc);
-pause->sge_th_hi = SGE_TH_HI(sc);
+pause->sge_th_lo = SGE_TH_LO(sc);
+pause->sge_th_hi = SGE_TH_HI(sc);
 
-/* validate SGE ring has enough to cross high threshold */

svn commit: r283275 - head/sys/dev/fdt

2015-05-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri May 22 02:00:44 2015
New Revision: 283275
URL: https://svnweb.freebsd.org/changeset/base/283275

Log:
  Add helper method fdt_find_child to make access to child nodes easier.
  
  Some FDT nodes have complex properties organized as a child sub-nodes
  (e.g. timing for LCD panel) we need easy way to obtain handles for
  these sub-nodes

Modified:
  head/sys/dev/fdt/fdt_common.c
  head/sys/dev/fdt/fdt_common.h

Modified: head/sys/dev/fdt/fdt_common.c
==
--- head/sys/dev/fdt/fdt_common.c   Fri May 22 01:44:07 2015
(r283274)
+++ head/sys/dev/fdt/fdt_common.c   Fri May 22 02:00:44 2015
(r283275)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
 
 #define FDT_COMPAT_LEN 255
 #define FDT_TYPE_LEN   64
+#define FDT_NAME_LEN   32
 
 #define FDT_REG_CELLS  4
 
@@ -310,6 +311,22 @@ fdt_find_compatible(phandle_t start, con
 }
 
 phandle_t
+fdt_find_child(phandle_t start, const char *child_name)
+{
+   char name[FDT_NAME_LEN];
+   phandle_t child;
+
+   for (child = OF_child(start); child != 0; child = OF_peer(child)) {
+   if (OF_getprop(child, "name", name, sizeof(name)) <= 0)
+   continue;
+   if (strcmp(name, child_name) == 0)
+   return (child);
+   }
+
+   return (0);
+}
+
+phandle_t
 fdt_depth_search_compatible(phandle_t start, const char *compat, int strict)
 {
phandle_t child, node;

Modified: head/sys/dev/fdt/fdt_common.h
==
--- head/sys/dev/fdt/fdt_common.h   Fri May 22 01:44:07 2015
(r283274)
+++ head/sys/dev/fdt/fdt_common.h   Fri May 22 02:00:44 2015
(r283275)
@@ -81,6 +81,7 @@ u_long fdt_data_get(void *, int);
 int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *);
 phandle_t fdt_find_compatible(phandle_t, const char *, int);
 phandle_t fdt_depth_search_compatible(phandle_t, const char *, int);
+phandle_t fdt_find_child(phandle_t, const char *);
 int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *);
 int fdt_get_reserved_regions(struct mem_region *, int *);
 int fdt_get_phyaddr(phandle_t, device_t, int *, void **);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r283276 - in head: . sys/arm/conf sys/arm/ti sys/arm/ti/am335x sys/arm/ti/cpsw sys/arm/ti/omap4 sys/arm/ti/usb sys/boot/fdt/dts/arm sys/dev/uart

2015-05-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri May 22 03:16:18 2015
New Revision: 283276
URL: https://svnweb.freebsd.org/changeset/base/283276

Log:
  Switch TI platform support code from using FreeBSD's custom-baked DTS
  files to vendor-provided ones. It should make easier to adopt platform
  code to new revisions of hardware and to use DTS overlays for various
  Beaglebone extensions (shields/capes).
  
  Original dts filenames were not changed, they're now wrappers over dts
  files provided by TI. So make sure you update .dtb files on your
  devices as part of kernel update
  
  GPIO addressing was changed: instead of one global /dev/gpioc0 there
  are per-bank instances of /dev/gpiocX. Each bank has 32 pins so for
  instance pin 121 on /dev/gpioc0 in old addressing scheme is now pin 25
  on /dev/gpioc3
  
  On Pandaboard serial console devices was changed from /dev/ttyu0 to
  /dev/ttyu2 so you'll have to update /etc/ttys to get login prompt
  on serial port in multiuser mode. Single user mode serial console
  should work as-is
  
  Differential Revision:https://reviews.freebsd.org/D2146
  Reviewed by:  rpaulo, ian, Michal Meloun, Svatopluk Kraus

Added:
  head/sys/arm/ti/am335x/am335x_ecap.c   (contents, props changed)
  head/sys/arm/ti/am335x/am335x_ehrpwm.c   (contents, props changed)
  head/sys/arm/ti/am335x/am335x_musb.c   (contents, props changed)
  head/sys/arm/ti/am335x/am335x_pwmss.c   (contents, props changed)
  head/sys/arm/ti/ti_hwmods.c   (contents, props changed)
  head/sys/arm/ti/ti_hwmods.h   (contents, props changed)
  head/sys/arm/ti/ti_pinmux.c   (contents, props changed)
  head/sys/arm/ti/ti_pinmux.h   (contents, props changed)
  head/sys/arm/ti/usb/omap_host.c   (contents, props changed)
  head/sys/arm/ti/usb/omap_tll.c   (contents, props changed)
  head/sys/boot/fdt/dts/arm/beaglebone-common.dtsi   (contents, props changed)
  head/sys/boot/fdt/dts/arm/pandaboard-common.dtsi   (contents, props changed)
  head/sys/boot/fdt/dts/arm/pandaboard-es.dts   (contents, props changed)
Deleted:
  head/sys/arm/ti/am335x/am335x_pwm.c
  head/sys/boot/fdt/dts/arm/am335x.dtsi
Modified:
  head/UPDATING
  head/sys/arm/conf/BEAGLEBONE
  head/sys/arm/conf/PANDABOARD
  head/sys/arm/ti/aintc.c
  head/sys/arm/ti/am335x/am335x_dmtimer.c
  head/sys/arm/ti/am335x/am335x_gpio.c
  head/sys/arm/ti/am335x/am335x_lcd.c
  head/sys/arm/ti/am335x/am335x_lcd.h
  head/sys/arm/ti/am335x/am335x_pmic.c
  head/sys/arm/ti/am335x/am335x_prcm.c
  head/sys/arm/ti/am335x/am335x_pwm.h
  head/sys/arm/ti/am335x/am335x_scm_padconf.c
  head/sys/arm/ti/am335x/am335x_usbss.c
  head/sys/arm/ti/am335x/files.am335x
  head/sys/arm/ti/cpsw/if_cpsw.c
  head/sys/arm/ti/cpsw/if_cpswreg.h
  head/sys/arm/ti/cpsw/if_cpswvar.h
  head/sys/arm/ti/files.ti
  head/sys/arm/ti/omap4/files.omap4
  head/sys/arm/ti/omap4/omap4_gpio.c
  head/sys/arm/ti/omap4/omap4_prcm_clks.c
  head/sys/arm/ti/omap4/omap4_scm_padconf.c
  head/sys/arm/ti/ti_adc.c
  head/sys/arm/ti/ti_common.c
  head/sys/arm/ti/ti_edma3.c
  head/sys/arm/ti/ti_gpio.c
  head/sys/arm/ti/ti_gpio.h
  head/sys/arm/ti/ti_i2c.c
  head/sys/arm/ti/ti_mbox.c
  head/sys/arm/ti/ti_prcm.h
  head/sys/arm/ti/ti_scm.c
  head/sys/arm/ti/ti_scm.h
  head/sys/arm/ti/ti_sdhci.c
  head/sys/arm/ti/ti_sdma.c
  head/sys/arm/ti/usb/omap_ehci.c
  head/sys/arm/ti/usb/omap_usb.h
  head/sys/boot/fdt/dts/arm/am335x-evm.dts
  head/sys/boot/fdt/dts/arm/beaglebone-black.dts
  head/sys/boot/fdt/dts/arm/beaglebone.dts
  head/sys/boot/fdt/dts/arm/pandaboard.dts
  head/sys/dev/uart/uart_dev_ti8250.c

Modified: head/UPDATING
==
--- head/UPDATING   Fri May 22 02:00:44 2015(r283275)
+++ head/UPDATING   Fri May 22 03:16:18 2015(r283276)
@@ -31,6 +31,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20150521:
+   TI platform code switched to using vendor DTS files and this update
+   may break existing systems running on Beaglebone, Beaglebone Black,
+   and Pandaboard:
+
+   - dtb files should be regenerated/reinstalled. Filenames are the
+ same but content is different now
+   - GPIO addressing was changed, now each GPIO bank (32 pins per bank)
+ has its own /dev/gpiocX device, e.g. pin 121 on /dev/gpioc0 in old
+ addressing scheme is now pin 25 on /dev/gpioc3.
+   - Pandaboard: /etc/ttys should be updated, serial console device is
+ now /dev/ttyu2, not /dev/ttyu0
+
 20150501:
soelim(1) from gnu/usr.bin/groff has been replaced by usr.bin/soelim.
If you need the GNU extension from groff soelim(1), install groff

Modified: head/sys/arm/conf/BEAGLEBONE
==
--- head/sys/arm/conf/BEAGLEBONEFri May 22 02:00:44 2015
(r283275)
+++ head/sys

svn commit: r283277 - head/sys/arm/at91

2015-05-21 Thread Warner Losh
Author: imp
Date: Fri May 22 05:02:53 2015
New Revision: 283277
URL: https://svnweb.freebsd.org/changeset/base/283277

Log:
  Need to handle the !FDT case still too... I thought in r270025 we
  wouldn't need it, but it appears that we still do for the moment...

Modified:
  head/sys/arm/at91/at91_pio.c

Modified: head/sys/arm/at91/at91_pio.c
==
--- head/sys/arm/at91/at91_pio.cFri May 22 03:16:18 2015
(r283276)
+++ head/sys/arm/at91/at91_pio.cFri May 22 05:02:53 2015
(r283277)
@@ -646,5 +646,9 @@ static driver_t at91_pio_driver = {
sizeof(struct at91_pio_softc),
 };
 
+#ifdef FDT
 EARLY_DRIVER_MODULE(at91_pio, at91_pinctrl, at91_pio_driver, at91_pio_devclass,
 NULL, NULL, BUS_PASS_INTERRUPT);
+#else
+DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, NULL, 
NULL);
+#endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r282971 - in head/sys: kern sys

2015-05-21 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512



On 5/21/15 09:58, Mateusz Guzik wrote:
> In other words, I would argue modifying native privmitives to 
> accomodate for zfs use may not be the best course of action.

Well, POSIX says this about pthread_cond_destroy(), quote:

"A condition variable can be destroyed immediately after all the
threads that are blocked on it are awakened."

This is also supported by our userland thread library (libthr), by the
way, and I don't see this as an unreasonable expectation, as there is
no programmer accessible API to drain a conditional variable.

BTW. what ZFS code does is that it released the mutex (z_range_lock in
the zfs_rlock.c case), then did a broadcast, at which point the code
shall reasonably expect that all threads that are blocked on it are
awaken, and destroying the condition variable *must* be safe at the time
.

Cheers,
-BEGIN PGP SIGNATURE-

iQIcBAEBCgAGBQJVXtC8AAoJEJW2GBstM+nsvBwP/3lx99PDC+LDYXnZ4wE3bOxh
h7I/Sn7fSMO8UzsY6H9Wgaw9SvPzLbeCtAuild8prcmtkIBfX2AJ2Z3MhrmaZjR3
zaZJhOL3gHOip9YWy6nSUaKeFjKgpoA4VrvyOhVczBZ45FYElEseYbnnr+QYA4AZ
U9PsSDf23z72/iCebbxwCNZt07sAPj3UtmWQAP0iGPIlUkW8kyJMzHn9jwLfENnH
GgBb8C9o9ayBODNh/JfeMnyFylRLnK2GllP5p4zi2boKprKBrFgEVUVo72bhXjD0
zhk3+shXi3U99SuudR7+tRSHHJNeaAOnfPOyNF3EvRFPsIsU/sxZL+FHy4AePURp
7qFJeozEX4mphj5m4WOlX8NMZoEm3SwInVjmlnb0yaOVuLtFM+IUkguYHO2Ckb4X
byljvYGXHXKoFZQx4LN+YOdTAOF2xvNhmwB9scfBYI+tEAzIoakcPE1eeciLHmR5
jjLjW4MX8fgMtvBlVlh9XOre9J81Cgj5mxmBK3Z4KnuZD26yrjpn4ZauCI6/7vRN
c16mgsdC5lzmgheWhDAethg5oXO0r5xmapLOMMW3ZE4LZ7+L6bCvMsmAjcmVwOzQ
ftyO20wx5JTicaK0oPz9i31Szdm8c4z6B/GZdHbZJT+tdypo2WcO9/OLeqDjo3Jj
6prgPNxd72hHS4okdTSA
=KCdi
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"