Re: svn commit: r287964 - in head: lib/libc/sys sys/kern sys/sys

2015-09-18 Thread Craig Rodrigues
On Fri, Sep 18, 2015 at 10:32 AM, Edward Tomasz Napierala  wrote:

>   pretty.  The reason for this is to avoid changing vfs_mountroot(), which
>   is (obviously) rather mission-critical, but not very well documented,
>   and thus hard to test properly.
>

vfs_mounroot() is indeed quite involved.  It's not perfect,
but I took an initial pass at writing the mount.conf(8) man page,
which tries to document some stuff.

--
Craig
___
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: r287978 - head/share/mk

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 23:25:43 2015
New Revision: 287978
URL: https://svnweb.freebsd.org/changeset/base/287978

Log:
  Fix LIBRARIES_ONLY
  
  It was erroring: make: don't know how to make _manpages. Stop
  
  Sponsored by: EMC / Isilon Storage Division
  MFC after:1 week

Modified:
  head/share/mk/bsd.lib.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkFri Sep 18 23:12:38 2015(r287977)
+++ head/share/mk/bsd.lib.mkFri Sep 18 23:25:43 2015(r287978)
@@ -294,7 +294,7 @@ all:
 .else
 all: ${_LIBS}
 
-.if ${MK_MAN} != "no"
+.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
 all: _manpages
 .endif
 .endif
___
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: r287979 - head/usr.sbin/sysrc

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 23:34:47 2015
New Revision: 287979
URL: https://svnweb.freebsd.org/changeset/base/287979

Log:
  Remove redundant beforeinstall.

Modified:
  head/usr.sbin/sysrc/Makefile

Modified: head/usr.sbin/sysrc/Makefile
==
--- head/usr.sbin/sysrc/MakefileFri Sep 18 23:25:43 2015
(r287978)
+++ head/usr.sbin/sysrc/MakefileFri Sep 18 23:34:47 2015
(r287979)
@@ -4,8 +4,4 @@ SCRIPTS= sysrc
 
 MAN= sysrc.8
 
-beforeinstall:
-   mkdir -p ${DESTDIR}${SCRIPTSDIR}
-   mkdir -p ${DESTDIR}${MANDIR}8
-
 .include 
___
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: r287980 - in head: gnu/usr.bin/groff/src/utils/indxbib lib/liblzma lib/libusb lib/libz

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 23:49:32 2015
New Revision: 287980
URL: https://svnweb.freebsd.org/changeset/base/287980

Log:
  Replace beforeinstall: handling with FILES.
  
  This actually fixes some cases to respect LIBRARIES_ONLY.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/gnu/usr.bin/groff/src/utils/indxbib/Makefile
  head/lib/liblzma/Makefile
  head/lib/libusb/Makefile
  head/lib/libz/Makefile

Modified: head/gnu/usr.bin/groff/src/utils/indxbib/Makefile
==
--- head/gnu/usr.bin/groff/src/utils/indxbib/Makefile   Fri Sep 18 23:34:47 
2015(r287979)
+++ head/gnu/usr.bin/groff/src/utils/indxbib/Makefile   Fri Sep 18 23:49:32 
2015(r287980)
@@ -5,9 +5,7 @@ SRCS=   indxbib.cpp signal.c
 DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
 LDADD= ${LIBBIB} ${LIBGROFF} -lm
 CLEANFILES=${MAN}
-
-beforeinstall:
-   ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
-   ${DIST_DIR}/eign ${DESTDIR}${SHAREDIR}/dict/
+FILES= ${DIST_DIR}/eign
+FILESDIR=  ${SHAREDIR}/dict/
 
 .include 

Modified: head/lib/liblzma/Makefile
==
--- head/lib/liblzma/Makefile   Fri Sep 18 23:34:47 2015(r287979)
+++ head/lib/liblzma/Makefile   Fri Sep 18 23:49:32 2015(r287980)
@@ -154,10 +154,11 @@ CFLAGS+=  -DSYMBOL_VERSIONING
 
 CLEANFILES+=   liblzma.pc
 
-.if !defined(LIBRARIES_ONLY)
-all: liblzma.pc
+FILES= liblzma.pc
+FILESDIR=  ${LIBDATADIR}/pkgconfig
+
 liblzma.pc: liblzma.pc.in
-   @sed -e 's,@prefix@,/usr,g ; \
+   sed -e 's,@prefix@,/usr,g ; \
s,@exec_prefix@,/usr,g  ; \
s,@libdir@,/usr/lib,g ; \
s,@includedir@,/usr/include,g ; \
@@ -166,9 +167,4 @@ liblzma.pc: liblzma.pc.in
s,@PTHREAD_CFLAGS@,,g ; \
s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET}
 
-beforeinstall:
-   @${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-   liblzma.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
-.endif
-
 .include 

Modified: head/lib/libusb/Makefile
==
--- head/lib/libusb/MakefileFri Sep 18 23:34:47 2015(r287979)
+++ head/lib/libusb/MakefileFri Sep 18 23:49:32 2015(r287980)
@@ -35,16 +35,9 @@ SRCS+=   libusb10_io.c
 
 .if defined(COMPAT_32BIT)
 CFLAGS+=   -DCOMPAT_32BIT
-.endif
-
-.ifndef COMPAT_32BIT
-beforeinstall:
-   ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-   ${.CURDIR}/libusb-0.1.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
-   ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-   ${.CURDIR}/libusb-1.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
-   ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-   ${.CURDIR}/libusb-2.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+.else
+FILES= libusb-0.1.pc libusb-1.0.pc libusb-2.0.pc
+FILESDIR=  ${LIBDATADIR}/pkgconfig
 .endif
 
 #

Modified: head/lib/libz/Makefile
==
--- head/lib/libz/Makefile  Fri Sep 18 23:34:47 2015(r287979)
+++ head/lib/libz/Makefile  Fri Sep 18 23:49:32 2015(r287980)
@@ -69,9 +69,8 @@ test: example minigzip
echo hello world | ./minigzip | ./minigzip -d )
 
 .ifndef COMPAT_32BIT
-beforeinstall:
-   ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-   ${.CURDIR}/zlib.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+FILES= zlib.pc
+FILESDIR=  ${LIBDATADIR}/pkgconfig
 .endif
 
 .include 
___
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: r287953 - head/sys/dev/usb/wlan

2015-09-18 Thread Adrian Chadd
Author: adrian
Date: Fri Sep 18 07:26:34 2015
New Revision: 287953
URL: https://svnweb.freebsd.org/changeset/base/287953

Log:
  Refactor out the tx buffer free code into a routine, rsu_freebuf().
  
  This makes it easier to add more transmit buffers, have different buffer
  pools for things, etc.

Modified:
  head/sys/dev/usb/wlan/if_rsu.c

Modified: head/sys/dev/usb/wlan/if_rsu.c
==
--- head/sys/dev/usb/wlan/if_rsu.c  Fri Sep 18 07:18:10 2015
(r287952)
+++ head/sys/dev/usb/wlan/if_rsu.c  Fri Sep 18 07:26:34 2015
(r287953)
@@ -174,6 +174,7 @@ static void rsu_free_tx_list(struct rsu_
 static voidrsu_free_list(struct rsu_softc *, struct rsu_data [], int);
 static struct rsu_data *_rsu_getbuf(struct rsu_softc *);
 static struct rsu_data *rsu_getbuf(struct rsu_softc *);
+static voidrsu_freebuf(struct rsu_softc *, struct rsu_data *);
 static int rsu_write_region_1(struct rsu_softc *, uint16_t, uint8_t *,
int);
 static voidrsu_write_1(struct rsu_softc *, uint16_t, uint8_t);
@@ -759,6 +760,14 @@ rsu_getbuf(struct rsu_softc *sc)
return (bf);
 }
 
+static void
+rsu_freebuf(struct rsu_softc *sc, struct rsu_data *bf)
+{
+
+   RSU_ASSERT_LOCKED(sc);
+   STAILQ_INSERT_TAIL(>sc_tx_inactive, bf, next);
+}
+
 static int
 rsu_write_region_1(struct rsu_softc *sc, uint16_t addr, uint8_t *buf,
 int len)
@@ -1742,7 +1751,7 @@ rsu_bulk_tx_callback_sub(struct usb_xfer
__func__, data);
STAILQ_REMOVE_HEAD(>sc_tx_active[which], next);
rsu_txeof(xfer, data);
-   STAILQ_INSERT_TAIL(>sc_tx_inactive, data, next);
+   rsu_freebuf(sc, data);
/* FALLTHROUGH */
case USB_ST_SETUP:
 tr_setup:
@@ -1766,7 +1775,7 @@ tr_setup:
if (data != NULL) {
STAILQ_REMOVE_HEAD(>sc_tx_active[which], next);
rsu_txeof(xfer, data);
-   STAILQ_INSERT_TAIL(>sc_tx_inactive, data, next);
+   rsu_freebuf(sc, data);
}
counter_u64_add(ic->ic_oerrors, 1);
 
@@ -1975,7 +1984,7 @@ rsu_start(struct rsu_softc *sc)
if (rsu_tx_start(sc, ni, m, bf) != 0) {
if_inc_counter(ni->ni_vap->iv_ifp,
IFCOUNTER_OERRORS, 1);
-   STAILQ_INSERT_HEAD(>sc_tx_inactive, bf, next);
+   rsu_freebuf(sc, bf);
ieee80211_free_node(ni);
break;
}
@@ -2477,7 +2486,7 @@ rsu_raw_xmit(struct ieee80211_node *ni, 
}
if (rsu_tx_start(sc, ni, m, bf) != 0) {
ieee80211_free_node(ni);
-   STAILQ_INSERT_HEAD(>sc_tx_inactive, bf, next);
+   rsu_freebuf(sc, bf);
RSU_UNLOCK(sc);
return (EIO);
}
___
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: r287955 - head/sys/cam/scsi

2015-09-18 Thread Alexander Motin
Author: mav
Date: Fri Sep 18 10:23:17 2015
New Revision: 287955
URL: https://svnweb.freebsd.org/changeset/base/287955

Log:
  Update list of ASC/ASCQ codes from 5/20/12 to 8/12/15.

Modified:
  head/sys/cam/scsi/scsi_all.c

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cFri Sep 18 07:55:33 2015
(r287954)
+++ head/sys/cam/scsi/scsi_all.cFri Sep 18 10:23:17 2015
(r287955)
@@ -969,7 +969,7 @@ static struct asc_table_entry asc_table[
 *
 * SCSI ASC/ASCQ Assignments
 * Numeric Sorted Listing
-* as of  5/20/12
+* as of  8/12/15
 *
 * D - DIRECT ACCESS DEVICE (SBC-2)   device column key
 * .T - SEQUENTIAL ACCESS DEVICE (SSC)   ---
@@ -1061,6 +1061,9 @@ static struct asc_table_entry asc_table[
/* DT P  B*/
{ SST(0x00, 0x20, SS_RDEF,  /* XXX TBD */
"Extended copy information available") },
+   /* D  */
+   { SST(0x00, 0x21, SS_RDEF,  /* XXX TBD */
+   "Atomic command aborted due to ACA") },
/* D   W O   BK   */
{ SST(0x01, 0x00, SS_RDEF,
"No index/sector signal") },
@@ -1118,6 +1121,9 @@ static struct asc_table_entry asc_table[
/*  F */
{ SST(0x04, 0x0D, SS_RDEF,  /* XXX TBD */
"Logical unit not ready, structure check required") },
+   /* DTL WR MAEBKVF */
+   { SST(0x04, 0x0E, SS_RDEF,  /* XXX TBD */
+   "Logical unit not ready, security session in progress") },
/* DT  WROM  B*/
{ SST(0x04, 0x10, SS_RDEF,  /* XXX TBD */
"Logical unit not ready, auxiliary memory not accessible") },
@@ -1157,6 +1163,24 @@ static struct asc_table_entry asc_table[
/* DT MAEB*/
{ SST(0x04, 0x1C, SS_RDEF,  /* XXX TBD */
"Logical unit not ready, additional power use not yet granted") },
+   /* D  */
+   { SST(0x04, 0x1D, SS_RDEF,  /* XXX TBD */
+   "Logical unit not ready, configuration in progress") },
+   /* D  */
+   { SST(0x04, 0x1E, SS_FATAL | ENXIO,
+   "Logical unit not ready, microcode activation required") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x04, 0x1F, SS_FATAL | ENXIO,
+   "Logical unit not ready, microcode download required") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x04, 0x20, SS_RDEF,  /* XXX TBD */
+   "Logical unit not ready, logical unit reset required") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x04, 0x21, SS_RDEF,  /* XXX TBD */
+   "Logical unit not ready, hard reset required") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x04, 0x22, SS_RDEF,  /* XXX TBD */
+   "Logical unit not ready, power cycle required") },
/* DTL WROMAEBKVF */
{ SST(0x05, 0x00, SS_RDEF,
"Logical unit does not respond to selection") },
@@ -1196,6 +1220,9 @@ static struct asc_table_entry asc_table[
/* DT  WRO   B*/
{ SST(0x09, 0x04, SS_RDEF,
"Head select fault") },
+   /* DT   RO   B*/
+   { SST(0x09, 0x05, SS_RDEF,
+   "Vibration induced tracking error") },
/* DTLPWROMAEBKVF */
{ SST(0x0A, 0x00, SS_FATAL | ENOSPC,
"Error log overflow") },
@@ -1229,6 +1256,30 @@ static struct asc_table_entry asc_table[
/* D  */
{ SST(0x0B, 0x09, SS_RDEF,  /* XXX TBD */
"Warning - device statistics notification available") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x0B, 0x0A, SS_RDEF,  /* XXX TBD */
+   "Warning - High critical temperature limit exceeded") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x0B, 0x0B, SS_RDEF,  /* XXX TBD */
+   "Warning - Low critical temperature limit exceeded") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x0B, 0x0C, SS_RDEF,  /* XXX TBD */
+   "Warning - High operating temperature limit exceeded") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x0B, 0x0D, SS_RDEF,  /* XXX TBD */
+   "Warning - Low operating temperature limit exceeded") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x0B, 0x0E, SS_RDEF,  /* XXX TBD */
+   "Warning - High citical humidity limit exceeded") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x0B, 0x0F, SS_RDEF,  /* XXX TBD */
+   "Warning - Low citical humidity limit exceeded") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x0B, 0x10, SS_RDEF,  /* XXX TBD */
+   "Warning - High operating humidity limit exceeded") },
+   /* DTLPWROMAEBKVF */
+   { SST(0x0B, 0x11, SS_RDEF,  /* XXX TBD */
+   "Warning - Low operating humidity limit exceeded") },
/*  T   R */
{ SST(0x0C, 0x00, SS_RDEF,
"Write error") },
@@ -1277,6 +1328,15 @@ 

svn commit: r287951 - head/etc/rc.d

2015-09-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Sep 18 06:54:52 2015
New Revision: 287951
URL: https://svnweb.freebsd.org/changeset/base/287951

Log:
  The "automount" rc script should depend on "automountd", not the other
  way around.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/etc/rc.d/automount
  head/etc/rc.d/automountd
  head/etc/rc.d/autounmountd

Modified: head/etc/rc.d/automount
==
--- head/etc/rc.d/automount Fri Sep 18 05:59:15 2015(r287950)
+++ head/etc/rc.d/automount Fri Sep 18 06:54:52 2015(r287951)
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: automount
-# REQUIRE: nfsclient
+# REQUIRE: nfsclient automountd
 # KEYWORD: nojail shutdown
 
 . /etc/rc.subr

Modified: head/etc/rc.d/automountd
==
--- head/etc/rc.d/automountdFri Sep 18 05:59:15 2015(r287950)
+++ head/etc/rc.d/automountdFri Sep 18 06:54:52 2015(r287951)
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: automountd
-# REQUIRE: automount
+# REQUIRE: DAEMON
 # KEYWORD: nojail
 
 . /etc/rc.subr

Modified: head/etc/rc.d/autounmountd
==
--- head/etc/rc.d/autounmountd  Fri Sep 18 05:59:15 2015(r287950)
+++ head/etc/rc.d/autounmountd  Fri Sep 18 06:54:52 2015(r287951)
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: autounmountd
-# REQUIRE: nfsclient
+# REQUIRE: DAEMON
 # KEYWORD: nojail
 
 . /etc/rc.subr
___
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: r287968 - head/sys/cam/ctl

2015-09-18 Thread Alexander Motin
Author: mav
Date: Fri Sep 18 20:11:10 2015
New Revision: 287968
URL: https://svnweb.freebsd.org/changeset/base/287968

Log:
  Mark I/Os with DMA flag while moving data through the HA link.

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Fri Sep 18 19:43:14 2015(r287967)
+++ head/sys/cam/ctl/ctl.c  Fri Sep 18 20:11:10 2015(r287968)
@@ -1148,6 +1148,7 @@ ctl_isc_event_handler(ctl_ha_channel cha
 */
io = msg->hdr.serializing_sc;
io->io_hdr.msg_type = CTL_MSG_DATAMOVE_DONE;
+   io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG;
io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE;
io->io_hdr.port_status = msg->scsi.fetd_status;
io->scsiio.residual = msg->scsi.residual;
@@ -11058,6 +11059,7 @@ ctl_failover_lun(struct ctl_lun *lun)
io->flags |= CTL_FLAG_FAILOVER;
} else { /* This can be only due to DATAMOVE */
io->msg_type = CTL_MSG_DATAMOVE_DONE;
+   io->flags &= ~CTL_FLAG_DMA_INPROG;
io->flags |= CTL_FLAG_IO_ACTIVE;
io->port_status = 31340;
ctl_enqueue_isc((union ctl_io *)io);
@@ -12443,6 +12445,7 @@ ctl_datamove(union ctl_io *io)
return;
}
io->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE;
+   io->io_hdr.flags |= CTL_FLAG_DMA_INPROG;
if (lun)
mtx_unlock(>lun_lock);
} else {
___
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: r287780 - in head: share/man/man9 sys/kern sys/sys

2015-09-18 Thread Gleb Smirnoff
  Hans,

  on behalf of core, I ask you to revert this change due to lack
of review and due to previous issues in this area.

On Mon, Sep 14, 2015 at 10:52:27AM +, Hans Petter Selasky wrote:
H> Author: hselasky
H> Date: Mon Sep 14 10:52:26 2015
H> New Revision: 287780
H> URL: https://svnweb.freebsd.org/changeset/base/287780
H> 
H> Log:
H>   Implement callout_drain_async(), inspired by the projects/hps_head
H>   branch.
H>   
H>   This function is used to drain a callout via a callback instead of
H>   blocking the caller until the drain is complete. Refer to the
H>   callout_drain_async() manual page for a detailed description.
H>   
H>   Limitation: If a lock is used with the callout, the callout can only
H>   be drained asynchronously one time unless the callout_init_mtx()
H>   function is called again. This limitation is not present in
H>   projects/hps_head and will require more invasive changes to the
H>   timeout code, which was not in the scope of this patch.
H>   
H>   Differential Revision: https://reviews.freebsd.org/D3521
H>   Reviewed by:   wblock
H>   MFC after: 1 month
H> 
H> Modified:
H>   head/share/man/man9/Makefile
H>   head/share/man/man9/timeout.9
H>   head/sys/kern/kern_timeout.c
H>   head/sys/sys/_callout.h
H>   head/sys/sys/callout.h
H> 
H> Modified: head/share/man/man9/Makefile
H> 
==
H> --- head/share/man/man9/Makefile Mon Sep 14 10:28:47 2015
(r287779)
H> +++ head/share/man/man9/Makefile Mon Sep 14 10:52:26 2015
(r287780)
H> @@ -1641,6 +1641,7 @@ MLINKS+=timeout.9 callout.9 \
H>  timeout.9 callout_active.9 \
H>  timeout.9 callout_deactivate.9 \
H>  timeout.9 callout_drain.9 \
H> +timeout.9 callout_drain_async.9 \
H>  timeout.9 callout_handle_init.9 \
H>  timeout.9 callout_init.9 \
H>  timeout.9 callout_init_mtx.9 \
H> 
H> Modified: head/share/man/man9/timeout.9
H> 
==
H> --- head/share/man/man9/timeout.9Mon Sep 14 10:28:47 2015
(r287779)
H> +++ head/share/man/man9/timeout.9Mon Sep 14 10:52:26 2015
(r287780)
H> @@ -36,6 +36,7 @@
H>  .Nm callout_active ,
H>  .Nm callout_deactivate ,
H>  .Nm callout_drain ,
H> +.Nm callout_drain_async ,
H>  .Nm callout_handle_init ,
H>  .Nm callout_init ,
H>  .Nm callout_init_mtx ,
H> @@ -70,6 +71,8 @@ typedef void timeout_t (void *);
H>  .Fn callout_deactivate "struct callout *c"
H>  .Ft int
H>  .Fn callout_drain "struct callout *c"
H> +.Ft int
H> +.Fn callout_drain_async "struct callout *c" "callout_func_t *fn" "void *arg"
H>  .Ft void
H>  .Fn callout_handle_init "struct callout_handle *handle"
H>  .Bd -literal
H> @@ -264,6 +267,24 @@ fully stopped before
H>  .Fn callout_drain
H>  returns.
H>  .Pp
H> +The function
H> +.Fn callout_drain_async
H> +is non-blocking and works the same as the
H> +.Fn callout_stop
H> +function.
H> +When this function returns non-zero, do not call it again until the 
callback function given by
H> +.Fa fn
H> +has been called with argument
H> +.Fa arg .
H> +Only one of
H> +.Fn callout_drain
H> +or
H> +.Fn callout_drain_async
H> +should be called at a time to drain a callout.
H> +If this function returns zero, it is safe to free the callout structure 
pointed to by the
H> +.Fa c
H> +argument immediately.
H> +.Pp
H>  The
H>  .Fn callout_reset
H>  and
H> 
H> Modified: head/sys/kern/kern_timeout.c
H> 
==
H> --- head/sys/kern/kern_timeout.c Mon Sep 14 10:28:47 2015
(r287779)
H> +++ head/sys/kern/kern_timeout.c Mon Sep 14 10:52:26 2015
(r287780)
H> @@ -1145,6 +1145,45 @@ callout_schedule(struct callout *c, int 
H>  }
H>  
H>  int
H> +callout_drain_async(struct callout *c, callout_func_t *func, void *arg)
H> +{
H> +struct callout_cpu *cc;
H> +struct lock_class *class;
H> +int retval;
H> +int direct;
H> +
H> +/* stop callout */
H> +callout_stop(c);
H> +
H> +/* check if callback is being called */
H> +cc = callout_lock(c);
H> +if (c->c_iflags & CALLOUT_DIRECT) {
H> +direct = 1;
H> +} else {
H> +direct = 0;
H> +}
H> +retval = (cc_exec_curr(cc, direct) == c);
H> +
H> +/* drop locks, if any */
H> +if (retval && c->c_lock != NULL &&
H> +c->c_lock != _object) {
H> +/* ensure we are properly locked */
H> +class = LOCK_CLASS(c->c_lock);
H> +class->lc_assert(c->c_lock, LA_XLOCKED);
H> +/* the final callback should not be called locked */
H> +c->c_lock = NULL;
H> +c->c_iflags |= CALLOUT_RETURNUNLOCKED;
H> +}
H> +CC_UNLOCK(cc);
H> +
H> +/* check if we should queue final callback */
H> +if (retval)
H> +callout_reset(c, 1, func, arg);
H> +
H> +return (retval);
H> +}
H> +
H> +int
H>  _callout_stop_safe(struct 

svn commit: r287967 - head/sys/cam/ctl

2015-09-18 Thread Alexander Motin
Author: mav
Date: Fri Sep 18 19:43:14 2015
New Revision: 287967
URL: https://svnweb.freebsd.org/changeset/base/287967

Log:
  Relax serseq option operation for reads.
  
  Previously, with serseq enabled, next command was unblocked only after
  previous completed.  With this change, for read operations, next command
  is unblocked as soon as last media read completed.  This is important
  for frontends that actually wait for data move completion (like camtgt),
  or when data are moved through the HA link, or especially when both.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_io.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Fri Sep 18 18:57:09 2015(r287966)
+++ head/sys/cam/ctl/ctl.c  Fri Sep 18 19:43:14 2015(r287967)
@@ -10592,6 +10592,8 @@ ctl_extent_check(union ctl_io *io1, unio
if (ctl_get_lba_len(io1, , ) != 0)
return (CTL_ACTION_ERROR);
 
+   if (io1->io_hdr.flags & CTL_FLAG_SERSEQ_DONE)
+   seq = FALSE;
return (ctl_extent_check_lba(lba1, len1, lba2, len2, seq));
 }
 
@@ -10601,6 +10603,8 @@ ctl_extent_check_seq(union ctl_io *io1, 
uint64_t lba1, lba2;
uint64_t len1, len2;
 
+   if (io1->io_hdr.flags & CTL_FLAG_SERSEQ_DONE)
+   return (CTL_ACTION_PASS);
if (ctl_get_lba_len(io1, , ) != 0)
return (CTL_ACTION_ERROR);
if (ctl_get_lba_len(io2, , ) != 0)
@@ -13218,6 +13222,21 @@ ctl_done_timer_wakeup(void *arg)
 #endif /* CTL_IO_DELAY */
 
 void
+ctl_serseq_done(union ctl_io *io)
+{
+   struct ctl_lun *lun;
+
+   lun = (struct ctl_lun *)io->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+   if (lun->be_lun == NULL ||
+   lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF)
+   return;
+   mtx_lock(>lun_lock);
+   io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE;
+   ctl_check_blocked(lun);
+   mtx_unlock(>lun_lock);
+}
+
+void
 ctl_done(union ctl_io *io)
 {
 

Modified: head/sys/cam/ctl/ctl.h
==
--- head/sys/cam/ctl/ctl.h  Fri Sep 18 18:57:09 2015(r287966)
+++ head/sys/cam/ctl/ctl.h  Fri Sep 18 19:43:14 2015(r287967)
@@ -172,6 +172,7 @@ int ctl_sap_log_sense_handler(struct ctl
   int pc);
 int ctl_config_move_done(union ctl_io *io);
 void ctl_datamove(union ctl_io *io);
+void ctl_serseq_done(union ctl_io *io);
 void ctl_done(union ctl_io *io);
 void ctl_data_submit_done(union ctl_io *io);
 void ctl_config_read_done(union ctl_io *io);

Modified: head/sys/cam/ctl/ctl_backend_block.c
==
--- head/sys/cam/ctl/ctl_backend_block.cFri Sep 18 18:57:09 2015
(r287966)
+++ head/sys/cam/ctl/ctl_backend_block.cFri Sep 18 19:43:14 2015
(r287967)
@@ -562,8 +562,10 @@ ctl_be_block_biodone(struct bio *bio)
ctl_complete_beio(beio);
} else {
if ((ARGS(io)->flags & CTL_LLF_READ) &&
-   beio->beio_cont == NULL)
+   beio->beio_cont == NULL) {
ctl_set_success(>scsiio);
+   ctl_serseq_done(io);
+   }
 #ifdef CTL_TIME_IO
getbintime(>io_hdr.dma_start_bt);
 #endif  
@@ -782,8 +784,10 @@ ctl_be_block_dispatch_file(struct ctl_be
ctl_complete_beio(beio);
} else {
if ((ARGS(io)->flags & CTL_LLF_READ) &&
-   beio->beio_cont == NULL)
+   beio->beio_cont == NULL) {
ctl_set_success(>scsiio);
+   ctl_serseq_done(io);
+   }
 #ifdef CTL_TIME_IO
getbintime(>io_hdr.dma_start_bt);
 #endif  
@@ -951,8 +955,10 @@ ctl_be_block_dispatch_zvol(struct ctl_be
ctl_complete_beio(beio);
} else {
if ((ARGS(io)->flags & CTL_LLF_READ) &&
-   beio->beio_cont == NULL)
+   beio->beio_cont == NULL) {
ctl_set_success(>scsiio);
+   ctl_serseq_done(io);
+   }
 #ifdef CTL_TIME_IO
getbintime(>io_hdr.dma_start_bt);
 #endif  

Modified: head/sys/cam/ctl/ctl_io.h
==
--- head/sys/cam/ctl/ctl_io.h   Fri Sep 18 18:57:09 2015(r287966)
+++ head/sys/cam/ctl/ctl_io.h   Fri Sep 18 19:43:14 2015(r287967)
@@ -115,7 +115,8 @@ typedef enum {
 
CTL_FLAG_FAILOVER   = 0x0400,   /* Killed by a failover */
CTL_FLAG_IO_ACTIVE  = 0x0800,   /* I/O active on this SC */
-   CTL_FLAG_STATUS_SENT= 0x1000/* Status sent by datamove */
+   CTL_FLAG_STATUS_SENT= 

Re: svn commit: r287780 - in head: share/man/man9 sys/kern sys/sys

2015-09-18 Thread Davide Italiano
On Thu, Sep 17, 2015 at 12:20 AM, Hans Petter Selasky  wrote:
> On 09/17/15 00:05, Gleb Smirnoff wrote:
>>
>> Weren't you explicitly asked not to touch this system without a proper
>> review and discussion?
>
>
> Adding a new function is not touching code.
>
> --HPS
>

I tried to stay away from this conversation as much as I could, partly
because I haven't touched this code in a couple of years, partly
because others have already expressed concerns. Sorry if I sound a
little bit harsh here but this is not your playground.
As somebody who spent a lot of time working on callout in the past I'm
completely opposed to introducing new KPI without proper review.
This has several problems:
1) It's a dead KPI, i.e. it has no consumers, which is a fairly bad
engineering practice.
2) Your commit message didn't explain what (if any) is the use case for this.
3) You didn't discuss it with anybody else. Review timeout is not an
excuse. If you want somebody to review this code ping -current or in
the worst case developers@. Writing interfaces is hard, most of the
times when you introduce a new one you may miss something useful,
that's why we have reviews. It happened in the past when me and mav@
introduced the new callout precision API and we had to change all the
functions in the middle of development because of external feedback.

Not even talking about the possibility of us changing our mind and
removing this KPI after 11 is shipped, while third-party vendors
started using it and very unhappily have to #ifdef their
drivers, or even worse drop FreeBSD support.

tl;dr:
I personally don't think that your past/records have some influence on
this. You introduced a new KPI, you took this decision lightly, and
completely ignored complaints from others. This is a very bad attitude
problem, and that's so much worse than all the technical problems this
commit brings.

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare
___
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: r287981 - in head: . secure/lib/libcrypto

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Sat Sep 19 03:46:10 2015
New Revision: 287981
URL: https://svnweb.freebsd.org/changeset/base/287981

Log:
  Replace afterinstall: hack from r111083 with 'make delete-old' functionality.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/ObsoleteFiles.inc
  head/secure/lib/libcrypto/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Sep 18 23:49:32 2015(r287980)
+++ head/ObsoleteFiles.inc  Sat Sep 19 03:46:10 2015(r287981)
@@ -7234,6 +7234,12 @@ OLD_LIBS+=usr/lib/libposix1e.so.2
 OLD_LIBS+=usr/lib/libskey.so.2
 OLD_LIBS+=usr/lib/libusbhid.so.0
 OLD_LIBS+=usr/lib/libvgl.so.2
+# 20030218: OpenSSL 0.9.7 import
+OLD_FILES+=usr/include/des.h
+OLD_FILES+=usr/lib/libdes.a
+OLD_FILES+=usr/lib/libdes.so
+OLD_LIBS+=usr/lib/libdes.so.3
+OLD_FILES+=usr/lib/libdes_p.a
 # 200302XX
 OLD_LIBS+=usr/lib/libacl.so.3
 OLD_LIBS+=usr/lib/libasn1.so.5

Modified: head/secure/lib/libcrypto/Makefile
==
--- head/secure/lib/libcrypto/Makefile  Fri Sep 18 23:49:32 2015
(r287980)
+++ head/secure/lib/libcrypto/Makefile  Sat Sep 19 03:46:10 2015
(r287981)
@@ -402,14 +402,6 @@ opensslconf.h: opensslconf-${MACHINE_CPU
 .endif
${CP} ${.ALLSRC} ${.TARGET}
 
-OLDSYMLINKS+=  libdes.a libdes.so libdes.so.3 libdes_p.a
-afterinstall:
-   @${ECHO} "Removing stale symlinks."
-   rm -f ${DESTDIR}${INCLUDEDIR}/des.h
-.for symlink in ${OLDSYMLINKS}
-   rm -f ${DESTDIR}${LIBDIR}/${symlink}
-.endfor
-
 .include 
 
 .if ${MACHINE_CPUARCH} == "amd64"
___
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: r287982 - in head: . usr.sbin/ntp/ntpdc

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Sat Sep 19 03:51:19 2015
New Revision: 287982
URL: https://svnweb.freebsd.org/changeset/base/287982

Log:
  Replace afterinstall: hack from r54681 with 'make delete-old' functionality.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/ObsoleteFiles.inc
  head/usr.sbin/ntp/ntpdc/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Sep 19 03:46:10 2015(r287981)
+++ head/ObsoleteFiles.inc  Sat Sep 19 03:51:19 2015(r287982)
@@ -7298,6 +7298,8 @@ OLD_LIBS+=usr/lib/libtermcap.so.2
 OLD_LIBS+=usr/lib/libutil.so.2
 OLD_LIBS+=usr/lib/libvgl.so.1
 OLD_LIBS+=usr/lib/libwrap.so.2
+# 19991216
+OLD_FILES+=usr/sbin/xntpdc
 # 199909XX
 OLD_LIBS+=usr/lib/libc_r.so.3
 # ???

Modified: head/usr.sbin/ntp/ntpdc/Makefile
==
--- head/usr.sbin/ntp/ntpdc/MakefileSat Sep 19 03:46:10 2015
(r287981)
+++ head/usr.sbin/ntp/ntpdc/MakefileSat Sep 19 03:51:19 2015
(r287982)
@@ -33,7 +33,4 @@ CLEANFILES+= .version version.c
 version.c:
sh -e ${.CURDIR}/../scripts/mkver ntpdc
 
-afterinstall:
-   rm -f ${DESTDIR}/usr/sbin/xntpdc
-
 .include 
___
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: r287984 - stable/10/sys/contrib/ipfilter/netinet

2015-09-18 Thread Cy Schubert
Author: cy
Date: Sat Sep 19 03:58:31 2015
New Revision: 287984
URL: https://svnweb.freebsd.org/changeset/base/287984

Log:
  MFC r287651, r287652, r287653.
  
  Fix mutex errors, fixup typos in comments.
  
  Obtained from:NetBSD r1.4.
  -This lie, anr those below, will be ignored--
  > Description of fields to fill in above: 76 columns --|
  > PR:   If a GNATS PR is affected by the change.
  > Submitted by: If someone else sent in the change.
  > Reviewed by:  If someone else reviewed your modification.
  > Approved by:  If you needed approval for this commit.
  > Obtained from:If the change is from a third party.
  > MFC after:N [day[s]|week[s]|month[s]].  Request a reminder 
email.
  > MFH:  Ports tree branch name.  Request approval for 
merge.
  > Relnotes: Set to 'yes' for mention in release notes.
  > Security: Vulnerability reference (one per line) or 
description.
  > Sponsored by: If the change was sponsored by an organization.
  > Differential Revision:https://reviews.freebsd.org/D### (*full* phabric 
URL needed).
  > Empty fields above will be automatically removed.
  
  _M   .
  Msys/contrib/ipfilter/netinet/ip_state.c

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_state.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_state.c
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_state.c   Sat Sep 19 03:53:37 
2015(r287983)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_state.c   Sat Sep 19 03:58:31 
2015(r287984)
@@ -1,4 +1,4 @@
-/* $FreeBSD$   */
+/* $FreeBSD$ */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -1054,7 +1054,7 @@ ipf_state_putent(softc, softs, data)
 /* to pointers and adjusts running stats for the hash table as appropriate. */
 /*  */
 /* This function can fail if the filter rule has had a population policy of */
-/* IP addresses used with stateful filteirng assigned to it.*/
+/* IP addresses used with stateful filtering assigned to it.*/
 /*  */
 /* Locking: it is assumed that some kind of lock on ipf_state is held.  */
 /*  Exits with is_lock initialised and held - *EVEN IF ERROR*.  */
@@ -1081,7 +1081,7 @@ ipf_state_insert(softc, is, rev)
}
 
/*
-* If we could trust is_hv, then the modulous would not be needed,
+* If we could trust is_hv, then the modulus would not be needed,
 * but when running with IPFILTER_SYNC, this stops bad values.
 */
hv = is->is_hv % softs->ipf_state_size;
@@ -1672,6 +1672,10 @@ ipf_state_add(softc, fin, stsave, flags)
SBUMPD(ipf_state_stats, iss_bucket_full);
return 4;
}
+
+   /*
+* No existing state; create new
+*/
KMALLOC(is, ipstate_t *);
if (is == NULL) {
SBUMPD(ipf_state_stats, iss_nomem);
@@ -1683,7 +1687,7 @@ ipf_state_add(softc, fin, stsave, flags)
is->is_rule = fr;
 
/*
-* Do not do the modulous here, it is done in ipf_state_insert().
+* Do not do the modulus here, it is done in ipf_state_insert().
 */
if (fr != NULL) {
ipftq_t *tq;
@@ -1711,7 +1715,7 @@ ipf_state_add(softc, fin, stsave, flags)
/*
 * It may seem strange to set is_ref to 2, but if stsave is not NULL
 * then a copy of the pointer is being stored somewhere else and in
-* the end, it will expect to be able to do osmething with it.
+* the end, it will expect to be able to do something with it.
 */
is->is_me = stsave;
if (stsave != NULL) {
@@ -3652,7 +3656,6 @@ ipf_state_del(softc, is, why)
softs->ipf_state_stats.iss_orphan++;
return refs;
}
-   MUTEX_EXIT(>is_lock);
 
fr = is->is_rule;
is->is_rule = NULL;
@@ -3664,6 +3667,7 @@ ipf_state_del(softc, is, why)
}
 
is->is_ref = 0;
+   MUTEX_EXIT(>is_lock);
 
if (is->is_tqehead[0] != NULL) {
if (ipf_deletetimeoutqueue(is->is_tqehead[0]) == 0)
___
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: r287983 - head/gnu/usr.bin/binutils/ld

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Sat Sep 19 03:53:37 2015
New Revision: 287983
URL: https://svnweb.freebsd.org/changeset/base/287983

Log:
  Replace afterinstall: hack with FILES mechanism.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/gnu/usr.bin/binutils/ld/Makefile

Modified: head/gnu/usr.bin/binutils/ld/Makefile
==
--- head/gnu/usr.bin/binutils/ld/Makefile   Sat Sep 19 03:51:19 2015
(r287982)
+++ head/gnu/usr.bin/binutils/ld/Makefile   Sat Sep 19 03:53:37 2015
(r287983)
@@ -45,6 +45,12 @@ LDADD=   ${DPADD}
 CLEANDIRS+=ldscripts
 CLEANFILES+=   ldemul-list.h stringify.sed
 
+FILES= ${LDSCRIPTS:S|^|ldscripts/|}
+FILESOWN=  ${LIBOWN}
+FILESGRP=  ${LIBGRP}
+FILESMODE= ${LIBMODE}
+FILESDIR=  ${SCRIPTDIR}
+
 HOST=  ${TARGET_TUPLE}
 LIBSEARCHPATH= \"${TOOLS_PREFIX}/lib\":\"${TOOLS_PREFIX}/usr/lib\"
 ELF_SCR_EXT=   x xbn xc xd xdc xdw xn xr xs xsc xsw xu xw
@@ -66,10 +72,6 @@ ldemul-list.h:
 stringify.sed:
ln -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
 
-afterinstall:
-   ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-   ${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
-
 GENDIRDEPS_FILTER.host+= Nusr.bin/yacc
 
 .include 
___
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: r287974 - head/share/man/man5

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 22:26:25 2015
New Revision: 287974
URL: https://svnweb.freebsd.org/changeset/base/287974

Log:
  Regenerate

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Fri Sep 18 22:22:32 2015
(r287973)
+++ head/share/man/man5/src.conf.5  Fri Sep 18 22:26:25 2015
(r287974)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 287942 2015-09-17 22:04:46Z 
bdrewery
 .\" $FreeBSD$
-.Dd September 17, 2015
+.Dd September 18, 2015
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -909,8 +909,11 @@ This must be set in the environment, mak
 not
 .Pa /etc/src.conf .
 .It Va WITH_META_MODE
-.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 287932 2015-09-17 
20:33:52Z bdrewery
+.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 287973 2015-09-18 
22:22:32Z bdrewery
 Enable building in meta mode.
+This is an experimental build feature.
+For details see
+http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm.
 .Pp
 The build is driven by dirdeps.mk using
 .Va DIRDEPS
@@ -924,7 +927,10 @@ recursively reads
 .Va DIRDEPS
 from Makefile.depend
 computing a graph of tree dependencies from the current origin.
-See http://www.crufty.net/help/sjg/dirdeps.htm
+Setting
+.Va NO_DIRDEPS
+will skip checking dirdep dependencies and will only build in the current
+directory.
 .Pp
 As each target is made
 .Xr make 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: r287977 - head/libexec/rtld-elf

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 23:12:38 2015
New Revision: 287977
URL: https://svnweb.freebsd.org/changeset/base/287977

Log:
  META_MODE: No need to fix the link in this case.
  
  The exists(${DESTDIR}...) check runs with DESTDIR being blank.  When the
  target runs it does have DESTDIR=${STAGE_OBJTOP} via bsd.sys.mk.  This
  results in the first execution warning that the symlink is missing.  The
  second run does run fine.  However, this chflags is not needed at all
  for META_MODE/STAGING since we never had this path being a schg file
  while using META_MODE.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/libexec/rtld-elf/Makefile

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Fri Sep 18 22:55:18 2015
(r287976)
+++ head/libexec/rtld-elf/Makefile  Fri Sep 18 23:12:38 2015
(r287977)
@@ -77,7 +77,7 @@ SYMBOL_MAPS+= ${.CURDIR}/${RTLD_ARCH}/Sy
 # Since moving rtld-elf to /libexec, we need to create a symlink.
 # Fixup the existing binary that's there so we can symlink over it.
 beforeinstall:
-.if exists(${DESTDIR}/usr/libexec/${PROG})
+.if exists(${DESTDIR}/usr/libexec/${PROG}) && ${MK_STAGING} == "no"
-chflags -h noschg ${DESTDIR}/usr/libexec/${PROG}
 .endif
 
___
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: r287973 - head/tools/build/options

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 22:22:32 2015
New Revision: 287973
URL: https://svnweb.freebsd.org/changeset/base/287973

Log:
  Document NO_DIRDEPS for META_MODE and give link to full details.

Modified:
  head/tools/build/options/WITH_META_MODE

Modified: head/tools/build/options/WITH_META_MODE
==
--- head/tools/build/options/WITH_META_MODE Fri Sep 18 21:36:29 2015
(r287972)
+++ head/tools/build/options/WITH_META_MODE Fri Sep 18 22:22:32 2015
(r287973)
@@ -1,5 +1,8 @@
 .\" $FreeBSD$
 Enable building in meta mode.
+This is an experimental build feature.
+For details see
+http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm.
 .Pp
 The build is driven by dirdeps.mk using
 .Va DIRDEPS
@@ -13,7 +16,10 @@ recursively reads
 .Va DIRDEPS
 from Makefile.depend
 computing a graph of tree dependencies from the current origin.
-See http://www.crufty.net/help/sjg/dirdeps.htm
+Setting
+.Va NO_DIRDEPS
+will skip checking dirdep dependencies and will only build in the current
+directory.
 .Pp
 As each target is made
 .Xr make 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: r287972 - head/include

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 21:36:29 2015
New Revision: 287972
URL: https://svnweb.freebsd.org/changeset/base/287972

Log:
  META_MODE: Avoid command changing in 2nd build.
  
  If the command to be ran changes then a rebuild is caused. Checking
  exists(${DESTDIR}...) from make results in this on the 2nd and
  possibly subsequent builds due to staging during build.  Avoid this
  by always running the existence check in the make sh command.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/include/Makefile

Modified: head/include/Makefile
==
--- head/include/Makefile   Fri Sep 18 21:18:44 2015(r287971)
+++ head/include/Makefile   Fri Sep 18 21:36:29 2015(r287972)
@@ -172,12 +172,12 @@ compat:
 copies:
 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \
${_MARCHS}
-.if exists(${DESTDIR}${INCLUDEDIR}/$i)
-   cd ${DESTDIR}${INCLUDEDIR}/$i; \
-   for h in *.h; do \
-   if [ -L $$h ]; then rm -f $$h; fi; \
-   done
-.endif
+   if [ -d ${DESTDIR}${INCLUDEDIR}/$i ]; then \
+   cd ${DESTDIR}${INCLUDEDIR}/$i; \
+   for h in *.h; do \
+   if [ -L $$h ]; then rm -f $$h; fi; \
+   done; \
+   fi
 .endfor
 .for i in ${LDIRS} 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS}
cd ${.CURDIR}/../sys; \
___
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: r287976 - head/share/msgdef

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 22:55:18 2015
New Revision: 287976
URL: https://svnweb.freebsd.org/changeset/base/287976

Log:
  Remove rm -Rf beforeinstall hack that was needed due to a change that
  only lasted 3 days in HEAD in 2001 (r88348 - r88459)
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/msgdef/Makefile

Modified: head/share/msgdef/Makefile
==
--- head/share/msgdef/Makefile  Fri Sep 18 22:28:13 2015(r287975)
+++ head/share/msgdef/Makefile  Fri Sep 18 22:55:18 2015(r287976)
@@ -134,11 +134,4 @@ SYMLINKS+= ../${lang_terr:C/:.*$//}.${en
 .endfor
 .endfor
 
-beforeinstall:
-.for locale in ${LOCALES}
-.if exists(${DESTDIR}${LOCALEDIR}/${locale}/LC_MESSAGES/)
-   rm -rf ${DESTDIR}${LOCALEDIR}/${locale}/LC_MESSAGES
-.endif
-.endfor
-
 .include 
___
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: r287970 - head/usr.bin/tip/tip

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 21:01:52 2015
New Revision: 287970
URL: https://svnweb.freebsd.org/changeset/base/287970

Log:
  Don't hide build commands.

Modified:
  head/usr.bin/tip/tip/Makefile

Modified: head/usr.bin/tip/tip/Makefile
==
--- head/usr.bin/tip/tip/Makefile   Fri Sep 18 20:28:37 2015
(r287969)
+++ head/usr.bin/tip/tip/Makefile   Fri Sep 18 21:01:52 2015
(r287970)
@@ -53,5 +53,5 @@ acutab.o log.o remote.o: Makefile
 # is no cu(1) with the schg-bit set.
 beforeinstall:
 .if exists(${DESTDIR}${BINDIR}/cu)
-   -@chflags noschg ${DESTDIR}${BINDIR}/cu
+   -chflags noschg ${DESTDIR}${BINDIR}/cu
 .endif
___
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: r287971 - head/cddl/lib/libdtrace

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 21:18:44 2015
New Revision: 287971
URL: https://svnweb.freebsd.org/changeset/base/287971

Log:
  Use FILES for installing the dtrace scripts.
  
  The BSD.usr.dist mtree always creates /usr/lib/dtrace so there is no
  need to check if it exists.
  
  The FILES mechanism already supports LIBRARIES_ONLY.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/cddl/lib/libdtrace/Makefile

Modified: head/cddl/lib/libdtrace/Makefile
==
--- head/cddl/lib/libdtrace/MakefileFri Sep 18 21:01:52 2015
(r287970)
+++ head/cddl/lib/libdtrace/MakefileFri Sep 18 21:18:44 2015
(r287971)
@@ -56,6 +56,10 @@ DSRCS=   errno.d \
udp.d   \
unistd.d
 
+FILES= ${DSRCS}
+FILESDIR=  /usr/lib/dtrace
+FILESMODE= ${NOBINMODE}
+
 WARNS?=1
 
 CFLAGS+=   -I${.OBJDIR} -I${.CURDIR} \
@@ -120,11 +124,4 @@ dt_names.c:
 
 beforedepend:  dt_errtags.c dt_names.c
 
-beforeinstall:
-.if !defined(LIBRARIES_ONLY) && exists(${DESTDIR}/usr/lib/dtrace)
-.for file in ${DSRCS}
-   ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} ${.CURDIR}/${file} 
${DESTDIR}/usr/lib/dtrace
-.endfor
-.endif
-
 .include 
___
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: r287975 - head/share/mk

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 22:28:13 2015
New Revision: 287975
URL: https://svnweb.freebsd.org/changeset/base/287975

Log:
  Garbage collect _SHLIBDIRPREFIX leftovers from r284898.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkFri Sep 18 22:26:25 2015(r287974)
+++ head/share/mk/bsd.lib.mkFri Sep 18 22:28:13 2015(r287975)
@@ -214,9 +214,8 @@ ${SHLIB_NAME_FULL}: beforelinking
 .endif
 
 .if defined(SHLIB_LINK)
-# ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building
-# and when building 32 bits library shims.  ${_SHLIBDIRPREFIX} is the directory
-# prefix where shared objects will be installed by the install target.
+# ${_LDSCRIPTROOT} is needed when cross-building
+# and when building 32 bits library shims.
 #
 # ${_LDSCRIPTROOT} is the directory prefix that will be used when generating
 # ld(1) scripts.  The crosstools' ld is configured to lookup libraries in an

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkFri Sep 18 22:26:25 2015(r287974)
+++ head/share/mk/bsd.sys.mkFri Sep 18 22:28:13 2015(r287975)
@@ -186,7 +186,6 @@ staging stage_libs stage_files stage_as 
 .else
 # allow targets like beforeinstall to be leveraged
 DESTDIR= ${STAGE_OBJTOP}
-_SHLIBDIRPREFIX= ${STAGE_OBJTOP}
 
 .if commands(beforeinstall)
 .if !empty(_LIBS) || ${MK_STAGING_PROG} != "no"
___
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: r287957 - head/sys/cam/ctl

2015-09-18 Thread Alexander Motin
Author: mav
Date: Fri Sep 18 12:08:00 2015
New Revision: 287957
URL: https://svnweb.freebsd.org/changeset/base/287957

Log:
  Kill HA link and shutdown the threads on shutdown.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_ha.c
  head/sys/cam/ctl/ctl_ha.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Fri Sep 18 10:44:25 2015(r287956)
+++ head/sys/cam/ctl/ctl.c  Fri Sep 18 12:08:00 2015(r287957)
@@ -1581,13 +1581,12 @@ ctl_shutdown(void)
softc = (struct ctl_softc *)control_softc;
 
if (softc->is_single == 0) {
+   ctl_ha_msg_shutdown(softc);
if (ctl_ha_msg_deregister(CTL_HA_CHAN_CTL)
-   != CTL_HA_STATUS_SUCCESS) {
-   printf("ctl_shutdown: ctl_ha_msg_deregister failed.\n");
-   }
-   if (ctl_ha_msg_shutdown(softc) != CTL_HA_STATUS_SUCCESS) {
-   printf("ctl_shutdown: ctl_ha_msg_shutdown failed.\n");
-   }
+   != CTL_HA_STATUS_SUCCESS)
+   printf("%s: ctl_ha_msg_deregister failed.\n", __func__);
+   if (ctl_ha_msg_destroy(softc) != CTL_HA_STATUS_SUCCESS)
+   printf("%s: ctl_ha_msg_destroy failed.\n", __func__);
ctl_frontend_deregister(_frontend);
}
 

Modified: head/sys/cam/ctl/ctl_ha.c
==
--- head/sys/cam/ctl/ctl_ha.c   Fri Sep 18 10:44:25 2015(r287956)
+++ head/sys/cam/ctl/ctl_ha.c   Fri Sep 18 12:08:00 2015(r287957)
@@ -155,6 +155,8 @@ struct ha_softc {
int  ha_receiving;
int  ha_wakeup;
int  ha_disconnect;
+   int  ha_shutdown;
+   eventhandler_tag ha_shutdown_eh;
TAILQ_HEAD(, ctl_ha_dt_req) ha_dts;
 } ha_softc;
 
@@ -568,10 +570,12 @@ ctl_ha_conn_thread(void *arg)
int error;
 
while (1) {
-   if (softc->ha_disconnect) {
+   if (softc->ha_disconnect || softc->ha_shutdown) {
ctl_ha_close(softc);
ctl_ha_lclose(softc);
softc->ha_disconnect = 0;
+   if (softc->ha_shutdown)
+   break;
} else if (softc->ha_so != NULL &&
(softc->ha_so->so_error ||
 softc->ha_so->so_rcv.sb_state & SBS_CANTRCVMORE))
@@ -614,6 +618,11 @@ ctl_ha_conn_thread(void *arg)
softc->ha_wakeup = 0;
mtx_unlock(>ha_lock);
}
+   mtx_lock(>ha_lock);
+   softc->ha_shutdown = 2;
+   wakeup(>ha_wakeup);
+   mtx_unlock(>ha_lock);
+   kthread_exit();
 }
 
 static int
@@ -936,6 +945,8 @@ ctl_ha_msg_init(struct ctl_softc *ctl_so
mtx_destroy(>ha_lock);
return (CTL_HA_STATUS_ERROR);
}
+   softc->ha_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync,
+   ctl_ha_msg_shutdown, ctl_softc, SHUTDOWN_PRI_FIRST);
SYSCTL_ADD_PROC(_softc->sysctl_ctx,
SYSCTL_CHILDREN(ctl_softc->sysctl_tree),
OID_AUTO, "ha_peer", CTLTYPE_STRING | CTLFLAG_RWTUN,
@@ -949,14 +960,40 @@ ctl_ha_msg_init(struct ctl_softc *ctl_so
return (CTL_HA_STATUS_SUCCESS);
 };
 
-ctl_ha_status
+void
 ctl_ha_msg_shutdown(struct ctl_softc *ctl_softc)
 {
struct ha_softc *softc = _softc;
 
-   if (ctl_ha_msg_deregister(CTL_HA_CHAN_DATA) != CTL_HA_STATUS_SUCCESS) {
-   printf("%s: ctl_ha_msg_deregister failed.\n", __func__);
+   /* Disconnect and shutdown threads. */
+   mtx_lock(>ha_lock);
+   if (softc->ha_shutdown < 2) {
+   softc->ha_shutdown = 1;
+   softc->ha_wakeup = 1;
+   wakeup(>ha_wakeup);
+   while (softc->ha_shutdown < 2) {
+   msleep(>ha_wakeup, >ha_lock, 0,
+   "shutdown", hz);
+   }
}
+   mtx_unlock(>ha_lock);
+};
+
+ctl_ha_status
+ctl_ha_msg_destroy(struct ctl_softc *ctl_softc)
+{
+   struct ha_softc *softc = _softc;
+
+   if (softc->ha_shutdown_eh != NULL) {
+   EVENTHANDLER_DEREGISTER(shutdown_pre_sync,
+   softc->ha_shutdown_eh);
+   softc->ha_shutdown_eh = NULL;
+   }
+
+   ctl_ha_msg_shutdown(ctl_softc); /* Just in case. */
+
+   if (ctl_ha_msg_deregister(CTL_HA_CHAN_DATA) != CTL_HA_STATUS_SUCCESS)
+   printf("%s: ctl_ha_msg_deregister failed.\n", __func__);
 
mtx_destroy(>ha_lock);
return (CTL_HA_STATUS_SUCCESS);

Modified: head/sys/cam/ctl/ctl_ha.h
==
--- head/sys/cam/ctl/ctl_ha.h   Fri Sep 18 10:44:25 2015(r287956)
+++ head/sys/cam/ctl/ctl_ha.h   Fri Sep 18 12:08:00 

svn commit: r287956 - head/sys/cam/scsi

2015-09-18 Thread Alexander Motin
Author: mav
Date: Fri Sep 18 10:44:25 2015
New Revision: 287956
URL: https://svnweb.freebsd.org/changeset/base/287956

Log:
  Update list of opcodes to 5/26/15.

Modified:
  head/sys/cam/scsi/scsi_all.c

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cFri Sep 18 10:23:17 2015
(r287955)
+++ head/sys/cam/scsi/scsi_all.cFri Sep 18 10:44:25 2015
(r287956)
@@ -175,7 +175,7 @@ static struct op_table_entry scsi_op_cod
 *
 * SCSI Operation Codes
 * Numeric Sorted Listing
-* as of  3/11/08
+* as of  5/26/15
 *
 * D - DIRECT ACCESS DEVICE (SBC-2)device column key
 * .T - SEQUENTIAL ACCESS DEVICE (SSC-2)   -
@@ -501,17 +501,22 @@ static struct op_table_entry scsi_op_cod
{ 0x93, D, "WRITE SAME(16)" },
/* 93   M  ERASE(16) */
{ 0x93, T, "ERASE(16)" },
-   /* 94 [usage proposed by SCSI Socket Services project] */
-   /* 95 [usage proposed by SCSI Socket Services project] */
-   /* 96 [usage proposed by SCSI Socket Services project] */
-   /* 97 [usage proposed by SCSI Socket Services project] */
+   /* 94  O   ZBC OUT */
+   { 0x94, D, "ZBC OUT" },
+   /* 95  O   ZBC OUT */
+   { 0x95, D, "ZBC OUT" },
+   /* 96 */
+   /* 97 */
/* 98 */
/* 99 */
-   /* 9A */
-   /* 9B */
+   /* 9A  O   WRITE STREAM(16) */
+   { 0x9A, D, "WRITE STREAM(16)" },
+   /* 9B  OO OOO  READ BUFFER(16) */
+   { 0x9B, ALL & ~(B) , "READ BUFFER(16)" },
/* 9C  O  WRITE ATOMIC(16) */
{ 0x9C, D, "WRITE ATOMIC(16)" },
-   /* 9D */
+   /* 9D  SERVICE ACTION BIDIRECTIONAL */
+   { 0x9D, ALL, "SERVICE ACTION BIDIRECTIONAL" },
/* XXX KDM ALL for this?  op-num.txt defines it for none.. */
/* 9E  SERVICE ACTION IN(16) */
{ 0x9E, ALL, "SERVICE ACTION IN(16)" },
___
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: r287952 - head/sys/netinet6

2015-09-18 Thread Alexander V. Chernikov
Author: melifaro
Date: Fri Sep 18 07:18:10 2015
New Revision: 287952
URL: https://svnweb.freebsd.org/changeset/base/287952

Log:
  * Simplify logic besides llchange variable.
  * Refresh nd6_is_router() comment.

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Fri Sep 18 06:54:52 2015(r287951)
+++ head/sys/netinet6/nd6.c Fri Sep 18 07:18:10 2015(r287952)
@@ -1618,15 +1618,15 @@ nd6_is_router(int type, int code, int is
 * neighbor cache, this is similar to (6).
 * This case is rare but we figured that we MUST NOT set IsRouter.
 *
-* newentry olladdr  lladdr  llchange   NS  RS  RA  redir
+*   is_new  old_addr new_addr  NS  RS  RA  redir
 *  D R
-*  0   n   n   --  (1) c   ? s
-*  0   y   n   --  (2) c   s s
-*  0   n   y   --  (3) c   s s
-*  0   y   y   n   (4) c   s s
-*  0   y   y   y   (5) c   s s
-*  1   --  n   --  (6) c   c   c s
-*  1   --  y   --  (7) c   c   s   c s
+*  0   n   n   (1) c   ? s
+*  0   y   n   (2) c   s s
+*  0   n   y   (3) c   s s
+*  0   y   y   (4) c   s s
+*  0   y   y   (5) c   s s
+*  1   --  n   (6) c   c   c s
+*  1   --  y   (7) c   c   s   c s
 *
 *  (c=clear s=set)
 */
@@ -1751,14 +1751,16 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
if (olladdr && lladdr) {
llchange = bcmp(lladdr, >ll_addr,
ifp->if_addrlen);
-   } else
+   } else if (!olladdr && lladdr)
+   llchange = 1;
+   else
llchange = 0;
 
/*
 * newentry olladdr  lladdr  llchange   (*=record)
 *  0   n   n   --  (1)
 *  0   y   n   --  (2)
-*  0   n   y   --  (3) * STALE
+*  0   n   y   y   (3) * STALE
 *  0   y   y   n   (4) *
 *  0   y   y   y   (5) * STALE
 *  1   --  n   --  (6)   NOSTATE(= PASSIVE)
@@ -1776,8 +1778,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
}
 
if (!is_newentry) {
-   if ((!olladdr && lladdr != NULL) || /* (3) */
-   (olladdr && lladdr != NULL && llchange)) {  /* (5) */
+   if (llchange != 0) {/* (3,5) */
do_update = 1;
newstate = ND6_LLINFO_STALE;
} else  /* (1-2,4) */
___
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: r287954 - head/sys/dev/usb/wlan

2015-09-18 Thread Adrian Chadd
Author: adrian
Date: Fri Sep 18 07:55:33 2015
New Revision: 287954
URL: https://svnweb.freebsd.org/changeset/base/287954

Log:
  Add in a temporary (hah!) workaround for net80211 scanning versus NIC
  requirements.
  
  Don't start the opmode and join path until a pending survey is finished.
  This seems to reliably fix things.
  
  Ideally I'd just finish off the net80211 pluggable scan stuff and implement
  the methods here so if_rsu can just drive the scan machinery.
  However, that's a .. later thing.
  
  Whilst here, remove the getbuf debugging; it's okay to run out of transmit
  buffers under load; it however isn't okay to not be able to send commands.
  I'll fix that later.

Modified:
  head/sys/dev/usb/wlan/if_rsu.c
  head/sys/dev/usb/wlan/if_rsureg.h

Modified: head/sys/dev/usb/wlan/if_rsu.c
==
--- head/sys/dev/usb/wlan/if_rsu.c  Fri Sep 18 07:26:34 2015
(r287953)
+++ head/sys/dev/usb/wlan/if_rsu.c  Fri Sep 18 07:55:33 2015
(r287954)
@@ -742,9 +742,7 @@ _rsu_getbuf(struct rsu_softc *sc)
STAILQ_REMOVE_HEAD(>sc_tx_inactive, next);
else
bf = NULL;
-   if (bf == NULL)
-   DPRINTF("out of xmit buffers\n");
-return (bf);
+   return (bf);
 }
 
 static struct rsu_data *
@@ -755,8 +753,6 @@ rsu_getbuf(struct rsu_softc *sc)
RSU_ASSERT_LOCKED(sc);
 
bf = _rsu_getbuf(sc);
-   if (bf == NULL)
-   DPRINTF("stop queue\n");
return (bf);
 }
 
@@ -947,6 +943,8 @@ rsu_fw_cmd(struct rsu_softc *sc, uint8_t
int cmdsz;
int xferlen;
 
+   RSU_ASSERT_LOCKED(sc);
+
data = rsu_getbuf(sc);
if (data == NULL)
return (ENOMEM);
@@ -1124,6 +1122,9 @@ rsu_site_survey(struct rsu_softc *sc, st
 {
struct r92s_fw_cmd_sitesurvey cmd;
struct ieee80211com *ic = >sc_ic;
+   int r;
+
+   RSU_ASSERT_LOCKED(sc);
 
memset(, 0, sizeof(cmd));
if ((ic->ic_flags & IEEE80211_F_ASCAN) || sc->sc_scan_pass == 1)
@@ -1137,7 +1138,11 @@ rsu_site_survey(struct rsu_softc *sc, st
 
}
DPRINTF("sending site survey command, pass=%d\n", sc->sc_scan_pass);
-   return (rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, , sizeof(cmd)));
+   r = rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, , sizeof(cmd));
+   if (r == 0) {
+   sc->sc_scanning = 1;
+   }
+   return (r);
 }
 
 static int
@@ -1152,6 +1157,27 @@ rsu_join_bss(struct rsu_softc *sc, struc
uint8_t *frm;
uint8_t opmode;
int error;
+   int cnt;
+   char *msg = "rsujoin";
+
+   RSU_ASSERT_LOCKED(sc);
+
+   /*
+* Until net80211 scanning doesn't automatically finish
+* before we tell it to, let's just wait until any pending
+* scan is done.
+*
+* XXX TODO: yes, this releases and re-acquires the lock.
+* We should re-verify the state whenever we re-attempt this!
+*/
+   cnt = 0;
+   while (sc->sc_scanning && cnt < 10) {
+   device_printf(sc->sc_dev,
+   "%s: still scanning! (attempt %d)\n",
+   __func__, cnt);
+   msleep(msg, >sc_mtx, 0, msg, hz / 2);
+   cnt++;
+   }
 
/* Let the FW decide the opmode based on the capinfo field. */
opmode = NDIS802_11AUTOUNKNOWN;
@@ -1309,12 +1335,18 @@ rsu_event_join_bss(struct rsu_softc *sc,
RSU_DPRINTF(sc, RSU_DEBUG_STATE | RSU_DEBUG_FWCMD,
"%s: Rx join BSS event len=%d res=%d\n",
__func__, len, res);
+
+   /*
+* XXX Don't do this; there's likely a better way to tell
+* the caller we failed.
+*/
if (res <= 0) {
RSU_UNLOCK(sc);
ieee80211_new_state(vap, IEEE80211_S_SCAN, -1);
RSU_LOCK(sc);
return;
}
+
tmp = le32toh(rsp->associd);
if (tmp >= vap->iv_max_aid) {
DPRINTF("Assoc ID overflow\n");
@@ -1376,8 +1408,14 @@ rsu_rx_event(struct rsu_softc *sc, uint8
RSU_DPRINTF(sc, RSU_DEBUG_SCAN,
"%s: site survey pass %d done, found %d BSS\n",
__func__, sc->sc_scan_pass, le32toh(*(uint32_t *)buf));
+   sc->sc_scanning = 0;
if (vap->iv_state != IEEE80211_S_SCAN)
break;  /* Ignore if not scanning. */
+
+   /*
+* XXX TODO: This needs to be done without a transition to
+* the SCAN state again.  Grr.
+*/
if (sc->sc_scan_pass == 0 && vap->iv_des_nssid != 0) {
/* Schedule a directed scan for hidden APs. */
/* XXX bad! */
@@ -2594,6 +2632,7 @@ rsu_init(struct rsu_softc *sc)
 
/* We're ready to go. */
sc->sc_running = 1;
+   sc->sc_scanning = 0;
return;
 fail:
   

svn commit: r287959 - head/sys/arm64/arm64

2015-09-18 Thread Andrew Turner
Author: andrew
Date: Fri Sep 18 13:44:15 2015
New Revision: 287959
URL: https://svnweb.freebsd.org/changeset/base/287959

Log:
  Don't read the floating-point registers for now. We will need to enable the
  VFP around the read of these instructions as they may raise an exception.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm64/arm64/machdep.c

Modified: head/sys/arm64/arm64/machdep.c
==
--- head/sys/arm64/arm64/machdep.c  Fri Sep 18 12:50:03 2015
(r287958)
+++ head/sys/arm64/arm64/machdep.c  Fri Sep 18 13:44:15 2015
(r287959)
@@ -894,8 +894,11 @@ DB_SHOW_COMMAND(specialregs, db_show_spr
PRINT_REG(elr_el1);
PRINT_REG(esr_el1);
PRINT_REG(far_el1);
+#if 0
+   /* ARM64TODO: Enable VFP before reading floating-point registers */
PRINT_REG(fpcr);
PRINT_REG(fpsr);
+#endif
PRINT_REG(id_aa64afr0_el1);
PRINT_REG(id_aa64afr1_el1);
PRINT_REG(id_aa64dfr0_el1);
___
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: r287960 - in head/sys/arm64: arm64 include

2015-09-18 Thread Konstantin Belousov
Author: kib
Date: Fri Sep 18 16:52:18 2015
New Revision: 287960
URL: https://svnweb.freebsd.org/changeset/base/287960

Log:
  Clear exclusive monitors when handling data aborts, the monitors are
  in unknown state per spec.
  
  Reviewed by:  andrew (previous version)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3668

Modified:
  head/sys/arm64/arm64/trap.c
  head/sys/arm64/include/cpufunc.h

Modified: head/sys/arm64/arm64/trap.c
==
--- head/sys/arm64/arm64/trap.c Fri Sep 18 13:44:15 2015(r287959)
+++ head/sys/arm64/arm64/trap.c Fri Sep 18 16:52:18 2015(r287960)
@@ -155,6 +155,13 @@ data_abort(struct trapframe *frame, uint
uint64_t far;
int error, sig, ucode;
 
+   /*
+* According to the ARMv8-A rev. A.g, B2.10.5 "Load-Exclusive
+* and Store-Exclusive instruction usage restrictions", state
+* of the exclusive monitors after data abort exception is unknown.
+*/
+   clrex();
+
 #ifdef KDB
if (kdb_active) {
kdb_reenter();

Modified: head/sys/arm64/include/cpufunc.h
==
--- head/sys/arm64/include/cpufunc.hFri Sep 18 13:44:15 2015
(r287959)
+++ head/sys/arm64/include/cpufunc.hFri Sep 18 16:52:18 2015
(r287960)
@@ -108,6 +108,17 @@ get_mpidr(void)
return (mpidr);
 }
 
+static __inline void
+clrex(void)
+{
+
+   /*
+* Ensure compiler barrier, otherwise the monitor clear might
+* occur too late for us ?
+*/
+   __asm __volatile("clrex" : : : "memory");
+}
+
 #definecpu_nullop()arm64_nullop()
 #definecpufunc_nullop()arm64_nullop()
 #definecpu_setttb(a)   arm64_setttb(a)
___
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: r287966 - head/share/mk

2015-09-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Sep 18 18:57:09 2015
New Revision: 287966
URL: https://svnweb.freebsd.org/changeset/base/287966

Log:
  Avoid /usr/obj// from r287899

Modified:
  head/share/mk/local.meta.sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Fri Sep 18 17:39:31 2015
(r287965)
+++ head/share/mk/local.meta.sys.mk Fri Sep 18 18:57:09 2015
(r287966)
@@ -29,7 +29,7 @@ SB_OBJROOT ?= ${SB}/obj/
 # this is what we use below
 OBJROOT ?= ${SB_OBJROOT}
 .endif
-OBJROOT ?= /usr/obj/${SRCTOP}/
+OBJROOT ?= /usr/obj${SRCTOP}/
 .if ${OBJROOT:M*/} != ""
 OBJROOT:= ${OBJROOT:H:tA}/
 .else
___
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: r287969 - head/lib/libc/sys

2015-09-18 Thread Xin LI
Author: delphij
Date: Fri Sep 18 20:28:37 2015
New Revision: 287969
URL: https://svnweb.freebsd.org/changeset/base/287969

Log:
  There is no HP 300 support in FreeBSD anymore, so remove the obsolete
  BUGS section.
  
  While I'm there also bump Dd date.
  
  MFC after:2 weeks

Modified:
  head/lib/libc/sys/reboot.2

Modified: head/lib/libc/sys/reboot.2
==
--- head/lib/libc/sys/reboot.2  Fri Sep 18 20:11:10 2015(r287968)
+++ head/lib/libc/sys/reboot.2  Fri Sep 18 20:28:37 2015(r287969)
@@ -28,7 +28,7 @@
 .\" @(#)reboot.2   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd September 18, 2015
 .Dt REBOOT 2
 .Os
 .Sh NAME
@@ -166,8 +166,3 @@ The
 .Fn reboot
 system call appeared in
 .Bx 4.0 .
-.Sh BUGS
-The HP300 implementation supports neither
-.Dv RB_DFLTROOT
-nor
-.Dv RB_KDB .
___
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: r287934 - head/sys/boot/efi/loader

2015-09-18 Thread John Baldwin
On Thursday, September 17, 2015 10:30:15 PM Bjoern A. Zeeb wrote:
> 
> > On 17 Sep 2015, at 20:43 , John Baldwin  wrote:
> > 
> > On Thursday, September 17, 2015 08:36:47 PM John Baldwin wrote:
> >> Author: jhb
> >> Date: Thu Sep 17 20:36:46 2015
> >> New Revision: 287934
> >> URL: https://svnweb.freebsd.org/changeset/base/287934
> >> 
> >> Log:
> >>  The EFI boot loader allocates a single chunk of contiguous memory to
> >>  hold the kernel, modules, and any other loaded data.  This memory block
> >>  is relocated to the kernel's expected location during the transfer of
> >>  control from the loader to the kernel.
> >> 
> >>  The GENERIC kernel on amd64 has recently grown such that a kernel + zfs.ko
> >>  no longer fits in the default staging size.  Bump the default size from
> >>  32MB to 48MB to provide more breathing room.
> > 
> > I believe that this should work fine for any system with 64MB of RAM.  One
> > downside of the static size is that the loader fails if it can't allocate
> > a contiguous staging size (it isn't able to grow the staging area on
> > demand).
> 
> how do md_images work in that case?

The md_image has to fit into the same staging area (kernel plus any other
files loaded by the loader including modules and md_images all have to fit
in the staging area).  That was the original motivation for making the
staging area a build-time tunable rather than always hardcoded at 32MB so
that people who wished to deploy a large md_image can use a make flag to
build a loader with a larger staging size (I tested this with a 200+MB
mfsroot).

-- 
John Baldwin
___
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: r287961 - head/sys/arm64/arm64

2015-09-18 Thread Konstantin Belousov
Author: kib
Date: Fri Sep 18 17:09:59 2015
New Revision: 287961
URL: https://svnweb.freebsd.org/changeset/base/287961

Log:
  Do not execute exception handlers with disabled interrupts.
  
  We should not call vm_fault(), or send a signal, with interrupts
  disabled.  MI kernel code is not prepared for such environment, not to
  mention that this increases system latency, since code appears to be
  executing as being under spinlock.
  
  The FAR register for data aborts is read before the interrupts are
  enabled, to avoid its corruption due to nested exception or context
  switch.
  
  Add asserts, similar to the checks done by other architectures, about
  not taking page faults in non-sleepable contexts, rather than die with
  late and somewhat confusing witness diagnostic.
  
  Reviewed by:  andrew
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3669

Modified:
  head/sys/arm64/arm64/trap.c

Modified: head/sys/arm64/arm64/trap.c
==
--- head/sys/arm64/arm64/trap.c Fri Sep 18 16:52:18 2015(r287960)
+++ head/sys/arm64/arm64/trap.c Fri Sep 18 17:09:59 2015(r287961)
@@ -76,6 +76,7 @@ extern register_t fsu_intr_fault;
 void do_el1h_sync(struct trapframe *);
 void do_el0_sync(struct trapframe *);
 void do_el0_error(struct trapframe *);
+static void print_registers(struct trapframe *frame);
 
 int (*dtrace_invop_jump_addr)(struct trapframe *);
 
@@ -144,7 +145,7 @@ svc_handler(struct trapframe *frame)
 }
 
 static void
-data_abort(struct trapframe *frame, uint64_t esr, int lower)
+data_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int lower)
 {
struct vm_map *map;
struct thread *td;
@@ -152,7 +153,6 @@ data_abort(struct trapframe *frame, uint
struct pcb *pcb;
vm_prot_t ftype;
vm_offset_t va;
-   uint64_t far;
int error, sig, ucode;
 
/*
@@ -181,17 +181,23 @@ data_abort(struct trapframe *frame, uint
return;
}
 
-   far = READ_SPECIALREG(far_el1);
-   p = td->td_proc;
+   KASSERT(td->td_md.md_spinlock_count == 0,
+   ("data abort with spinlock held"));
+   if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK |
+   WARN_GIANTOK, NULL, "Kernel page fault") != 0) {
+   print_registers(frame);
+   panic("data abort in critical section or under mutex");
+   }
 
+   p = td->td_proc;
if (lower)
-   map = >td_proc->p_vmspace->vm_map;
+   map = >p_vmspace->vm_map;
else {
/* The top bit tells us which range to use */
if ((far >> 63) == 1)
map = kernel_map;
else
-   map = >td_proc->p_vmspace->vm_map;
+   map = >p_vmspace->vm_map;
}
 
va = trunc_page(far);
@@ -246,7 +252,7 @@ void
 do_el1h_sync(struct trapframe *frame)
 {
uint32_t exception;
-   uint64_t esr;
+   uint64_t esr, far;
 
/* Read the esr register to get the exception details */
esr = READ_SPECIALREG(esr_el1);
@@ -281,7 +287,9 @@ do_el1h_sync(struct trapframe *frame)
print_registers(frame);
panic("VFP exception in the kernel");
case EXCP_DATA_ABORT:
-   data_abort(frame, esr, 0);
+   far = READ_SPECIALREG(far_el1);
+   intr_enable();
+   data_abort(frame, esr, far, 0);
break;
case EXCP_BRK:
 #ifdef KDTRACE_HOOKS
@@ -328,7 +336,7 @@ do_el0_sync(struct trapframe *frame)
 {
struct thread *td;
uint32_t exception;
-   uint64_t esr;
+   uint64_t esr, far;
 
/* Check we have a sane environment when entering from userland */
KASSERT((uintptr_t)get_pcpu() >= VM_MIN_KERNEL_ADDRESS,
@@ -337,6 +345,13 @@ do_el0_sync(struct trapframe *frame)
 
esr = READ_SPECIALREG(esr_el1);
exception = ESR_ELx_EXCEPTION(esr);
+   switch (exception) {
+   case EXCP_INSN_ABORT_L:
+   case EXCP_DATA_ABORT_L:
+   case EXCP_DATA_ABORT:
+   far = READ_SPECIALREG(far_el1);
+   }
+   intr_enable();
 
CTR4(KTR_TRAP,
"do_el0_sync: curthread: %p, esr %lx, elr: %lx, frame: %p",
@@ -352,18 +367,12 @@ do_el0_sync(struct trapframe *frame)
 #endif
break;
case EXCP_SVC:
-   /*
-* Ensure the svc_handler is being run with interrupts enabled.
-* They will be automatically restored when returning from
-* exception handler.
-*/
-   intr_enable();
svc_handler(frame);
break;
case EXCP_INSN_ABORT_L:
case EXCP_DATA_ABORT_L:
case EXCP_DATA_ABORT:
-   data_abort(frame, esr, 1);
+   data_abort(frame, esr, far, 1);
 

svn commit: r287963 - in stable/10: sbin/ipfw sys/netinet sys/netpfil/ipfw

2015-09-18 Thread Alexander V. Chernikov
Author: melifaro
Date: Fri Sep 18 17:29:24 2015
New Revision: 287963
URL: https://svnweb.freebsd.org/changeset/base/287963

Log:
  MFC r266310
  
Fix wrong formatting of 0.0.0.0/X table records in ipfw(8).
  
Add `flags` u16 field to the hole in ipfw_table_xentry structure.
Kernel has been guessing address family for supplied record based
on xent length size.
Userland, however, has been getting fixed-size ipfw_table_xentry structures
guessing address family by checking address by IN6_IS_ADDR_V4COMPAT().
  
Fix this behavior by providing specific IPFW_TCF_INET flag for IPv4 records.
  
  PR:   bin/189471,kern/200169

Modified:
  stable/10/sbin/ipfw/ipfw2.c
  stable/10/sys/netinet/ip_fw.h
  stable/10/sys/netpfil/ipfw/ip_fw_table.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/ipfw/ipfw2.c
==
--- stable/10/sbin/ipfw/ipfw2.c Fri Sep 18 17:17:40 2015(r287962)
+++ stable/10/sbin/ipfw/ipfw2.c Fri Sep 18 17:29:24 2015(r287963)
@@ -4389,7 +4389,7 @@ table_list(uint16_t num, int need_header
addr6 = >k.addr6;
 
 
-   if (IN6_IS_ADDR_V4COMPAT(addr6)) {
+   if ((xent->flags & IPFW_TCF_INET) != 0) {
/* IPv4 address */
inet_ntop(AF_INET, >s6_addr32[3], tbuf, 
sizeof(tbuf));
} else {

Modified: stable/10/sys/netinet/ip_fw.h
==
--- stable/10/sys/netinet/ip_fw.h   Fri Sep 18 17:17:40 2015
(r287962)
+++ stable/10/sys/netinet/ip_fw.h   Fri Sep 18 17:29:24 2015
(r287963)
@@ -614,6 +614,7 @@ typedef struct  _ipfw_table_xentry {
uint8_t type;   /* entry type   */
uint8_t masklen;/* mask length  */
uint16_ttbl;/* table number */
+   uint16_tflags;  /* record flags */
uint32_tvalue;  /* value*/
union {
/* Longest field needs to be aligned by 4-byte boundary */
@@ -621,6 +622,7 @@ typedef struct  _ipfw_table_xentry {
chariface[IF_NAMESIZE]; /* interface name   */
} k;
 } ipfw_table_xentry;
+#defineIPFW_TCF_INET   0x01/* CIDR flags: IPv4 record  
*/
 
 typedef struct _ipfw_table {
u_int32_t   size;   /* size of entries in bytes */

Modified: stable/10/sys/netpfil/ipfw/ip_fw_table.c
==
--- stable/10/sys/netpfil/ipfw/ip_fw_table.cFri Sep 18 17:17:40 2015
(r287962)
+++ stable/10/sys/netpfil/ipfw/ip_fw_table.cFri Sep 18 17:29:24 2015
(r287963)
@@ -697,6 +697,7 @@ dump_table_xentry_base(struct radix_node
xent->masklen = 33 - ffs(ntohl(n->mask.sin_addr.s_addr));
/* Save IPv4 address as deprecated IPv6 compatible */
xent->k.addr6.s6_addr32[3] = n->addr.sin_addr.s_addr;
+   xent->flags = IPFW_TCF_INET;
xent->value = n->value;
tbl->cnt++;
return (0);
___
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: r287964 - in head: lib/libc/sys sys/kern sys/sys

2015-09-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Sep 18 17:32:22 2015
New Revision: 287964
URL: https://svnweb.freebsd.org/changeset/base/287964

Log:
  Kernel part of reroot support - a way to change rootfs without reboot.
  
  Note that the mountlist manipulations are somewhat fragile, and not very
  pretty.  The reason for this is to avoid changing vfs_mountroot(), which
  is (obviously) rather mission-critical, but not very well documented,
  and thus hard to test properly.  It might be possible to rework it to use
  its own simple root mount mechanism instead of vfs_mountroot().
  
  Reviewed by:  kib@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D2698

Modified:
  head/lib/libc/sys/reboot.2
  head/sys/kern/kern_shutdown.c
  head/sys/kern/vfs_mountroot.c
  head/sys/sys/reboot.h

Modified: head/lib/libc/sys/reboot.2
==
--- head/lib/libc/sys/reboot.2  Fri Sep 18 17:29:24 2015(r287963)
+++ head/lib/libc/sys/reboot.2  Fri Sep 18 17:32:22 2015(r287964)
@@ -113,6 +113,13 @@ Normally, the disks are sync'd (see
 before the processor is halted or rebooted.
 This option may be useful if file system changes have been made manually
 or if the processor is on fire.
+.It Dv RB_REROOT
+Instead of rebooting, unmount all filesystems except the one containing
+currently-running executable, and mount root filesystem using the same
+mechanism which is used during normal boot, based on
+vfs.root.mountfrom
+.Xr kenv 8
+variable.
 .It Dv RB_RDONLY
 Initially mount the root file system read-only.
 This is currently the default, and this option has been deprecated.

Modified: head/sys/kern/kern_shutdown.c
==
--- head/sys/kern/kern_shutdown.c   Fri Sep 18 17:29:24 2015
(r287963)
+++ head/sys/kern/kern_shutdown.c   Fri Sep 18 17:32:22 2015
(r287964)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -150,10 +151,16 @@ static struct dumperinfo dumper;  /* our 
 static struct pcb dumppcb; /* Registers. */
 lwpid_t dumptid;   /* Thread ID. */
 
+static struct cdevsw reroot_cdevsw = {
+ .d_version = D_VERSION,
+ .d_name= "reroot",
+};
+
 static void poweroff_wait(void *, int);
 static void shutdown_halt(void *junk, int howto);
 static void shutdown_panic(void *junk, int howto);
 static void shutdown_reset(void *junk, int howto);
+static int kern_reroot(void);
 
 /* register various local shutdown events */
 static void
@@ -173,6 +180,26 @@ shutdown_conf(void *unused)
 SYSINIT(shutdown_conf, SI_SUB_INTRINSIC, SI_ORDER_ANY, shutdown_conf, NULL);
 
 /*
+ * The only reason this exists is to create the /dev/reroot/ directory,
+ * used by reroot code in init(8) as a mountpoint for tmpfs.
+ */
+static void
+reroot_conf(void *unused)
+{
+   int error;
+   struct cdev *cdev;
+
+   error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, ,
+   _cdevsw, NULL, UID_ROOT, GID_WHEEL, 0600, "reroot/reroot");
+   if (error != 0) {
+   printf("%s: failed to create device node, error %d",
+   __func__, error);
+   }
+}
+
+SYSINIT(reroot_conf, SI_SUB_DEVFS, SI_ORDER_ANY, reroot_conf, NULL);
+
+/*
  * The system call that results in a reboot.
  */
 /* ARGSUSED */
@@ -188,9 +215,13 @@ sys_reboot(struct thread *td, struct reb
if (error == 0)
error = priv_check(td, PRIV_REBOOT);
if (error == 0) {
-   mtx_lock();
-   kern_reboot(uap->opt);
-   mtx_unlock();
+   if (uap->opt & RB_REROOT) {
+   error = kern_reroot();
+   } else {
+   mtx_lock();
+   kern_reboot(uap->opt);
+   mtx_unlock();
+   }
}
return (error);
 }
@@ -336,6 +367,102 @@ kern_reboot(int howto)
 }
 
 /*
+ * The system call that results in changing the rootfs.
+ */
+static int
+kern_reroot(void)
+{
+   struct vnode *oldrootvnode, *vp;
+   struct mount *mp, *devmp;
+   int error;
+
+   if (curproc != initproc)
+   return (EPERM);
+
+   /*
+* Mark the filesystem containing currently-running executable
+* (the temporary copy of init(8)) busy.
+*/
+   vp = curproc->p_textvp;
+   error = vn_lock(vp, LK_SHARED);
+   if (error != 0)
+   return (error);
+   mp = vp->v_mount;
+   error = vfs_busy(mp, MBF_NOWAIT);
+   if (error != 0) {
+   vfs_ref(mp);
+   VOP_UNLOCK(vp, 0);
+   error = vfs_busy(mp, 0);
+   vn_lock(vp, LK_SHARED | LK_RETRY);
+   vfs_rel(mp);
+   if (error != 0) {
+   VOP_UNLOCK(vp, 0);
+  

svn commit: r287965 - head/sys/dev/iwm

2015-09-18 Thread Adrian Chadd
Author: adrian
Date: Fri Sep 18 17:39:31 2015
New Revision: 287965
URL: https://svnweb.freebsd.org/changeset/base/287965

Log:
  Ensure the ring state is also blanked upon reset, otherwise
  duplicate rx events get handled during reset paths.
  
  Submitted by: Matthew Dillion 
  Obtained from:DragonflyBSD

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri Sep 18 17:32:22 2015(r287964)
+++ head/sys/dev/iwm/if_iwm.c   Fri Sep 18 17:39:31 2015(r287965)
@@ -884,7 +884,9 @@ iwm_reset_rx_ring(struct iwm_softc *sc, 
(void) iwm_pcie_rx_stop(sc);
iwm_nic_unlock(sc);
}
+   /* Reset the ring state */
ring->cur = 0;
+   memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat));
 }
 
 static void
___
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"