svn commit: r308462 - head/usr.sbin/gstat

2016-11-08 Thread Marcelo Araujo
Author: araujo
Date: Wed Nov  9 07:31:39 2016
New Revision: 308462
URL: https://svnweb.freebsd.org/changeset/base/308462

Log:
  Add flag -B which does the same like batch mode but without exiting after
  print. Also add a new flag -s that add blocks size to statistics.
  
  PR:   198347, 212726
  Submitted by: Ben RUBSON 
  Tested by:pi
  MFC After:2 weeks.

Modified:
  head/usr.sbin/gstat/gstat.8
  head/usr.sbin/gstat/gstat.c

Modified: head/usr.sbin/gstat/gstat.8
==
--- head/usr.sbin/gstat/gstat.8 Wed Nov  9 07:09:27 2016(r308461)
+++ head/usr.sbin/gstat/gstat.8 Wed Nov  9 07:31:39 2016(r308462)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 3, 2014
+.Dd November 10, 2016
 .Dt GSTAT 8
 .Os
 .Sh NAME
@@ -32,7 +32,7 @@
 .Nd print statistics about GEOM disks
 .Sh SYNOPSIS
 .Nm
-.Op Fl abcdop
+.Op Fl abBcdops
 .Op Fl f Ar filter
 .Op Fl I Ar interval
 .Sh DESCRIPTION
@@ -50,6 +50,10 @@ Only display providers that are at least
 Batch mode.
 Collect numbers, print and exit.
 Default if stdout is not a tty.
+.It Fl B
+Endless batch mode.
+Same as batch mode, but does not exit after collecting
+the first set of data.
 .It Fl c
 Enable display of
 .Xr geom 4
@@ -72,6 +76,8 @@ The format of the regular expression is 
 .It Fl o
 Enable display of statistics for other operations
 .Pq Dv BIO_FLUSH .
+.It Fl s
+Enable blocks' size statistics.
 .It Fl I Ar interval
 Refresh the
 .Nm

Modified: head/usr.sbin/gstat/gstat.c
==
--- head/usr.sbin/gstat/gstat.c Wed Nov  9 07:09:27 2016(r308461)
+++ head/usr.sbin/gstat/gstat.c Wed Nov  9 07:31:39 2016(r308462)
@@ -51,11 +51,11 @@
 #include 
 #include 
 
-static int flag_a, flag_b, flag_c, flag_d, flag_o, flag_p;
+static int flag_a, flag_b, flag_B, flag_c, flag_d, flag_o, flag_p, flag_s;
 static int flag_I = 100;
 
 #define PRINTMSG(...) do { \
-   if (flag_b && !loop)\
+   if ((flag_b && !loop) || (flag_B))  \
printf(__VA_ARGS__);\
else if (!flag_b)   \
printw(__VA_ARGS__);\
@@ -88,7 +88,7 @@ main(int argc, char **argv)
char *p;
char f_s[100], pf_s[100], tmp_f_s[100];
const char *line;
-   long double ld[13];
+   long double ld[16];
uint64_t u64;
EditLine *el;
History *hist;
@@ -104,7 +104,7 @@ main(int argc, char **argv)
flag_b = 1;
 
f_s[0] = '\0';
-   while ((i = getopt(argc, argv, "abdcf:I:op")) != -1) {
+   while ((i = getopt(argc, argv, "abBdcf:I:ops")) != -1) {
switch (i) {
case 'a':
flag_a = 1;
@@ -112,6 +112,10 @@ main(int argc, char **argv)
case 'b':
flag_b = 1;
break;
+   case 'B':
+   flag_B = 1;
+   flag_b = 1;
+   break;
case 'c':
flag_c = 1;
break;
@@ -146,6 +150,9 @@ main(int argc, char **argv)
case 'p':
flag_p = 1;
break;
+   case 's':
+   flag_s = 1;
+   break;
case '?':
default:
usage();
@@ -208,7 +215,8 @@ main(int argc, char **argv)

geom_stats_snapshot_reset(sp);
geom_stats_snapshot_reset(sq);
-   move(0,0);
+   if (!flag_b)
+   move(0,0);
PRINTMSG("dT: %5.3fs  w: %.3fs", dt, (float)flag_I / 100);
if (f_s[0] != '\0') {
PRINTMSG("  filter: ");
@@ -231,10 +239,20 @@ main(int argc, char **argv)
}
PRINTMSG("\n");
PRINTMSG(" L(q)  ops/s   ");
-   PRINTMSG(" r/s   kBps   ms/r   ");
-   PRINTMSG(" w/s   kBps   ms/w   ");
-   if (flag_d)
-   PRINTMSG(" d/s   kBps   ms/d   ");
+   if (flag_s) {
+   PRINTMSG(" r/s kB   kBps   ms/r   ");
+   PRINTMSG(" w/s kB   kBps   ms/w   ");
+   }
+   else {
+   PRINTMSG(" r/s   kBps   ms/r   ");
+   PRINTMSG(" w/s   kBps   ms/w   ");
+   }
+   if (flag_d) {
+   if (flag_s)
+   PRINTMSG(" d/s kB   kBps   ms/d   ");
+   else
+   

svn commit: r308461 - head/sys/dev/sound/usb

2016-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Nov  9 07:09:27 2016
New Revision: 308461
URL: https://svnweb.freebsd.org/changeset/base/308461

Log:
  Allow higher sample rates to have more jitter than lower ones.
  
  PR:   208791
  MFC after:3 days

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Wed Nov  9 06:47:29 2016
(r308460)
+++ head/sys/dev/sound/usb/uaudio.c Wed Nov  9 07:09:27 2016
(r308461)
@@ -2079,6 +2079,8 @@ uaudio_chan_play_sync_callback(struct us
 * recording channel:
 */
if (ch->priv_sc->sc_rec_chan.num_alt == 0) {
+   int32_t jitter_max = howmany(sample_rate, 16000);
+
/*
 * Range check the jitter values to avoid
 * bogus sample rate adjustments. The expected
@@ -2087,12 +2089,11 @@ uaudio_chan_play_sync_callback(struct us
 * mandates this requirement. Refer to chapter
 * 5.12.4.2 about feedback.
 */
-   if (temp > sample_rate)
-   ch->jitter_curr = 1;
-   else if (temp < sample_rate)
-   ch->jitter_curr = -1;
-   else
-   ch->jitter_curr = 0;
+   ch->jitter_curr = temp - sample_rate;
+   if (ch->jitter_curr > jitter_max)
+   ch->jitter_curr = jitter_max;
+   else if (ch->jitter_curr < -jitter_max)
+   ch->jitter_curr = -jitter_max;
}
ch->feedback_rate = temp;
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308460 - head/sys/dev/usb

2016-11-08 Thread Kevin Lo
Author: kevlo
Date: Wed Nov  9 06:47:29 2016
New Revision: 308460
URL: https://svnweb.freebsd.org/changeset/base/308460

Log:
  Sort DLINK section and add USB device ID of D-Link DWA-131 rev E1.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsWed Nov  9 04:42:09 2016(r308459)
+++ head/sys/dev/usb/usbdevsWed Nov  9 06:47:29 2016(r308460)
@@ -1621,12 +1621,18 @@ product DLINK DUBE100   0x1a00  10/100 Eth
 product DLINK DUBE100C10x1a02  DUB-E100 rev C1
 product DLINK DSB650TX40x200c  10/100 Ethernet
 product DLINK DWL120E  0x3200  DWL-120 rev E
+product DLINK RTL8192CU_1  0x3307  RTL8192CU
+product DLINK RTL8188CU0x3308  RTL8188CU
+product DLINK RTL8192CU_2  0x3309  RTL8192CU
+product DLINK RTL8192CU_3  0x330a  RTL8192CU
+product DLINK DWA131B  0x330d  DWA-131 rev B
 product DLINK DWA125D1 0x330f  DWA-125 rev D1
 product DLINK DWA123D1 0x3310  DWA-123 rev D1
 product DLINK DWA171A1 0x3314  DWA-171 rev A1
 product DLINK DWA182C1 0x3315  DWA-182 rev C1
 product DLINK DWA180A1 0x3316  DWA-180 rev A1
 product DLINK DWA172A1 0x3318  DWA-172 rev A1
+product DLINK DWA131E1 0x3319  DWA-131 rev E1
 product DLINK DWL122   0x3700  DWL-122
 product DLINK DWLG120  0x3701  DWL-G120
 product DLINK DWL120F  0x3702  DWL-120 rev F
@@ -1652,17 +1658,12 @@ product DLINK DSB650TX_PNA  0x4003  1/10/1
 product DLINK DSB650TX30x400b  10/100 Ethernet
 product DLINK DSB650TX20x4102  10/100 Ethernet
 product DLINK DUB1312  0x4a00  10/100/1000 Ethernet
-product DLINK DSB650   0xabc1  10/100 Ethernet
-product DLINK DUBH70xf103  DUB-H7 USB 2.0 7-Port Hub
-product DLINK DWR510_CD0xa805  DWR-510 CD-ROM Mode
-product DLINK DWR510   0x7e12  DWR-510
 product DLINK DWM157   0x7d02  DWM-157
+product DLINK DWR510   0x7e12  DWR-510
 product DLINK DWM157_CD0xa707  DWM-157 CD-ROM Mode
-product DLINK RTL8188CU0x3308  RTL8188CU
-productDLINK RTL8192CU_1   0x3307  RTL8192CU
-productDLINK RTL8192CU_2   0x3309  RTL8192CU
-productDLINK RTL8192CU_3   0x330a  RTL8192CU
-productDLINK DWA131B   0x330d  DWA-131 rev B
+product DLINK DWR510_CD0xa805  DWR-510 CD-ROM Mode
+product DLINK DSB650   0xabc1  10/100 Ethernet
+product DLINK DUBH70xf103  DUB-H7 USB 2.0 7-Port Hub
 product DLINK2 RTL8192SU_1 0x3300  RTL8192SU
 product DLINK2 RTL8192SU_2 0x3302  RTL8192SU
 product DLINK2 DWA131A10x3303  DWA-131 A1
@@ -1673,8 +1674,8 @@ product DLINK2 DWA130D1   0x3a0f  DWA-130 
 product DLINK2 DWLG122C1   0x3c03  DWL-G122 c1
 product DLINK2 WUA1340 0x3c04  WUA-1340
 product DLINK2 DWA111  0x3c06  DWA-111
-product DLINK2 RT2870_10x3c09  RT2870
 product DLINK2 DWA110  0x3c07  DWA-110
+product DLINK2 RT2870_10x3c09  RT2870
 product DLINK2 RT3072  0x3c0a  RT3072
 product DLINK2 RT3072_10x3c0b  RT3072
 product DLINK2 RT3070_10x3c0d  RT3070
@@ -4477,6 +4478,7 @@ product TOSHIBA TRANSMEMORY   0x6545  USB T
 
 /* TP-Link products */
 product TPLINK T4U 0x0101  Archer T4U
+product TPLINK WN823NV20x0109  TL-WN823N v2
 
 /* Trek Technology products */
 product TREK THUMBDRIVE0x  ThumbDrive
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r308458 - in head/sys: boot/fdt/dts/arm modules/dtb/am335x

2016-11-08 Thread Luiz Otavio O Souza
On 9 November 2016 at 02:26, Emmanuel Vadot wrote:
> On Wed, 9 Nov 2016 04:07:15 + (UTC)
> Luiz Otavio O Souza wrote:
>
>> Author: loos
>> Date: Wed Nov  9 04:07:15 2016
>> New Revision: 308458
>> URL: https://svnweb.freebsd.org/changeset/base/308458
>>
>> Log:
>>   Add the DTS for the Netgate SG-1000 (micro-Firewall).
>>
>>   The SG-1000 boots with GENERIC ARM kernel on -head.
>>
>>   Obtained from:  pfSense
>>   Sponsored by:   Rubicon Communications, LLC (Netgate)
>>
>> Added:
>>   head/sys/boot/fdt/dts/arm/ubmc.dtsi   (contents, props changed)
>>   head/sys/boot/fdt/dts/arm/ufw.dts   (contents, props changed)
>> Modified:
>>   head/sys/modules/dtb/am335x/Makefile
>
>  Hello Luiz,
>
>  Two things:
>
>  - If ubmc.dtsi is gnu licenced it shouldn't go in sys/boot/fdt/dts.
> It shouldn't go to sys/gnu/dts too as it's not from upstream.
>   - I don't understand why you didn't use the am33xx.dtsi from
> upstream, it is the way to go for dts.
>
>  The correct way to add support for this board would be :
>
>  1) Create a ubmc.dtsi that uses upstream am33xx.dtsi and submit it
> upstream (i.e. linux-arm), MIT/GPL dual licence
>  2) Create a ufw.dts and also submit it upstream (also MIT/GPL)
>  3) Since those are also MIT you could add them to sys/boot/fdt
>  4) When we will update the dts from upstream you can then remove them
> from sys/boot/fdt
>
>  But there would still be a problem since the am33xx.dtsi is not MIT/GPL
> licenced.
>  So I guess you don't have any other solution than dealing with DTS
> somewhere in the pfsense repository (maybe with package or something).
>
>  The DTS world is already a mess with it's licence and the fact that
> linux is the "official" place, so please do not add more :)

Hi Emmanuel,

Yes, you're right.  I forgot about the licence in this file.

This is not an issue for us in pfSense (we do not depend on this
change in FreeBSD), we want to provide support for the people that is
going to use/test FreeBSD on uFW.

As this is all our work, I'll redo the files and include our changes
in a single file.

FreeBSD is the upstream here, it is the first officially supported OS for uFW.

Thanks,
Luiz
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308459 - head/bin/hostname

2016-11-08 Thread Marcelo Araujo
Author: araujo
Date: Wed Nov  9 04:42:09 2016
New Revision: 308459
URL: https://svnweb.freebsd.org/changeset/base/308459

Log:
  Fix missing '-' for the flags -s and -d on both manpage and usage.
  
  Reported by:  garga, bde

Modified:
  head/bin/hostname/hostname.1
  head/bin/hostname/hostname.c

Modified: head/bin/hostname/hostname.1
==
--- head/bin/hostname/hostname.1Wed Nov  9 04:07:15 2016
(r308458)
+++ head/bin/hostname/hostname.1Wed Nov  9 04:42:09 2016
(r308459)
@@ -29,7 +29,7 @@
 .\"@(#)hostname.1  8.2 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd November 9, 2016
+.Dd November 10, 2016
 .Dt HOSTNAME 1
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl f
-.Op Fl s|d
+.Op Fl s | d
 .Op Ar name-of-host
 .Sh DESCRIPTION
 The

Modified: head/bin/hostname/hostname.c
==
--- head/bin/hostname/hostname.cWed Nov  9 04:07:15 2016
(r308458)
+++ head/bin/hostname/hostname.cWed Nov  9 04:42:09 2016
(r308459)
@@ -108,6 +108,6 @@ static void
 usage(void)
 {
 
-   (void)fprintf(stderr, "usage: hostname [-f] [s|d] [name-of-host]\n");
+   (void)fprintf(stderr, "usage: hostname [-f] [-s | -d] 
[name-of-host]\n");
exit(1);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r308443 - head/bin/hostname

2016-11-08 Thread Marcelo Araujo
Fixed, thanks!

2016-11-09 9:39 GMT+08:00 Bruce Evans :

> On Tue, 8 Nov 2016, Renato Botelho wrote:
>
> On 8 Nov 2016, at 09:36, Marcelo Araujo  wrote:
>>>
>>> Log:
>>>  Add -d flag that prints domain only.
>>>
>>>  PR:212875
>>>  Submitted by:  Ben RUBSON 
>>>  Reviewed by:   pi
>>>
>>
> This has many style bugs.
>
>
> Modified:
>>>  head/bin/hostname/hostname.1
>>>  head/bin/hostname/hostname.c
>>>
>>> Modified: head/bin/hostname/hostname.1
>>> 
>>> ==
>>> --- head/bin/hostname/hostname.1Tue Nov  8 10:10:55 2016
>>> (r308442)
>>> +++ head/bin/hostname/hostname.1Tue Nov  8 11:36:33 2016
>>> (r308443)
>>> @@ -29,7 +29,7 @@
>>> .\" @(#)hostname.1  8.2 (Berkeley) 4/28/95
>>> .\" $FreeBSD$
>>> .\"
>>> -.Dd December 7, 2006
>>> +.Dd November 9, 2016
>>> .Dt HOSTNAME 1
>>> .Os
>>> .Sh NAME
>>> @@ -37,7 +37,8 @@
>>> .Nd set or print name of current host system
>>> .Sh SYNOPSIS
>>> .Nm
>>> -.Op Fl fs
>>> +.Op Fl f
>>> +.Op Fl s|d
>>> .Op Ar name-of-host
>>> .Sh DESCRIPTION
>>> The
>>> @@ -62,6 +63,8 @@ This is the default behavior.
>>> .It Fl s
>>> Trim off any domain information from the printed
>>> name.
>>> +.It Fl d
>>> +Only print domain information.
>>> .El
>>> .Sh SEE ALSO
>>> .Xr gethostname 3 ,
>>>
>>> Modified: head/bin/hostname/hostname.c
>>> 
>>> ==
>>> --- head/bin/hostname/hostname.cTue Nov  8 10:10:55 2016
>>> (r308442)
>>> +++ head/bin/hostname/hostname.cTue Nov  8 11:36:33 2016
>>> (r308443)
>>> @@ -54,11 +54,12 @@ static void usage(void) __dead2;
>>> int
>>> main(int argc, char *argv[])
>>> {
>>> -   int ch, sflag;
>>> +   int ch, sflag, dflag;
>>> char *p, hostname[MAXHOSTNAMELEN];
>>>
>>> sflag = 0;
>>> -   while ((ch = getopt(argc, argv, "fs")) != -1)
>>> +   dflag = 0;
>>> +   while ((ch = getopt(argc, argv, "fsd")) != -1)
>>> switch (ch) {
>>> case 'f':
>>> /*
>>> @@ -70,6 +71,9 @@ main(int argc, char *argv[])
>>> case 's':
>>> sflag = 1;
>>> break;
>>> +   case 'd':
>>> +   dflag = 1;
>>> +   break;
>>> case '?':
>>> default:
>>> usage();
>>> @@ -77,7 +81,7 @@ main(int argc, char *argv[])
>>> argc -= optind;
>>> argv += optind;
>>>
>>> -   if (argc > 1)
>>> +   if (argc > 1 || (sflag && dflag))
>>> usage();
>>>
>>> if (*argv) {
>>> @@ -90,6 +94,10 @@ main(int argc, char *argv[])
>>> p = strchr(hostname, '.');
>>> if (p != NULL)
>>> *p = '\0';
>>> +   } else if (dflag) {
>>> +   p = strchr(hostname, '.');
>>> +   if (p != NULL)
>>> +   strcpy(hostname, ++p);
>>> }
>>> (void)printf("%s\n", hostname);
>>> }
>>> @@ -100,6 +108,6 @@ static void
>>> usage(void)
>>> {
>>>
>>> -   (void)fprintf(stderr, "usage: hostname [-fs] [name-of-host]\n");
>>> +   (void)fprintf(stderr, "usage: hostname [-f] [s|d]
>>> [name-of-host]\n");
>>>
>>
>>
>> It’s missing ‘-‘ sign on [s|d] block, what makes message a bit confused
>> IMO. Maybe [-s|-d] would be more clear.
>>
>
> Both are wrong.
>
> This is also broken in the man page, where the '|' is literal and
> misformatted.  Normal markup would give '[-d | -s]' in the man page, and
> this should be copied to the usage message.  Hard-coding the '|' using
> 's|d' gives the different syntax error of a hyphen before the 's'but no
> hyphen before the 's' ('[-s|d]').
>
> The hard-coding has 2 other bugs:
> - missing spaces around '|'
> - d and s are unsorted
>
> d and s are unsorted consistently in about 8 instances in the patch.
>
> The correct order for sorting -f and [-d | -s] in the synopsis and
> usage message is unclear.  It would be best to put -f after -d and keep
> -s attached to -d, but with longer options list this takes too much
> space by splitting up the single-letter options.
>
> Bruce




-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r308458 - in head/sys: boot/fdt/dts/arm modules/dtb/am335x

2016-11-08 Thread Emmanuel Vadot
On Wed, 9 Nov 2016 04:07:15 + (UTC)
Luiz Otavio O Souza  wrote:

> Author: loos
> Date: Wed Nov  9 04:07:15 2016
> New Revision: 308458
> URL: https://svnweb.freebsd.org/changeset/base/308458
> 
> Log:
>   Add the DTS for the Netgate SG-1000 (micro-Firewall).
>   
>   The SG-1000 boots with GENERIC ARM kernel on -head.
>   
>   Obtained from:  pfSense
>   Sponsored by:   Rubicon Communications, LLC (Netgate)
> 
> Added:
>   head/sys/boot/fdt/dts/arm/ubmc.dtsi   (contents, props changed)
>   head/sys/boot/fdt/dts/arm/ufw.dts   (contents, props changed)
> Modified:
>   head/sys/modules/dtb/am335x/Makefile

 Hello Luiz,

 Two things:

 - If ubmc.dtsi is gnu licenced it shouldn't go in sys/boot/fdt/dts.
It shouldn't go to sys/gnu/dts too as it's not from upstream.
  - I don't understand why you didn't use the am33xx.dtsi from
upstream, it is the way to go for dts.

 The correct way to add support for this board would be :

 1) Create a ubmc.dtsi that uses upstream am33xx.dtsi and submit it
upstream (i.e. linux-arm), MIT/GPL dual licence
 2) Create a ufw.dts and also submit it upstream (also MIT/GPL)
 3) Since those are also MIT you could add them to sys/boot/fdt
 4) When we will update the dts from upstream you can then remove them
from sys/boot/fdt

 But there would still be a problem since the am33xx.dtsi is not MIT/GPL
licenced.
 So I guess you don't have any other solution than dealing with DTS
somewhere in the pfsense repository (maybe with package or something).

 The DTS world is already a mess with it's licence and the fact that
linux is the "official" place, so please do not add more :)

> Added: head/sys/boot/fdt/dts/arm/ubmc.dtsi
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/sys/boot/fdt/dts/arm/ubmc.dtsi   Wed Nov  9 04:07:15 2016
> (r308458)
> @@ -0,0 +1,315 @@
> +/*
> + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * $FreeBSD$
> + */
> +
> +/ {
> + memory {
> + device_type = "memory";
> + reg = <0x8000 0x1000>; /* 256 MB */
> + };
> +
> + vmmcsd_fixed: fixedregulator@0 {
> + compatible = "regulator-fixed";
> + regulator-name = "vmmcsd_fixed";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + };
> +};
> +
> +_pinmux {
> + pinctrl-names = "default";
> + pinctrl-0 = <_pin>;
> +
> + i2c0_pins: pinmux_i2c0_pins {
> + pinctrl-single,pins = <
> + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)   
> /* i2c0_sda.i2c0_sda */
> + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)   
> /* i2c0_scl.i2c0_scl */
> + >;
> + };
> +
> + i2c1_pins: pinmux_i2c1_pins {
> + pinctrl-single,pins = <
> + AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE3)   
> /* uart0_ctsn.i2c1_sda */
> + AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE3)   
> /* uart0_rtsn.i2c1_scl */
> + >;
> + };
> +
> + spi0_pins: pinmux_spi0_pins {
> + pinctrl-single,pins = <
> + AM33XX_IOPAD(0x950, PIN_INPUT_PULLDOWN | MUX_MODE0) 
> /* spi0_sclk.spi0_sclk */
> + AM33XX_IOPAD(0x954, PIN_INPUT_PULLDOWN | MUX_MODE0) 
> /* spi0_d0.spi0_miso */
> + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0)   
> /* spi0_d1.spi0_mosi */
> + AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0)   
> /* spi0_cs0.spi0_cs0 */
> + >;
> + };
> +
> + spi1_pins: pinmux_spi1_pins {
> + pinctrl-single,pins = <
> + AM33XX_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE2) 
> /* mii1_col.spi1_sclk */
> + AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE2) 
> /* mii1_crs.spi1_miso */
> + AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE2)   
> /* mii1_rx_er.spi1_mosi */
> + AM33XX_IOPAD(0x944, PIN_INPUT_PULLUP | MUX_MODE2)   
> /* rmii1_ref_clk.spi1_cs0 */
> + >;
> + };
> +
> + uart0_pins: pinmux_uart0_pins {
> + pinctrl-single,pins = <
> + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)   
> /* uart0_rxd.uart0_rxd */
> + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
> /* uart0_txd.uart0_txd */
> + >;
> + };
> +
> + clkout2_pin: pinmux_clkout2_pin {
> + pinctrl-single,pins = <
> + AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) 

svn commit: r308458 - in head/sys: boot/fdt/dts/arm modules/dtb/am335x

2016-11-08 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Nov  9 04:07:15 2016
New Revision: 308458
URL: https://svnweb.freebsd.org/changeset/base/308458

Log:
  Add the DTS for the Netgate SG-1000 (micro-Firewall).
  
  The SG-1000 boots with GENERIC ARM kernel on -head.
  
  Obtained from:pfSense
  Sponsored by: Rubicon Communications, LLC (Netgate)

Added:
  head/sys/boot/fdt/dts/arm/ubmc.dtsi   (contents, props changed)
  head/sys/boot/fdt/dts/arm/ufw.dts   (contents, props changed)
Modified:
  head/sys/modules/dtb/am335x/Makefile

Added: head/sys/boot/fdt/dts/arm/ubmc.dtsi
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/fdt/dts/arm/ubmc.dtsi Wed Nov  9 04:07:15 2016
(r308458)
@@ -0,0 +1,315 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * $FreeBSD$
+ */
+
+/ {
+   memory {
+   device_type = "memory";
+   reg = <0x8000 0x1000>; /* 256 MB */
+   };
+
+   vmmcsd_fixed: fixedregulator@0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vmmcsd_fixed";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   };
+};
+
+_pinmux {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pin>;
+
+   i2c0_pins: pinmux_i2c0_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)   
/* i2c0_sda.i2c0_sda */
+   AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)   
/* i2c0_scl.i2c0_scl */
+   >;
+   };
+
+   i2c1_pins: pinmux_i2c1_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE3)   
/* uart0_ctsn.i2c1_sda */
+   AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE3)   
/* uart0_rtsn.i2c1_scl */
+   >;
+   };
+
+   spi0_pins: pinmux_spi0_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x950, PIN_INPUT_PULLDOWN | MUX_MODE0) 
/* spi0_sclk.spi0_sclk */
+   AM33XX_IOPAD(0x954, PIN_INPUT_PULLDOWN | MUX_MODE0) 
/* spi0_d0.spi0_miso */
+   AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0)   
/* spi0_d1.spi0_mosi */
+   AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0)   
/* spi0_cs0.spi0_cs0 */
+   >;
+   };
+
+   spi1_pins: pinmux_spi1_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE2) 
/* mii1_col.spi1_sclk */
+   AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE2) 
/* mii1_crs.spi1_miso */
+   AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rx_er.spi1_mosi */
+   AM33XX_IOPAD(0x944, PIN_INPUT_PULLUP | MUX_MODE2)   
/* rmii1_ref_clk.spi1_cs0 */
+   >;
+   };
+
+   uart0_pins: pinmux_uart0_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)   
/* uart0_rxd.uart0_rxd */
+   AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
/* uart0_txd.uart0_txd */
+   >;
+   };
+
+   clkout2_pin: pinmux_clkout2_pin {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
/* xdma_event_intr1.clkout2 */
+   >;
+   };
+
+   cpsw_default: cpsw_default {
+   pinctrl-single,pins = <
+   /* Slave 1 */
+   AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txen.rgmii_1_txen */
+   AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxdv.rgmii_1_rxdv */
+   AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txd3.rgmii_1_txd3 */
+   AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txd2.rgmii_1_txd2 */
+   AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txd1.rgmii_1_txd1 */
+   AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txd0.rgmii_1_txd0 */
+   AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txclk.rgmii_1_txclk */
+   AM33XX_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxclk.rgmii_1_rxclk */
+   AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxd3.rgmii_1_rxd3 */
+   AM33XX_IOPAD(0x938, 

Re: svn commit: r308443 - head/bin/hostname

2016-11-08 Thread Bruce Evans

On Tue, 8 Nov 2016, Renato Botelho wrote:


On 8 Nov 2016, at 09:36, Marcelo Araujo  wrote:

Log:
 Add -d flag that prints domain only.

 PR:212875
 Submitted by:  Ben RUBSON 
 Reviewed by:   pi


This has many style bugs.


Modified:
 head/bin/hostname/hostname.1
 head/bin/hostname/hostname.c

Modified: head/bin/hostname/hostname.1
==
--- head/bin/hostname/hostname.1Tue Nov  8 10:10:55 2016
(r308442)
+++ head/bin/hostname/hostname.1Tue Nov  8 11:36:33 2016
(r308443)
@@ -29,7 +29,7 @@
.\"@(#)hostname.1  8.2 (Berkeley) 4/28/95
.\" $FreeBSD$
.\"
-.Dd December 7, 2006
+.Dd November 9, 2016
.Dt HOSTNAME 1
.Os
.Sh NAME
@@ -37,7 +37,8 @@
.Nd set or print name of current host system
.Sh SYNOPSIS
.Nm
-.Op Fl fs
+.Op Fl f
+.Op Fl s|d
.Op Ar name-of-host
.Sh DESCRIPTION
The
@@ -62,6 +63,8 @@ This is the default behavior.
.It Fl s
Trim off any domain information from the printed
name.
+.It Fl d
+Only print domain information.
.El
.Sh SEE ALSO
.Xr gethostname 3 ,

Modified: head/bin/hostname/hostname.c
==
--- head/bin/hostname/hostname.cTue Nov  8 10:10:55 2016
(r308442)
+++ head/bin/hostname/hostname.cTue Nov  8 11:36:33 2016
(r308443)
@@ -54,11 +54,12 @@ static void usage(void) __dead2;
int
main(int argc, char *argv[])
{
-   int ch, sflag;
+   int ch, sflag, dflag;
char *p, hostname[MAXHOSTNAMELEN];

sflag = 0;
-   while ((ch = getopt(argc, argv, "fs")) != -1)
+   dflag = 0;
+   while ((ch = getopt(argc, argv, "fsd")) != -1)
switch (ch) {
case 'f':
/*
@@ -70,6 +71,9 @@ main(int argc, char *argv[])
case 's':
sflag = 1;
break;
+   case 'd':
+   dflag = 1;
+   break;
case '?':
default:
usage();
@@ -77,7 +81,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;

-   if (argc > 1)
+   if (argc > 1 || (sflag && dflag))
usage();

if (*argv) {
@@ -90,6 +94,10 @@ main(int argc, char *argv[])
p = strchr(hostname, '.');
if (p != NULL)
*p = '\0';
+   } else if (dflag) {
+   p = strchr(hostname, '.');
+   if (p != NULL)
+   strcpy(hostname, ++p);
}
(void)printf("%s\n", hostname);
}
@@ -100,6 +108,6 @@ static void
usage(void)
{

-   (void)fprintf(stderr, "usage: hostname [-fs] [name-of-host]\n");
+   (void)fprintf(stderr, "usage: hostname [-f] [s|d] [name-of-host]\n");



It???s missing ???-??? sign on [s|d] block, what makes message a bit confused 
IMO. Maybe [-s|-d] would be more clear.


Both are wrong.

This is also broken in the man page, where the '|' is literal and
misformatted.  Normal markup would give '[-d | -s]' in the man page, and
this should be copied to the usage message.  Hard-coding the '|' using
's|d' gives the different syntax error of a hyphen before the 's'but no
hyphen before the 's' ('[-s|d]').

The hard-coding has 2 other bugs:
- missing spaces around '|'
- d and s are unsorted

d and s are unsorted consistently in about 8 instances in the patch.

The correct order for sorting -f and [-d | -s] in the synopsis and
usage message is unclear.  It would be best to put -f after -d and keep
-s attached to -d, but with longer options list this takes too much
space by splitting up the single-letter options.

Bruce___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r308457 - in head: sbin/pfctl sys/amd64/vmm/io sys/arm/include sys/arm/ti/omap4 sys/arm64/arm64 sys/cam sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/dev/dtrace/aarch64 sys/cd...

2016-11-08 Thread Bryan Drewery
Author: bdrewery
Date: Tue Nov  8 23:59:41 2016
New Revision: 308457
URL: https://svnweb.freebsd.org/changeset/base/308457

Log:
  Fix improper use of "its".
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sbin/pfctl/pfctl_optimize.c
  head/sys/amd64/vmm/io/vlapic.c
  head/sys/arm/include/profile.h
  head/sys/arm/ti/omap4/omap4_prcm_clks.c
  head/sys/arm64/arm64/identcpu.c
  head/sys/cam/cam.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/arm/dtrace_subr.c
  head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
  head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c
  head/sys/dev/aic7xxx/aic7xxx.seq
  head/sys/dev/ath/if_ath_tdma.c
  head/sys/dev/isci/scil/sati_design.h
  head/sys/dev/isci/scil/sci_base_controller.h
  head/sys/dev/sfxge/common/efx_mcdi.c
  head/sys/dev/sound/pci/hda/hdaa.c
  head/sys/dev/sound/pci/hda/hdac.c
  head/sys/fs/nullfs/null_vnops.c
  head/sys/geom/raid/md_ddf.c
  head/sys/geom/raid/md_intel.c
  head/sys/geom/raid/md_jmicron.c
  head/sys/geom/raid/md_nvidia.c
  head/sys/geom/raid/md_promise.c
  head/sys/geom/raid/md_sii.c
  head/sys/i386/include/cserial.h
  head/sys/kern/init_main.c
  head/sys/kern/kern_ctf.c
  head/sys/kern/subr_firmware.c
  head/sys/kern/uipc_mbuf.c
  head/sys/net80211/ieee80211_node.h
  head/sys/netgraph/ng_base.c
  head/sys/powerpc/powerpc/mmu_if.m
  head/sys/security/mac/mac_inet.c
  head/sys/vm/vm_pageout.c
  head/sys/x86/xen/xen_intr.c
  head/usr.bin/du/du.c
  head/usr.bin/xlint/lint2/read.c
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt
  head/usr.sbin/newsyslog/newsyslog.c

Modified: head/sbin/pfctl/pfctl_optimize.c
==
--- head/sbin/pfctl/pfctl_optimize.cTue Nov  8 22:41:11 2016
(r308456)
+++ head/sbin/pfctl/pfctl_optimize.cTue Nov  8 23:59:41 2016
(r308457)
@@ -84,7 +84,7 @@ TAILQ_HEAD(superblocks, superblock);
  * Description of the PF rule structure.
  */
 enum {
-BARRIER,   /* the presence of the field puts the rule in it's own block */
+BARRIER,   /* the presence of the field puts the rule in its own block */
 BREAK, /* the field may not differ between rules in a superblock */
 NOMERGE,   /* the field may not differ between rules when combined */
 COMBINED,  /* the field may itself be combined with other rules */
@@ -104,7 +104,7 @@ static struct pf_rule_field {
 
 
 /*
- * The presence of these fields in a rule put the rule in it's own
+ * The presence of these fields in a rule put the rule in its own
  * superblock.  Thus it will not be optimized.  It also prevents the
  * rule from being re-ordered at all.
  */

Modified: head/sys/amd64/vmm/io/vlapic.c
==
--- head/sys/amd64/vmm/io/vlapic.c  Tue Nov  8 22:41:11 2016
(r308456)
+++ head/sys/amd64/vmm/io/vlapic.c  Tue Nov  8 23:59:41 2016
(r308457)
@@ -859,7 +859,7 @@ vlapic_calcdest(struct vm *vm, cpuset_t 
 
/*
 * Logical mode: match each APIC that has a bit set
-* in it's LDR that matches a bit in the ldest.
+* in its LDR that matches a bit in the ldest.
 */
CPU_ZERO(dmask);
amask = vm_active_cpus(vm);

Modified: head/sys/arm/include/profile.h
==
--- head/sys/arm/include/profile.h  Tue Nov  8 22:41:11 2016
(r308456)
+++ head/sys/arm/include/profile.h  Tue Nov  8 23:59:41 2016
(r308457)
@@ -89,7 +89,7 @@ typedef u_longfptrdiff_t;
__asm__("ldmfd  sp!, {r0-r3, lr}"); \
/*  \
 * Return to the caller. Loading lr and pc in one instruction   \
-* is deprecated on ARMv7 so we need this on it's own.  \
+* is deprecated on ARMv7 so we need this on its own.   \
 */ \
__asm__("ldmfd  sp!, {pc}");
 void bintr(void);

Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c
==
--- head/sys/arm/ti/omap4/omap4_prcm_clks.c Tue Nov  8 22:41:11 2016
(r308456)
+++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Tue Nov  8 23:59:41 2016
(r308457)
@@ -1033,7 +1033,7 @@ omap4_clk_get_arm_fclk_freq(struct ti_cl
  * The USB clocking setup seems to be a bit more tricky than the other 
modules,
  * to start with the clocking diagram for the HS host module shows 13 
different
  * clocks.  So to try and make it easier to follow the clocking activation
- * 

svn commit: r308456 - in head/libexec/rtld-elf: . sparc64

2016-11-08 Thread John Baldwin
Author: jhb
Date: Tue Nov  8 22:41:11 2016
New Revision: 308456
URL: https://svnweb.freebsd.org/changeset/base/308456

Log:
  Pass the correct flag to find_symdef() from _rtld_bind().
  
  When symbol versioning was added to rtld, the boolean 'in_plt' argument
  to find_symdef() was converted to a bitmask of flags.  The first flag
  added was 'SYMLOOK_IN_PLT' which replaced the 'in_plt' bool.  This
  happened to still work by accident as SYMLOOK_IN_PLT had the value of 1
  which is the same as 'true', so there should be no functional change.
  
  Tested on:amd64
  Reviewed by:  kan
  MFC after:2 weeks
  Sponsored by: DARPA / AFRL

Modified:
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/sparc64/reloc.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cTue Nov  8 21:57:49 2016
(r308455)
+++ head/libexec/rtld-elf/rtld.cTue Nov  8 22:41:11 2016
(r308456)
@@ -713,8 +713,8 @@ _rtld_bind(Obj_Entry *obj, Elf_Size relo
rel = (const Elf_Rel *) ((caddr_t) obj->pltrela + reloff);
 
 where = (Elf_Addr *) (obj->relocbase + rel->r_offset);
-def = find_symdef(ELF_R_SYM(rel->r_info), obj, , true, NULL,
-   );
+def = find_symdef(ELF_R_SYM(rel->r_info), obj, , SYMLOOK_IN_PLT,
+   NULL, );
 if (def == NULL)
rtld_die();
 if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC)

Modified: head/libexec/rtld-elf/sparc64/reloc.c
==
--- head/libexec/rtld-elf/sparc64/reloc.c   Tue Nov  8 21:57:49 2016
(r308455)
+++ head/libexec/rtld-elf/sparc64/reloc.c   Tue Nov  8 22:41:11 2016
(r308456)
@@ -503,7 +503,7 @@ reloc_plt(Obj_Entry *obj)
assert(ELF64_R_TYPE_ID(rela->r_info) == R_SPARC_JMP_SLOT);
where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
def = find_symdef(ELF_R_SYM(rela->r_info), obj, ,
-   true, NULL, lockstate);
+   SYMLOOK_IN_PLT, NULL, lockstate);
value = (Elf_Addr)(defobj->relocbase + def->st_value);
*where = value;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308455 - stable/9/usr.sbin/mountd

2016-11-08 Thread Rick Macklem
Author: rmacklem
Date: Tue Nov  8 21:57:49 2016
New Revision: 308455
URL: https://svnweb.freebsd.org/changeset/base/308455

Log:
  MFC: r307891
  Fix the man page to reflect the change done by r307890 to mountd.c
  so that the "-n" option uses the sysctl for the correct NFS server.
  This is a content change.

Modified:
  stable/9/usr.sbin/mountd/mountd.8
Directory Properties:
  stable/9/usr.sbin/mountd/   (props changed)

Modified: stable/9/usr.sbin/mountd/mountd.8
==
--- stable/9/usr.sbin/mountd/mountd.8   Tue Nov  8 21:52:55 2016
(r308454)
+++ stable/9/usr.sbin/mountd/mountd.8   Tue Nov  8 21:57:49 2016
(r308455)
@@ -28,7 +28,7 @@
 .\" @(#)mountd.8   8.4 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd October 14, 2012
+.Dd October 24, 2016
 .Dt MOUNTD 8
 .Os
 .Sh NAME
@@ -96,7 +96,7 @@ requests to be logged.
 Allow non-root mount requests to be served.
 This should only be specified if there are clients such as PC's,
 that require it.
-It will automatically clear the vfs.nfsrv.nfs_privport sysctl flag, which
+It will automatically clear the vfs.[nfsrv|nfsd].nfs_privport sysctl flag, 
which
 controls if the kernel will accept NFS requests from reserved ports only.
 .It Fl o
 This flag forces the system to run the old NFS server, which does not
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308454 - stable/9/usr.sbin/mountd

2016-11-08 Thread Rick Macklem
Author: rmacklem
Date: Tue Nov  8 21:52:55 2016
New Revision: 308454
URL: https://svnweb.freebsd.org/changeset/base/308454

Log:
  MFC: r307890
  mountd(8) was erroneously setting the sysctl for the old NFS server
  when the new/default NFS server was running, for the "-n" option.
  
  This patch fixes the problem for stable/10 and stable/9.
  Since the new NFS server uses vfs.nfsd.nfs_privport == 0 by default,
  there wouldn't have been many users affected by the code not setting
  it to 0 when the "-n" option was specified.

Modified:
  stable/9/usr.sbin/mountd/mountd.c
Directory Properties:
  stable/9/usr.sbin/mountd/   (props changed)

Modified: stable/9/usr.sbin/mountd/mountd.c
==
--- stable/9/usr.sbin/mountd/mountd.c   Tue Nov  8 21:47:00 2016
(r308453)
+++ stable/9/usr.sbin/mountd/mountd.c   Tue Nov  8 21:52:55 2016
(r308454)
@@ -421,11 +421,20 @@ main(int argc, char **argv)
rpc_control(RPC_SVC_CONNMAXREC_SET, );
 
if (!resvport_only) {
-   if (sysctlbyname("vfs.nfsrv.nfs_privport", NULL, NULL,
-   _only, sizeof(resvport_only)) != 0 &&
-   errno != ENOENT) {
-   syslog(LOG_ERR, "sysctl: %m");
-   exit(1);
+   if (run_v4server != 0) {
+   if (sysctlbyname("vfs.nfsd.nfs_privport", NULL, NULL,
+   _only, sizeof(resvport_only)) != 0 &&
+   errno != ENOENT) {
+   syslog(LOG_ERR, "sysctl: %m");
+   exit(1);
+   }
+   } else {
+   if (sysctlbyname("vfs.nfsrv.nfs_privport", NULL, NULL,
+   _only, sizeof(resvport_only)) != 0 &&
+   errno != ENOENT) {
+   syslog(LOG_ERR, "sysctl: %m");
+   exit(1);
+   }
}
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308453 - stable/10/usr.sbin/mountd

2016-11-08 Thread Rick Macklem
Author: rmacklem
Date: Tue Nov  8 21:47:00 2016
New Revision: 308453
URL: https://svnweb.freebsd.org/changeset/base/308453

Log:
  MFC: r307891
  Fix the man page to reflect the change done by r307890 to mountd.c
  so that the "-n" option uses the sysctl for the correct NFS server.
  This is a content change.

Modified:
  stable/10/usr.sbin/mountd/mountd.8
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/mountd/mountd.8
==
--- stable/10/usr.sbin/mountd/mountd.8  Tue Nov  8 21:39:15 2016
(r308452)
+++ stable/10/usr.sbin/mountd/mountd.8  Tue Nov  8 21:47:00 2016
(r308453)
@@ -28,7 +28,7 @@
 .\" @(#)mountd.8   8.4 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd October 14, 2012
+.Dd October 24, 2016
 .Dt MOUNTD 8
 .Os
 .Sh NAME
@@ -96,7 +96,7 @@ requests to be logged.
 Allow non-root mount requests to be served.
 This should only be specified if there are clients such as PC's,
 that require it.
-It will automatically clear the vfs.nfsrv.nfs_privport sysctl flag, which
+It will automatically clear the vfs.[nfsrv|nfsd].nfs_privport sysctl flag, 
which
 controls if the kernel will accept NFS requests from reserved ports only.
 .It Fl o
 This flag forces the system to run the old NFS server, which does not
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308452 - stable/10/usr.sbin/mountd

2016-11-08 Thread Rick Macklem
Author: rmacklem
Date: Tue Nov  8 21:39:15 2016
New Revision: 308452
URL: https://svnweb.freebsd.org/changeset/base/308452

Log:
  MFC: r307890
  mountd(8) was erroneously setting the sysctl for the old NFS server
  when the new/default NFS server was running, for the "-n" option.
  
  This patch fixes the problem for stable/10 and stable/9.
  Since the new NFS server uses vfs.nfsd.nfs_privport == 0 by default,
  there wouldn't have been many users affected by the code not setting
  it to 0 when the "-n" option was specified.

Modified:
  stable/10/usr.sbin/mountd/mountd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/mountd/mountd.c
==
--- stable/10/usr.sbin/mountd/mountd.c  Tue Nov  8 21:17:24 2016
(r308451)
+++ stable/10/usr.sbin/mountd/mountd.c  Tue Nov  8 21:39:15 2016
(r308452)
@@ -489,11 +489,20 @@ main(int argc, char **argv)
rpc_control(RPC_SVC_CONNMAXREC_SET, );
 
if (!resvport_only) {
-   if (sysctlbyname("vfs.nfsrv.nfs_privport", NULL, NULL,
-   _only, sizeof(resvport_only)) != 0 &&
-   errno != ENOENT) {
-   syslog(LOG_ERR, "sysctl: %m");
-   exit(1);
+   if (run_v4server != 0) {
+   if (sysctlbyname("vfs.nfsd.nfs_privport", NULL, NULL,
+   _only, sizeof(resvport_only)) != 0 &&
+   errno != ENOENT) {
+   syslog(LOG_ERR, "sysctl: %m");
+   exit(1);
+   }
+   } else {
+   if (sysctlbyname("vfs.nfsrv.nfs_privport", NULL, NULL,
+   _only, sizeof(resvport_only)) != 0 &&
+   errno != ENOENT) {
+   syslog(LOG_ERR, "sysctl: %m");
+   exit(1);
+   }
}
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308451 - in head/sys/cam: . scsi

2016-11-08 Thread Conrad E. Meyer
Author: cem
Date: Tue Nov  8 21:17:24 2016
New Revision: 308451
URL: https://svnweb.freebsd.org/changeset/base/308451

Log:
  cam: Zero bio pointer in user-supplied SCSI CCBs
  
  The BUF_TRACKING bio pointer only makes sense for kernel consumers of
  CCBs.
  
  PR:   214250
  Reported by:  trasz@
  Reviewed by:  imp@, markj@
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8477

Modified:
  head/sys/cam/cam_xpt.c
  head/sys/cam/scsi/scsi_pass.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Tue Nov  8 21:15:50 2016(r308450)
+++ head/sys/cam/cam_xpt.c  Tue Nov  8 21:17:24 2016(r308451)
@@ -414,6 +414,10 @@ xptdoioctl(struct cdev *dev, u_long cmd,
struct cam_eb *bus;
 
inccb = (union ccb *)addr;
+#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING)
+   if (inccb->ccb_h.func_code == XPT_SCSI_IO)
+   inccb->csio.bio = NULL;
+#endif
 
bus = xpt_find_bus(inccb->ccb_h.path_id);
if (bus == NULL)
@@ -593,6 +597,10 @@ xptdoioctl(struct cdev *dev, u_long cmd,
unit = ccb->cgdl.unit_number;
name = ccb->cgdl.periph_name;
base_periph_found = 0;
+#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING)
+   if (ccb->ccb_h.func_code == XPT_SCSI_IO)
+   ccb->csio.bio = NULL;
+#endif
 
/*
 * Sanity check -- make sure we don't get a null peripheral

Modified: head/sys/cam/scsi/scsi_pass.c
==
--- head/sys/cam/scsi/scsi_pass.c   Tue Nov  8 21:15:50 2016
(r308450)
+++ head/sys/cam/scsi/scsi_pass.c   Tue Nov  8 21:17:24 2016
(r308451)
@@ -1777,6 +1777,10 @@ passdoioctl(struct cdev *dev, u_long cmd
int ccb_malloced;
 
inccb = (union ccb *)addr;
+#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING)
+   if (inccb->ccb_h.func_code == XPT_SCSI_IO)
+   inccb->csio.bio = NULL;
+#endif
 
/*
 * Some CCB types, like scan bus and scan lun can only go
@@ -1875,6 +1879,10 @@ passdoioctl(struct cdev *dev, u_long cmd
cam_periph_lock(periph);
break;
}
+#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING)
+   if (ccb->ccb_h.func_code == XPT_SCSI_IO)
+   ccb->csio.bio = NULL;
+#endif
 
if (ccb->ccb_h.flags & CAM_CDB_POINTER) {
if (ccb->csio.cdb_len > IOCDBLEN) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308450 - stable/11/usr.sbin/mountd

2016-11-08 Thread Rick Macklem
Author: rmacklem
Date: Tue Nov  8 21:15:50 2016
New Revision: 308450
URL: https://svnweb.freebsd.org/changeset/base/308450

Log:
  MFC: r307891
  Fix the man page to reflect the change done by r307890 to mountd.c
  so that the "-n" option uses the sysctl for the new NFS server.
  This is a content change.

Modified:
  stable/11/usr.sbin/mountd/mountd.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/mountd/mountd.8
==
--- stable/11/usr.sbin/mountd/mountd.8  Tue Nov  8 21:09:48 2016
(r308449)
+++ stable/11/usr.sbin/mountd/mountd.8  Tue Nov  8 21:15:50 2016
(r308450)
@@ -28,7 +28,7 @@
 .\" @(#)mountd.8   8.4 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd October 14, 2012
+.Dd October 24, 2016
 .Dt MOUNTD 8
 .Os
 .Sh NAME
@@ -95,7 +95,7 @@ requests to be logged.
 Allow non-root mount requests to be served.
 This should only be specified if there are clients such as PC's,
 that require it.
-It will automatically clear the vfs.nfsrv.nfs_privport sysctl flag, which
+It will automatically clear the vfs.nfsd.nfs_privport sysctl flag, which
 controls if the kernel will accept NFS requests from reserved ports only.
 .It Fl p Ar port
 Force
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308449 - stable/11/usr.sbin/mountd

2016-11-08 Thread Rick Macklem
Author: rmacklem
Date: Tue Nov  8 21:09:48 2016
New Revision: 308449
URL: https://svnweb.freebsd.org/changeset/base/308449

Log:
  MFC: r307890
  mountd(8) was erroneously setting the sysctl for the old NFS server
  when the new/default NFS server was running, for the "-n" option.
  
  This patch fixes the problem for head and stable/11. For stable/10 the
  patch will need to be modified when MFC'd, since the stable/10 mountd.c
  handles both old and new NFS servers.
  Since the new NFS server uses vfs.nfsd.nfs_privport == 0 by default,
  there wouldn't have been many users affected by the code not setting
  it to 0 when the "-n" option was specified.

Modified:
  stable/11/usr.sbin/mountd/mountd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/mountd/mountd.c
==
--- stable/11/usr.sbin/mountd/mountd.c  Tue Nov  8 20:58:25 2016
(r308448)
+++ stable/11/usr.sbin/mountd/mountd.c  Tue Nov  8 21:09:48 2016
(r308449)
@@ -476,7 +476,7 @@ main(int argc, char **argv)
rpc_control(RPC_SVC_CONNMAXREC_SET, );
 
if (!resvport_only) {
-   if (sysctlbyname("vfs.nfsrv.nfs_privport", NULL, NULL,
+   if (sysctlbyname("vfs.nfsd.nfs_privport", NULL, NULL,
_only, sizeof(resvport_only)) != 0 &&
errno != ENOENT) {
syslog(LOG_ERR, "sysctl: %m");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308448 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-11-08 Thread Alexander Motin
Author: mav
Date: Tue Nov  8 20:58:25 2016
New Revision: 308448
URL: https://svnweb.freebsd.org/changeset/base/308448

Log:
  MFC r307857: Fix panic after ZVOL renamed to name invalid for DEVFS.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Nov 
 8 20:57:46 2016(r308447)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Nov 
 8 20:58:25 2016(r308448)
@@ -780,8 +780,10 @@ zvol_remove_zv(zvol_state_t *zv)
g_topology_lock();
zvol_geom_destroy(zv);
g_topology_unlock();
-   } else if (zv->zv_volmode == ZFS_VOLMODE_DEV)
-   destroy_dev(zv->zv_dev);
+   } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) {
+   if (zv->zv_dev != NULL)
+   destroy_dev(zv->zv_dev);
+   }
 #endif
 
avl_destroy(>zv_znode.z_range_avl);
@@ -2952,14 +2954,14 @@ zvol_rename_minor(zvol_state_t *zv, cons
} else if (zv->zv_volmode == ZFS_VOLMODE_DEV) {
struct make_dev_args args;
 
-   dev = zv->zv_dev;
-   ASSERT(dev != NULL);
-   zv->zv_dev = NULL;
-   destroy_dev(dev);
-   if (zv->zv_total_opens > 0) {
-   zv->zv_flags &= ~ZVOL_EXCL;
-   zv->zv_total_opens = 0;
-   zvol_last_close(zv);
+   if ((dev = zv->zv_dev) != NULL) {
+   zv->zv_dev = NULL;
+   destroy_dev(dev);
+   if (zv->zv_total_opens > 0) {
+   zv->zv_flags &= ~ZVOL_EXCL;
+   zv->zv_total_opens = 0;
+   zvol_last_close(zv);
+   }
}
 
make_dev_args_init();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308447 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-11-08 Thread Alexander Motin
Author: mav
Date: Tue Nov  8 20:57:46 2016
New Revision: 308447
URL: https://svnweb.freebsd.org/changeset/base/308447

Log:
  MFC r307857: Fix panic after ZVOL renamed to name invalid for DEVFS.

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Nov 
 8 20:12:13 2016(r308446)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Nov 
 8 20:57:46 2016(r308447)
@@ -782,8 +782,10 @@ zvol_remove_zv(zvol_state_t *zv)
g_topology_lock();
zvol_geom_destroy(zv);
g_topology_unlock();
-   } else if (zv->zv_volmode == ZFS_VOLMODE_DEV)
-   destroy_dev(zv->zv_dev);
+   } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) {
+   if (zv->zv_dev != NULL)
+   destroy_dev(zv->zv_dev);
+   }
 #endif
 
avl_destroy(>zv_znode.z_range_avl);
@@ -2973,14 +2975,14 @@ zvol_rename_minor(zvol_state_t *zv, cons
} else if (zv->zv_volmode == ZFS_VOLMODE_DEV) {
struct make_dev_args args;
 
-   dev = zv->zv_dev;
-   ASSERT(dev != NULL);
-   zv->zv_dev = NULL;
-   destroy_dev(dev);
-   if (zv->zv_total_opens > 0) {
-   zv->zv_flags &= ~ZVOL_EXCL;
-   zv->zv_total_opens = 0;
-   zvol_last_close(zv);
+   if ((dev = zv->zv_dev) != NULL) {
+   zv->zv_dev = NULL;
+   destroy_dev(dev);
+   if (zv->zv_total_opens > 0) {
+   zv->zv_flags &= ~ZVOL_EXCL;
+   zv->zv_total_opens = 0;
+   zvol_last_close(zv);
+   }
}
 
make_dev_args_init();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308446 - stable/11/libexec/ftpd

2016-11-08 Thread Kurt Lidl
Author: lidl
Date: Tue Nov  8 20:12:13 2016
New Revision: 308446
URL: https://svnweb.freebsd.org/changeset/base/308446

Log:
  MFC r308175: Revisit blacklistd support in ftpd
  
  Enhance blacklistd support to not log anything by default,
  unless blacklistd support is enabled on the command line.
  Document new flag in man page, cleanup patches to be less
  intrusive in code.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/libexec/ftpd/blacklist.c
  stable/11/libexec/ftpd/blacklist_client.h
  stable/11/libexec/ftpd/ftpd.8
  stable/11/libexec/ftpd/ftpd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/ftpd/blacklist.c
==
--- stable/11/libexec/ftpd/blacklist.c  Tue Nov  8 17:36:19 2016
(r308445)
+++ stable/11/libexec/ftpd/blacklist.c  Tue Nov  8 20:12:13 2016
(r308446)
@@ -37,16 +37,20 @@
 #include 
 
 static struct blacklist *blstate;
+extern int use_blacklist;
 
 void
 blacklist_init(void)
 {
-   blstate = blacklist_open();
+
+   if (use_blacklist)
+   blstate = blacklist_open();
 }
 
 void
 blacklist_notify(int action, int fd, char *msg)
 {
+
if (blstate == NULL)
return;
(void)blacklist_r(blstate, action, fd, msg);

Modified: stable/11/libexec/ftpd/blacklist_client.h
==
--- stable/11/libexec/ftpd/blacklist_client.h   Tue Nov  8 17:36:19 2016
(r308445)
+++ stable/11/libexec/ftpd/blacklist_client.h   Tue Nov  8 20:12:13 2016
(r308446)
@@ -28,5 +28,26 @@
 
 /* $FreeBSD$ */
 
-void blacklist_notify(int, int, char *);
+#ifndef BLACKLIST_CLIENT_H
+#define BLACKLIST_CLIENT_H
+
+enum {
+   BLACKLIST_AUTH_OK = 0,
+   BLACKLIST_AUTH_FAIL
+};
+
+#ifdef USE_BLACKLIST
 void blacklist_init(void);
+void blacklist_notify(int, int, char *);
+
+#define BLACKLIST_INIT() blacklist_init()
+#define BLACKLIST_NOTIFY(x, y, z) blacklist_notify(x, y, z)
+
+#else
+
+#define BLACKLIST_INIT()
+#define BLACKLIST_NOTIFY(x, y, z)
+
+#endif
+
+#endif /* BLACKLIST_CLIENT_H */

Modified: stable/11/libexec/ftpd/ftpd.8
==
--- stable/11/libexec/ftpd/ftpd.8   Tue Nov  8 17:36:19 2016
(r308445)
+++ stable/11/libexec/ftpd/ftpd.8   Tue Nov  8 20:12:13 2016
(r308446)
@@ -36,7 +36,7 @@
 .Nd Internet File Transfer Protocol server
 .Sh SYNOPSIS
 .Nm
-.Op Fl 468ADdEhMmOoRrSUvW
+.Op Fl 468ABDdEhMmOoRrSUvW
 .Op Fl l Op Fl l
 .Op Fl a Ar address
 .Op Fl P Ar port
@@ -95,6 +95,14 @@ When
 .Fl D
 is specified, accept connections only on the specified
 .Ar address .
+.It Fl B
+With this option set,
+.Nm
+sends authentication success and failure messages to the
+.Xr blacklistd 8
+daemon.  If this option is not specified, no communcation with the
+.Xr blacklistd 8
+daemon is attempted.
 .It Fl D
 With this option set,
 .Nm

Modified: stable/11/libexec/ftpd/ftpd.c
==
--- stable/11/libexec/ftpd/ftpd.c   Tue Nov  8 17:36:19 2016
(r308445)
+++ stable/11/libexec/ftpd/ftpd.c   Tue Nov  8 20:12:13 2016
(r308446)
@@ -144,6 +144,7 @@ int noretr = 0; /* RETR command is disa
 intnoguestretr = 0;/* RETR command is disabled for anon users. */
 intnoguestmkd = 0; /* MKD command is disabled for anon users. */
 intnoguestmod = 1; /* anon users may not modify existing files. */
+intuse_blacklist = 0;
 
 off_t  file_size;
 off_t  byte_count;
@@ -305,7 +306,7 @@ main(int argc, char *argv[], char **envp
openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
 
while ((ch = getopt(argc, argv,
-   "468a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) {
+   "468a:ABdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) {
switch (ch) {
case '4':
family = (family == AF_INET6) ? AF_UNSPEC : AF_INET;
@@ -327,6 +328,14 @@ main(int argc, char *argv[], char **envp
anon_only = 1;
break;
 
+   case 'B':
+#ifdef USE_BLACKLIST
+   use_blacklist = 1;
+#else
+   syslog(LOG_WARNING, "not compiled with USE_BLACKLIST 
support");
+#endif
+   break;
+
case 'd':
ftpdebug++;
break;
@@ -644,9 +653,7 @@ gotchild:
reply(220, "%s FTP server (%s) ready.", hostname, version);
else
reply(220, "FTP server ready.");
-#ifdef USE_BLACKLIST
-   blacklist_init();
-#endif
+   BLACKLIST_INIT();
for (;;)
(void) yyparse();
/* NOTREACHED */
@@ -1422,9 +1429,7 @@ skip:
 */
if (rval) {

Re: svn commit: r308443 - head/bin/hostname

2016-11-08 Thread Renato Botelho
> On 8 Nov 2016, at 09:36, Marcelo Araujo  wrote:
> 
> Author: araujo
> Date: Tue Nov  8 11:36:33 2016
> New Revision: 308443
> URL: https://svnweb.freebsd.org/changeset/base/308443
> 
> Log:
>  Add -d flag that prints domain only.
> 
>  PR:  212875
>  Submitted by:Ben RUBSON 
>  Reviewed by: pi
> 
> Modified:
>  head/bin/hostname/hostname.1
>  head/bin/hostname/hostname.c
> 
> Modified: head/bin/hostname/hostname.1
> ==
> --- head/bin/hostname/hostname.1  Tue Nov  8 10:10:55 2016
> (r308442)
> +++ head/bin/hostname/hostname.1  Tue Nov  8 11:36:33 2016
> (r308443)
> @@ -29,7 +29,7 @@
> .\"   @(#)hostname.1  8.2 (Berkeley) 4/28/95
> .\" $FreeBSD$
> .\"
> -.Dd December 7, 2006
> +.Dd November 9, 2016
> .Dt HOSTNAME 1
> .Os
> .Sh NAME
> @@ -37,7 +37,8 @@
> .Nd set or print name of current host system
> .Sh SYNOPSIS
> .Nm
> -.Op Fl fs
> +.Op Fl f
> +.Op Fl s|d
> .Op Ar name-of-host
> .Sh DESCRIPTION
> The
> @@ -62,6 +63,8 @@ This is the default behavior.
> .It Fl s
> Trim off any domain information from the printed
> name.
> +.It Fl d
> +Only print domain information.
> .El
> .Sh SEE ALSO
> .Xr gethostname 3 ,
> 
> Modified: head/bin/hostname/hostname.c
> ==
> --- head/bin/hostname/hostname.c  Tue Nov  8 10:10:55 2016
> (r308442)
> +++ head/bin/hostname/hostname.c  Tue Nov  8 11:36:33 2016
> (r308443)
> @@ -54,11 +54,12 @@ static void usage(void) __dead2;
> int
> main(int argc, char *argv[])
> {
> - int ch, sflag;
> + int ch, sflag, dflag;
>   char *p, hostname[MAXHOSTNAMELEN];
> 
>   sflag = 0;
> - while ((ch = getopt(argc, argv, "fs")) != -1)
> + dflag = 0;
> + while ((ch = getopt(argc, argv, "fsd")) != -1)
>   switch (ch) {
>   case 'f':
>   /*
> @@ -70,6 +71,9 @@ main(int argc, char *argv[])
>   case 's':
>   sflag = 1;
>   break;
> + case 'd':
> + dflag = 1;
> + break;
>   case '?':
>   default:
>   usage();
> @@ -77,7 +81,7 @@ main(int argc, char *argv[])
>   argc -= optind;
>   argv += optind;
> 
> - if (argc > 1)
> + if (argc > 1 || (sflag && dflag))
>   usage();
> 
>   if (*argv) {
> @@ -90,6 +94,10 @@ main(int argc, char *argv[])
>   p = strchr(hostname, '.');
>   if (p != NULL)
>   *p = '\0';
> + } else if (dflag) {
> + p = strchr(hostname, '.');
> + if (p != NULL)
> + strcpy(hostname, ++p);
>   }
>   (void)printf("%s\n", hostname);
>   }
> @@ -100,6 +108,6 @@ static void
> usage(void)
> {
> 
> - (void)fprintf(stderr, "usage: hostname [-fs] [name-of-host]\n");
> + (void)fprintf(stderr, "usage: hostname [-f] [s|d] [name-of-host]\n");


It’s missing ‘-‘ sign on [s|d] block, what makes message a bit confused IMO. 
Maybe [-s|-d] would be more clear.

--
Renato Botelho

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

svn commit: r308445 - head/lib/libgcc_s

2016-11-08 Thread Ed Maste
Author: emaste
Date: Tue Nov  8 17:36:19 2016
New Revision: 308445
URL: https://svnweb.freebsd.org/changeset/base/308445

Log:
  add missing i386 symbols libgcc_s symbol version map
  
  After r308294 they were missing on i386 (and previously were exported
  only accidentally).
  
  Reported by:  antoine

Modified:
  head/lib/libgcc_s/Version.map

Modified: head/lib/libgcc_s/Version.map
==
--- head/lib/libgcc_s/Version.map   Tue Nov  8 12:15:57 2016
(r308444)
+++ head/lib/libgcc_s/Version.map   Tue Nov  8 17:36:19 2016
(r308445)
@@ -8,9 +8,12 @@ global:
__absvsi2;
__addvdi3;
__addvsi3;
+   __ashldi3;
__ashlti3;
+   __ashrdi3;
__ashrti3;
__clear_cache;
+   __cmpdi2;
__cmpti2;
__deregister_frame;
__deregister_frame_info;
@@ -19,23 +22,36 @@ global:
__divti3;
__ffsdi2;
__ffsti2;
+   __fixdfdi;
__fixdfti;
+   __fixsfdi;
__fixsfti;
__fixunsdfdi;
+   __fixunsdfsi;
__fixunsdfti;
__fixunssfdi;
+   __fixunssfsi;
__fixunssfti;
__fixunsxfdi;
+   __fixunsxfsi;
__fixunsxfti;
+   __fixxfdi;
__fixxfti;
+   __floatdidf;
+   __floatdisf;
+   __floatdixf;
__floattidf;
__floattisf;
__floattixf;
+   __lshrdi3;
__lshrti3;
+   __moddi3;
__modti3;
+   __muldi3;
__mulvdi3;
__mulvsi3;
__multi3;
+   __negdi2;
__negti2;
__negvdi2;
__negvsi2;
@@ -47,10 +63,13 @@ global:
__register_frame_table;
__subvdi3;
__subvsi3;
+   __ucmpdi2;
__ucmpti2;
__udivdi3;
+   __udivmoddi4;
__udivmodti4;
__udivti3;
+   __umoddi3;
__umodti3;
_Unwind_DeleteException;
_Unwind_Find_FDE;
@@ -82,12 +101,16 @@ GCC_3.3.1 {
 
 GCC_3.4 {
__clzdi2;
+   __clzsi2;
__clzti2;
__ctzdi2;
+   __ctzsi2;
__ctzti2;
__paritydi2;
+   __paritysi2;
__parityti2;
__popcountdi2;
+   __popcountsi2;
__popcountti2;
 } GCC_3.3.1;
 
@@ -116,6 +139,9 @@ GCC_4.0.0 {
 } GCC_3.4.4;
 
 GCC_4.2.0 {
+   __floatundidf;
+   __floatundisf;
+   __floatundixf;
__floatuntidf;
__floatuntisf;
__floatuntixf;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r308160 - in head: etc etc/mtree usr.sbin/syslogd

2016-11-08 Thread Conrad Meyer
On Mon, Oct 31, 2016 at 6:41 PM, Baptiste Daroussin  wrote:
> Author: bapt
> Date: Tue Nov  1 01:41:24 2016
> New Revision: 308160
> URL: https://svnweb.freebsd.org/changeset/base/308160
>
> Log:
>   syslogd(8): add an 'include' keyword
>
>   All the '.conf' files not beginning with a '.' contained int he directory
>   following the keyword will be included.
>
>   This keyword can only be used in the first level configuration files.
>
>   Modify the default syslogd.conf to 'include' /etc/syslog.d and
>   /usr/local/etc/syslog.d
>
>   It simplify a lot handling of syslog from automation tools.

This breaks some paths in init(), as pointed out by Coverity (CID
1365665).  See inline below.

>...
> Modified: head/usr.sbin/syslogd/syslogd.c
> ==
> --- head/usr.sbin/syslogd/syslogd.c Tue Nov  1 01:19:48 2016
> (r308159)
> +++ head/usr.sbin/syslogd/syslogd.c Tue Nov  1 01:41:24 2016
> (r308160)
> ...
> @@ -1601,6 +1604,157 @@ die(int signo)
> ...
>  /*
>   *  INIT -- Initialize syslogd from configuration table
>   */
> @@ -1611,9 +1765,6 @@ init(int signo)
> FILE *cf;
> struct filed *f, *next, **nextp;
> char *p;
> -   char cline[LINE_MAX];
> -   char prog[LINE_MAX];
> -   char host[MAXHOSTNAMELEN];
> char oldLocalHostName[MAXHOSTNAMELEN];
> char hostMsg[2*MAXHOSTNAMELEN+40];
> char bootfileMsg[LINE_MAX];
> @@ -1684,7 +1835,6 @@ init(int signo)
> free((char *)f);
> }
> Files = NULL;
> -   nextp = 

This line leaves nextp uninitialized in init().

>
> /* open the configuration file */
> if ((cf = fopen(ConfFile, "r")) == NULL) {

Nextp is used in init() between these two hunks:

1838
1839 /* open the configuration file */
1840 if ((cf = fopen(ConfFile, "r")) == NULL) {
1841 dprintf("cannot open %s\n", ConfFile);
1842 *nextp = (struct filed *)calloc(1, sizeof(*f));
    now bogus
1843 if (*nextp == NULL) {
1844 logerror("calloc");
1845 exit(1);
1846 }
1847 cfline("*.ERR\t/dev/console", *nextp, "*", "*");
1848 (*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f));
1849 if ((*nextp)->f_next == NULL) {
1850 logerror("calloc");
1851 exit(1);
1852 }
1853 cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*");
1854 Initialized = 1;
1855 return;
1856 }


> @@ -1705,83 +1855,7 @@ init(int signo)
> ...

Thanks,
Conrad
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308444 - in head/sys/arm: allwinner allwinner/a10 broadcom/bcm2835 qemu ti

2016-11-08 Thread Andrew Turner
Author: andrew
Date: Tue Nov  8 12:15:57 2016
New Revision: 308444
URL: https://svnweb.freebsd.org/changeset/base/308444

Log:
  Start to remove the old pre-INTRNG code from the arm platforms. These have
  all moved to use INTRNG.
  
  Reviewed by:  manu, mmel
  Sponsored by: ABT Systems Ltd
  Differential Revision:https://reviews.freebsd.org/D8469

Deleted:
  head/sys/arm/allwinner/a10_common.c
  head/sys/arm/broadcom/bcm2835/bcm2835_common.c
  head/sys/arm/broadcom/bcm2835/bcm2836.h
  head/sys/arm/qemu/virt_common.c
  head/sys/arm/ti/ti_common.c
Modified:
  head/sys/arm/allwinner/a10/a10_intc.c
  head/sys/arm/allwinner/files.allwinner
  head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
  head/sys/arm/broadcom/bcm2835/bcm2835_intr.c
  head/sys/arm/broadcom/bcm2835/bcm2836.c
  head/sys/arm/broadcom/bcm2835/bcm2836_mp.c
  head/sys/arm/broadcom/bcm2835/files.bcm283x
  head/sys/arm/qemu/files.qemu
  head/sys/arm/ti/aintc.c
  head/sys/arm/ti/files.ti
  head/sys/arm/ti/ti_gpio.c
  head/sys/arm/ti/ti_gpio.h

Modified: head/sys/arm/allwinner/a10/a10_intc.c
==
--- head/sys/arm/allwinner/a10/a10_intc.c   Tue Nov  8 11:36:33 2016
(r308443)
+++ head/sys/arm/allwinner/a10/a10_intc.c   Tue Nov  8 12:15:57 2016
(r308444)
@@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef INTRNG
 #include 
-#endif
 #include 
 #include 
 
@@ -54,9 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef INTRNG
 #include "pic_if.h"
-#endif
 
 /**
  * Interrupt controller registers
@@ -97,12 +93,10 @@ __FBSDID("$FreeBSD$");
 #defineSW_INT_ENABLE_REG(_b)   (0x40 + ((_b) * 4))
 #defineSW_INT_MASK_REG(_b) (0x50 + ((_b) * 4))
 
-#ifdef INTRNG
 struct a10_intr_irqsrc {
struct intr_irqsrc  isrc;
u_int   irq;
 };
-#endif
 
 struct a10_aintc_softc {
device_tsc_dev;
@@ -110,9 +104,7 @@ struct a10_aintc_softc {
bus_space_tag_t aintc_bst;
bus_space_handle_t  aintc_bsh;
struct mtx  mtx;
-#ifdef INTRNG
struct a10_intr_irqsrc  isrcs[A10_INTR_MAX_NIRQS];
-#endif
 };
 
 #defineaintc_read_4(sc, reg)   
\
@@ -189,31 +181,6 @@ a10_pending_irq(struct a10_aintc_softc *
return (-1);
 }
 
-#ifndef INTRNG
-
-static struct a10_aintc_softc *a10_aintc_sc = NULL;
-
-int
-arm_get_next_irq(int last_irq)
-{
-   return (a10_pending_irq(a10_aintc_sc));
-}
-
-void
-arm_mask_irq(uintptr_t irq)
-{
-   a10_intr_mask(a10_aintc_sc, irq);
-}
-
-void
-arm_unmask_irq(uintptr_t irq)
-{
-   a10_intr_unmask(a10_aintc_sc, irq);
-   a10_intr_eoi(a10_aintc_sc, irq);
-}
-
-#else /* INTRNG */
-
 static int
 a10_intr(void *arg)
 {
@@ -340,8 +307,6 @@ a10_intr_post_filter(device_t dev, struc
a10_intr_eoi(sc, irq);
 }
 
-#endif /* INTRNG */
-
 static int
 a10_aintc_probe(device_t dev)
 {
@@ -363,13 +328,6 @@ a10_aintc_attach(device_t dev)
int i;
sc->sc_dev = dev;
 
-#ifndef INTRNG
-   if (a10_aintc_sc)
-   goto error;
-
-   a10_aintc_sc = sc;
-#endif
-
sc->aintc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
, RF_ACTIVE);
if (!sc->aintc_res) {
@@ -393,12 +351,10 @@ a10_aintc_attach(device_t dev)
/* config the external interrupt source type*/
aintc_write_4(sc, SW_INT_NMI_CTRL_REG, 0x00);
 
-#ifdef INTRNG
if (a10_intr_pic_attach(sc) != 0) {
device_printf(dev, "could not attach PIC\n");
return (ENXIO);
}
-#endif
 
return (0);
 
@@ -411,7 +367,7 @@ error:
 static device_method_t a10_aintc_methods[] = {
DEVMETHOD(device_probe, a10_aintc_probe),
DEVMETHOD(device_attach,a10_aintc_attach),
-#ifdef INTRNG
+
/* Interrupt controller interface */
DEVMETHOD(pic_disable_intr, a10_intr_disable_intr),
DEVMETHOD(pic_enable_intr,  a10_intr_enable_intr),
@@ -419,7 +375,7 @@ static device_method_t a10_aintc_methods
DEVMETHOD(pic_post_filter,  a10_intr_post_filter),
DEVMETHOD(pic_post_ithread, a10_intr_post_ithread),
DEVMETHOD(pic_pre_ithread,  a10_intr_pre_ithread),
-#endif
+
{ 0, 0 }
 };
 

Modified: head/sys/arm/allwinner/files.allwinner
==
--- head/sys/arm/allwinner/files.allwinner  Tue Nov  8 11:36:33 2016
(r308443)
+++ head/sys/arm/allwinner/files.allwinner  Tue Nov  8 12:15:57 2016
(r308444)
@@ -3,7 +3,6 @@ kern/kern_clocksource.c standard
 
 arm/allwinner/a10_ahci.c   optionalahci
 arm/allwinner/a10_codec.c  optionalsound
-arm/allwinner/a10_common.c standard
 arm/allwinner/a10_dmac.c   standard
 arm/allwinner/a31_dmac.c 

svn commit: r308443 - head/bin/hostname

2016-11-08 Thread Marcelo Araujo
Author: araujo
Date: Tue Nov  8 11:36:33 2016
New Revision: 308443
URL: https://svnweb.freebsd.org/changeset/base/308443

Log:
  Add -d flag that prints domain only.
  
  PR:   212875
  Submitted by: Ben RUBSON 
  Reviewed by:  pi

Modified:
  head/bin/hostname/hostname.1
  head/bin/hostname/hostname.c

Modified: head/bin/hostname/hostname.1
==
--- head/bin/hostname/hostname.1Tue Nov  8 10:10:55 2016
(r308442)
+++ head/bin/hostname/hostname.1Tue Nov  8 11:36:33 2016
(r308443)
@@ -29,7 +29,7 @@
 .\"@(#)hostname.1  8.2 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd December 7, 2006
+.Dd November 9, 2016
 .Dt HOSTNAME 1
 .Os
 .Sh NAME
@@ -37,7 +37,8 @@
 .Nd set or print name of current host system
 .Sh SYNOPSIS
 .Nm
-.Op Fl fs
+.Op Fl f
+.Op Fl s|d
 .Op Ar name-of-host
 .Sh DESCRIPTION
 The
@@ -62,6 +63,8 @@ This is the default behavior.
 .It Fl s
 Trim off any domain information from the printed
 name.
+.It Fl d
+Only print domain information.
 .El
 .Sh SEE ALSO
 .Xr gethostname 3 ,

Modified: head/bin/hostname/hostname.c
==
--- head/bin/hostname/hostname.cTue Nov  8 10:10:55 2016
(r308442)
+++ head/bin/hostname/hostname.cTue Nov  8 11:36:33 2016
(r308443)
@@ -54,11 +54,12 @@ static void usage(void) __dead2;
 int
 main(int argc, char *argv[])
 {
-   int ch, sflag;
+   int ch, sflag, dflag;
char *p, hostname[MAXHOSTNAMELEN];
 
sflag = 0;
-   while ((ch = getopt(argc, argv, "fs")) != -1)
+   dflag = 0;
+   while ((ch = getopt(argc, argv, "fsd")) != -1)
switch (ch) {
case 'f':
/*
@@ -70,6 +71,9 @@ main(int argc, char *argv[])
case 's':
sflag = 1;
break;
+   case 'd':
+   dflag = 1;
+   break;
case '?':
default:
usage();
@@ -77,7 +81,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
 
-   if (argc > 1)
+   if (argc > 1 || (sflag && dflag))
usage();
 
if (*argv) {
@@ -90,6 +94,10 @@ main(int argc, char *argv[])
p = strchr(hostname, '.');
if (p != NULL)
*p = '\0';
+   } else if (dflag) {
+   p = strchr(hostname, '.');
+   if (p != NULL)
+   strcpy(hostname, ++p);
}
(void)printf("%s\n", hostname);
}
@@ -100,6 +108,6 @@ static void
 usage(void)
 {
 
-   (void)fprintf(stderr, "usage: hostname [-fs] [name-of-host]\n");
+   (void)fprintf(stderr, "usage: hostname [-f] [s|d] [name-of-host]\n");
exit(1);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308442 - head/sys/kern

2016-11-08 Thread Konstantin Belousov
Author: kib
Date: Tue Nov  8 10:10:55 2016
New Revision: 308442
URL: https://svnweb.freebsd.org/changeset/base/308442

Log:
  Tweaks for the buffer pager.
  
  Pass current thread credentials instead of NOCRED.
  Only allow unmapped buffers for filesystem which proclaimed the support.
  
  For all filesystems which currently use buffer pager (UFS, msdosfs and
  cd9660), the changes are effectively nop.
  
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Tue Nov  8 10:06:43 2016(r308441)
+++ head/sys/kern/vfs_bio.c Tue Nov  8 10:10:55 2016(r308442)
@@ -4686,13 +4686,15 @@ vfs_bio_getpages(struct vnode *vp, vm_pa
vm_page_t m;
vm_object_t object;
struct buf *bp;
+   struct mount *mp;
daddr_t lbn, lbnp;
vm_ooffset_t la, lb, poff, poffe;
long bsize;
-   int bo_bs, error, i;
+   int bo_bs, br_flags, error, i;
bool redo, lpart;
 
object = vp->v_object;
+   mp = vp->v_mount;
la = IDX_TO_OFF(ma[count - 1]->pindex);
if (la >= object->un_pager.vnp.vnp_size)
return (VM_PAGER_BAD);
@@ -4709,6 +4711,8 @@ vfs_bio_getpages(struct vnode *vp, vm_pa
vnp.vnp_size, PAGE_SIZE) - la);
}
}
+   br_flags = (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMAPPED_BUFS)
+   != 0) ? GB_UNMAPPED : 0;
VM_OBJECT_WLOCK(object);
 again:
for (i = 0; i < count; i++)
@@ -4741,8 +4745,8 @@ again:
lbnp = lbn;
 
bsize = get_blksize(vp, lbn);
-   error = bread_gb(vp, lbn, bsize, NOCRED, GB_UNMAPPED,
-   );
+   error = bread_gb(vp, lbn, bsize, curthread->td_ucred,
+   br_flags, );
if (error != 0)
goto end_pages;
if (LIST_EMPTY(>b_dep)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308441 - head/sys/arm/allwinner/clk

2016-11-08 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov  8 10:06:43 2016
New Revision: 308441
URL: https://svnweb.freebsd.org/changeset/base/308441

Log:
  Do not fail to attach the clock if we cannot set the assigned parents as this
  property isn't mandatory.
  
  MFC after:2 weeks

Modified:
  head/sys/arm/allwinner/clk/aw_ahbclk.c

Modified: head/sys/arm/allwinner/clk/aw_ahbclk.c
==
--- head/sys/arm/allwinner/clk/aw_ahbclk.c  Tue Nov  8 10:05:11 2016
(r308440)
+++ head/sys/arm/allwinner/clk/aw_ahbclk.c  Tue Nov  8 10:06:43 2016
(r308441)
@@ -351,7 +351,7 @@ aw_ahbclk_attach(device_t dev)
}
 
error = clk_set_assigned(dev, node);
-   if (error != 0) {
+   if (error != 0 && error != ENOENT) {
device_printf(dev, "cannot set assigned parents: %d\n", error);
goto fail;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308440 - head/sys/dev/extres/clk

2016-11-08 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov  8 10:05:11 2016
New Revision: 308440
URL: https://svnweb.freebsd.org/changeset/base/308440

Log:
  Do not warn if the 'assigned-clock-parents' property does not exists.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/extres/clk/clk.c

Modified: head/sys/dev/extres/clk/clk.c
==
--- head/sys/dev/extres/clk/clk.c   Tue Nov  8 09:54:11 2016
(r308439)
+++ head/sys/dev/extres/clk/clk.c   Tue Nov  8 10:05:11 2016
(r308440)
@@ -1205,7 +1205,9 @@ clk_set_assigned(device_t dev, phandle_t
"assigned-clock-parents", "#clock-cells", );
 
if (error != 0) {
-   device_printf(dev, "cannot parse assigned-clock-parents 
property\n");
+   if (error != ENOENT)
+   device_printf(dev,
+   "cannot parse assigned-clock-parents property\n");
return (error);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308439 - svnadmin/conf

2016-11-08 Thread Pawel Jakub Dawidek
Author: pjd
Date: Tue Nov  8 09:54:11 2016
New Revision: 308439
URL: https://svnweb.freebsd.org/changeset/base/308439

Log:
  Please welcome Konrad Witaszczyk (def@) as a new source committer.
  Konrad is interested in working on encrypted kernel dumps and memory
  deduplication, at least initially.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessTue Nov  8 09:51:55 2016(r308438)
+++ svnadmin/conf/accessTue Nov  8 09:54:11 2016(r308439)
@@ -65,6 +65,7 @@ das
 davidch
 davidcs
 dchagin
+def
 deischen
 delphij
 des

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Tue Nov  8 09:51:55 2016(r308438)
+++ svnadmin/conf/mentors   Tue Nov  8 09:54:11 2016(r308439)
@@ -18,6 +18,7 @@ benl  philip  Co-mentor: simon
 carl   jimharris
 cherry gibbs
 dabvangyzen
+defpjd
 dexuan sephe
 erignn Co-mentor: thompsa
 ivadaszadrian  Co-mentor: cognet
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308438 - in stable/11/sys: amd64/amd64 i386/i386 kern x86/include x86/x86

2016-11-08 Thread Konstantin Belousov
Author: kib
Date: Tue Nov  8 09:51:55 2016
New Revision: 308438
URL: https://svnweb.freebsd.org/changeset/base/308438

Log:
  MFC r307866:
  Handle broadcast NMIs.
  
  MFC r307880:
  Follow-up to r307866.
  
  MFC r308030:
  Use correct cpu id in the banner.

Modified:
  stable/11/sys/amd64/amd64/trap.c
  stable/11/sys/i386/i386/trap.c
  stable/11/sys/kern/subr_smp.c
  stable/11/sys/x86/include/x86_smp.h
  stable/11/sys/x86/include/x86_var.h
  stable/11/sys/x86/x86/cpu_machdep.c
  stable/11/sys/x86/x86/mp_x86.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/trap.c
==
--- stable/11/sys/amd64/amd64/trap.cTue Nov  8 08:09:48 2016
(r308437)
+++ stable/11/sys/amd64/amd64/trap.cTue Nov  8 09:51:55 2016
(r308438)
@@ -144,14 +144,6 @@ static char *trap_msg[] = {
"DTrace pid return trap",   /* 32 T_DTRACE_RET */
 };
 
-#ifdef KDB
-static int kdb_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN,
-   _on_nmi, 0, "Go to KDB on NMI");
-#endif
-static int panic_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN,
-   _on_nmi, 0, "Panic on NMI");
 static int prot_fault_translation;
 SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN,
 _fault_translation, 0,
@@ -377,21 +369,7 @@ trap(struct trapframe *frame)
 
 #ifdef DEV_ISA
case T_NMI:
-   /* machine/parity/power fail/"kitchen sink" faults */
-   if (isa_nmi(frame->tf_err) == 0) {
-#ifdef KDB
-   /*
-* NMI can be hooked up to a pushbutton
-* for debugging.
-*/
-   if (kdb_on_nmi) {
-   printf ("NMI ... going to debugger\n");
-   kdb_trap(type, 0, frame);
-   }
-#endif /* KDB */
-   goto userout;
-   } else if (panic_on_nmi)
-   panic("NMI indicates hardware failure");
+   nmi_handle_intr(type, frame);
break;
 #endif /* DEV_ISA */
 
@@ -563,22 +541,8 @@ trap(struct trapframe *frame)
 
 #ifdef DEV_ISA
case T_NMI:
-   /* machine/parity/power fail/"kitchen sink" faults */
-   if (isa_nmi(frame->tf_err) == 0) {
-#ifdef KDB
-   /*
-* NMI can be hooked up to a pushbutton
-* for debugging.
-*/
-   if (kdb_on_nmi) {
-   printf ("NMI ... going to debugger\n");
-   kdb_trap(type, 0, frame);
-   }
-#endif /* KDB */
-   goto out;
-   } else if (panic_on_nmi == 0)
-   goto out;
-   /* FALLTHROUGH */
+   nmi_handle_intr(type, frame);
+   goto out;
 #endif /* DEV_ISA */
}
 

Modified: stable/11/sys/i386/i386/trap.c
==
--- stable/11/sys/i386/i386/trap.c  Tue Nov  8 08:09:48 2016
(r308437)
+++ stable/11/sys/i386/i386/trap.c  Tue Nov  8 09:51:55 2016
(r308438)
@@ -158,14 +158,6 @@ static char *trap_msg[] = {
 int has_f00f_bug = 0;  /* Initialized so that it can be patched. */
 #endif
 
-#ifdef KDB
-static int kdb_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN,
-   _on_nmi, 0, "Go to KDB on NMI");
-#endif
-static int panic_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN,
-   _on_nmi, 0, "Panic on NMI");
 static int prot_fault_translation = 0;
 SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW,
_fault_translation, 0, "Select signal to deliver on protection 
fault");
@@ -467,21 +459,7 @@ user_trctrap_out:
}
goto userout;
 #else /* !POWERFAIL_NMI */
-   /* machine/parity/power fail/"kitchen sink" faults */
-   if (isa_nmi(frame->tf_err) == 0) {
-#ifdef KDB
-   /*
-* NMI can be hooked up to a pushbutton
-* for debugging.
-*/
-   if (kdb_on_nmi) {
-   printf ("NMI ... going to debugger\n");
-   kdb_trap(type, 0, frame);
-   }
-#endif /* KDB */
-   

Re: svn commit: r308345 - head/sys/dev/e1000

2016-11-08 Thread Sepherosa Ziehau
On Mon, Nov 7, 2016 at 10:05 PM, Sean Bruno  wrote:
>
>
> On 11/06/16 23:37, Sepherosa Ziehau wrote:
>> On Sun, Nov 6, 2016 at 7:16 AM, John Baldwin  wrote:
>>> On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote:
 Author: sbruno
 Date: Sat Nov  5 16:30:42 2016
 New Revision: 308345
 URL: https://svnweb.freebsd.org/changeset/base/308345

 Log:
   r295133 attempted to deactivate TSO in the 100Mbit link case with this
   adapter to work around bugs in TSO handling at this speed.

   em_init_locked is called during first boot of the adapter and will
   see that link_speed is unitialized, effectively turning off tso for
   all cards at all speeds, which I believe was *not* the intent.

   Move the handling of TSO deactivation to the link handler where we can
   more effectively make the decision about what to do.  In addition,
   completely purge the TSO capabilities instead of disabling just CSUM_TSO.

   Thanks to jhb for explanation of the hw capabilites api.

   Thanks to royger and cognet for testing the 100Mbit failure case to
   ensure that their adapters do indeed still work.

   MFC after:  1 week
   Sponsored by:   Limelight Networks

 Modified:
   head/sys/dev/e1000/if_em.c

 Modified: head/sys/dev/e1000/if_em.c
 ==
 --- head/sys/dev/e1000/if_em.cSat Nov  5 16:23:33 2016
 (r308344)
 +++ head/sys/dev/e1000/if_em.cSat Nov  5 16:30:42 2016
 (r308345)
 @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1);
  #define MAX_INTS_PER_SEC 8000
  #define DEFAULT_ITR  (10/(MAX_INTS_PER_SEC * 256))

 -/* Allow common code without TSO */
 -#ifndef CSUM_TSO
 -#define CSUM_TSO 0
 -#endif
 -
  #define TSO_WORKAROUND   4

  static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver 
 parameters");
 @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter)
   if_clearhwassist(ifp);
   if (if_getcapenable(ifp) & IFCAP_TXCSUM)
   if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0);
 - /*
 - ** There have proven to be problems with TSO when not
 - ** at full gigabit speed, so disable the assist automatically
 - ** when at lower speeds.  -jfv
 - */
 - if (if_getcapenable(ifp) & IFCAP_TSO4) {
 - if (adapter->link_speed == SPEED_1000)
 - if_sethwassistbits(ifp, CSUM_TSO, 0);
 - }
 +
 + if (if_getcapenable(ifp) & IFCAP_TSO4)
 + if_sethwassistbits(ifp, CSUM_TSO, 0);
>>>
>>> Does this always disable TSO?  Should this part be removed entirely?
>>> (That is, it seems like this would disable TSO even on Gigabit links).
>>>
   /* Configure for OS presence */
   em_init_manageability(adapter);
 @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad
   if (link_check && (adapter->link_active == 0)) {
   e1000_get_speed_and_duplex(hw, >link_speed,
   >link_duplex);
 + /*
 + ** There have proven to be problems with TSO when not
 + ** at full gigabit speed, so disable the assist automatically
 + ** when at lower speeds.  -jfv
 + */
 + if (adapter->link_speed != SPEED_1000) {
 + if_sethwassistbits(ifp, 0, CSUM_TSO);
 + if_setcapenablebit(ifp, 0, IFCAP_TSO4);
 + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4);
 +
 + }
>>>
>>> Even though I suggested it, I wonder if it wouldn't be better to only
>>> modify if_capenable and not if_capabilities, that way the admin can
>>> decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving
>>> an adapter from 100 to 1G).
>>
>> I believe simply clearing CSUM_TSO should work for the TCP stack;
>> messing administrative like capenable and hwcaps does not sound
>> correct to me.
>>
>
> I don't disagree, but I also don't have an opinion.  What I didn't want,
> was a continuation of the half disabled/half enabled TSO code path that
> we had prior to this change.
>
>> As for this patch, do you need to re-enable TSO once link speed
>> becomes 1000Mbps?
>
> Probably?  There wasn't a clear way to flip this back on that I could
> find that would catch the case of "link speed was 100 and is now 1000".
>
>
> BTW, since the link status check/update is async w/
>> the TX path, does this really work, if there are TSO packets pending
>> on the TX rings (let alone inflight TSO packets from the TCP stack)
>> when the link speed changed to 100Mbps?
>
> TSO packets that are "pending" will continue out their path, AFAIK.  I
> 

svn commit: r308437 - head/sys/dev/sound/usb

2016-11-08 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Nov  8 08:09:48 2016
New Revision: 308437
URL: https://svnweb.freebsd.org/changeset/base/308437

Log:
  Range check the jitter values to avoid bogus sample rate adjustments.
  The expected deviation should not be more than 1Hz per second. The USB
  v2.0 specification also mandates this requirement. Refer to chapter
  5.12.4.2 about feedback.
  
  PR:   208791
  MFC after:3 days

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Tue Nov  8 07:18:39 2016
(r308436)
+++ head/sys/dev/sound/usb/uaudio.c Tue Nov  8 08:09:48 2016
(r308437)
@@ -2078,9 +2078,22 @@ uaudio_chan_play_sync_callback(struct us
 * Use feedback value as fallback when there is no
 * recording channel:
 */
-   if (ch->priv_sc->sc_rec_chan.num_alt == 0)
-   ch->jitter_curr = temp - sample_rate;
-
+   if (ch->priv_sc->sc_rec_chan.num_alt == 0) {
+   /*
+* Range check the jitter values to avoid
+* bogus sample rate adjustments. The expected
+* deviation should not be more than 1Hz per
+* second. The USB v2.0 specification also
+* mandates this requirement. Refer to chapter
+* 5.12.4.2 about feedback.
+*/
+   if (temp > sample_rate)
+   ch->jitter_curr = 1;
+   else if (temp < sample_rate)
+   ch->jitter_curr = -1;
+   else
+   ch->jitter_curr = 0;
+   }
ch->feedback_rate = temp;
break;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"