minor diff for vmctl.8

2016-09-11 Thread Rob Pierce
"host" is not a command argument.

Rob

Index: vmctl.8
===
RCS file: /cvs/src/usr.sbin/vmctl/vmctl.8,v
retrieving revision 1.13
diff -u -p -r1.13 vmctl.8
--- vmctl.8 18 Aug 2016 16:12:05 -  1.13
+++ vmctl.8 12 Sep 2016 01:36:59 -
@@ -28,8 +28,7 @@
 The
 .Nm
 utility is used to control the virtual machine monitor (VMM) subsystem.
-A VMM manages virtual machines (VMs) on a
-.Ar host .
+A VMM manages virtual machines (VMs) on a host.
 The VMM subsystem is responsible for creating, destroying, and executing
 VMs.
 .Pp



Re: /usr/bin/skeyprune owner

2016-09-11 Thread Todd C. Miller
On Sun, 11 Sep 2016 10:06:55 +0200, Martin Natano wrote:

> Another ${INSTALL} invokation that doesn't mention the owner. Ok?

OK millert@

 - todd



Re: bin/chmod: set owner of symlinks

2016-09-11 Thread Alexander Hall
On Sat, Sep 10, 2016 at 01:46:05PM -0700, Philip Guenther wrote:
> On Sat, 10 Sep 2016, Martin Natano wrote:
> > When building with noperm the symlinks end up with the build user as
> > owner instead of root. Ok?
> ...
> > --- bin/chmod/Makefile  6 Sep 2001 18:52:55 -   1.7
> > +++ bin/chmod/Makefile  10 Sep 2016 17:31:05 -
> > @@ -10,9 +10,11 @@ LINKS=   ${BINDIR}/chmod ${BINDIR}/chgrp \
> >  afterinstall:
> > (cd ${DESTDIR}/usr/sbin; \
> > ln -sf ../../sbin/chown .; \
> > -   ln -sf ../../bin/chgrp .)
> > +   ln -sf ../../bin/chgrp .; \
> > +   chown -h root:wheel chown chgrp)
> > (cd ${DESTDIR}/usr/bin; \
> > -   ln -sf ../../bin/chmod chflags)
> > +   ln -sf ../../bin/chmod chflags; \
> > +   chown -h root:wheel chflags)
> 
> As with the sysctl symlink, I think these should be root:bin.
> 
> Also, let's follow best practice and s/;/ &&/ in those commands so that 
> failure propagates.

My eyes agree, but for the record, from man(1):

SHELL COMMANDS
 ...
 Commands are executed using /bin/sh in "set -e" mode, unless '-' is
 specified.


/Alexander



Re: Fix sxie(4) tx

2016-09-11 Thread Marcus Glocker
On Sun, Sep 11, 2016 at 01:24:23PM +0200, Mark Kettenis wrote:

> Hardware has two transmit FIFOs, and the idea is to alternate between
> the two.  The code that decides which FIFO to use is busted.  It keeps
> a count of the number of FIFOs in use.  That means that if the count
> is one, we don't actually know which if the FIFOs is currently in use.
> If we pick the wrong FIFO for the next packet, the interface hangs and
> we get a watchdog timeout.
> 
> Diff below fixes this by using a bitmask to keep track of the FIFOs
> that are in use.
> 
> ok?

I can't test it myself, but makes sense to me.  ok mglocker
 
> Index: arch/armv7/sunxi/sxie.c
> ===
> RCS file: /cvs/src/sys/arch/armv7/sunxi/sxie.c,v
> retrieving revision 1.21
> diff -u -p -r1.21 sxie.c
> --- arch/armv7/sunxi/sxie.c   22 Aug 2016 19:38:42 -  1.21
> +++ arch/armv7/sunxi/sxie.c   11 Sep 2016 11:18:24 -
> @@ -101,6 +101,9 @@
>  #define SXIE_INTR_DISABLE0x
>  #define SXIE_INTR_CLEAR  0x
>  
> +#define SXIE_TX_FIFO00x0001
> +#define SXIE_TX_FIFO10x0002
> +
>  #define  SXIE_RX_ENABLE  0x0004
>  #define  SXIE_TX_ENABLE  0x0003
>  #define  SXIE_RXTX_ENABLE0x0007
> @@ -436,16 +439,13 @@ sxie_intr(void *arg)
>   sxie_recv(sc);
>   }
>  
> - pending &= 3;
> -
> - if (pending) {
> + if (pending & (SXIE_TX_FIFO0 | SXIE_TX_FIFO1)) {
>   ifq_clr_oactive(>if_snd);
> - sc->txf_inuse--;
> - ifp->if_opackets++;
> - if (pending == 3) { /* 2 packets got sent */
> - sc->txf_inuse--;
> + if (pending & SXIE_TX_FIFO0)
> + ifp->if_opackets++;
> + if (pending & SXIE_TX_FIFO1)
>   ifp->if_opackets++;
> - }
> + sc->txf_inuse &= ~pending;
>   if (sc->txf_inuse == 0)
>   ifp->if_timer = 0;
>   else
> @@ -473,7 +473,7 @@ sxie_start(struct ifnet *ifp)
>   uint32_t fifo;
>   uint32_t txbuf[SXIE_MAX_PKT_SIZE / sizeof(uint32_t)]; /* XXX !!! */
>  
> - if (sc->txf_inuse > 1)
> + if (sc->txf_inuse == (SXIE_TX_FIFO0 | SXIE_TX_FIFO1))
>   ifq_set_oactive(>if_snd);
>  
>   if (!(ifp->if_flags & IFF_RUNNING) || ifq_is_oactive(>if_snd))
> @@ -494,7 +494,7 @@ trynext:
>   return;
>   }
>  
> - if (sc->txf_inuse > 1) {
> + if (sc->txf_inuse == (SXIE_TX_FIFO0 | SXIE_TX_FIFO1)) {
>   ifq_deq_rollback(>if_snd, m);
>   printf("sxie_start: tx fifos in use.\n");
>   ifq_set_oactive(>if_snd);
> @@ -502,10 +502,14 @@ trynext:
>   }
>  
>   /* select fifo */
> - fifo = sc->txf_inuse;
> + if (sc->txf_inuse & SXIE_TX_FIFO0) {
> + sc->txf_inuse |= SXIE_TX_FIFO1;
> + fifo = 1;
> + } else {
> + sc->txf_inuse |= SXIE_TX_FIFO0;
> + fifo = 0;
> + }
>   SXIWRITE4(sc, SXIE_TXINS, fifo);
> -
> - sc->txf_inuse++;
>  
>   /* set packet length */
>   SXIWRITE4(sc, SXIE_TXPKTLEN0 + (fifo * 4), m->m_pkthdr.len);



Re: reduce double caching in mfs

2016-09-11 Thread Ted Unangst
Bob Beck wrote:
> I really dislike "CHEAP".
> 
> and it almost seems like these should actually be NOCACHE.. why the heck
> can't they be?

So i looked at NOCACHE, but it seemed like that option may destroy the buffer
too soon. Anyway, I tested it and it does go boom. With just NOCACHE in mfs,
creating a file in mfs results in panic: dup alloc. Haven't looked further,
but I suspect there's some assumptions about just exactly how fast a buf can
be recycled in ffs. NOCACHE is killing it too soon.



merge usbd_open_pipe.9 & usbd_close_pipe.9 into a single manpage

2016-09-11 Thread Adam Wolk
Hi tech@,

I have been going through usbdi recently and I believe that the mentioned
manpages can be merged into a single one since they operate on the same
abstraction in the interface.

I am cross referrencing with NetBSD which recently added documentation for the
usbdi interface:
  - https://man-k.org/man/netbsd/9/usbdi?r=1=usb_rem_task

Feedback? OK's?

Regards,
Adam
Index: Makefile
===
RCS file: /cvs/src/share/man/man9/Makefile,v
retrieving revision 1.280
diff -u -p -r1.280 Makefile
--- Makefile5 Sep 2016 07:22:29 -   1.280
+++ Makefile11 Sep 2016 17:51:33 -
@@ -33,7 +33,7 @@ MAN=  aml_evalnode.9 atomic_add_int.9 ato
spl.9 srp_enter.9 srpl_rc_init.9 startuphook_establish.9 \
socreate.9 sosplice.9 style.9 syscall.9 sysctl_int.9 \
task_add.9 tc_init.9 time_second.9 timeout.9 tsleep.9 tvtohz.9 \
-   uiomove.9 uvm.9 usbd_close_pipe.9 usbd_open_pipe.9 usbd_ref_wait.9 \
+   uiomove.9 uvm.9 usbd_open_pipe.9 usbd_ref_wait.9 \
usbd_transfer.9 vfs.9 vfs_busy.9 \
vfs_cache.9 vaccess.9 vclean.9 vcount.9 vdevgone.9 vfinddev.9 vflush.9 \
vflushbuf.9 vget.9 vgone.9 vhold.9 vinvalbuf.9 vnode.9 vnsubr.9 \
Index: usbd_close_pipe.9
===
RCS file: usbd_close_pipe.9
diff -N usbd_close_pipe.9
--- usbd_close_pipe.9   4 May 2015 10:12:34 -   1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,48 +0,0 @@
-.\" $OpenBSD: usbd_close_pipe.9,v 1.1 2015/05/04 10:12:34 mpi Exp $
-.\"
-.\" Copyright (c) 2015 Sean Levy 
-.\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.\"
-.Dd $Mdocdate: May 4 2015 $
-.Dt USBD_CLOSE_PIPE 9
-.Os
-.Sh NAME
-.Nm usbd_close_pipe , usbd_abort_pipe
-.Nd delete or abort transfers on a USB pipe
-.Sh SYNOPSIS
-.In dev/usb/usb.h
-.In dev/usb/usbdi.h
-.Ft usbd_status
-.Fn usbd_close_pipe "struct usbd_pipe *pipe"
-.Ft usbd_status
-.Fn usbd_abort_pipe "struct usbd_pipe *pipe"
-.Sh DESCRIPTION
-The
-.Fn usbd_abort_pipe
-function aborts any transfers queued on
-.Fa pipe .
-.Pp
-The
-.Fn usbd_close_pipe
-function aborts any transfers queued on
-.Fa pipe
-then deletes it.
-.Sh CONTEXT
-.Fn usbd_abort_pipe
-and
-.Fn usbd_close_pipe
-can be called during autoconf or from process context.
-.Sh SEE ALSO
-.Xr usb 4 ,
-.Xr usbd_open_pipe 9
Index: usbd_open_pipe.9
===
RCS file: /cvs/src/share/man/man9/usbd_open_pipe.9,v
retrieving revision 1.4
diff -u -p -r1.4 usbd_open_pipe.9
--- usbd_open_pipe.927 Jun 2016 23:38:01 -  1.4
+++ usbd_open_pipe.911 Sep 2016 17:51:33 -
@@ -18,8 +18,11 @@
 .Dt USBD_OPEN_PIPE 9
 .Os
 .Sh NAME
-.Nm usbd_open_pipe , usbd_open_pipe_intr
-.Nd create USB pipe
+.Nm usbd_open_pipe ,
+.Nm usbd_open_pipe_intr ,
+.Nm usbd_close_pipe ,
+.Nm usbd_abort_pipe
+.Nd manage USB transfer pipes
 .Sh SYNOPSIS
 .In dev/usb/usb.h
 .In dev/usb/usbdi.h
@@ -27,16 +30,21 @@
 .Fn usbd_open_pipe "struct usbd_interface *iface" "uint8_t address" "uint8_t 
flags" "struct usbd_pipe **pipe"
 .Ft usbd_status
 .Fn usbd_open_pipe_intr "struct usbd_interface *iface" "uint8_t address" 
"uint8_t flags" "struct usbd_pipe **pipe" "void *priv" "void *buffer" "uint32_t 
len" "usbd_callback cb" "int ival"
+.Ft usbd_status
+.Fn usbd_close_pipe "struct usbd_pipe *pipe"
+.Ft usbd_status
+.Fn usbd_abort_pipe "struct usbd_pipe *pipe"
 .Sh DESCRIPTION
 The
-.Fn usbd_open_pipe
-and
+.Fn usbd_open_pipe ,
 .Fn usbd_open_pipe_intr
-functions create pipes.
+and
+.Fn usbd_close_pipe
+functions create and destroy pipes.
 A pipe is a logical connection between the host and an endpoint on a
 USB device.
 USB drivers use pipes to manage transfers to or from a USB
-endpoint.
+endpoint. It is common to have more than one pipe per device.
 .Pp
 The
 .Fn usbd_open_pipe
@@ -121,12 +129,22 @@ transfers maintained by the pipe, unlike
 continue to be processed every
 .Fa ival
 milliseconds.
+.Pp
+.Fn usbd_close_pipe
+function aborts any transfers queued on
+.Fa pipe .
+.Pp
+.Fn usbd_abort_pipe
+function aborts any transfers queued on
+.Fa pipe
+then delets it.
 .Sh CONTEXT
-.Fn usbd_open_pipe
+.Fn usbd_open_pipe ,
+.Fn usbd_open_pipe_intr ,
+.Fn 

Re: mg docs ownership

2016-09-11 Thread Florian Obser
On Sun, Sep 11, 2016 at 12:15:28PM +, Mark Lumsden wrote:
> > Maybe we should just not install it? Mark?
> 
> A couple of years ago when the tutorial started being installed there
> were no dissenting voices, so unless there are objections, I'd carry
> on doing that. And Martin's diff makes sense I think. 
> 

yes, OK florian@

I was a bit surprised that we have that file. I don't want to bikeshed
this, Martin's work is much more important.

> Mark 

-- 
I'm not entirely sure you are real.



Re: Fix Wacom Intuos S 2 descriptor and make wsmouse work

2016-09-11 Thread Mike Burns
On 2016-09-11 16.14.44 +0200, Frank Groeneveld wrote:
> I've also made some progress regarding the scaling bug. It seems the
> device is not properly detached from Xorg when it is unplugged, because
> the log starts getting spammed with loads of messages like this:
> 
> [   202.482] (EE) ws: wacom: read error Input/output error
> 
> When I create an xorg.conf that only contains the wsmouse device of the
> Wacom tablet and disabled all other wsmouse devices,  I cannot controle
> the device anymore after plugging it in again. Without the xorg.conf I
> can control it, but with the wrong scale.
> 
> I think this difference is caused by the fact that the "all containing"
> /dev/wsmouse is still passing data to Xorg for the Wacom device, but
> the tablet specific /dev/wsmouse1 device is not. Switchting to a console
> somehow forces Xorg to reopen the /dev/wsmouse1 device which results in
> a working mouse pointer (or in good scaled mouse pointer movement in the
> case of not using an xorg.conf file to disable other wsmouse devices).
> 
> Does anybody see why the ws driver start to print these errors? Am I
> missing an important call on detachment?

It is quite likely related to this discussion:

http://marc.info/?l=openbsd-misc=140529029513846=2
http://marc.info/?l=openbsd-misc=140589215905202=2
http://marc.info/?l=openbsd-misc=141676273919602=2



Re: Fix Wacom Intuos S 2 descriptor and make wsmouse work

2016-09-11 Thread Frank Groeneveld
On Thu, Sep 08, 2016 at 07:44:33PM +0200, Ulf Brosziewski wrote:
> Maybe one day I'll get it right:
> s/wsmouse_input_sync()/wsmouse_input_sync(ms->sc_wsmousedev)/

Haha, you did get it right indeed. Attached my working updated patch,
with your suggested API usage. Looks cleaner like this.

I've also made some progress regarding the scaling bug. It seems the
device is not properly detached from Xorg when it is unplugged, because
the log starts getting spammed with loads of messages like this:

[   202.482] (EE) ws: wacom: read error Input/output error

When I create an xorg.conf that only contains the wsmouse device of the
Wacom tablet and disabled all other wsmouse devices,  I cannot controle
the device anymore after plugging it in again. Without the xorg.conf I
can control it, but with the wrong scale.

I think this difference is caused by the fact that the "all containing"
/dev/wsmouse is still passing data to Xorg for the Wacom device, but
the tablet specific /dev/wsmouse1 device is not. Switchting to a console
somehow forces Xorg to reopen the /dev/wsmouse1 device which results in
a working mouse pointer (or in good scaled mouse pointer movement in the
case of not using an xorg.conf file to disable other wsmouse devices).

Does anybody see why the ws driver start to print these errors? Am I
missing an important call on detachment?

Thanks.

Frank
Index: share/man/man4/uwacom.4
===
RCS file: share/man/man4/uwacom.4
diff -N share/man/man4/uwacom.4
--- /dev/null   1 Jan 1970 00:00:00 -
+++ share/man/man4/uwacom.4 5 Sep 2016 18:36:32 -
@@ -0,0 +1,60 @@
+.\" $OpenBSD$
+.\"
+.\" Copyright (c) 2016 Frank Groeneveld 
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: September 5 2016 $
+.Dt UWACOM 4
+.Os
+.Sh NAME
+.Nm uwacom
+.Nd Wacom USB tablets
+.Sh SYNOPSIS
+.Cd "uwacom*  at uhidev?"
+.Cd "wsmouse* at uwacom? mux 0"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides basic support for Wacom USB tablets.
+Access to these devices is through the
+.Xr wscons 4
+framework.
+.Pp
+Absolute positioning of the mouse cursor can be done by hovering the pen above 
the tablet. Touching the tablet with the pen tip will emulate mouse button 0, 
while the two pen buttons will emulate button 1 and button 2.
+.Pp
+The
+.Nm
+driver supports the following Wacom tablets:
+.Pp
+.Bl -column "Intuos Draw" "Model Number" -offset 6n
+.It Em Name Ta Model Number
+.It Li Intuos Draw Ta CTL-490
+.Sh SEE ALSO
+.Xr uhidev 4 ,
+.Xr usb 4 ,
+.Xr wsmouse 4
+.Sh HISTORY
+The
+.Nm
+driver
+first appeared in
+.Ox 6.1 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Frank Groeneveld fr...@frankgroeneveld.nl .
+.Sh BUGS
+To make axis scaling work correctly, the device should be plugged in when X 
starts. Advanced features such as pen tip pressure are not supported.
Index: sys/arch/amd64/conf/GENERIC
===
RCS file: /cvs/src/sys/arch/amd64/conf/GENERIC,v
retrieving revision 1.432
diff -u -p -r1.432 GENERIC
--- sys/arch/amd64/conf/GENERIC 4 Sep 2016 10:22:05 -   1.432
+++ sys/arch/amd64/conf/GENERIC 5 Sep 2016 18:36:32 -
@@ -244,6 +244,8 @@ umass*  at uhub?# USB Mass Storage devi
 ubcmtp*at uhub?# Broadcom USB trackpad
 wsmouse* at ubcmtp? mux 0
 uhidev*at uhub?# Human Interface Devices
+uwacom*at uhidev?  # USB Wacom tablet
+wsmouse* at uwacom? mux 0
 ums*   at uhidev?  # USB mouse
 wsmouse* at ums? mux 0
 uts*   at uhub?# USB touchscreen
Index: sys/dev/hid/hid.h
===
RCS file: /cvs/src/sys/dev/hid/hid.h,v
retrieving revision 1.4
diff -u -p -r1.4 hid.h
--- sys/dev/hid/hid.h   20 Jan 2016 01:26:00 -  1.4
+++ sys/dev/hid/hid.h   5 Sep 2016 18:36:32 -
@@ -127,6 +127,7 @@ int hid_is_collection(const void *, int,
 #define HUP_MICROSOFT  0xff00
 /* XXX compat */
 #define HUP_APPLE  0x00ff
+#define HUP_WACOM  0xff00
 
 /* Usages, Power Device */
 #define HUP_INAME  0x0001
Index: sys/dev/usb/files.usb

Re: mg docs ownership

2016-09-11 Thread Mark Lumsden
> Maybe we should just not install it? Mark?

A couple of years ago when the tutorial started being installed there
were no dissenting voices, so unless there are objections, I'd carry
on doing that. And Martin's diff makes sense I think. 

Mark 



texinfo ownership fix

2016-09-11 Thread Martin Natano
Similar to guenther's fix for gnu/binutils*. Ok?

natano


Index: gnu/usr.bin/texinfo/Makefile.bsd-wrapper
===
RCS file: /cvs/src/gnu/usr.bin/texinfo/Makefile.bsd-wrapper,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile.bsd-wrapper
--- gnu/usr.bin/texinfo/Makefile.bsd-wrapper11 Jul 2014 23:23:28 -  
1.42
+++ gnu/usr.bin/texinfo/Makefile.bsd-wrapper11 Sep 2016 12:12:03 -
@@ -34,13 +34,17 @@ config: .FORCE
 .endif
PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
${XCFLAGS} \
-   INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
+   INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o 
${BINOWN} -g ${BINGRP} -m ${BINMODE}" \
+   INSTALL_SCRIPT="${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 
${BINMODE}" \
+   INSTALL_DATA="${INSTALL} ${INSTALL_COPY} -o ${DOCOWN} -g ${DOCGRP}  -m 
${NONBINMODE}" \
/bin/sh ${.CURDIR}/configure --infodir=/usr/share/info 
--prefix=/usr --disable-nls ${CF}
 
 config.status:
PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
${XCFLAGS} \
-   INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
+   INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o 
${BINOWN} -g ${BINGRP}  -m ${BINMODE}" \
+   INSTALL_SCRIPT="${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 
${BINMODE}" \
+   INSTALL_DATA="${INSTALL} ${INSTALL_COPY} -o ${DOCOWN} -g ${DOCGRP} -m 
${NONBINMODE}" \
/bin/sh ${.CURDIR}/configure --infodir=/usr/share/info 
--prefix=/usr --disable-nls ${CF}
 
 BEFOREMAN=config.status



/etc/ssl/* owner

2016-09-11 Thread Martin Natano
Following diff installs the files in /etc/ssl with the correct owner.
Ok?

natano


Index: lib/libcrypto/Makefile
===
RCS file: /cvs/src/lib/libcrypto/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- lib/libcrypto/Makefile  4 Sep 2016 17:59:26 -   1.4
+++ lib/libcrypto/Makefile  11 Sep 2016 11:45:25 -
@@ -424,11 +424,11 @@ all beforedepend: ${GENERATED}
 
 
 distribution:
-   ${INSTALL} ${INSTALL_COPY} -g ${BINGRP} -m 444 \
+   ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
   ${.CURDIR}/openssl.cnf ${DESTDIR}/etc/ssl/openssl.cnf && \
-   ${INSTALL} ${INSTALL_COPY} -g ${BINGRP} -m 444 \
+   ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
   ${.CURDIR}/cert.pem ${DESTDIR}/etc/ssl/cert.pem && \
-   ${INSTALL} ${INSTALL_COPY} -g ${BINGRP} -m 444 \
+   ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
   ${.CURDIR}/x509v3.cnf ${DESTDIR}/etc/ssl/x509v3.cnf
 
 ${PC_FILES}: opensslv.h
Index: usr.sbin/ikectl/Makefile
===
RCS file: /cvs/src/usr.sbin/ikectl/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- usr.sbin/ikectl/Makefile1 Mar 2016 13:54:39 -   1.6
+++ usr.sbin/ikectl/Makefile11 Sep 2016 11:45:26 -
@@ -16,7 +16,7 @@ CFLAGS+=  -Wshadow -Wpointer-arith -Wcast
 CFLAGS+=   -Wsign-compare
 
 distribution:
-   ${INSTALL} -C -g wheel -m 0644 ${.CURDIR}/ikeca.cnf \
+   ${INSTALL} -C -o root -g wheel -m 0644 ${.CURDIR}/ikeca.cnf \
${DESTDIR}/etc/ssl/ikeca.cnf
 
 .include 



sqlite3 headers owner

2016-09-11 Thread Martin Natano
The sqlite3 headers are installed with the build user as owner, but
should be owned by root. Ok?

natano


Index: Makefile
===
RCS file: /cvs/src/lib/libsqlite3/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile12 Sep 2015 02:08:34 -  1.15
+++ Makefile11 Sep 2016 11:22:24 -
@@ -104,7 +104,8 @@ beforeinstall:
 includes:
@for i in ${FILES}; do \
cmp -s ${.CURDIR}/src/$$i ${DESTDIR}/usr/include/$$i || \
-   ${INSTALL} ${INSTALL_COPY} -m 444 ${.CURDIR}/src/$$i 
${DESTDIR}/usr/include/$$i; \
+   ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
+   ${.CURDIR}/src/$$i ${DESTDIR}/usr/include/$$i; \
done
 
 .PHONY: header



Fix sxie(4) tx

2016-09-11 Thread Mark Kettenis
Hardware has two transmit FIFOs, and the idea is to alternate between
the two.  The code that decides which FIFO to use is busted.  It keeps
a count of the number of FIFOs in use.  That means that if the count
is one, we don't actually know which if the FIFOs is currently in use.
If we pick the wrong FIFO for the next packet, the interface hangs and
we get a watchdog timeout.

Diff below fixes this by using a bitmask to keep track of the FIFOs
that are in use.

ok?


Index: arch/armv7/sunxi/sxie.c
===
RCS file: /cvs/src/sys/arch/armv7/sunxi/sxie.c,v
retrieving revision 1.21
diff -u -p -r1.21 sxie.c
--- arch/armv7/sunxi/sxie.c 22 Aug 2016 19:38:42 -  1.21
+++ arch/armv7/sunxi/sxie.c 11 Sep 2016 11:18:24 -
@@ -101,6 +101,9 @@
 #define SXIE_INTR_DISABLE  0x
 #define SXIE_INTR_CLEAR0x
 
+#define SXIE_TX_FIFO0  0x0001
+#define SXIE_TX_FIFO1  0x0002
+
 #defineSXIE_RX_ENABLE  0x0004
 #defineSXIE_TX_ENABLE  0x0003
 #defineSXIE_RXTX_ENABLE0x0007
@@ -436,16 +439,13 @@ sxie_intr(void *arg)
sxie_recv(sc);
}
 
-   pending &= 3;
-
-   if (pending) {
+   if (pending & (SXIE_TX_FIFO0 | SXIE_TX_FIFO1)) {
ifq_clr_oactive(>if_snd);
-   sc->txf_inuse--;
-   ifp->if_opackets++;
-   if (pending == 3) { /* 2 packets got sent */
-   sc->txf_inuse--;
+   if (pending & SXIE_TX_FIFO0)
+   ifp->if_opackets++;
+   if (pending & SXIE_TX_FIFO1)
ifp->if_opackets++;
-   }
+   sc->txf_inuse &= ~pending;
if (sc->txf_inuse == 0)
ifp->if_timer = 0;
else
@@ -473,7 +473,7 @@ sxie_start(struct ifnet *ifp)
uint32_t fifo;
uint32_t txbuf[SXIE_MAX_PKT_SIZE / sizeof(uint32_t)]; /* XXX !!! */
 
-   if (sc->txf_inuse > 1)
+   if (sc->txf_inuse == (SXIE_TX_FIFO0 | SXIE_TX_FIFO1))
ifq_set_oactive(>if_snd);
 
if (!(ifp->if_flags & IFF_RUNNING) || ifq_is_oactive(>if_snd))
@@ -494,7 +494,7 @@ trynext:
return;
}
 
-   if (sc->txf_inuse > 1) {
+   if (sc->txf_inuse == (SXIE_TX_FIFO0 | SXIE_TX_FIFO1)) {
ifq_deq_rollback(>if_snd, m);
printf("sxie_start: tx fifos in use.\n");
ifq_set_oactive(>if_snd);
@@ -502,10 +502,14 @@ trynext:
}
 
/* select fifo */
-   fifo = sc->txf_inuse;
+   if (sc->txf_inuse & SXIE_TX_FIFO0) {
+   sc->txf_inuse |= SXIE_TX_FIFO1;
+   fifo = 1;
+   } else {
+   sc->txf_inuse |= SXIE_TX_FIFO0;
+   fifo = 0;
+   }
SXIWRITE4(sc, SXIE_TXINS, fifo);
-
-   sc->txf_inuse++;
 
/* set packet length */
SXIWRITE4(sc, SXIE_TXPKTLEN0 + (fifo * 4), m->m_pkthdr.len);



Re: smtpd config parsing cleanup

2016-09-11 Thread Gilles Chehade
On Fri, Sep 09, 2016 at 01:35:27PM +0200, Eric Faurot wrote:
> Because of the small ad hoc changes that were made here and there over
> the years, the listener config code has become a bit convoluted I think.
> Here is a little cleanup to:
> 
> - have all listener creation functions take listen_opts as param,
>   and call config_listener() when done, which adds the listener(s)
>   to the current config list of listeners.
> 
> - make the fallback chain between interface(), host_v4() host_v6()
>   and host_dns() obvious when creating an if_listener.
> 
> - fix a bug where the specified family was ignored if the listener
>   is given as a hostname.
> 
> 

i like it, ok

please commit soon so people get a chance to spot any error we didn't

gilles


> Index: parse.y
> ===
> RCS file: /cvs/src/usr.sbin/smtpd/parse.y,v
> retrieving revision 1.189
> diff -u -p -r1.189 parse.y
> --- parse.y   31 Aug 2016 15:24:04 -  1.189
> +++ parse.y   9 Sep 2016 11:11:54 -
> @@ -138,15 +138,14 @@ static struct listen_opts {
>   uint32_toptions;
>  } listen_opts;
>  
> -static struct listener   *create_sock_listener(struct listen_opts *);
> -static void   create_if_listener(struct listenerlist *,  struct 
> listen_opts *);
> -static void   config_listener(struct listener *,  struct listen_opts 
> *);
> -
> -struct listener  *host_v4(const char *, in_port_t);
> -struct listener  *host_v6(const char *, in_port_t);
> -int   host_dns(struct listenerlist *, struct listen_opts *);
> -int   host(struct listenerlist *, struct listen_opts *);
> -int   interface(struct listenerlist *, struct listen_opts *);
> +static void  create_sock_listener(struct listen_opts *);
> +static void  create_if_listener(struct listen_opts *);
> +static void  config_listener(struct listener *, struct listen_opts *);
> +static int   host_v4(struct listen_opts *);
> +static int   host_v6(struct listen_opts *);
> +static int   host_dns(struct listen_opts *);
> +static int   interface(struct listen_opts *);
> +
>  void  set_local(const char *);
>  void  set_localaddrs(struct table *);
>  int   delaytonum(char *);
> @@ -695,13 +694,13 @@ socket_listener : SOCKET sock_listen {
>   yyerror("socket listener already configured");
>   YYERROR;
>   }
> - conf->sc_sock_listener = 
> create_sock_listener(_opts);
> + create_sock_listener(_opts);
>   }
>   ;
>  
>  if_listener  : STRING if_listen {
>   listen_opts.ifx = $1;
> - create_if_listener(conf->sc_listeners, _opts);
> + create_if_listener(_opts);
>   }
>   ;
>  
> @@ -2005,7 +2004,7 @@ parse_config(struct smtpd *x_conf, const
>   /* If the socket listener was not configured, create a default one. */
>   if (!conf->sc_sock_listener) {
>   memset(_opts, 0, sizeof listen_opts);
> - conf->sc_sock_listener = create_sock_listener(_opts);
> + create_sock_listener(_opts);
>   }
>  
>   /* Free macros and check which have not been used. */
> @@ -2109,7 +2108,7 @@ symget(const char *nam)
>   return (NULL);
>  }
>  
> -static struct listener *
> +static void
>  create_sock_listener(struct listen_opts *lo)
>  {
>   struct listener *l = xcalloc(1, sizeof(*l), "create_sock_listener");
> @@ -2118,13 +2117,12 @@ create_sock_listener(struct listen_opts 
>   l->ss.ss_family = AF_LOCAL;
>   l->ss.ss_len = sizeof(struct sockaddr *);
>   l->local = 1;
> + conf->sc_sock_listener = l;
>   config_listener(l, lo);
> -
> - return (l);
>  }
>  
>  static void
> -create_if_listener(struct listenerlist *ll,  struct listen_opts *lo)
> +create_if_listener(struct listen_opts *lo)
>  {
>   uint16_tflags;
>  
> @@ -2142,17 +2140,11 @@ create_if_listener(struct listenerlist *
>   if (lo->port) {
>   lo->flags = lo->ssl|lo->auth|flags;
>   lo->port = htons(lo->port);
> - if (!interface(ll, lo))
> - if (host(ll, lo) <= 0)
> - errx(1, "invalid virtual ip or interface: %s", 
> lo->ifx);
>   }
>   else {
>   if (lo->ssl & F_SMTPS) {
>   lo->port = htons(465);
>   lo->flags = F_SMTPS|lo->auth|flags;
> - if (!interface(ll, lo))
> - if (host(ll, lo) <= 0)
> - errx(1, "invalid virtual ip or 
> interface: %s", lo->ifx);
>   }
>  
>   if (!lo->ssl || (lo->ssl & F_STARTTLS)) {
> @@ -2160,11 +2152,19 @@ create_if_listener(struct listenerlist *
>   lo->flags = lo->auth|flags;
>   if (lo->ssl & 

Re: sdmmc i/o reset fix

2016-09-11 Thread Mark Kettenis
> Date: Sun, 11 Sep 2016 09:45:59 +0200
> From: Marcus Glocker 
> 
> This gets the sdmmc i/o reset working.
> 
> Now on my allwinner,sun5i-r8 the wifi device also attaches again
> after a reboot (currently just works on cold boot).
> 
> ok?

Had something very similar in one of my trees.  Still detects the
broadcom module on the cubox. So ok kettenis@

> Index: sdmmc_io.c
> ===
> RCS file: /cvs/src/sys/dev/sdmmc/sdmmc_io.c,v
> retrieving revision 1.26
> diff -u -p -r1.26 sdmmc_io.c
> --- sdmmc_io.c12 May 2016 15:26:42 -  1.26
> +++ sdmmc_io.c11 Sep 2016 07:33:36 -
> @@ -113,9 +113,6 @@ sdmmc_io_enable(struct sdmmc_softc *sc)
>   return 1;
>   }
>  
> - /* Reset I/O functions (again). */
> - sdmmc_io_reset(sc);
> -
>   /* Send the new OCR value until all cards are ready. */
>   if (sdmmc_io_send_op_cond(sc, host_ocr, NULL) != 0) {
>   printf("%s: can't send I/O OCR\n", DEVNAME(sc));
> @@ -550,10 +547,13 @@ sdmmc_io_xchg(struct sdmmc_softc *sc, st
>  void
>  sdmmc_io_reset(struct sdmmc_softc *sc)
>  {
> -#if 0 /* XXX command fails */
> - (void)sdmmc_io_write(sc, NULL, SD_IO_REG_CCCR_CTL, CCCR_CTL_RES);
> - sdmmc_delay(10);
> -#endif
> + u_int8_t data = CCCR_CTL_RES;
> +
> + rw_assert_wrlock(>sc_lock);
> +
> + if (sdmmc_io_rw_direct(sc, NULL, SD_IO_CCCR_CTL, (u_char *),
> + SD_ARG_CMD52_WRITE) == 0)
> + sdmmc_delay(10);
>  }
>  
>  /*
> 
> 



Re: missing includes in games/

2016-09-11 Thread Theo Buehler
On Sun, Sep 11, 2016 at 11:23:13AM +0200, Landry Breuil wrote:
> On Sun, Sep 11, 2016 at 11:17:25AM +0200, Theo Buehler wrote:
> > These all call time(3), so should include  directly.
> > 
> > ok?
> > 
> > Index: bcd/bcd.c
> > ===
> > RCS file: /var/cvs/src/games/bcd/bcd.c,v
> > retrieving revision 1.25
> > diff -u -p -r1.25 bcd.c
> > --- bcd/bcd.c   7 Mar 2016 12:07:55 -   1.25
> > +++ bcd/bcd.c   11 Sep 2016 08:53:40 -
> > @@ -63,6 +63,8 @@
> >   * Nov 5, 1993
> >   */
> >  
> > +#include 
> > +
> >  #include 
> >  #include 
> >  #include 
> 
> This one is unrelated ?
> 

oops, that one snuck in by accident. Yes, it's unrelated, for u_short.



Re: missing includes in games/

2016-09-11 Thread Landry Breuil
On Sun, Sep 11, 2016 at 11:17:25AM +0200, Theo Buehler wrote:
> These all call time(3), so should include  directly.
> 
> ok?
> 
> Index: bcd/bcd.c
> ===
> RCS file: /var/cvs/src/games/bcd/bcd.c,v
> retrieving revision 1.25
> diff -u -p -r1.25 bcd.c
> --- bcd/bcd.c 7 Mar 2016 12:07:55 -   1.25
> +++ bcd/bcd.c 11 Sep 2016 08:53:40 -
> @@ -63,6 +63,8 @@
>   * Nov 5, 1993
>   */
>  
> +#include 
> +
>  #include 
>  #include 
>  #include 

This one is unrelated ?



missing includes in games/

2016-09-11 Thread Theo Buehler
These all call time(3), so should include  directly.

ok?

Index: arithmetic/arithmetic.c
===
RCS file: /var/cvs/src/games/arithmetic/arithmetic.c,v
retrieving revision 1.26
diff -u -p -r1.26 arithmetic.c
--- arithmetic/arithmetic.c 27 Jan 2016 13:42:08 -  1.26
+++ arithmetic/arithmetic.c 11 Sep 2016 09:02:44 -
@@ -67,6 +67,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 intgetrandom(int, int, int);
Index: atc/log.c
===
RCS file: /var/cvs/src/games/atc/log.c,v
retrieving revision 1.22
diff -u -p -r1.22 log.c
--- atc/log.c   16 Mar 2016 15:00:35 -  1.22
+++ atc/log.c   11 Sep 2016 09:08:25 -
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "extern.h"
Index: atc/main.c
===
RCS file: /var/cvs/src/games/atc/main.c,v
retrieving revision 1.29
diff -u -p -r1.29 main.c
--- atc/main.c  7 Mar 2016 13:48:25 -   1.29
+++ atc/main.c  11 Sep 2016 09:08:47 -
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
Index: battlestar/com6.c
===
RCS file: /var/cvs/src/games/battlestar/com6.c,v
retrieving revision 1.22
diff -u -p -r1.22 com6.c
--- battlestar/com6.c   31 Dec 2015 17:51:19 -  1.22
+++ battlestar/com6.c   11 Sep 2016 09:09:17 -
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "extern.h"
 
Index: bcd/bcd.c
===
RCS file: /var/cvs/src/games/bcd/bcd.c,v
retrieving revision 1.25
diff -u -p -r1.25 bcd.c
--- bcd/bcd.c   7 Mar 2016 12:07:55 -   1.25
+++ bcd/bcd.c   11 Sep 2016 08:53:40 -
@@ -63,6 +63,8 @@
  * Nov 5, 1993
  */
 
+#include 
+
 #include 
 #include 
 #include 
Index: boggle/boggle/mach.c
===
RCS file: /var/cvs/src/games/boggle/boggle/mach.c,v
retrieving revision 1.21
diff -u -p -r1.21 mach.c
--- boggle/boggle/mach.c10 Jan 2016 14:10:38 -  1.21
+++ boggle/boggle/mach.c11 Sep 2016 09:14:31 -
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "bog.h"
 #include "extern.h"
Index: canfield/canfield/canfield.c
===
RCS file: /var/cvs/src/games/canfield/canfield/canfield.c,v
retrieving revision 1.26
diff -u -p -r1.26 canfield.c
--- canfield/canfield/canfield.c10 Jan 2016 13:35:09 -  1.26
+++ canfield/canfield/canfield.c11 Sep 2016 09:10:20 -
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #definedecksize52
Index: hack/hack.unix.c
===
RCS file: /var/cvs/src/games/hack/hack.unix.c,v
retrieving revision 1.19
diff -u -p -r1.19 hack.unix.c
--- hack/hack.unix.c15 Mar 2016 19:56:20 -  1.19
+++ hack/hack.unix.c11 Sep 2016 09:10:51 -
@@ -80,6 +80,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "hack.h"
Index: mille/save.c
===
RCS file: /var/cvs/src/games/mille/save.c,v
retrieving revision 1.12
diff -u -p -r1.12 save.c
--- mille/save.c8 Jan 2016 18:09:59 -   1.12
+++ mille/save.c11 Sep 2016 09:11:06 -
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "mille.h"
Index: monop/execute.c
===
RCS file: /var/cvs/src/games/monop/execute.c,v
retrieving revision 1.13
diff -u -p -r1.13 execute.c
--- monop/execute.c 8 Jan 2016 18:20:33 -   1.13
+++ monop/execute.c 11 Sep 2016 09:11:27 -
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "monop.ext"
 
Index: pom/pom.c
===
RCS file: /var/cvs/src/games/pom/pom.c,v
retrieving revision 1.23
diff -u -p -r1.23 pom.c
--- pom/pom.c   27 Aug 2016 02:02:44 -  1.23
+++ pom/pom.c   11 Sep 2016 09:11:46 -
@@ -51,6 +51,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #ifndef M_PI
Index: sail/sync.c
===
RCS file: /var/cvs/src/games/sail/sync.c,v
retrieving revision 1.14
diff -u -p -r1.14 sync.c
--- sail/sync.c 8 Jan 2016 20:26:33 -   1.14
+++ sail/sync.c 11 Sep 2016 09:12:02 -
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "extern.h"
Index: snake/snake.c
===
RCS file: /var/cvs/src/games/snake/snake.c,v
retrieving revision 1.27
diff -u -p -r1.27 snake.c
--- snake/snake.c 

Re: libm: don't use deprecated classification macros

2016-09-11 Thread Theo Buehler
On Sat, Sep 10, 2016 at 01:33:26PM -0700, Philip Guenther wrote:
> 
> fpclassify(3) says:
> 
>  The symbols isinff(), and isnanf() are provided as compatibility aliases
>  to isinf(), and isnan(), respectively, and their uses are deprecated.
>  Similarly, finite() and finitef() are deprecated versions of isfinite().
> 
> So let's use the preferred names in libm.
> 
> ok?

ok



Re: libm: make sqrtl() use fe*() instead of fp*()

2016-09-11 Thread Theo Buehler
On Sat, Sep 10, 2016 at 09:47:55PM -0700, Philip Guenther wrote:
> 
> On systems that don't have a native version, we use an implementation of 
> sqrtl() (square-root of long double) that -- to do its job -- pokes at the 
> floating-point exception state and rounding mode.  In particular, at a key 
> point it clears any previous "inexact" exception and sets the rounding 
> mode to "toward zero" and then does a division.  It then tests whether 
> that raised an "inexact" exception and fixes the result up based on that, 
> and finally restores the rounding mode before returning.
> 
> The current version does that using the old, non-standard fp* routines: 
> fp{set,get}sticky() and fpsetround().  This diff switches it to the new, 
> standardized fe* routines: fe{clear,test}except() and fe{get,set}round().
> 
> (Why bother?  The fp* routines are defined in libc, while the fe* routines 
> are defined inside libm itself...which means that with some symbol 
> redirection they can be made to call directly, without going through the 
> PLT.  This diff is thus a prelude to the larger diff I have sitting in my 
> tree to do exactly that, reducing 136 PLT entries to just 22 on amd64, for 
> example.  Even on a HW-FP-poor arch like mips64 it gets reduced from 204 
> to only 56 PLT entries.)
> 
> ok?
> 

looks correct to me, ok tb



/usr/bin/skeyprune owner

2016-09-11 Thread Martin Natano
Another ${INSTALL} invokation that doesn't mention the owner. Ok?

natano


Index: Makefile
===
RCS file: /cvs/src/usr.bin/skey/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile30 Mar 2016 06:38:46 -  1.15
+++ Makefile11 Sep 2016 07:52:23 -
@@ -9,7 +9,7 @@ DPADD=  ${LIBSKEY}
 LDADD= -lskey
 
 beforeinstall:
-   ${INSTALL} ${INSTALL_COPY} -m 755 ${.CURDIR}/skeyprune.pl \
-   ${DESTDIR}${BINDIR}/skeyprune
+   ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 755 \
+   ${.CURDIR}/skeyprune.pl ${DESTDIR}${BINDIR}/skeyprune
 
 .include 



sdmmc i/o reset fix

2016-09-11 Thread Marcus Glocker
This gets the sdmmc i/o reset working.

Now on my allwinner,sun5i-r8 the wifi device also attaches again
after a reboot (currently just works on cold boot).

ok?


Index: sdmmc_io.c
===
RCS file: /cvs/src/sys/dev/sdmmc/sdmmc_io.c,v
retrieving revision 1.26
diff -u -p -r1.26 sdmmc_io.c
--- sdmmc_io.c  12 May 2016 15:26:42 -  1.26
+++ sdmmc_io.c  11 Sep 2016 07:33:36 -
@@ -113,9 +113,6 @@ sdmmc_io_enable(struct sdmmc_softc *sc)
return 1;
}
 
-   /* Reset I/O functions (again). */
-   sdmmc_io_reset(sc);
-
/* Send the new OCR value until all cards are ready. */
if (sdmmc_io_send_op_cond(sc, host_ocr, NULL) != 0) {
printf("%s: can't send I/O OCR\n", DEVNAME(sc));
@@ -550,10 +547,13 @@ sdmmc_io_xchg(struct sdmmc_softc *sc, st
 void
 sdmmc_io_reset(struct sdmmc_softc *sc)
 {
-#if 0 /* XXX command fails */
-   (void)sdmmc_io_write(sc, NULL, SD_IO_REG_CCCR_CTL, CCCR_CTL_RES);
-   sdmmc_delay(10);
-#endif
+   u_int8_t data = CCCR_CTL_RES;
+
+   rw_assert_wrlock(>sc_lock);
+
+   if (sdmmc_io_rw_direct(sc, NULL, SD_IO_CCCR_CTL, (u_char *),
+   SD_ARG_CMD52_WRITE) == 0)
+   sdmmc_delay(10);
 }
 
 /*



Re: binutils-2.17 ownership fixes

2016-09-11 Thread Martin Natano
> Index: gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper
> ===
> RCS file: 
> /data/src/openbsd/src/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper,v
> retrieving revision 1.8
> diff -u -p -r1.8 Makefile.bsd-wrapper
> --- gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper5 Jul 2013 21:29:51 
> -   1.8
> +++ gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper11 Sep 2016 01:54:10 
> -
> @@ -102,7 +102,8 @@ install: maninstall
>   tooldir=${PREFIX} \
>   BSDSRCDIR=${BSDSRCDIR} \
>   INSTALL_MODULES='${INSTALL_MODULES}' \
> - INSTALL_PROGRAM='install -c -S' \
> + INSTALL_PROGRAM='install -c -S ${INSTALL_STRIP} -o ${BINOWN} -g 
> ${BINGRP} -m ${BINMODE}' \
> + INSTALL_DATA='install -c -o ${BINOWN} -g ${DOCGRP} -m 
> ${NONBINMODE}' \

I think that should be ${DOCOWN} not ${BINOWN} for INSTALL_DATA,
otherwise OK natano@.


>   INSTALL_INFO_HOST_MODULES='${INSTALL_INFO_HOST_MODULES}' \
> install install-info
>  
> Index: gnu/usr.bin/binutils/Makefile.bsd-wrapper
> ===
> RCS file: /data/src/openbsd/src/gnu/usr.bin/binutils/Makefile.bsd-wrapper,v
> retrieving revision 1.83
> diff -u -p -r1.83 Makefile.bsd-wrapper
> --- gnu/usr.bin/binutils/Makefile.bsd-wrapper 1 Jun 2015 17:36:19 -   
> 1.83
> +++ gnu/usr.bin/binutils/Makefile.bsd-wrapper 11 Sep 2016 01:54:15 -
> @@ -81,7 +81,8 @@ install: maninstall
>   tooldir=${PREFIX} \
>   BSDSRCDIR=${BSDSRCDIR} \
>   INSTALL_MODULES='${INSTALL_MODULES}' \
> - INSTALL_PROGRAM='install -c -S' \
> + INSTALL_PROGRAM='install -c -S ${INSTALL_STRIP} -o ${BINOWN} -g 
> ${BINGRP} -m ${BINMODE}' \
> + INSTALL_DATA='install -c -o ${BINOWN} -g ${DOCGRP} -m 
> ${NONBINMODE}' \

same here


>   INSTALL_INFO_HOST_MODULES='${INSTALL_INFO_HOST_MODULES}' \
> install install-info
>