svn commit: r252291 - stable/9/sbin/mdconfig

2013-06-27 Thread Hiroki Sato
Author: hrs
Date: Thu Jun 27 06:57:09 2013
New Revision: 252291
URL: http://svnweb.freebsd.org/changeset/base/252291

Log:
  MFC 230423, 230612, 232964, 252033, 252036, 252051:
  
  - Replace the beerware license on mdconfig(8) with standard 2-clause BSD.
  - Rewrite option parsing in mdconfig(8).  This makes it more user-friendly
by removing the ordering requirements and adding more descriptive error
messages; it also makes it more readable and maintainable.
  - Add -f file support to listing mode (-l).  When a -f option is
specified, only md(4) devices which have the specified file as backing
store are displayed.
  - Use MD_NAME instead of md.
  - Use _PATH_DEV instead of /dev/.
  - Return -1 when the specified backing store file is not found in the md
device list.

Modified:
  stable/9/sbin/mdconfig/mdconfig.8
  stable/9/sbin/mdconfig/mdconfig.c
Directory Properties:
  stable/9/sbin/mdconfig/   (props changed)

Modified: stable/9/sbin/mdconfig/mdconfig.8
==
--- stable/9/sbin/mdconfig/mdconfig.8   Thu Jun 27 06:37:24 2013
(r252290)
+++ stable/9/sbin/mdconfig/mdconfig.8   Thu Jun 27 06:57:09 2013
(r252291)
@@ -41,7 +41,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd November 3, 2012
+.Dd June 20, 2013
 .Dt MDCONFIG 8
 .Os
 .Sh NAME
@@ -67,6 +67,7 @@
 .Fl l
 .Op Fl n
 .Op Fl v
+.Op Fl f Ar file
 .Op Fl u Ar unit
 .Nm
 .Ar file
@@ -124,6 +125,19 @@ List configured devices.
 If given with
 .Fl u ,
 display details about that particular device.
+If given with
+.Fl f Ar file ,
+display
+.Xr md 4
+device names of which
+.Ar file
+is used as the backing store.
+If both of
+.Fl u
+and
+.Fl f
+options are specified,
+display devices which match the two conditions. 
 If the
 .Fl v
 option is specified, show all details.

Modified: stable/9/sbin/mdconfig/mdconfig.c
==
--- stable/9/sbin/mdconfig/mdconfig.c   Thu Jun 27 06:37:24 2013
(r252290)
+++ stable/9/sbin/mdconfig/mdconfig.c   Thu Jun 27 06:57:09 2013
(r252291)
@@ -1,14 +1,35 @@
-/*
- * 
- * THE BEER-WARE LICENSE (Revision 42):
- * p...@freebsd.org wrote this file.  As long as you retain this notice you
- * can do whatever you want with this stuff. If we meet some day, and you think
- * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
- * 
+/*-
+ * Copyright (c) 2000-2004 Poul-Henning Kamp p...@freebsd.org
+ * Copyright (c) 2012 The FreeBSD Foundation
+ * All rights reserved.
  *
- * $FreeBSD$
+ * Portions of this software were developed by Edward Tomasz Napierala
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
  *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
  */
+
 #include sys/param.h
 #include sys/devicestat.h
 #include sys/ioctl.h
@@ -26,22 +47,22 @@
 #include inttypes.h
 #include libgeom.h
 #include libutil.h
+#include paths.h
 #include stdarg.h
 #include stdio.h
 #include stdlib.h
 #include string.h
 #include unistd.h
 
-
 static struct md_ioctl mdio;
 static enum {UNSET, ATTACH, DETACH, LIST} action = UNSET;
 static int nflag;
 
 static void usage(void);
 static void md_set_file(const char *);
-static int md_find(char *, const char *);
-static int md_query(char *name);
-static int md_list(char *units, int opt);
+static int md_find(const char *, const char *);
+static int md_query(const char *, const int, const char *);
+static int md_list(const char *, int, const char *);
 static char *geom_config_get(struct gconf *g, const char *name);
 

svn commit: r252292 - stable/9/sys/kern

2013-06-27 Thread Konstantin Belousov
Author: kib
Date: Thu Jun 27 07:27:08 2013
New Revision: 252292
URL: http://svnweb.freebsd.org/changeset/base/252292

Log:
  MFC r251684:
  Fix two issues with the spin loops in the umtx(2) implementation.
  - When looping, check for the pending suspension.
  - Add missed checks for the faults from casuword*().

Modified:
  stable/9/sys/kern/kern_umtx.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_umtx.c
==
--- stable/9/sys/kern/kern_umtx.c   Thu Jun 27 06:57:09 2013
(r252291)
+++ stable/9/sys/kern/kern_umtx.c   Thu Jun 27 07:27:08 2013
(r252292)
@@ -505,6 +505,32 @@ umtxq_count_pi(struct umtx_key *key, str
return (0);
 }
 
+static int
+umtxq_check_susp(struct thread *td)
+{
+   struct proc *p;
+   int error;
+
+   /*
+* The check for TDF_NEEDSUSPCHK is racy, but it is enough to
+* eventually break the lockstep loop.
+*/
+   if ((td-td_flags  TDF_NEEDSUSPCHK) == 0)
+   return (0);
+   error = 0;
+   p = td-td_proc;
+   PROC_LOCK(p);
+   if (P_SHOULDSTOP(p) ||
+   ((p-p_flag  P_TRACED)  (td-td_dbgflags  TDB_SUSPEND))) {
+   if (p-p_flag  P_SINGLE_EXIT)
+   error = EINTR;
+   else
+   error = ERESTART;
+   }
+   PROC_UNLOCK(p);
+   return (error);
+}
+
 /*
  * Wake up threads waiting on an userland object.
  */
@@ -666,6 +692,10 @@ _do_lock_umtx(struct thread *td, struct 
if (owner == -1)
return (EFAULT);
 
+   error = umtxq_check_susp(td);
+   if (error != 0)
+   break;
+
/* If this failed the lock has changed, restart. */
continue;
}
@@ -715,6 +745,9 @@ _do_lock_umtx(struct thread *td, struct 
umtxq_remove(uq);
umtxq_unlock(uq-uq_key);
umtx_key_release(uq-uq_key);
+
+   if (error == 0)
+   error = umtxq_check_susp(td);
}
 
return (0);
@@ -865,6 +898,10 @@ _do_lock_umtx32(struct thread *td, uint3
if (owner == -1)
return (EFAULT);
 
+   error = umtxq_check_susp(td);
+   if (error != 0)
+   break;
+
/* If this failed the lock has changed, restart. */
continue;
}
@@ -914,6 +951,9 @@ _do_lock_umtx32(struct thread *td, uint3
umtxq_remove(uq);
umtxq_unlock(uq-uq_key);
umtx_key_release(uq-uq_key);
+
+   if (error == 0)
+   error = umtxq_check_susp(td);
}
 
return (0);
@@ -1157,6 +1197,10 @@ _do_lock_normal(struct thread *td, struc
if (owner == -1)
return (EFAULT);
 
+   error = umtxq_check_susp(td);
+   if (error != 0)
+   return (error);
+
/* If this failed the lock has changed, 
restart. */
continue;
}
@@ -1215,6 +1259,9 @@ _do_lock_normal(struct thread *td, struc
umtxq_remove(uq);
umtxq_unlock(uq-uq_key);
umtx_key_release(uq-uq_key);
+
+   if (error == 0)
+   error = umtxq_check_susp(td);
}
 
return (0);
@@ -1374,6 +1421,11 @@ do_wake2_umutex(struct thread *td, struc
if (old == owner)
break;
owner = old;
+   if (old == -1)
+   break;
+   error = umtxq_check_susp(td);
+   if (error != 0)
+   break;
}
} else if (count == 1) {
owner = fuword32(__DEVOLATILE(uint32_t *, m-m_owner));
@@ -1384,6 +1436,11 @@ do_wake2_umutex(struct thread *td, struc
if (old == owner)
break;
owner = old;
+   if (old == -1)
+   break;
+   error = umtxq_check_susp(td);
+   if (error != 0)
+   break;
}
}
umtxq_lock(key);
@@ -1848,6 +1905,10 @@ _do_lock_pi(struct thread *td, struct um
break;
}
 
+   error = umtxq_check_susp(td);
+   if (error != 0)
+   break;
+
  

svn commit: r252294 - head/sys/dev/usb/serial

2013-06-27 Thread Remko Lodder
Author: remko
Date: Thu Jun 27 09:06:00 2013
New Revision: 252294
URL: http://svnweb.freebsd.org/changeset/base/252294

Log:
  Add support for the NTT Docomo L-02C card.
  
  PR:   180017
  Submitted by: Masaharu FUJITA
  Glanced at by:imp
  MFC after:1 week

Modified:
  head/sys/dev/usb/serial/u3g.c

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Thu Jun 27 08:12:23 2013
(r252293)
+++ head/sys/dev/usb/serial/u3g.c   Thu Jun 27 09:06:00 2013
(r252294)
@@ -391,6 +391,7 @@ static const STRUCT_USB_HOST_ID u3g_devs
U3G_DEV(QISDA, H20_2, 0),
U3G_DEV(QISDA, H21_1, 0),
U3G_DEV(QISDA, H21_2, 0),
+   U3G_DEV(QUALCOMM, NTT_L02C_MODEM, U3GINIT_SCSIEJECT),
U3G_DEV(QUALCOMM2, AC8700, 0),
U3G_DEV(QUALCOMM2, MF330, 0),
U3G_DEV(QUALCOMM2, SIM5218, 0),
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2013-06-27 Thread Remko Lodder
Author: remko
Date: Thu Jun 27 09:08:07 2013
New Revision: 252295
URL: http://svnweb.freebsd.org/changeset/base/252295

Log:
  Add support for the NTT Docomo L-02C card.
  (This file didn't get along in the previous commit)
  
  PR:   180017
  Submitted by: Masaharu FUJITA
  Glanced at by:imp
  MFC after:1 week

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Jun 27 09:06:00 2013(r252294)
+++ head/sys/dev/usb/usbdevsThu Jun 27 09:08:07 2013(r252295)
@@ -3418,6 +3418,8 @@ product QISDA H20_2   0x4519  3G modem
 
 /* Qualcomm products */
 product QUALCOMM CDMA_MSM  0x6000  CDMA Technologies MSM phone
+product QUALCOMM NTT_L02C_MODEM0x618f  NTT DOCOMO L-02C
+product QUALCOMM NTT_L02C_STORAGE  0x61dd  NTT DOCOMO L-02C
 product QUALCOMM2 MF3300x6613  MF330
 product QUALCOMM2 RWT_FCT  0x3100  RWT FCT-CDMA 2000 1xRTT modem
 product QUALCOMM2 CDMA_MSM 0x3196  CDMA Technologies MSM modem
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252296 - stable/9/sys/boot/sparc64/loader

2013-06-27 Thread Marius Strobl
Author: marius
Date: Thu Jun 27 09:14:50 2013
New Revision: 252296
URL: http://svnweb.freebsd.org/changeset/base/252296

Log:
  MFC: r251589
  
  - The method introduced as part of r234898 (MFCed to stable/9 in r236076)
for not altering the boot path when booting from ZFS turned out to also
cause the boot path not being adjusted if booting from CD-ROM with firmware
versions that do not employ the cdrom alias in that case. So shuffle the
code around instead in order to achieve the original intent. Ideally, we
shouldn't fiddle with the boot path when booting from UFS on a disk either;
unfortunately, there doesn't seem to be an universal way of telling disks
and CD-ROMs apart, though. [1]
  - Use NULL instead of 0 for pointers.
  
  PR:   179289 [1]

Modified:
  stable/9/sys/boot/sparc64/loader/main.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/sparc64/loader/main.c
==
--- stable/9/sys/boot/sparc64/loader/main.c Thu Jun 27 09:08:07 2013
(r252295)
+++ stable/9/sys/boot/sparc64/loader/main.c Thu Jun 27 09:14:50 2013
(r252296)
@@ -160,17 +160,19 @@ struct devsw *devsw[] = {
 #ifdef LOADER_ZFS_SUPPORT
zfs_dev,
 #endif
-   0
+   NULL
 };
+
 struct arch_switch archsw;
 
 static struct file_format sparc64_elf = {
__elfN(loadfile),
__elfN(exec)
 };
+
 struct file_format *file_formats[] = {
sparc64_elf,
-   0
+   NULL
 };
 
 struct fs_ops *file_system[] = {
@@ -198,19 +200,20 @@ struct fs_ops *file_system[] = {
 #ifdef LOADER_TFTP_SUPPORT
tftp_fsops,
 #endif
-   0
+   NULL
 };
+
 struct netif_driver *netif_drivers[] = {
 #ifdef LOADER_NET_SUPPORT
ofwnet,
 #endif
-   0
+   NULL
 };
 
 extern struct console ofwconsole;
 struct console *consoles[] = {
ofwconsole,
-   0
+   NULL
 };
 
 #ifdef LOADER_DEBUG
@@ -854,24 +857,6 @@ main(int (*openfirm)(void *))
OF_getprop(chosen, bootpath, bootpath, sizeof(bootpath));
 
/*
-* Sun compatible bootable CD-ROMs have a disk label placed
-* before the cd9660 data, with the actual filesystem being
-* in the first partition, while the other partitions contain
-* pseudo disk labels with embedded boot blocks for different
-* architectures, which may be followed by UFS filesystems.
-* The firmware will set the boot path to the partition it
-* boots from ('f' in the sun4u case), but we want the kernel
-* to be loaded from the cd9660 fs ('a'), so the boot path
-* needs to be altered.
-*/
-   if (bootpath[strlen(bootpath) - 2] == ':' 
-   bootpath[strlen(bootpath) - 1] == 'f' 
-   strstr(bootpath, cdrom) != NULL) {
-   bootpath[strlen(bootpath) - 1] = 'a';
-   printf(Boot path set to %s\n, bootpath);
-   }
-
-   /*
 * Initialize devices.
 */
for (dp = devsw; *dp != 0; dp++)
@@ -883,9 +868,24 @@ main(int (*openfirm)(void *))
(void)strncpy(bootpath, zfs_fmtdev(zfs_currdev),
sizeof(bootpath) - 1);
bootpath[sizeof(bootpath) - 1] = '\0';
-   }
+   } else
 #endif
 
+   /*
+* Sun compatible bootable CD-ROMs have a disk label placed before
+* the ISO 9660 data, with the actual file system being in the first
+* partition, while the other partitions contain pseudo disk labels
+* with embedded boot blocks for different architectures, which may
+* be followed by UFS file systems.
+* The firmware will set the boot path to the partition it boots from
+* ('f' in the sun4u/sun4v case), but we want the kernel to be loaded
+* from the ISO 9660 file system ('a'), so the boot path needs to be
+* altered.
+*/
+   if (bootpath[strlen(bootpath) - 2] == ':' 
+   bootpath[strlen(bootpath) - 1] == 'f')
+   bootpath[strlen(bootpath) - 1] = 'a';
+
env_setenv(currdev, EV_VOLATILE, bootpath,
ofw_setcurrdev, env_nounset);
env_setenv(loaddev, EV_VOLATILE, bootpath,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252297 - stable/9/sys/dev/puc

2013-06-27 Thread Marius Strobl
Author: marius
Date: Thu Jun 27 09:20:22 2013
New Revision: 252297
URL: http://svnweb.freebsd.org/changeset/base/252297

Log:
  MFC: r248340
  
  Add support for Exar XR17V358 8-port serial device to puc(4)

Modified:
  stable/9/sys/dev/puc/pucdata.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/puc/   (props changed)

Modified: stable/9/sys/dev/puc/pucdata.c
==
--- stable/9/sys/dev/puc/pucdata.c  Thu Jun 27 09:14:50 2013
(r252296)
+++ stable/9/sys/dev/puc/pucdata.c  Thu Jun 27 09:20:22 2013
(r252297)
@@ -50,6 +50,7 @@ __FBSDID($FreeBSD$);
 static puc_config_f puc_config_amc;
 static puc_config_f puc_config_diva;
 static puc_config_f puc_config_exar;
+static puc_config_f puc_config_exar_pcie;
 static puc_config_f puc_config_icbook;
 static puc_config_f puc_config_moxa;
 static puc_config_f puc_config_oxford_pcie;
@@ -630,6 +631,14 @@ const struct puc_cfg puc_pci_devices[] =
PUC_PORT_8S, 0x10, 0, -1,
},
 
+   /* The XR17V358 uses the 125MHz PCIe clock as its reference clock. */
+   {   0x13a8, 0x0358, 0x, 0,
+   Exar XR17V358,
+   12500,
+   PUC_PORT_8S, 0x10, 0, -1,
+   .config_function = puc_config_exar_pcie
+   },
+
{   0x13fe, 0x1600, 0x1602, 0x0002,
Advantech PCI-1602,
DEFAULT_RCLK * 8,
@@ -1186,6 +1195,17 @@ puc_config_exar(struct puc_softc *sc, en
 }
 
 static int
+puc_config_exar_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+intptr_t *res)
+{
+   if (cmd == PUC_CFG_GET_OFS) {
+   *res = port * 0x400;
+   return (0);
+   }
+   return (ENXIO);
+}
+
+static int
 puc_config_icbook(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
 intptr_t *res)
 {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252298 - stable/9/sys/dev/puc

2013-06-27 Thread Marius Strobl
Author: marius
Date: Thu Jun 27 09:21:22 2013
New Revision: 252298
URL: http://svnweb.freebsd.org/changeset/base/252298

Log:
  MFC: r248472
  
  Correct the definition for Exar XR17V258IV: we must use a config_function
  to specify the offset into the PCI memory spare at which each serial port
  will find its registers.  This was already done for other Exar PCI serial
  devices; it was accidentally omitted for this specific device.

Modified:
  stable/9/sys/dev/puc/pucdata.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/puc/   (props changed)

Modified: stable/9/sys/dev/puc/pucdata.c
==
--- stable/9/sys/dev/puc/pucdata.c  Thu Jun 27 09:20:22 2013
(r252297)
+++ stable/9/sys/dev/puc/pucdata.c  Thu Jun 27 09:21:22 2013
(r252298)
@@ -629,6 +629,7 @@ const struct puc_cfg puc_pci_devices[] =
Exar XR17V258IV,
DEFAULT_RCLK * 8,
PUC_PORT_8S, 0x10, 0, -1,
+   .config_function = puc_config_exar
},
 
/* The XR17V358 uses the 125MHz PCIe clock as its reference clock. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252299 - stable/9/sys/dev/puc

2013-06-27 Thread Marius Strobl
Author: marius
Date: Thu Jun 27 09:22:36 2013
New Revision: 252299
URL: http://svnweb.freebsd.org/changeset/base/252299

Log:
  MFC: r251713
  
  Fix whitespace and normalize some entries.

Modified:
  stable/9/sys/dev/puc/pucdata.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/puc/   (props changed)

Modified: stable/9/sys/dev/puc/pucdata.c
==
--- stable/9/sys/dev/puc/pucdata.c  Thu Jun 27 09:21:22 2013
(r252298)
+++ stable/9/sys/dev/puc/pucdata.c  Thu Jun 27 09:22:36 2013
(r252299)
@@ -512,14 +512,14 @@ const struct puc_cfg puc_pci_devices[] =
Moxa Technologies, Smartio CP-102E/PCIe,
DEFAULT_RCLK * 8,
PUC_PORT_2S, 0x14, 0, -1,
-   .config_function = puc_config_moxa
+   .config_function = puc_config_moxa
},
 
{   0x1393, 0x1025, 0x, 0,
Moxa Technologies, Smartio CP-102EL/PCIe,
DEFAULT_RCLK * 8,
PUC_PORT_2S, 0x14, 0, -1,
-   .config_function = puc_config_moxa
+   .config_function = puc_config_moxa
},
 
{   0x1393, 0x1040, 0x, 0,
@@ -550,7 +550,7 @@ const struct puc_cfg puc_pci_devices[] =
Moxa Technologies, Smartio CP-104EL-A/PCIe,
DEFAULT_RCLK * 8,
PUC_PORT_4S, 0x14, 0, -1,
-   .config_function = puc_config_moxa
+   .config_function = puc_config_moxa
},
 
{   0x1393, 0x1120, 0x, 0,
@@ -569,14 +569,14 @@ const struct puc_cfg puc_pci_devices[] =
Moxa Technologies, Smartio CP-114EL/PCIe,
DEFAULT_RCLK * 8,
PUC_PORT_4S, 0x14, 0, -1,
-   .config_function = puc_config_moxa
+   .config_function = puc_config_moxa
},
 
{   0x1393, 0x1182, 0x, 0,
Moxa Technologies, Smartio CP-118EL-A/PCIe,
DEFAULT_RCLK * 8,
PUC_PORT_8S, 0x14, 0, -1,
-   .config_function = puc_config_moxa
+   .config_function = puc_config_moxa
},
 
{   0x1393, 0x1680, 0x, 0,
@@ -601,7 +601,7 @@ const struct puc_cfg puc_pci_devices[] =
Moxa Technologies, Smartio CP-168EL-A/PCIe,
DEFAULT_RCLK * 8,
PUC_PORT_8S, 0x14, 0, -1,
-   .config_function = puc_config_moxa
+   .config_function = puc_config_moxa
},
 
{   0x13a8, 0x0152, 0x, 0,
@@ -711,10 +711,10 @@ const struct puc_cfg puc_pci_devices[] =
 * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports.
 */
{
-   0x1415, 0x9501, 0x10fc ,0xc070,
-   I-O DATA RSA-PCI2/R,
-   DEFAULT_RCLK * 8,
-   PUC_PORT_2S, 0x10, 0, 8,
+   0x1415, 0x9501, 0x10fc, 0xc070,
+   I-O DATA RSA-PCI2/R,
+   DEFAULT_RCLK * 8,
+   PUC_PORT_2S, 0x10, 0, 8,
},
 
{   0x1415, 0x9501, 0x131f, 0x2050,
@@ -830,7 +830,7 @@ const struct puc_cfg puc_pci_devices[] =
 *
 * Lindy 51189 (4 port)
 * URL:http://www.lindy.com URL:http://tinyurl.com/lindy-51189
-* 
+*
 * StarTech.com PEX4S952 (4 port) and PEX8S952 (8 port)
 * URL:http://www.startech.com
 */
@@ -990,10 +990,10 @@ const struct puc_cfg puc_pci_devices[] =
PUC_PORT_2S, 0x10, 0, 8,
},
 
-   {0x5372, 0x6873, 0x, 0,
-Sun 1040 PCI Quad Serial,
-DEFAULT_RCLK,
-PUC_PORT_4S, 0x10, 4, 0,
+   {   0x5372, 0x6873, 0x, 0,
+   Sun 1040 PCI Quad Serial,
+   DEFAULT_RCLK,
+   PUC_PORT_4S, 0x10, 4, 0,
},
 
{   0x, 0x0001, 0x, 0,
@@ -1015,10 +1015,10 @@ const struct puc_cfg puc_pci_devices[] =
},
 
{   0x9710, 0x9815, 0x, 0,
-   NetMos NM9815 Dual 1284 Printer port, 
+   NetMos NM9815 Dual 1284 Printer port,
0,
PUC_PORT_2P, 0x10, 8, 0,
-   }, 
+   },
 
/*
 * This is more specific than the generic NM9835 entry that follows, and
@@ -1444,19 +1444,19 @@ puc_config_timedia(struct puc_softc *sc,
 {
static const uint16_t dual[] = {
0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
-   0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079, 
-   0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079, 
+   0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
+   0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
0xD079, 0
};
static const uint16_t quad[] = {
-   0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157, 
-   0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159, 
+   0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 

svn commit: r252300 - stable/9/sys/dev/puc

2013-06-27 Thread Marius Strobl
Author: marius
Date: Thu Jun 27 09:23:53 2013
New Revision: 252300
URL: http://svnweb.freebsd.org/changeset/base/252300

Log:
  MFC: r251715
  
  All of Oxford/PLX OX16PCI954, OXm16PCI954 and OXu16PCI954 share the
  exact same (subsystem) device and vendor IDs. However, the reference
  design for the OXu16PCI954 uses a 14.7456 MHz clock (as does the EXSYS
  EX-41098-2 equipped with these), while at least the OX16PCI954 defaults
  to a 1.8432 MHz one. According to the datasheets of these chips, the
  only difference in PCI configuration space is that OXu16PCI954 have
  a revision ID of 1 while the other two are at 0. So employ the latter
  for determining the default clock rates of this family.

Modified:
  stable/9/sys/dev/puc/pucdata.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/puc/   (props changed)

Modified: stable/9/sys/dev/puc/pucdata.c
==
--- stable/9/sys/dev/puc/pucdata.c  Thu Jun 27 09:22:36 2013
(r252299)
+++ stable/9/sys/dev/puc/pucdata.c  Thu Jun 27 09:23:53 2013
(r252300)
@@ -53,6 +53,7 @@ static puc_config_f puc_config_exar;
 static puc_config_f puc_config_exar_pcie;
 static puc_config_f puc_config_icbook;
 static puc_config_f puc_config_moxa;
+static puc_config_f puc_config_oxford_pci954;
 static puc_config_f puc_config_oxford_pcie;
 static puc_config_f puc_config_quatech;
 static puc_config_f puc_config_syba;
@@ -743,8 +744,9 @@ const struct puc_cfg puc_pci_devices[] =
 
{   0x1415, 0x9501, 0x, 0,
Oxford Semiconductor OX16PCI954 UARTs,
-   DEFAULT_RCLK,
+   0,
PUC_PORT_4S, 0x10, 0, 8,
+   .config_function = puc_config_oxford_pci954
},
 
{   0x1415, 0x950a, 0x131f, 0x2030,
@@ -1516,6 +1518,28 @@ puc_config_timedia(struct puc_softc *sc,
 }
 
 static int
+puc_config_oxford_pci954(struct puc_softc *sc, enum puc_cfg_cmd cmd,
+int port __unused, intptr_t *res)
+{
+
+   switch (cmd) {
+   case PUC_CFG_GET_CLOCK:
+   /*
+* OXu16PCI954 use a 14.7456 MHz clock by default while
+* OX16PCI954 and OXm16PCI954 employ a 1.8432 MHz one.
+*/
+   if (pci_get_revid(sc-sc_dev) == 1)
+   *res = DEFAULT_RCLK * 8;
+   else
+   *res = DEFAULT_RCLK;
+   return (0);
+   default:
+   break;
+   }
+   return (ENXIO);
+}
+
+static int
 puc_config_oxford_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
 intptr_t *res)
 {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252301 - stable/9/sys/dev/mpt

2013-06-27 Thread Marius Strobl
Author: marius
Date: Thu Jun 27 09:30:09 2013
New Revision: 252301
URL: http://svnweb.freebsd.org/changeset/base/252301

Log:
  MFC: r252180
  
  Flag mpt(4) as supporting unmapped I/O; all necessary conversion actually
  already has been done as part of r246713 (MFCed to stable/9 in r251874)
  except for a comment update.

Modified:
  stable/9/sys/dev/mpt/mpt_cam.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/mpt/mpt_cam.c
==
--- stable/9/sys/dev/mpt/mpt_cam.c  Thu Jun 27 09:23:53 2013
(r252300)
+++ stable/9/sys/dev/mpt/mpt_cam.c  Thu Jun 27 09:30:09 2013
(r252301)
@@ -1254,7 +1254,8 @@ mpt_timeout(void *arg)
 }
 
 /*
- * Callback routine from bus_dmamap_load or, in simple cases, called 
directly.
+ * Callback routine from bus_dmamap_load_ccb(9) or, in simple cases, called
+ * directly.
  *
  * Takes a list of physical segments and builds the SGL for SCSI IO command
  * and forwards the commard to the IOC after one last check that CAM has not
@@ -1688,7 +1689,6 @@ mpt_execute_req(void *arg, bus_dma_segme
hdrp = req-req_vbuf;
mpt_off = req-req_vbuf;
 
-
if (error == 0  ((uint32_t)nseg) = mpt-max_seg_cnt) {
error = EFBIG;
}
@@ -3595,21 +3595,21 @@ mpt_action(struct cam_sim *sim, union cc
 #ifdef CAM_NEW_TRAN_CODE
cpi-protocol = PROTO_SCSI;
if (mpt-is_fc) {
-   cpi-hba_misc = PIM_NOBUSRESET;
+   cpi-hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED;
cpi-base_transfer_speed = 10;
cpi-hba_inquiry = PI_TAG_ABLE;
cpi-transport = XPORT_FC;
cpi-transport_version = 0;
cpi-protocol_version = SCSI_REV_SPC;
} else if (mpt-is_sas) {
-   cpi-hba_misc = PIM_NOBUSRESET;
+   cpi-hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED;
cpi-base_transfer_speed = 30;
cpi-hba_inquiry = PI_TAG_ABLE;
cpi-transport = XPORT_SAS;
cpi-transport_version = 0;
cpi-protocol_version = SCSI_REV_SPC2;
} else {
-   cpi-hba_misc = PIM_SEQSCAN;
+   cpi-hba_misc = PIM_SEQSCAN | PIM_UNMAPPED;
cpi-base_transfer_speed = 3300;
cpi-hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16;
cpi-transport = XPORT_SPI;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252302 - head/sbin/nvmecontrol

2013-06-27 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jun 27 10:42:09 2013
New Revision: 252302
URL: http://svnweb.freebsd.org/changeset/base/252302

Log:
  Fix build.

Modified:
  head/sbin/nvmecontrol/logpage.c
  head/sbin/nvmecontrol/nvmecontrol.c

Modified: head/sbin/nvmecontrol/logpage.c
==
--- head/sbin/nvmecontrol/logpage.c Thu Jun 27 09:30:09 2013
(r252301)
+++ head/sbin/nvmecontrol/logpage.c Thu Jun 27 10:42:09 2013
(r252302)
@@ -227,7 +227,7 @@ print_log_firmware(void *buf, uint32_t s
}
 }
 
-struct logpage_function {
+static struct logpage_function {
uint8_t log_page;
print_fn_t  fn;
 } logfuncs[] = {

Modified: head/sbin/nvmecontrol/nvmecontrol.c
==
--- head/sbin/nvmecontrol/nvmecontrol.c Thu Jun 27 09:30:09 2013
(r252301)
+++ head/sbin/nvmecontrol/nvmecontrol.c Thu Jun 27 10:42:09 2013
(r252302)
@@ -46,7 +46,7 @@ __FBSDID($FreeBSD$);
 
 typedef void (*nvme_fn_t)(int argc, char *argv[]);
 
-struct nvme_function {
+static struct nvme_function {
const char  *name;
nvme_fn_t   fn;
const char  *usage;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252303 - stable/9/sys/cam/scsi

2013-06-27 Thread Steven Hartland
Author: smh
Date: Thu Jun 27 10:55:35 2013
New Revision: 252303
URL: http://svnweb.freebsd.org/changeset/base/252303

Log:
  MFC r252045:
  Corrected ATA Passthrough defines from decimal to hex

Modified:
  stable/9/sys/cam/scsi/scsi_all.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_all.h
==
--- stable/9/sys/cam/scsi/scsi_all.hThu Jun 27 10:42:09 2013
(r252302)
+++ stable/9/sys/cam/scsi/scsi_all.hThu Jun 27 10:55:35 2013
(r252303)
@@ -917,10 +917,10 @@ struct ata_pass_12 {
 #defineAP_PROTO_DMA_QUEUED (0x07  1)
 #defineAP_PROTO_DEVICE_DIAG(0x08  1)
 #defineAP_PROTO_DEVICE_RESET   (0x09  1)
-#defineAP_PROTO_UDMA_IN(0x10  1)
-#defineAP_PROTO_UDMA_OUT   (0x11  1)
-#defineAP_PROTO_FPDMA  (0x12  1)
-#defineAP_PROTO_RESP_INFO  (0x15  1)
+#defineAP_PROTO_UDMA_IN(0x0a  1)
+#defineAP_PROTO_UDMA_OUT   (0x0b  1)
+#defineAP_PROTO_FPDMA  (0x0c  1)
+#defineAP_PROTO_RESP_INFO  (0x0f  1)
 #defineAP_MULTI0xe0
u_int8_t flags;
 #defineAP_T_LEN0x03
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252304 - stable/8/sys/cam/scsi

2013-06-27 Thread Steven Hartland
Author: smh
Date: Thu Jun 27 10:58:31 2013
New Revision: 252304
URL: http://svnweb.freebsd.org/changeset/base/252304

Log:
  MFC r252045:
  Corrected ATA Passthrough defines from decimal to hex

Modified:
  stable/8/sys/cam/scsi/scsi_all.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cam/   (props changed)

Modified: stable/8/sys/cam/scsi/scsi_all.h
==
--- stable/8/sys/cam/scsi/scsi_all.hThu Jun 27 10:55:35 2013
(r252303)
+++ stable/8/sys/cam/scsi/scsi_all.hThu Jun 27 10:58:31 2013
(r252304)
@@ -571,10 +571,10 @@ struct ata_pass_12 {
 #defineAP_PROTO_DMA_QUEUED (0x07  1)
 #defineAP_PROTO_DEVICE_DIAG(0x08  1)
 #defineAP_PROTO_DEVICE_RESET   (0x09  1)
-#defineAP_PROTO_UDMA_IN(0x10  1)
-#defineAP_PROTO_UDMA_OUT   (0x11  1)
-#defineAP_PROTO_FPDMA  (0x12  1)
-#defineAP_PROTO_RESP_INFO  (0x15  1)
+#defineAP_PROTO_UDMA_IN(0x0a  1)
+#defineAP_PROTO_UDMA_OUT   (0x0b  1)
+#defineAP_PROTO_FPDMA  (0x0c  1)
+#defineAP_PROTO_RESP_INFO  (0x0f  1)
 #defineAP_MULTI0xe0
u_int8_t flags;
 #defineAP_T_LEN0x03
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r251886 - in head: contrib/apr contrib/apr-util contrib/serf contrib/sqlite3 contrib/subversion share/mk usr.bin usr.bin/svn usr.bin/svn/lib usr.bin/svn/lib/libapr usr.bin/svn/lib/liba

2013-06-27 Thread Garrett Cooper
On Jun 17, 2013, at 7:53 PM, Peter Wemm wrote:

 Author: peter
 Date: Tue Jun 18 02:53:45 2013
 New Revision: 251886
 URL: http://svnweb.freebsd.org/changeset/base/251886
 
 Log:
  Introduce svnlite so that we can check out our source code again.
 
  This is actually a fully functional build except:
  * All internal shared libraries are static linked to make sure there
is no interference with ports (and to reduce build time).
  * It does not have the python/perl/etc plugin or API support.
  * By default, it installs as svnlite rather than svn.
  * If WITH_SVN added in make.conf, you get svn.
  * If WITHOUT_SVNLITE is in make.conf, this is completely disabled.
 
  To be absolutely clear, this is not intended for any use other than
  checking out freebsd source and committing, like we once did with cvs.
 
  It should be usable for small scale local repositories that don't
  need the python/perl plugin architecture.

Hi Peter!
Thanks for adding this to FreeBSD! Could you please document the 
WITHOUT_SVNLITE knob ( http://www.freebsd.org/cgi/query-pr.cgi?pr=180025 ) in 
src.conf(5)?
Thanks again :)!
-Garrett
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252305 - in stable/9: . release/doc share/man/man5

2013-06-27 Thread Glen Barber
Author: gjb
Date: Thu Jun 27 13:03:19 2013
New Revision: 252305
URL: http://svnweb.freebsd.org/changeset/base/252305

Log:
  MFC r230786, r246283, r251084, r251085, r251086:
  
  r230786 (imp):
  - Allow specification of build shell for the buildenv target.
  
  r246283 (hrs) (partial):
  - Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
  
  r251084:
  - r245757 introduced warning output if update method is set to
CVS_UPDATE or SUP_UPDATE.
  - CVS exporter for stable/9/ is turned off for nearly one month
now.
  - It is finally time to swing the ax at these update methods.
  
  r251085:
  - Fix typo introduced in r251084.
  
  r251086:
  - Remove references to CVS_UPDATE and SUP_UPDATE to catch up
with r251084.
  
  Approved by:  kib (mentor)

Modified:
  stable/9/Makefile.inc1   (contents, props changed)
  stable/9/release/doc/Makefile
  stable/9/share/man/man5/make.conf.5
Directory Properties:
  stable/9/release/doc/   (props changed)
  stable/9/share/man/man5/   (props changed)

Modified: stable/9/Makefile.inc1
==
--- stable/9/Makefile.inc1  Thu Jun 27 10:58:31 2013(r252304)
+++ stable/9/Makefile.inc1  Thu Jun 27 13:03:19 2013(r252305)
@@ -23,6 +23,9 @@
 #  when NO_ROOT is set.  (default: ${DESTDIR}/METALOG)
 #  TARGET=machine to crossbuild world for a different machine type
 #  TARGET_ARCH= may be required when a TARGET supports multiple endians
+#  BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh)
+#  WORLD_FLAGS= additional flags to pass to make(1) during buildworld
+#  KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel
 
 #
 # The intended user-driven targets are:
@@ -111,15 +114,10 @@ CLEANDIR= clean cleandepend
 CLEANDIR=  cleandir
 .endif
 
-CVS?=  cvs
-CVSFLAGS?= -A -P -d -I!
-SVN?=  svn
+BUILDENV_SHELL?=/bin/sh
+
+SVN?=  /usr/local/bin/svn
 SVNFLAGS?= -r HEAD
-SUP?=  /usr/bin/csup
-SUPFLAGS?= -g -L 2
-.if defined(SUPHOST)
-SUPFLAGS+= -h ${SUPHOST}
-.endif
 
 MAKEOBJDIRPREFIX?= /usr/obj
 .if !defined(OSRELDATE)
@@ -240,7 +238,7 @@ BMAKEENV=   INSTALL=sh ${.CURDIR}/tools/i
MAKEFLAGS=-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS} \
COMPILER_TYPE=${COMPILER_TYPE}
 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
-   ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
+   ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
DESTDIR= \
BOOTSTRAPPING=${OSRELDATE} \
SSP_CFLAGS= \
@@ -250,7 +248,7 @@ BMAKE=  MAKEOBJDIRPREFIX=${WORLDTMP} \
 
 # build-tools stage
 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
-   ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
+   ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
DESTDIR= \
BOOTSTRAPPING=${OSRELDATE} \
@@ -283,7 +281,7 @@ WMAKE_COMPILER_TYPE=gcc
 WMAKE_COMPILER_TYPE=   clang
 .endif
 WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
-WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
+WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 
DESTDIR=${WORLDTMP}
 
 .if ${TARGET_ARCH} == amd64 || ${TARGET_ARCH} == powerpc64
 # 32 bit world
@@ -373,7 +371,7 @@ IMAKE_MTREE=MTREE_CMD=nmtree ${MTREEFL
 
 # kernel stage
 KMAKEENV=  ${WMAKEENV}
-KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME}
+KMAKE= ${KMAKEENV} ${MAKE} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
 
 #
 # buildworld
@@ -602,7 +600,7 @@ buildenvvars:
 
 buildenv:
@echo Entering world for ${TARGET_ARCH}:${TARGET}
-   @cd ${.CURDIR}  env ${WMAKEENV} sh || true
+   @cd ${.CURDIR}  env ${WMAKEENV} ${BUILDENV_SHELL} || true
 
 TOOLCHAIN_TGTS=${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
 toolchain: ${TOOLCHAIN_TGTS}
@@ -1014,59 +1012,18 @@ doxygen:
 # latest copy.
 #
 update:
-.if defined(SUP_UPDATE)
+.if (defined(CVS_UPDATE) || defined(SUP_UPDATE))  !defined(SVN_UPDATE)
@echo --
-   @echo  Running ${SUP}
+   @echo CVS_UPDATE and SUP_UPDATE are no longer supported.
+   @echo Please see: https://wiki.freebsd.org/CvsIsDeprecated;
@echo --
-   @echo !! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!
-   @echo !! Update methods with ${SUP} are deprecated.
-   @echo !! Please see http://www.freebsd.org/handbook/svn.html;
-   @echo !! and convert your update method to SVN_UPDATE or
-   @echo !! freebsd-update(8).
-   @echo !! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!
-   @sleep 5
-.if defined(SUPFILE)
-   @${SUP} ${SUPFLAGS} ${SUPFILE}
-.endif
-.if defined(SUPFILE1)
-   @${SUP} 

Re: svn commit: r252283 - in stable/9: contrib/tcpdump usr.sbin/tcpdump/tcpdump

2013-06-27 Thread Glen Barber
On Thu, Jun 27, 2013 at 12:38:00AM +, Xin LI wrote:
 Author: delphij
 Date: Thu Jun 27 00:37:59 2013
 New Revision: 252283
 URL: http://svnweb.freebsd.org/changeset/base/252283
 
 Log:
   MFC: tcpdump 4.4.0.
 

I think this breaks the build.

cc -O -pipe -G0  -I/src/usr.sbin/tcpdump/tcpdump
-I/src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump -DHAVE_CONFIG_H
-D_U_=__attribute__((unused)) -DINET6 -DLBL_ALIGN
-I/obj/mips.mipsel/src/tmp/usr/include/openssl -DHAVE_LIBCRYPTO 
-DHAVE_OPENSSL_EVP_H
-DHAVE_NET_PFVAR_H -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
-Wno-uninitialized -Wno-pointer-sign -c
/src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c
/src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c: In 
function
'print_src_dst':
/src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c:330: 
error: 'tcpstates'
undeclared (first use in this function)
/src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c:330: 
error: (Each
undeclared identifier is reported only once
/src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c:330: 
error: for each
function it appears in.)
*** Error code 1

Stop in /src/usr.sbin/tcpdump/tcpdump.
*** Error code 1

Glen



pgphiGcBPX6DZ.pgp
Description: PGP signature


svn commit: r252306 - in stable/8: cddl/contrib/opensolaris/cmd/zpool sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-06-27 Thread Steven Hartland
Author: smh
Date: Thu Jun 27 14:32:51 2013
New Revision: 252306
URL: http://svnweb.freebsd.org/changeset/base/252306

Log:
  MFC r252056:
  Fix destroyed ZFS pools failing to import
  
  MFC r252059:
  Fix ZFS zpool freeze (debug command) not processing due to invalid ioctl call 
syntax.
  
  MFC r252060:
  Fix intermittent ZFS lock panic
  
  MFC r252061:
  Switch ZFS mutex_owner macro to use sx_xholder as its now exported via sx.h

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  stable/8/sys/cddl/compat/opensolaris/sys/mutex.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Jun 27 
13:03:19 2013(r252305)
+++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Jun 27 
14:32:51 2013(r252306)
@@ -5332,10 +5332,9 @@ main(int argc, char **argv)
 * 'freeze' is a vile debugging abomination, so we treat
 * it as such.
 */
-   char buf[16384];
-   int fd = open(ZFS_DEV, O_RDWR);
-   (void) strcpy((void *)buf, argv[2]);
-   return (!!ioctl(fd, ZFS_IOC_POOL_FREEZE, buf));
+   zfs_cmd_t zc = { 0 };
+   (void) strlcpy(zc.zc_name, argv[2], sizeof (zc.zc_name));
+   return (!!zfs_ioctl(g_zfs, ZFS_IOC_POOL_FREEZE, zc));
} else {
(void) fprintf(stderr, gettext(unrecognized 
command '%s'\n), cmdname);

Modified: stable/8/sys/cddl/compat/opensolaris/sys/mutex.h
==
--- stable/8/sys/cddl/compat/opensolaris/sys/mutex.hThu Jun 27 13:03:19 
2013(r252305)
+++ stable/8/sys/cddl/compat/opensolaris/sys/mutex.hThu Jun 27 14:32:51 
2013(r252306)
@@ -71,8 +71,7 @@ typedef struct sx kmutex_t;
 #definemutex_tryenter(lock)sx_try_xlock(lock)
 #definemutex_exit(lock)sx_xunlock(lock)
 #definemutex_owned(lock)   sx_xlocked(lock)
-/* TODO: Change to sx_xholder() once it is moved from kern_sx.c to sx.h. */
-#definemutex_owner(lock)   ((lock)-sx_lock  SX_LOCK_SHARED ? 
NULL : (struct thread *)SX_OWNER((lock)-sx_lock))
+#definemutex_owner(lock)   sx_xholder(lock)
 
 #endif /* _KERNEL */
 

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Thu Jun 
27 13:03:19 2013(r252305)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Thu Jun 
27 14:32:51 2013(r252306)
@@ -1834,6 +1834,7 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg)
vdev_config_dirty(vd-vdev_top);
}
 
+   bzero(smlock, sizeof (smlock));
mutex_init(smlock, NULL, MUTEX_DEFAULT, NULL);
 
space_map_create(smsync, sm-sm_start, sm-sm_size, sm-sm_shift,

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jun 
27 13:03:19 2013(r252305)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jun 
27 14:32:51 2013(r252306)
@@ -270,8 +270,7 @@ vdev_geom_read_config(struct g_consumer 
continue;
 
if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE,
-   state) != 0 || state == POOL_STATE_DESTROYED ||
-   state  POOL_STATE_L2CACHE) {
+   state) != 0 || state  POOL_STATE_L2CACHE) {
nvlist_free(*config);
*config = NULL;
continue;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r252283 - in stable/9: contrib/tcpdump usr.sbin/tcpdump/tcpdump

2013-06-27 Thread Sergey Kandaurov
On 27 June 2013 17:58, Glen Barber g...@freebsd.org wrote:
 On Thu, Jun 27, 2013 at 12:38:00AM +, Xin LI wrote:
 Author: delphij
 Date: Thu Jun 27 00:37:59 2013
 New Revision: 252283
 URL: http://svnweb.freebsd.org/changeset/base/252283

 Log:
   MFC: tcpdump 4.4.0.


 I think this breaks the build.

 cc -O -pipe -G0  -I/src/usr.sbin/tcpdump/tcpdump
 -I/src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump -DHAVE_CONFIG_H
 -D_U_=__attribute__((unused)) -DINET6 -DLBL_ALIGN
 -I/obj/mips.mipsel/src/tmp/usr/include/openssl -DHAVE_LIBCRYPTO 
 -DHAVE_OPENSSL_EVP_H
 -DHAVE_NET_PFVAR_H -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k 
 -W
 -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
 -Wno-uninitialized -Wno-pointer-sign -c
 /src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c
 /src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c: In 
 function
 'print_src_dst':
 /src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c:330: 
 error: 'tcpstates'
 undeclared (first use in this function)
 /src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c:330: 
 error: (Each
 undeclared identifier is reported only once
 /src/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfsync.c:330: 
 error: for each
 function it appears in.)

It is broken in stable/9 due to contrib/pf include spaghetti.
This does work in head thanks to glebius.
This change tries to fix the build on stable/9.

Merge r240136 partially from projects/pf via head.
This is a direct change due to significant divergence in code.

Index: sys/contrib/pf/net/if_pfsync.c
===
--- sys/contrib/pf/net/if_pfsync.c  (revision 252306)
+++ sys/contrib/pf/net/if_pfsync.c  (working copy)
@@ -114,6 +114,7 @@
 #include netinet/in.h
 #include netinet/if_ether.h
 #include netinet/tcp.h
+#include netinet/tcp_fsm.h
 #include netinet/tcp_seq.h

 #ifdef INET
Index: sys/contrib/pf/net/pf.c
===
--- sys/contrib/pf/net/pf.c (revision 252306)
+++ sys/contrib/pf/net/pf.c (working copy)
@@ -111,6 +111,7 @@
 #include netinet/ip.h
 #include netinet/ip_var.h
 #include netinet/tcp.h
+#include netinet/tcp_fsm.h
 #include netinet/tcp_seq.h
 #include netinet/udp.h
 #include netinet/ip_icmp.h
Index: sys/contrib/pf/net/pf_norm.c
===
--- sys/contrib/pf/net/pf_norm.c(revision 252306)
+++ sys/contrib/pf/net/pf_norm.c(working copy)
@@ -67,6 +67,7 @@
 #include netinet/ip.h
 #include netinet/ip_var.h
 #include netinet/tcp.h
+#include netinet/tcp_fsm.h
 #include netinet/tcp_seq.h
 #include netinet/udp.h
 #include netinet/ip_icmp.h
Index: sys/contrib/pf/net/pfvar.h
===
--- sys/contrib/pf/net/pfvar.h  (revision 252306)
+++ sys/contrib/pf/net/pfvar.h  (working copy)
@@ -58,8 +58,6 @@
 #include netinet/in.h
 #endif

-#include netinet/tcp_fsm.h
-
 struct ip;
 struct ip6_hdr;
 #ifdef __FreeBSD__


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


Re: svn commit: r252283 - in stable/9: contrib/tcpdump usr.sbin/tcpdump/tcpdump

2013-06-27 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 06/27/13 06:58, Glen Barber wrote:
 On Thu, Jun 27, 2013 at 12:38:00AM +, Xin LI wrote:
 Author: delphij Date: Thu Jun 27 00:37:59 2013 New Revision:
 252283 URL: http://svnweb.freebsd.org/changeset/base/252283
 
 Log: MFC: tcpdump 4.4.0.
 
 
 I think this breaks the build.

I'll fix this asap.

Cheers,
- -- 
Xin LI delp...@delphij.nethttps://www.delphij.net/
FreeBSD - The Power to Serve!   Live free or die
-BEGIN PGP SIGNATURE-

iQEcBAEBCgAGBQJRzHP4AAoJEG80Jeu8UPuz07kH/15VQh2bOnSK86+rfDx1w01P
nD4wxr7TnZuTk/D6hfGUoHpfyFBGdC6l8aCeWQJHGGwd4FuEcFcxV7k9BMqFvNdr
kJyhO1ZR2QvIda2eRjW2rzGMsKNYK6zJiMYjE5NKUUW27PIPVr+YbWb7zSwUPlhz
3/bD4xndI/pyxPUvPJ7/7/T1kqsUmvwAIrVEKABs6AQjhQ8vJQfCc8hdiyDZgav/
/GtQtKiRqRTMXLTQOAgCwpsYc/lwpi66sZdY7WNVNdqPZ9RbxKqZWPwc+gLsHWDO
FcMVliD2uVarXd6a2BMceZzLcnqN4FKRanTHcmm3TD1IrjiePtRiQ2ds/tHF68o=
=+GO0
-END PGP SIGNATURE-
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252307 - stable/9/contrib/tcpdump

2013-06-27 Thread Xin LI
Author: delphij
Date: Thu Jun 27 17:33:04 2013
New Revision: 252307
URL: http://svnweb.freebsd.org/changeset/base/252307

Log:
  Fix build: in a recent pf refactor (head@240233), pf_var.h was modified
  to not include netinet/tcp_fsm.h, and HEAD tcpdump rely on this change
  as the tcp_fsm.h will only be processed once.
  
  Solve this by defining TCPSTATES earlier.  This wouldn't cause breakage
  should pf be merged in the future.
  
  Noticed by:   tinderbox via many
  Pointy hat to:delphij

Modified:
  stable/9/contrib/tcpdump/print-pfsync.c

Modified: stable/9/contrib/tcpdump/print-pfsync.c
==
--- stable/9/contrib/tcpdump/print-pfsync.c Thu Jun 27 14:32:51 2013
(r252306)
+++ stable/9/contrib/tcpdump/print-pfsync.c Thu Jun 27 17:33:04 2013
(r252307)
@@ -37,10 +37,10 @@
 
 #include sys/endian.h
 #include net/if.h
+#defineTCPSTATES
 #include net/pfvar.h /* XXX */
 #include net/if_pfsync.h
 #include netinet/ip.h
-#defineTCPSTATES
 #include netinet/tcp_fsm.h
 
 #include string.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252308 - in stable/9: cddl/contrib/opensolaris/cmd/zpool sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-06-27 Thread Steven Hartland
Author: smh
Date: Thu Jun 27 18:20:19 2013
New Revision: 252308
URL: http://svnweb.freebsd.org/changeset/base/252308

Log:
  MFC r252056:
  Fix destroyed ZFS pools failing to import
  
  MFC r252059:
  Fix ZFS zpool freeze (debug command) not processing due to invalid ioctl call 
syntax.
  
  MFC r252060:
  Fix intermittent ZFS lock panic
  
  MFC r252061:
  Switch ZFS mutex_owner macro to use sx_xholder as its now exported via sx.h

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  stable/9/sys/cddl/compat/opensolaris/sys/mutex.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Jun 27 
17:33:04 2013(r252307)
+++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Jun 27 
18:20:19 2013(r252308)
@@ -5322,10 +5322,9 @@ main(int argc, char **argv)
 * 'freeze' is a vile debugging abomination, so we treat
 * it as such.
 */
-   char buf[16384];
-   int fd = open(ZFS_DEV, O_RDWR);
-   (void) strcpy((void *)buf, argv[2]);
-   return (!!ioctl(fd, ZFS_IOC_POOL_FREEZE, buf));
+   zfs_cmd_t zc = { 0 };
+   (void) strlcpy(zc.zc_name, argv[2], sizeof (zc.zc_name));
+   return (!!zfs_ioctl(g_zfs, ZFS_IOC_POOL_FREEZE, zc));
} else {
(void) fprintf(stderr, gettext(unrecognized 
command '%s'\n), cmdname);

Modified: stable/9/sys/cddl/compat/opensolaris/sys/mutex.h
==
--- stable/9/sys/cddl/compat/opensolaris/sys/mutex.hThu Jun 27 17:33:04 
2013(r252307)
+++ stable/9/sys/cddl/compat/opensolaris/sys/mutex.hThu Jun 27 18:20:19 
2013(r252308)
@@ -71,8 +71,7 @@ typedef struct sx kmutex_t;
 #definemutex_tryenter(lock)sx_try_xlock(lock)
 #definemutex_exit(lock)sx_xunlock(lock)
 #definemutex_owned(lock)   sx_xlocked(lock)
-/* TODO: Change to sx_xholder() once it is moved from kern_sx.c to sx.h. */
-#definemutex_owner(lock)   ((lock)-sx_lock  SX_LOCK_SHARED ? 
NULL : (struct thread *)SX_OWNER((lock)-sx_lock))
+#definemutex_owner(lock)   sx_xholder(lock)
 
 #endif /* _KERNEL */
 

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Thu Jun 
27 17:33:04 2013(r252307)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Thu Jun 
27 18:20:19 2013(r252308)
@@ -1834,6 +1834,7 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg)
vdev_config_dirty(vd-vdev_top);
}
 
+   bzero(smlock, sizeof (smlock));
mutex_init(smlock, NULL, MUTEX_DEFAULT, NULL);
 
space_map_create(smsync, sm-sm_start, sm-sm_size, sm-sm_shift,

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jun 
27 17:33:04 2013(r252307)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jun 
27 18:20:19 2013(r252308)
@@ -270,8 +270,7 @@ vdev_geom_read_config(struct g_consumer 
continue;
 
if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE,
-   state) != 0 || state == POOL_STATE_DESTROYED ||
-   state  POOL_STATE_L2CACHE) {
+   state) != 0 || state  POOL_STATE_L2CACHE) {
nvlist_free(*config);
*config = NULL;
continue;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252310 - in head: etc/defaults etc/rc.d include sbin/swapon share/man/man5

2013-06-27 Thread Hiroki Sato
Author: hrs
Date: Thu Jun 27 18:28:45 2013
New Revision: 252310
URL: http://svnweb.freebsd.org/changeset/base/252310

Log:
  - Add vnode-backed swap space specification support.  This is enabled when
device names md or md[0-9]* and a file option are specified in
/etc/fstab like this:
  
mdnoneswapsw,file=/swap.bin   0   0
  
  - Add GBDE/GELI encrypted swap space specification support, which
rc.d/encswap supported.  The /etc/fstab lines are like the following:
  
/dev/ada1p1.bde   noneswapsw  0   0
/dev/ada1p2.eli   noneswapsw  0   0
  
.eli devices accepts aalgo, ealgo, keylen, and sectorsize as options.
  
swapctl(8) can understand an encrypted device in the command line
like this:
  
# swapctl -a /dev/ada2p1.bde
  
  - -L flag is added to support late option to defer swapon until
rc.d/mountlate runs.
  
  - rc.d script change:
  
  rc.d/encswap - removed
  rc.d/addswap - just display a warning message if $swapfile is defined
  rc.d/swap1 - renamed to rc.d/swap
  rc.d/swaplate - newly added to support late option
  
  These changes alleviate a race condition between device creation/removal
  and swapon/swapoff.
  
  MFC after:1 week
  Reviewed by:  wblock (manual page)

Added:
  head/etc/rc.d/swap
 - copied, changed from r251659, head/etc/rc.d/swap1
  head/etc/rc.d/swaplate   (contents, props changed)
Deleted:
  head/etc/rc.d/encswap
  head/etc/rc.d/swap1
Modified:
  head/etc/defaults/rc.conf
  head/etc/rc.d/Makefile
  head/etc/rc.d/addswap
  head/etc/rc.d/fsck
  head/etc/rc.d/mdconfig
  head/include/paths.h
  head/sbin/swapon/swapon.8
  head/sbin/swapon/swapon.c
  head/share/man/man5/fstab.5

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Thu Jun 27 18:24:24 2013(r252309)
+++ head/etc/defaults/rc.conf   Thu Jun 27 18:28:45 2013(r252310)
@@ -32,8 +32,6 @@ early_late_divider=FILESYSTEMS  # Scrip
 always_force_depends=NO  # Set to check that indicated dependencies are
# running during boot (can increase boot time).
 
-swapfile=NO  # Set to name of swapfile if aux swapfile desired.
-swapfile_mdunit=99   # Swapfile md(4) unit number created by mdconfig(8).
 apm_enable=NO# Set to YES to enable APM BIOS functions (or 
NO).
 apmd_enable=NO   # Run apmd to handle APM event from userland.
 apmd_flags=  # Flags to apmd (if enabled).
@@ -85,9 +83,6 @@ geli_autodetach=YES # Automatically de
 #geli_da1_autodetach=NO
 #geli_mirror_home_flags=-k /etc/geli/home.keys
 
-geli_swap_flags=-e aes -l 256 -s 4096 -d # Options for GELI-encrypted
-   # swap partitions.
-
 root_rw_mount=YES# Set to NO to inhibit remounting root read-write.
 fsck_y_enable=NO # Set to YES to do fsck -y if the initial preen fails.
 fsck_y_flags=# Additional flags for fsck -y

Modified: head/etc/rc.d/Makefile
==
--- head/etc/rc.d/Makefile  Thu Jun 27 18:24:24 2013(r252309)
+++ head/etc/rc.d/Makefile  Thu Jun 27 18:28:45 2013(r252310)
@@ -37,7 +37,6 @@ FILES=DAEMON \
dhclient \
dmesg \
dumpon \
-   encswap \
faith \
fsck \
ftp-proxy \
@@ -139,7 +138,8 @@ FILES=  DAEMON \
static_arp \
static_ndp \
stf \
-   swap1 \
+   swap \
+   swaplate \
syscons \
sysctl \
syslogd \

Modified: head/etc/rc.d/addswap
==
--- head/etc/rc.d/addswap   Thu Jun 27 18:24:24 2013(r252309)
+++ head/etc/rc.d/addswap   Thu Jun 27 18:28:45 2013(r252310)
@@ -13,57 +13,12 @@
 . /etc/rc.subr
 
 name=addswap
-start_cmd=addswap_start
-stop_cmd=addswap_stop
+start_cmd=:
+stop_cmd=:
+rcvar=
 
-addswap_start()
-{
-   case ${swapfile} in
-   [Nn][Oo] | '')
-   ;;
-   *)
-   if [ -w ${swapfile} ]; then
-   check_startmsgs  echo Adding ${swapfile} as 
additional swap
-
-   if [ -n ${swapfile_mdunit} ]; then
-   mdev=/dev/md${swapfile_mdunit#md}
-   mdconfig -a -t vnode -f ${swapfile} -u 
${swapfile_mdunit}
-   else
-   mdev=/dev/`mdconfig -a -t vnode -f 
${swapfile}`
-   fi
-
-   if [ $? -eq 0 ]; then
-   swapon ${mdev}
-   else
-   echo error creating swapfile device
-   fi
-   fi
-   ;;
-   esac
-}
-
-addswap_stop()
-{
-   case ${swapfile} in
- 

Re: svn commit: r252310 - in head: etc/defaults etc/rc.d include sbin/swapon share/man/man5

2013-06-27 Thread Garrett Cooper
On Jun 27, 2013, at 11:28 AM, Hiroki Sato h...@freebsd.org wrote:

 Author: hrs
 Date: Thu Jun 27 18:28:45 2013
 New Revision: 252310
 URL: http://svnweb.freebsd.org/changeset/base/252310
 
 Log:
  - Add vnode-backed swap space specification support.  This is enabled when
device names md or md[0-9]* and a file option are specified in
/etc/fstab like this:
 
mdnoneswapsw,file=/swap.bin   0   0
 
  - Add GBDE/GELI encrypted swap space specification support, which
rc.d/encswap supported.  The /etc/fstab lines are like the following:
 
/dev/ada1p1.bde   noneswapsw  0   0
/dev/ada1p2.eli   noneswapsw  0   0
 
.eli devices accepts aalgo, ealgo, keylen, and sectorsize as options.
 
swapctl(8) can understand an encrypted device in the command line
like this:
 
# swapctl -a /dev/ada2p1.bde
 
  - -L flag is added to support late option to defer swapon until
rc.d/mountlate runs.
 
  - rc.d script change:
 
  rc.d/encswap - removed
  rc.d/addswap - just display a warning message if $swapfile is defined
  rc.d/swap1 - renamed to rc.d/swap
  rc.d/swaplate - newly added to support late option
 
  These changes alleviate a race condition between device creation/removal
  and swapon/swapoff.

Hi Sato-san!

I noticed that you've been working with mdconfig, et al a lot lately. Would you 
have some spare cycles to look at some of the related mdconfig PRs? 
http://www.freebsd.org/cgi/query-pr-summary.cgi?text=Mdconfig
Thanks!
-Garrett
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252311 - in head/sys/arm: arm include

2013-06-27 Thread Andrew Turner
Author: andrew
Date: Thu Jun 27 18:54:18 2013
New Revision: 252311
URL: http://svnweb.freebsd.org/changeset/base/252311

Log:
  Add UNWINDSVCFRAME to provide the unwind pseudo ops to allow us to unwind
  past a trapframe.
  
  Use this macro in exception_exit as it is the function the unwinder enters
  as the functions that store the frame setting lr to point to it.

Modified:
  head/sys/arm/arm/exception.S
  head/sys/arm/include/asmacros.h

Modified: head/sys/arm/arm/exception.S
==
--- head/sys/arm/arm/exception.SThu Jun 27 18:28:45 2013
(r252310)
+++ head/sys/arm/arm/exception.SThu Jun 27 18:54:18 2013
(r252311)
@@ -206,7 +206,7 @@ END(address_exception_entry)
  */
 
 ASENTRY_NP(exception_exit)
-   STOP_UNWINDING
+   UNWINDSVCFRAME
DO_AST
PULLFRAMEFROMSVCANDEXIT
 END(exception_exit)

Modified: head/sys/arm/include/asmacros.h
==
--- head/sys/arm/include/asmacros.h Thu Jun 27 18:28:45 2013
(r252310)
+++ head/sys/arm/include/asmacros.h Thu Jun 27 18:54:18 2013
(r252311)
@@ -206,7 +206,16 @@
 mov r0, r0;/* NOP for previous instruction 
*/ \
add sp, sp, #(4*15);/* Adjust the stack pointer */ \
ldmia   sp, {sp, lr, pc}^   /* Restore lr and exit */
-#endif 
+#endif
+#if defined(__ARM_EABI__)
+#defineUNWINDSVCFRAME  
   \
+   .save {r13-r15};/* Restore sp, lr, pc */   \
+   .pad #(2*4);/* Skip user sp and lr */  \
+   .save {r0-r12}; /* Restore r0-r12 */   \
+   .pad #(4)   /* Skip spsr */
+#else
+#defineUNWINDSVCFRAME
+#endif
 
 #defineDATA(name) \
.data ; \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252312 - head/sys/dev/cxgbe

2013-06-27 Thread Navdeep Parhar
Author: np
Date: Thu Jun 27 18:59:07 2013
New Revision: 252312
URL: http://svnweb.freebsd.org/changeset/base/252312

Log:
  Update T5 register ranges.  This is so that regdump skips over registers
  with read side-effects.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Jun 27 18:54:18 2013
(r252311)
+++ head/sys/dev/cxgbe/t4_main.cThu Jun 27 18:59:07 2013
(r252312)
@@ -3634,7 +3634,7 @@ t4_get_regs(struct adapter *sc, struct t
0x1fee0, 0x1fee0,
0x1ff00, 0x1ff84,
0x1ffc0, 0x1ffc8,
-   0x3, 0x30040,
+   0x3, 0x30030,
0x30100, 0x30144,
0x30190, 0x301d0,
0x30200, 0x30318,
@@ -3643,29 +3643,29 @@ t4_get_regs(struct adapter *sc, struct t
0x30800, 0x30834,
0x308c0, 0x30908,
0x30910, 0x309ac,
-   0x30a00, 0x30a04,
-   0x30a0c, 0x30a2c,
+   0x30a00, 0x30a2c,
0x30a44, 0x30a50,
0x30a74, 0x30c24,
+   0x30d00, 0x30d00,
0x30d08, 0x30d14,
0x30d1c, 0x30d20,
0x30d3c, 0x30d50,
0x31200, 0x3120c,
0x31220, 0x31220,
0x31240, 0x31240,
-   0x31600, 0x31600,
-   0x31608, 0x3160c,
+   0x31600, 0x3160c,
0x31a00, 0x31a1c,
-   0x31e04, 0x31e20,
+   0x31e00, 0x31e20,
0x31e38, 0x31e3c,
0x31e80, 0x31e80,
0x31e88, 0x31ea8,
0x31eb0, 0x31eb4,
0x31ec8, 0x31ed4,
0x31fb8, 0x32004,
-   0x32208, 0x3223c,
-   0x32248, 0x3227c,
-   0x32288, 0x322bc,
+   0x32200, 0x32200,
+   0x32208, 0x32240,
+   0x32248, 0x32280,
+   0x32288, 0x322c0,
0x322c8, 0x322fc,
0x32600, 0x32630,
0x32a00, 0x32abc,
@@ -3697,7 +3697,7 @@ t4_get_regs(struct adapter *sc, struct t
0x33c28, 0x33c28,
0x33c3c, 0x33c50,
0x33cf0, 0x33cfc,
-   0x34000, 0x34040,
+   0x34000, 0x34030,
0x34100, 0x34144,
0x34190, 0x341d0,
0x34200, 0x34318,
@@ -3706,29 +3706,29 @@ t4_get_regs(struct adapter *sc, struct t
0x34800, 0x34834,
0x348c0, 0x34908,
0x34910, 0x349ac,
-   0x34a00, 0x34a04,
-   0x34a0c, 0x34a2c,
+   0x34a00, 0x34a2c,
0x34a44, 0x34a50,
0x34a74, 0x34c24,
+   0x34d00, 0x34d00,
0x34d08, 0x34d14,
0x34d1c, 0x34d20,
0x34d3c, 0x34d50,
0x35200, 0x3520c,
0x35220, 0x35220,
0x35240, 0x35240,
-   0x35600, 0x35600,
-   0x35608, 0x3560c,
+   0x35600, 0x3560c,
0x35a00, 0x35a1c,
-   0x35e04, 0x35e20,
+   0x35e00, 0x35e20,
0x35e38, 0x35e3c,
0x35e80, 0x35e80,
0x35e88, 0x35ea8,
0x35eb0, 0x35eb4,
0x35ec8, 0x35ed4,
0x35fb8, 0x36004,
-   0x36208, 0x3623c,
-   0x36248, 0x3627c,
-   0x36288, 0x362bc,
+   0x36200, 0x36200,
+   0x36208, 0x36240,
+   0x36248, 0x36280,
+   0x36288, 0x362c0,
0x362c8, 0x362fc,
0x36600, 0x36630,
0x36a00, 0x36abc,
@@ -3760,7 +3760,7 @@ t4_get_regs(struct adapter *sc, struct t
0x37c28, 0x37c28,
0x37c3c, 0x37c50,
0x37cf0, 0x37cfc,
-   0x38000, 0x38040,
+   0x38000, 0x38030,
0x38100, 0x38144,
0x38190, 0x381d0,
0x38200, 0x38318,
@@ -3769,29 +3769,29 @@ t4_get_regs(struct adapter *sc, struct t
0x38800, 0x38834,
0x388c0, 0x38908,
0x38910, 0x389ac,
-   0x38a00, 0x38a04,
-   0x38a0c, 0x38a2c,
+   0x38a00, 0x38a2c,
0x38a44, 0x38a50,
0x38a74, 0x38c24,
+   0x38d00, 0x38d00,
0x38d08, 0x38d14,
0x38d1c, 0x38d20,
0x38d3c, 0x38d50,
0x39200, 0x3920c,
0x39220, 0x39220,
0x39240, 0x39240,
-   0x39600, 0x39600,
-   0x39608, 0x3960c,
+   0x39600, 0x3960c,
0x39a00, 0x39a1c,
-   0x39e04, 0x39e20,
+   0x39e00, 

Re: svn commit: r252310 - in head: etc/defaults etc/rc.d include sbin/swapon share/man/man5

2013-06-27 Thread Hiroki Sato
Garrett Cooper yaneurab...@gmail.com wrote
  in 7413b684-3995-428b-8762-a49b0a180...@gmail.com:

ya I noticed that you've been working with mdconfig, et al a lot
ya lately. Would you have some spare cycles to look at some of the
ya related mdconfig PRs?
ya http://www.freebsd.org/cgi/query-pr-summary.cgi?text=Mdconfig

 Okay, I will take a look at them.  Thanks for the pointer.

-- Hiroki


pgp5ADlvgme8Q.pgp
Description: PGP signature


Re: svn commit: r252310 - in head: etc/defaults etc/rc.d include sbin/swapon share/man/man5

2013-06-27 Thread Garrett Cooper
MOn Jun 27, 2013, at 12:00 PM, Hiroki Sato h...@freebsd.org wrote:

 Garrett Cooper yaneurab...@gmail.com wrote
  in 7413b684-3995-428b-8762-a49b0a180...@gmail.com:
 
 ya I noticed that you've been working with mdconfig, et al a lot
 ya lately. Would you have some spare cycles to look at some of the
 ya related mdconfig PRs?
 ya http://www.freebsd.org/cgi/query-pr-summary.cgi?text=Mdconfig
 
 Okay, I will take a look at them.  Thanks for the pointer.

Np -- thanks :)!
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252313 - head/sys/kern

2013-06-27 Thread Mikolaj Golub
Author: trociny
Date: Thu Jun 27 19:14:03 2013
New Revision: 252313
URL: http://svnweb.freebsd.org/changeset/base/252313

Log:
  To avoid LOR, always drop the filedesc lock before exporting fd to sbuf.
  
  Reviewed by:  kib
  MFC after:3 days

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cThu Jun 27 18:59:07 2013
(r252312)
+++ head/sys/kern/kern_descrip.cThu Jun 27 19:14:03 2013
(r252313)
@@ -3427,12 +3427,10 @@ kern_proc_filedesc_out(struct proc *p,  
 * re-validate and re-evaluate its properties when
 * the loop continues.
 */
-   if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO)
-   FILEDESC_SUNLOCK(fdp);
+   FILEDESC_SUNLOCK(fdp);
error = export_fd_to_sb(data, type, i, fflags, refcnt,
offset, fd_cap_rights, kif, sb, remainder);
-   if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO)
-   FILEDESC_SLOCK(fdp);
+   FILEDESC_SLOCK(fdp);
if (error)
break;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252314 - head/share/examples/etc

2013-06-27 Thread Jung-uk Kim
Author: jkim
Date: Thu Jun 27 19:47:58 2013
New Revision: 252314
URL: http://svnweb.freebsd.org/changeset/base/252314

Log:
  Add amdfam10 to the supported CPU types for amd64.  This complements
  r251691 and 251692.

Modified:
  head/share/examples/etc/make.conf

Modified: head/share/examples/etc/make.conf
==
--- head/share/examples/etc/make.conf   Thu Jun 27 19:14:03 2013
(r252313)
+++ head/share/examples/etc/make.conf   Thu Jun 27 19:47:58 2013
(r252314)
@@ -38,8 +38,8 @@
 #  pentium3m, pentium3, pentium-m, pentium2,
 #  pentiumpro, pentium-mmx, pentium, i486
 #   (VIA CPUs) c7, c3-2, c3
-#   AMD64 architecture:opteron-sse3, athlon64-sse3, k8-sse3, opteron,
-#  athlon64, k8, core2, nocona
+#   AMD64 architecture:amdfam10, opteron-sse3, athlon64-sse3, k8-sse3,
+#  opteron, athlon64, k8, core2, nocona
 #   Intel ia64 architecture:   itanium2, itanium
 #   SPARC-V9 architecture: v9 (generic 64-bit V9), ultrasparc (default
 #  if omitted), ultrasparc3
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252315 - in head/sys: dev/pci kern sys

2013-06-27 Thread John Baldwin
Author: jhb
Date: Thu Jun 27 20:21:54 2013
New Revision: 252315
URL: http://svnweb.freebsd.org/changeset/base/252315

Log:
  Make detaching drivers from PCI devices more robust.  While here, fix a
  bug where a PCI device would be powered down if it failed to probe, but
  not when its driver was detached (e.g. via kldunload).
  - Add a new helper method resource_list_release_active() which forcefully
releases any active resources of a specified type from a resource list.
  - Add a bus_child_detached method for the PCI bus driver which forces any
active resources to be released (and whines to the console if it finds
any) and then powers the device down.
  - Call pci_child_detached() if we fail to probe a device when a driver
is kldloaded.  This isn't perfect but can avoid leaking resources
from a probe() routine in the kldload case.
  
  Reviewed by:  imp, brooks
  MFC after:1 month

Modified:
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_private.h
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Thu Jun 27 19:47:58 2013(r252314)
+++ head/sys/dev/pci/pci.c  Thu Jun 27 20:21:54 2013(r252315)
@@ -152,6 +152,7 @@ static device_method_t pci_methods[] = {
DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
DEVMETHOD(bus_activate_resource, pci_activate_resource),
DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
+   DEVMETHOD(bus_child_detached,   pci_child_detached),
DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method),
DEVMETHOD(bus_child_location_str, pci_child_location_str_method),
DEVMETHOD(bus_remap_intr,   pci_remap_intr_method),
@@ -3489,7 +3490,7 @@ pci_driver_added(device_t dev, driver_t 
pci_printf(dinfo-cfg, reprobing on driver added\n);
pci_cfg_restore(child, dinfo);
if (device_probe_and_attach(child) != 0)
-   pci_cfg_save(child, dinfo, 1);
+   pci_child_detached(dev, child);
}
free(devlist, M_TEMP);
 }
@@ -3804,6 +3805,34 @@ pci_probe_nomatch(device_t dev, device_t
pci_cfg_save(child, device_get_ivars(child), 1);
 }
 
+void
+pci_child_detached(device_t dev, device_t child)
+{
+   struct pci_devinfo *dinfo;
+   struct resource_list *rl;
+
+   dinfo = device_get_ivars(child);
+   rl = dinfo-resources;
+
+   /*
+* Have to deallocate IRQs before releasing any MSI messages and
+* have to release MSI messages before deallocating any memory
+* BARs.
+*/
+   if (resource_list_release_active(rl, dev, child, SYS_RES_IRQ) != 0)
+   pci_printf(dinfo-cfg, Device leaked IRQ resources\n);
+   if (dinfo-cfg.msi.msi_alloc != 0 || dinfo-cfg.msix.msix_alloc != 0) {
+   pci_printf(dinfo-cfg, Device leaked MSI vectors\n);
+   (void)pci_release_msi(child);
+   }
+   if (resource_list_release_active(rl, dev, child, SYS_RES_MEMORY) != 0)
+   pci_printf(dinfo-cfg, Device leaked memory resources\n);
+   if (resource_list_release_active(rl, dev, child, SYS_RES_IOPORT) != 0)
+   pci_printf(dinfo-cfg, Device leaked I/O resources\n);
+
+   pci_cfg_save(child, dinfo, 1);
+}
+
 /*
  * Parse the PCI device database, if loaded, and return a pointer to a
  * description of the device.

Modified: head/sys/dev/pci/pci_private.h
==
--- head/sys/dev/pci/pci_private.h  Thu Jun 27 19:47:58 2013
(r252314)
+++ head/sys/dev/pci/pci_private.h  Thu Jun 27 20:21:54 2013
(r252315)
@@ -106,6 +106,7 @@ struct pci_devinfo *pci_read_device(devi
size_t size);
 void   pci_print_verbose(struct pci_devinfo *dinfo);
 intpci_freecfg(struct pci_devinfo *dinfo);
+void   pci_child_detached(device_t dev, device_t child);
 intpci_child_location_str_method(device_t cbdev, device_t child,
char *buf, size_t buflen);
 intpci_child_pnpinfo_str_method(device_t cbdev, device_t child,

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cThu Jun 27 19:47:58 2013(r252314)
+++ head/sys/kern/subr_bus.cThu Jun 27 20:21:54 2013(r252315)
@@ -3316,6 +3316,48 @@ resource_list_release(struct resource_li
 }
 
 /**
+ * @brief Release all active resources of a given type
+ *
+ * Release all active resources of a specified type.  This is intended
+ * to be used to cleanup resources leaked by a driver after detach or
+ * a failed attach.
+ *
+ * @param rl   the resource list which was allocated from
+ * @param bus  the parent device of @p 

svn commit: r252317 - stable/9/sys/dev/pci

2013-06-27 Thread John Baldwin
Author: jhb
Date: Thu Jun 27 20:35:39 2013
New Revision: 252317
URL: http://svnweb.freebsd.org/changeset/base/252317

Log:
  MFC 250418,252166:
  Revision 233677 broke certain machines.  Specifically, if the firmware/BIOS
  assigned conflicting ranges to BARs then leaving the BARs alone could
  result in one device stealing mmio accesses intended to go to a second
  device.  Prior to 233677 the PCI bus driver attempted to handle this case
  by clearing the BAR to 0 depending on BARs based at 0 not decoding (which
  is not guaranteed to be true).  Now when a conflicting BAR is detected the
  following steps are taken:
  
   1) If hw.pci.realloc_bars (a new tunable) is enabled (default is disabled),
  then ignore the current BAR setting from the firmware and attempt to
  allocate a fresh resource range for the BAR.
  
   2) If 1) failed (or was disabled), disable decoding for the relevant
  BAR type (e.g. disable mem decoding for a memory BAR) and emit a
  warning if booting verbose.

Modified:
  stable/9/sys/dev/pci/pci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/pci/pci.c
==
--- stable/9/sys/dev/pci/pci.c  Thu Jun 27 20:27:34 2013(r252316)
+++ stable/9/sys/dev/pci/pci.c  Thu Jun 27 20:35:39 2013(r252317)
@@ -289,6 +289,12 @@ SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_
 enable these bits correctly.  We'd like to do this all the time, but there\n\
 are some peripherals that this causes problems with.);
 
+static int pci_do_realloc_bars = 0;
+TUNABLE_INT(hw.pci.realloc_bars, pci_do_realloc_bars);
+SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RW,
+pci_do_realloc_bars, 0,
+Attempt to allocate a new range for any BARs whose original 
firmware-assigned ranges fail to allocate during the initial device scan.);
+
 static int pci_do_power_nodriver = 0;
 TUNABLE_INT(hw.pci.do_power_nodriver, pci_do_power_nodriver);
 SYSCTL_INT(_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RW,
@@ -2745,13 +2751,34 @@ pci_add_map(device_t bus, device_t dev, 
 */
res = resource_list_reserve(rl, bus, dev, type, reg, start, end, count,
prefetch ? RF_PREFETCHABLE : 0);
+   if (pci_do_realloc_bars  res == NULL  (start != 0 || end != ~0ul)) {
+   /*
+* If the allocation fails, try to allocate a resource for
+* this BAR using any available range.  The firmware felt
+* it was important enough to assign a resource, so don't
+* disable decoding if we can help it.
+*/
+   resource_list_delete(rl, type, reg);
+   resource_list_add(rl, type, reg, 0, ~0ul, count);
+   res = resource_list_reserve(rl, bus, dev, type, reg, 0, ~0ul,
+   count, prefetch ? RF_PREFETCHABLE : 0);
+   }
if (res == NULL) {
/*
 * If the allocation fails, delete the resource list entry
-* to force pci_alloc_resource() to allocate resources
-* from the parent.
+* and disable decoding for this device.
+*
+* If the driver requests this resource in the future,
+* pci_reserve_map() will try to allocate a fresh
+* resource range.
 */
resource_list_delete(rl, type, reg);
+   pci_disable_io(dev, type);
+   if (bootverbose)
+   device_printf(bus,
+   pci%d:%d:%d:%d bar %#x failed to allocate\n,
+   pci_get_domain(dev), pci_get_bus(dev),
+   pci_get_slot(dev), pci_get_function(dev), reg);
} else {
start = rman_get_start(res);
pci_write_bar(dev, pm, start);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252318 - stable/8/sys/dev/pci

2013-06-27 Thread John Baldwin
Author: jhb
Date: Thu Jun 27 21:02:26 2013
New Revision: 252318
URL: http://svnweb.freebsd.org/changeset/base/252318

Log:
  MFC 233662,233677-233678,250418,252166:
  If the firmware/BIOS assigns conflicting ranges to BARs then leaving the
  BARs alone could result in one device stealing mmio accesses intended to go
  to a second device.  Previously the PCI bus driver attempted to handle this
  case by clearing the BAR to 0 depending on BARs based at 0 not decoding (which
  is not guaranteed to be true).  Now when a conflicting BAR is detected the
  following steps are taken:
  
   1) If hw.pci.realloc_bars (a new tunable) is enabled (default is disabled),
  then ignore the current BAR setting from the firmware and attempt to
  allocate a fresh resource range for the BAR.
  
   2) If 1) failed (or was disabled), disable decoding for the relevant
  BAR type (e.g. disable mem decoding for a memory BAR) and emit a
  warning if booting verbose.

Modified:
  stable/8/sys/dev/pci/pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/pci/   (props changed)

Modified: stable/8/sys/dev/pci/pci.c
==
--- stable/8/sys/dev/pci/pci.c  Thu Jun 27 20:35:39 2013(r252317)
+++ stable/8/sys/dev/pci/pci.c  Thu Jun 27 21:02:26 2013(r252318)
@@ -295,6 +295,12 @@ SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_
 enable these bits correctly.  We'd like to do this all the time, but there\n\
 are some peripherals that this causes problems with.);
 
+static int pci_do_realloc_bars = 0;
+TUNABLE_INT(hw.pci.realloc_bars, pci_do_realloc_bars);
+SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RW,
+pci_do_realloc_bars, 0,
+Attempt to allocate a new range for any BARs whose original 
firmware-assigned ranges fail to allocate during the initial device scan.);
+
 static int pci_do_power_nodriver = 0;
 TUNABLE_INT(hw.pci.do_power_nodriver, pci_do_power_nodriver);
 SYSCTL_INT(_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RW,
@@ -2743,20 +2749,39 @@ pci_add_map(device_t bus, device_t dev, 
 */
res = resource_list_alloc(rl, bus, dev, type, reg, start, end, count,
prefetch ? RF_PREFETCHABLE : 0);
+   if (pci_do_realloc_bars  res == NULL  (start != 0 || end != ~0ul)) {
+   /*
+* If the allocation fails, try to allocate a resource for
+* this BAR using any available range.  The firmware felt
+* it was important enough to assign a resource, so don't
+* disable decoding if we can help it.
+*/
+   resource_list_delete(rl, type, reg);
+   resource_list_add(rl, type, reg, 0, ~0ul, count);
+   res = resource_list_alloc(rl, bus, dev, type, reg, 0, ~0ul,
+   count, prefetch ? RF_PREFETCHABLE : 0);
+   }
if (res == NULL) {
/*
-* If the allocation fails, clear the BAR and delete
-* the resource list entry to force
-* pci_alloc_resource() to allocate resources from the
-* parent.
+* If the allocation fails, delete the resource list entry
+* and disable decoding for this device.
+*
+* If the driver requests this resource in the future,
+* pci_reserve_map() will try to allocate a fresh
+* resource range.
 */
resource_list_delete(rl, type, reg);
-   start = 0;
+   pci_disable_io(dev, type);
+   if (bootverbose)
+   device_printf(bus,
+   pci%d:%d:%d:%d bar %#x failed to allocate\n,
+   pci_get_domain(dev), pci_get_bus(dev),
+   pci_get_slot(dev), pci_get_function(dev), reg);
} else {
start = rman_get_start(res);
+   pci_write_bar(dev, pm, start);
rman_set_device(res, bus);
}
-   pci_write_bar(dev, pm, start);
return (barlen);
 }
 
@@ -3732,7 +3757,7 @@ pci_describe_device(device_t dev)
if ((desc = malloc(strlen(vp) + strlen(dp) + 3, M_DEVBUF, M_NOWAIT)) !=
NULL)
sprintf(desc, %s, %s, vp, dp);
- out:
+out:
if (vp != NULL)
free(vp, M_DEVBUF);
if (dp != NULL)
@@ -4008,7 +4033,7 @@ pci_alloc_map(device_t dev, device_t chi
count, *rid, type, rman_get_start(res));
map = rman_get_start(res);
pci_write_bar(child, pm, map);
-out:;
+out:
return (res);
 }
 
@@ -4210,19 +4235,6 @@ pci_delete_resource(device_t dev, device
rman_get_start(rle-res));
return;
}
-
-#ifndef __PCI_BAR_ZERO_VALID
-   /*
-* If this is a 

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

2013-06-27 Thread John Baldwin
On Wednesday, June 26, 2013 3:26:38 am Andre Oppermann wrote:
 On 25.06.2013 20:44, John Baldwin wrote:
  Author: jhb
  Date: Tue Jun 25 18:44:15 2013
  New Revision: 252209
  URL: http://svnweb.freebsd.org/changeset/base/252209
 
  Log:
 Several improvements to rmlock(9).  Many of these are based on patches
 provided by Isilon.
 - Add an rm_assert() supporting various lock assertions similar to other
   locking primitives.  Because rmlocks track readers the assertions are
   always fully accurate unlike rw_assert() and sx_assert().
 - Flesh out the lock class methods for rmlocks to support sleeping via
   condvars and rm_sleep() (but only while holding write locks), rmlock
   details in 'show lock' in DDB, and the lc_owner method used by
   dtrace.
 - Add an internal destroyed cookie so that API functions can assert
   that an rmlock is not destroyed.
 - Make use of rm_assert() to add various assertions to the API (e.g.
   to assert locks are held when an unlock routine is called).
 - Give RM_SLEEPABLE locks their own lock class and always use the
   rmlock's own lock_object with WITNESS.
 - Use THREAD_NO_SLEEPING() / THREAD_SLEEPING_OK() to disallow sleeping
   while holding a read lock on an rmlock.
 
 Thanks!
 
 Would it make sense to move struct rm_queue from struct pcpu itself to
 using DPCPU as a next step?

Perhaps.  It might make pcpu.h cleaner, aside from that concern I don't think
it really matters much.

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


svn commit: r252320 - head/sys/arm/arm

2013-06-27 Thread Andrew Turner
Author: andrew
Date: Thu Jun 27 22:26:56 2013
New Revision: 252320
URL: http://svnweb.freebsd.org/changeset/base/252320

Log:
  Support reading registers r0-r3 when unwinding. There is a seperate
  instruction to load these. We only hit it when unwinding past an trap frame
  as in C r0-r3 would never have been saved onto the stack.

Modified:
  head/sys/arm/arm/db_trace.c

Modified: head/sys/arm/arm/db_trace.c
==
--- head/sys/arm/arm/db_trace.c Thu Jun 27 21:34:29 2013(r252319)
+++ head/sys/arm/arm/db_trace.c Thu Jun 27 22:26:56 2013(r252320)
@@ -108,6 +108,7 @@ extern int extab_start, extab_end, exidx
 #defineINSN_VSP_REG0x90
 #defineINSN_POP_COUNT  0xa0
 #defineINSN_FINISH 0xb0
+#defineINSN_POP_REGS   0xb1
 #defineINSN_VSP_LARGE_INC  0xb2
 
 /* An item in the exception index table */
@@ -268,6 +269,24 @@ db_unwind_exec_insn(struct unwind_state 
/* Stop processing */
state-entries = 0;
 
+   } else if ((insn == INSN_POP_REGS)) {
+   unsigned int mask, reg;
+
+   mask = db_unwind_exec_read_byte(state);
+   if (mask == 0 || (mask  0xf0) != 0)
+   return 1;
+
+   /* Update SP */
+   update_vsp = 1;
+
+   /* Load the registers */
+   for (reg = 0; mask  reg  4; mask = 1, reg++) {
+   if (mask  1) {
+   state-registers[reg] = *vsp++;
+   state-update_mask |= 1  reg;
+   }
+   }
+
} else if ((insn  INSN_VSP_LARGE_INC_MASK) == INSN_VSP_LARGE_INC) {
unsigned int uleb128;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252321 - in vendor/hyperv/dist/sys: dev/hyperv/stordisengage dev/hyperv/storvsc dev/hyperv/vmbus modules/hyperv modules/hyperv/stordisengage

2013-06-27 Thread Peter Grehan
Author: grehan
Date: Fri Jun 28 00:29:07 2013
New Revision: 252321
URL: http://svnweb.freebsd.org/changeset/base/252321

Log:
  Import Microsoft HyperV driver update
  From https://github.com/FreeBSDonHyper-V/VendorBranchForFreeBSDonHyper-V
  rev: 3c707c73520adbd6d1f4ff009826dbbfb0c2dc4d

Added:
  vendor/hyperv/dist/sys/dev/hyperv/stordisengage/
  vendor/hyperv/dist/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c
  vendor/hyperv/dist/sys/modules/hyperv/stordisengage/
  vendor/hyperv/dist/sys/modules/hyperv/stordisengage/Makefile
Modified:
  vendor/hyperv/dist/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  vendor/hyperv/dist/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
  vendor/hyperv/dist/sys/modules/hyperv/Makefile

Added: vendor/hyperv/dist/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/hyperv/dist/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c  
Fri Jun 28 00:29:07 2013(r252321)
@@ -0,0 +1,194 @@
+/*-
+ * Copyright (c) 1998 - 2008 Søren Schmidt s...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer,
+ *without modification, immediately at the beginning of the file.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/*-
+ * Copyright (c) 2009-2013 Microsoft Corp.
+ * Copyright (c) 2012 NetApp Inc.
+ * Copyright (c) 2012 Citrix Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/kernel.h
+#include sys/module.h
+#include sys/ata.h
+#include sys/bus.h
+#include sys/conf.h
+#include sys/malloc.h
+#include sys/sema.h
+#include sys/taskqueue.h
+#include vm/uma.h
+#include machine/stdarg.h
+#include machine/resource.h
+#include machine/bus.h
+#include sys/rman.h
+#include dev/pci/pcivar.h
+#include dev/pci/pcireg.h
+#include dev/ata/ata-all.h
+#include dev/ata/ata-pci.h
+#include ata_if.h
+
+#define HV_X64_MSR_GUEST_OS_ID 0x4000
+#define HV_X64_CPUID_MIN   0x4005
+#define HV_X64_CPUID_MAX   0x4000
+
+/* prototypes */
+static int hv_ata_pci_probe(device_t dev);
+static int hv_ata_pci_attach(device_t dev);
+static int hv_ata_pci_detach(device_t dev);
+
+static int hv_check_for_hyper_v(void);
+
+/*
+ * generic PCI ATA device probe
+ */
+static int
+hv_ata_pci_probe(device_t dev)
+{
+   int ata_disk_enable = 0;
+   if(bootverbose)
+   

svn commit: r252322 - vendor/hyperv/20130627

2013-06-27 Thread Peter Grehan
Author: grehan
Date: Fri Jun 28 00:34:39 2013
New Revision: 252322
URL: http://svnweb.freebsd.org/changeset/base/252322

Log:
  Tag hyperv 20130627

Added:
  vendor/hyperv/20130627/
 - copied from r252321, vendor/hyperv/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r252313 - head/sys/kern

2013-06-27 Thread Mateusz Guzik
On Thu, Jun 27, 2013 at 07:14:04PM +, Mikolaj Golub wrote:
 Author: trociny
 Date: Thu Jun 27 19:14:03 2013
 New Revision: 252313
 URL: http://svnweb.freebsd.org/changeset/base/252313
 
 Log:
   To avoid LOR, always drop the filedesc lock before exporting fd to sbuf.
   
   Reviewed by:kib
   MFC after:  3 days
 
 Modified:
   head/sys/kern/kern_descrip.c
 
 Modified: head/sys/kern/kern_descrip.c
 ==
 --- head/sys/kern/kern_descrip.c  Thu Jun 27 18:59:07 2013
 (r252312)
 +++ head/sys/kern/kern_descrip.c  Thu Jun 27 19:14:03 2013
 (r252313)
 @@ -3427,12 +3427,10 @@ kern_proc_filedesc_out(struct proc *p,  
* re-validate and re-evaluate its properties when
* the loop continues.
*/
 - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO)
 - FILEDESC_SUNLOCK(fdp);
 + FILEDESC_SUNLOCK(fdp);
   error = export_fd_to_sb(data, type, i, fflags, refcnt,
   offset, fd_cap_rights, kif, sb, remainder);
 - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO)
 - FILEDESC_SLOCK(fdp);
 + FILEDESC_SLOCK(fdp);
   if (error)
   break;
   }

Is this really ok? What prevents given fd from going away during
export_fd_to_sb execution? Both DTYPE_VNODE and DTYPE_FIFO pass down
a vrefed vnode so these are safe. But for example DTYPE_SOCKET goes with
fp-f_data, which can go away in the meantime (or I'm misreading the code).

I suggest obtainng ref to fp and passing it down in all cases.

-- 
Mateusz Guzik mjguzik gmail.com
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252323 - stable/9/sys/kern

2013-06-27 Thread Lawrence Stewart
Author: lstewart
Date: Fri Jun 28 02:38:33 2013
New Revision: 252323
URL: http://svnweb.freebsd.org/changeset/base/252323

Log:
  MFC r250951,251838:
  
  Ensure alq's shutdown_pre_sync event handler is deregistered on module unload 
to
  avoid a dangling pointer and eventual panic on system shutdown.
  
  Reported by:  Ali comnetboy at gmail.com

Modified:
  stable/9/sys/kern/kern_alq.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_alq.c
==
--- stable/9/sys/kern/kern_alq.cFri Jun 28 00:34:39 2013
(r252322)
+++ stable/9/sys/kern/kern_alq.cFri Jun 28 02:38:33 2013
(r252323)
@@ -99,6 +99,7 @@ static LIST_HEAD(, alq) ald_active;
 static int ald_shutingdown = 0;
 struct thread *ald_thread;
 static struct proc *ald_proc;
+static eventhandler_tag alq_eventhandler_tag = NULL;
 
 #defineALD_LOCK()  mtx_lock(ald_mtx)
 #defineALD_UNLOCK()mtx_unlock(ald_mtx)
@@ -194,8 +195,8 @@ ald_daemon(void)
 
ald_thread = FIRST_THREAD_IN_PROC(ald_proc);
 
-   EVENTHANDLER_REGISTER(shutdown_pre_sync, ald_shutdown, NULL,
-   SHUTDOWN_PRI_FIRST);
+   alq_eventhandler_tag = EVENTHANDLER_REGISTER(shutdown_pre_sync,
+   ald_shutdown, NULL, SHUTDOWN_PRI_FIRST);
 
ALD_LOCK();
 
@@ -941,6 +942,8 @@ alq_load_handler(module_t mod, int what,
if (LIST_FIRST(ald_queues) == NULL) {
ald_shutingdown = 1;
ALD_UNLOCK();
+   EVENTHANDLER_DEREGISTER(shutdown_pre_sync,
+   alq_eventhandler_tag);
ald_shutdown(NULL, 0);
mtx_destroy(ald_mtx);
} else {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252324 - stable/8/sys/kern

2013-06-27 Thread Lawrence Stewart
Author: lstewart
Date: Fri Jun 28 03:04:07 2013
New Revision: 252324
URL: http://svnweb.freebsd.org/changeset/base/252324

Log:
  MFC r250951,251838:
  
  Ensure alq's shutdown_pre_sync event handler is deregistered on module unload 
to
  avoid a dangling pointer and eventual panic on system shutdown.
  
  Reported by:  Ali comnetboy at gmail.com

Modified:
  stable/8/sys/kern/kern_alq.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/kern_alq.c
==
--- stable/8/sys/kern/kern_alq.cFri Jun 28 02:38:33 2013
(r252323)
+++ stable/8/sys/kern/kern_alq.cFri Jun 28 03:04:07 2013
(r252324)
@@ -99,6 +99,7 @@ static LIST_HEAD(, alq) ald_active;
 static int ald_shutingdown = 0;
 struct thread *ald_thread;
 static struct proc *ald_proc;
+static eventhandler_tag alq_eventhandler_tag = NULL;
 
 #defineALD_LOCK()  mtx_lock(ald_mtx)
 #defineALD_UNLOCK()mtx_unlock(ald_mtx)
@@ -194,8 +195,8 @@ ald_daemon(void)
 
ald_thread = FIRST_THREAD_IN_PROC(ald_proc);
 
-   EVENTHANDLER_REGISTER(shutdown_pre_sync, ald_shutdown, NULL,
-   SHUTDOWN_PRI_FIRST);
+   alq_eventhandler_tag = EVENTHANDLER_REGISTER(shutdown_pre_sync,
+   ald_shutdown, NULL, SHUTDOWN_PRI_FIRST);
 
ALD_LOCK();
 
@@ -941,6 +942,8 @@ alq_load_handler(module_t mod, int what,
if (LIST_FIRST(ald_queues) == NULL) {
ald_shutingdown = 1;
ALD_UNLOCK();
+   EVENTHANDLER_DEREGISTER(shutdown_pre_sync,
+   alq_eventhandler_tag);
ald_shutdown(NULL, 0);
mtx_destroy(ald_mtx);
} else {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252325 - head/sys/cddl/dev/dtmalloc

2013-06-27 Thread Mark Johnston
Author: markj
Date: Fri Jun 28 03:14:40 2013
New Revision: 252325
URL: http://svnweb.freebsd.org/changeset/base/252325

Log:
  The dtmalloc provider uses the short description of a malloc type as the
  function name of its corresponding DTrace probes. These descriptions may
  contain whitespace, but probe names cannot, so just replace any whitespace
  with underscores when creating probes.
  
  MFC after:1 week

Modified:
  head/sys/cddl/dev/dtmalloc/dtmalloc.c

Modified: head/sys/cddl/dev/dtmalloc/dtmalloc.c
==
--- head/sys/cddl/dev/dtmalloc/dtmalloc.c   Fri Jun 28 03:04:07 2013
(r252324)
+++ head/sys/cddl/dev/dtmalloc/dtmalloc.c   Fri Jun 28 03:14:40 2013
(r252325)
@@ -28,6 +28,7 @@
 #include sys/param.h
 #include sys/systm.h
 #include sys/conf.h
+#include sys/ctype.h
 #include sys/kernel.h
 #include sys/malloc.h
 #include sys/module.h
@@ -111,8 +112,17 @@ dtmalloc_type_cb(struct malloc_type *mtp
 {
char name[DTRACE_FUNCNAMELEN];
struct malloc_type_internal *mtip = mtp-ks_handle;
+   int i;
 
+   /*
+* malloc_type descriptions are allowed to contain whitespace, but
+* DTrace probe identifiers are not, so replace the whitespace with
+* underscores.
+*/
strlcpy(name, mtp-ks_shortdesc, sizeof(name));
+   for (i = 0; name[i] != 0; i++)
+   if (isspace(name[i]))
+   name[i] = '_';
 
if (dtrace_probe_lookup(dtmalloc_id, NULL, name, malloc) != 0)
return;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252326 - stable/9/sys/sys

2013-06-27 Thread Lawrence Stewart
Author: lstewart
Date: Fri Jun 28 03:22:43 2013
New Revision: 252326
URL: http://svnweb.freebsd.org/changeset/base/252326

Log:
  MFC r251682:
  
  Remove some duplicate code by making KHELP_DECLARE_MOD() a wrapper around
  KHELP_DECLARE_MOD_UMA().

Modified:
  stable/9/sys/sys/module_khelp.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/sys/module_khelp.h
==
--- stable/9/sys/sys/module_khelp.h Fri Jun 28 03:14:40 2013
(r252325)
+++ stable/9/sys/sys/module_khelp.h Fri Jun 28 03:22:43 2013
(r252326)
@@ -70,22 +70,6 @@ struct khelp_modevent_data {
uma_dtorumadtor;
 };
 
-#defineKHELP_DECLARE_MOD(hname, hdata, hhooks, version)
\
-   static struct khelp_modevent_data kmd_##hname = {   \
-   .name = #hname, \
-   .helper = hdata \
-   .hooks = hhooks,\
-   .nhooks = sizeof(hhooks) / sizeof(hhooks[0]),   \
-   };  \
-   static moduledata_t h_##hname = {   \
-   .name = #hname, \
-   .evhand = khelp_modevent,   \
-   .priv = kmd_##hname\
-   };  \
-   DECLARE_MODULE(hname, h_##hname, SI_SUB_PROTO_IFATTACHDOMAIN,   \
-   SI_ORDER_ANY);  \
-   MODULE_VERSION(hname, version)
-
 #defineKHELP_DECLARE_MOD_UMA(hname, hdata, hhooks, version, size, 
ctor, dtor) \
static struct khelp_modevent_data kmd_##hname = {   \
.name = #hname, \
@@ -105,6 +89,9 @@ struct khelp_modevent_data {
SI_ORDER_ANY);  \
MODULE_VERSION(hname, version)
 
+#defineKHELP_DECLARE_MOD(hname, hdata, hhooks, version)
\
+   KHELP_DECLARE_MOD_UMA(hname, hdata, hhooks, version, 0, NULL, NULL)
+
 intkhelp_modevent(module_t mod, int type, void *data);
 
 #endif /* _SYS_MODULE_KHELP_H_ */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252327 - stable/8/sys/sys

2013-06-27 Thread Lawrence Stewart
Author: lstewart
Date: Fri Jun 28 03:23:24 2013
New Revision: 252327
URL: http://svnweb.freebsd.org/changeset/base/252327

Log:
  MFC r251682:
  
  Remove some duplicate code by making KHELP_DECLARE_MOD() a wrapper around
  KHELP_DECLARE_MOD_UMA().

Modified:
  stable/8/sys/sys/module_khelp.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/sys/   (props changed)

Modified: stable/8/sys/sys/module_khelp.h
==
--- stable/8/sys/sys/module_khelp.h Fri Jun 28 03:22:43 2013
(r252326)
+++ stable/8/sys/sys/module_khelp.h Fri Jun 28 03:23:24 2013
(r252327)
@@ -70,22 +70,6 @@ struct khelp_modevent_data {
uma_dtorumadtor;
 };
 
-#defineKHELP_DECLARE_MOD(hname, hdata, hhooks, version)
\
-   static struct khelp_modevent_data kmd_##hname = {   \
-   .name = #hname, \
-   .helper = hdata \
-   .hooks = hhooks,\
-   .nhooks = sizeof(hhooks) / sizeof(hhooks[0]),   \
-   };  \
-   static moduledata_t h_##hname = {   \
-   .name = #hname, \
-   .evhand = khelp_modevent,   \
-   .priv = kmd_##hname\
-   };  \
-   DECLARE_MODULE(hname, h_##hname, SI_SUB_PROTO_IFATTACHDOMAIN,   \
-   SI_ORDER_ANY);  \
-   MODULE_VERSION(hname, version)
-
 #defineKHELP_DECLARE_MOD_UMA(hname, hdata, hhooks, version, size, 
ctor, dtor) \
static struct khelp_modevent_data kmd_##hname = {   \
.name = #hname, \
@@ -105,6 +89,9 @@ struct khelp_modevent_data {
SI_ORDER_ANY);  \
MODULE_VERSION(hname, version)
 
+#defineKHELP_DECLARE_MOD(hname, hdata, hhooks, version)
\
+   KHELP_DECLARE_MOD_UMA(hname, hdata, hhooks, version, 0, NULL, NULL)
+
 intkhelp_modevent(module_t mod, int type, void *data);
 
 #endif /* _SYS_MODULE_KHELP_H_ */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252328 - stable/9/sys/kern

2013-06-27 Thread Lawrence Stewart
Author: lstewart
Date: Fri Jun 28 03:39:54 2013
New Revision: 252328
URL: http://svnweb.freebsd.org/changeset/base/252328

Log:
  MFC r251725:
  
  Fix a potential NULL-pointer dereference that would trigger if the hhook
  registration site did not provide storage for a copy of the hhook_head struct.

Modified:
  stable/9/sys/kern/kern_hhook.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_hhook.c
==
--- stable/9/sys/kern/kern_hhook.c  Fri Jun 28 03:23:24 2013
(r252327)
+++ stable/9/sys/kern/kern_hhook.c  Fri Jun 28 03:39:54 2013
(r252328)
@@ -264,9 +264,10 @@ hhook_head_register(int32_t hhook_type, 
STAILQ_INIT(tmphhh-hhh_hooks);
HHH_LOCK_INIT(tmphhh);
 
-   if (hhh != NULL)
+   if (hhh != NULL) {
refcount_init(tmphhh-hhh_refcount, 1);
-   else
+   *hhh = tmphhh;
+   } else
refcount_init(tmphhh-hhh_refcount, 0);
 
if (flags  HHOOK_HEADISINVNET) {
@@ -278,8 +279,6 @@ hhook_head_register(int32_t hhook_type, 
/* XXXLAS: Add tmphhh to the non-virtualised list. */
}
 
-   *hhh = tmphhh;
-
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252329 - stable/8/sys/kern

2013-06-27 Thread Lawrence Stewart
Author: lstewart
Date: Fri Jun 28 03:41:23 2013
New Revision: 252329
URL: http://svnweb.freebsd.org/changeset/base/252329

Log:
  MFC r251725:
  
  Fix a potential NULL-pointer dereference that would trigger if the hhook
  registration site did not provide storage for a copy of the hhook_head struct.

Modified:
  stable/8/sys/kern/kern_hhook.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/kern_hhook.c
==
--- stable/8/sys/kern/kern_hhook.c  Fri Jun 28 03:39:54 2013
(r252328)
+++ stable/8/sys/kern/kern_hhook.c  Fri Jun 28 03:41:23 2013
(r252329)
@@ -264,9 +264,10 @@ hhook_head_register(int32_t hhook_type, 
STAILQ_INIT(tmphhh-hhh_hooks);
HHH_LOCK_INIT(tmphhh);
 
-   if (hhh != NULL)
+   if (hhh != NULL) {
refcount_init(tmphhh-hhh_refcount, 1);
-   else
+   *hhh = tmphhh;
+   } else
refcount_init(tmphhh-hhh_refcount, 0);
 
if (flags  HHOOK_HEADISINVNET) {
@@ -278,8 +279,6 @@ hhook_head_register(int32_t hhook_type, 
/* XXXLAS: Add tmphhh to the non-virtualised list. */
}
 
-   *hhh = tmphhh;
-
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252330 - in head/sys: conf geom kern sys vm

2013-06-27 Thread Jeff Roberson
Author: jeff
Date: Fri Jun 28 03:51:20 2013
New Revision: 252330
URL: http://svnweb.freebsd.org/changeset/base/252330

Log:
   - Add a general purpose resource allocator, vmem, from NetBSD.  It was
 originally inspired by the Solaris vmem detailed in the proceedings
 of usenix 2001.  The NetBSD version was heavily refactored for bugs
 and simplicity.
   - Use this resource allocator to allocate the buffer and transient maps.
 Buffer cache defrags are reduced by 25% when used by filesystems with
 mixed block sizes.  Ultimately this may permit dynamic buffer cache
 sizing on low KVA machines.
  
  Discussed with:   alc, kib, attilio
  Tested by:pho
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/sys/kern/subr_vmem.c   (contents, props changed)
  head/sys/sys/vmem.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/geom/geom_io.c
  head/sys/kern/vfs_bio.c
  head/sys/sys/malloc.h
  head/sys/vm/vm.h
  head/sys/vm/vm_init.c
  head/sys/vm/vm_kern.c
  head/sys/vm/vm_kern.h
  head/sys/vm/vm_object.c
  head/sys/vm/vm_pager.c
  head/sys/vm/vm_pager.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Jun 28 03:41:23 2013(r252329)
+++ head/sys/conf/files Fri Jun 28 03:51:20 2013(r252330)
@@ -2797,6 +2797,7 @@ kern/subr_trap.c  standard
 kern/subr_turnstile.c  standard
 kern/subr_uio.cstandard
 kern/subr_unit.c   standard
+kern/subr_vmem.c   standard
 kern/subr_witness.coptional witness
 kern/sys_capability.c  standard
 kern/sys_generic.c standard

Modified: head/sys/geom/geom_io.c
==
--- head/sys/geom/geom_io.c Fri Jun 28 03:41:23 2013(r252329)
+++ head/sys/geom/geom_io.c Fri Jun 28 03:51:20 2013(r252330)
@@ -49,6 +49,7 @@ __FBSDID($FreeBSD$);
 #include sys/proc.h
 #include sys/stack.h
 #include sys/sysctl.h
+#include sys/vmem.h
 
 #include sys/errno.h
 #include geom/geom.h
@@ -626,7 +627,6 @@ g_io_transient_map_bio(struct bio *bp)
vm_offset_t addr;
long size;
u_int retried;
-   int rv;
 
KASSERT(unmapped_buf_allowed, (unmapped disabled));
 
@@ -636,10 +636,7 @@ g_io_transient_map_bio(struct bio *bp)
retried = 0;
atomic_add_long(transient_maps, 1);
 retry:
-   vm_map_lock(bio_transient_map);
-   if (vm_map_findspace(bio_transient_map, vm_map_min(bio_transient_map),
-   size, addr)) {
-   vm_map_unlock(bio_transient_map);
+   if (vmem_alloc(transient_arena, size, M_BESTFIT | M_NOWAIT, addr)) {
if (transient_map_retries != 0 
retried = transient_map_retries) {
g_io_deliver(bp, EDEADLK/* XXXKIB */);
@@ -651,7 +648,7 @@ retry:
/*
 * Naive attempt to quisce the I/O to get more
 * in-flight requests completed and defragment
-* the bio_transient_map.
+* the transient_arena.
 */
CTR3(KTR_GEOM, g_down retrymap bp %p provider %s r %d,
bp, bp-bio_to-name, retried);
@@ -661,12 +658,6 @@ retry:
goto retry;
}
}
-   rv = vm_map_insert(bio_transient_map, NULL, 0, addr, addr + size,
-   VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT);
-   KASSERT(rv == KERN_SUCCESS,
-   (vm_map_insert(bio_transient_map) rv %d %jx %lx,
-   rv, (uintmax_t)addr, size));
-   vm_map_unlock(bio_transient_map);
atomic_add_int(inflight_transient_maps, 1);
pmap_qenter((vm_offset_t)addr, bp-bio_ma, OFF_TO_IDX(size));
bp-bio_data = (caddr_t)addr + bp-bio_ma_offset;

Added: head/sys/kern/subr_vmem.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/kern/subr_vmem.c   Fri Jun 28 03:51:20 2013(r252330)
@@ -0,0 +1,1372 @@
+/*-
+ * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi,
+ * Copyright (c) 2013 EMC Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED 

Re: svn commit: r252310 - in head: etc/defaults etc/rc.d include sbin/swapon share/man/man5

2013-06-27 Thread Glen Barber
On Thu, Jun 27, 2013 at 06:28:45PM +, Hiroki Sato wrote:
 Author: hrs
 Date: Thu Jun 27 18:28:45 2013
 New Revision: 252310
 URL: http://svnweb.freebsd.org/changeset/base/252310
 
 Log:
   - Add vnode-backed swap space specification support.  This is enabled when
 device names md or md[0-9]* and a file option are specified in
 /etc/fstab like this:
   

[...]

I think this breaks the build.

cc1: warnings being treated as errors
/src/sbin/swapon/swapon.c: In function 'swap_on_off_gbde':
/src/sbin/swapon/swapon.c:251: warning: declaration of 'devname' shadows a 
global declaration
/obj/ia64.ia64/src/tmp/usr/include/stdlib.h:272: warning: shadowed declaration 
is here
/src/sbin/swapon/swapon.c: In function 'swap_on_off_geli':
/src/sbin/swapon/swapon.c:323: warning: declaration of 'devname' shadows a 
global declaration
/obj/ia64.ia64/src/tmp/usr/include/stdlib.h:272: warning: shadowed declaration 
is here
/src/sbin/swapon/swapon.c:394: warning: cast discards qualifiers from pointer 
target type
*** Error code 1

Stop.
make: stopped in /src/sbin/swapon
*** Error code 1

Glen



pgpAK64aFK2wp.pgp
Description: PGP signature


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

2013-06-27 Thread Peter Grehan
Author: grehan
Date: Fri Jun 28 05:01:25 2013
New Revision: 252331
URL: http://svnweb.freebsd.org/changeset/base/252331

Log:
  Allow the PCI config address register to be read. The Linux
  kernel does this. Also remove an unused header file.
  
  Submitted by: tycho nightingale at pluribusnetworks com
  Reviewed by:  neel

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

Modified: head/usr.sbin/bhyve/pci_emul.c
==
--- head/usr.sbin/bhyve/pci_emul.c  Fri Jun 28 03:51:20 2013
(r252330)
+++ head/usr.sbin/bhyve/pci_emul.c  Fri Jun 28 05:01:25 2013
(r252331)
@@ -47,13 +47,14 @@ __FBSDID($FreeBSD$);
 #include bhyverun.h
 #include inout.h
 #include mem.h
-#include mptbl.h
 #include pci_emul.h
 #include ioapic.h
 
 #define CONF1_ADDR_PORT0x0cf8
 #define CONF1_DATA_PORT0x0cfc
 
+#define CONF1_ENABLE  0x8000ul
+
 #defineCFGWRITE(pi,off,val,b)  
\
 do {   \
if ((b) == 1) { \
@@ -1224,20 +1225,29 @@ pci_emul_cfgaddr(struct vmctx *ctx, int 
 {
uint32_t x;
 
-   assert(!in);
-
-   if (bytes != 4)
-   return (-1);
+   if (bytes != 4) {
+   if (in)
+   *eax = (bytes == 2) ? 0x : 0xff;
+   return (0);
+   }
 
-   x = *eax;
-   cfgoff = x  PCI_REGMAX;
-   cfgfunc = (x  8)  PCI_FUNCMAX;
-   cfgslot = (x  11)  PCI_SLOTMAX;
-   cfgbus = (x  16)  PCI_BUSMAX;
+   if (in) {
+   x = (cfgbus  16) |
+   (cfgslot  11) |
+   (cfgfunc  8) |
+   cfgoff;
+   *eax = x | CONF1_ENABLE;
+   } else {
+   x = *eax;
+   cfgoff = x  PCI_REGMAX;
+   cfgfunc = (x  8)  PCI_FUNCMAX;
+   cfgslot = (x  11)  PCI_SLOTMAX;
+   cfgbus = (x  16)  PCI_BUSMAX;
+   }
 
return (0);
 }
-INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_OUT, pci_emul_cfgaddr);
+INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_INOUT, pci_emul_cfgaddr);
 
 static uint32_t
 bits_changed(uint32_t old, uint32_t new, uint32_t mask)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252332 - head/sbin/swapon

2013-06-27 Thread Hiroki Sato
Author: hrs
Date: Fri Jun 28 05:09:01 2013
New Revision: 252332
URL: http://svnweb.freebsd.org/changeset/base/252332

Log:
  Fix build.
  
  Spotted by:   gjb

Modified:
  head/sbin/swapon/swapon.c

Modified: head/sbin/swapon/swapon.c
==
--- head/sbin/swapon/swapon.c   Fri Jun 28 05:01:25 2013(r252331)
+++ head/sbin/swapon/swapon.c   Fri Jun 28 05:09:01 2013(r252332)
@@ -248,11 +248,11 @@ swap_on_off_gbde(char *name, int doingal
 {
const char *ret;
char pass[64 * 2 + 1], bpass[64];
-   char *devname, *p;
+   char *dname, *p;
int i, fd, error;
 
-   devname = strdup(name);
-   p = strrchr(devname, '.');
+   dname = strdup(name);
+   p = strrchr(dname, '.');
if (p == NULL) {
warnx(%s: Malformed device name, name);
return (NULL);
@@ -268,7 +268,7 @@ swap_on_off_gbde(char *name, int doingal
pass[sizeof(pass) - 1] = '\0';
 
error = run_cmd(fd, %s init %s -P %s, _PATH_GBDE,
-   devname, pass);
+   dname, pass);
if (error) {
/* bde device found.  Ignore it. */
close(fd);
@@ -278,7 +278,7 @@ swap_on_off_gbde(char *name, int doingal
}
close(fd);
error = run_cmd(fd, %s attach %s -p %s, _PATH_GBDE,
-   devname, pass);
+   dname, pass);
if (error) {
close(fd);
warnx(gbde (attach) error: %s, name);
@@ -298,11 +298,11 @@ swap_on_off_gbde(char *name, int doingal
fd = -1;
switch (which_prog) {
case SWAPOFF:
-   error = run_cmd(fd, %s detach %s, _PATH_GBDE, devname);
+   error = run_cmd(fd, %s detach %s, _PATH_GBDE, dname);
if (error) {
/* bde device not found.  Ignore it. */
if (!qflag)
-   warnx(%s: Device not found, devname);
+   warnx(%s: Device not found, dname);
return (NULL);
}
break;
@@ -320,14 +320,14 @@ static const char *
 swap_on_off_geli(char *name, char *mntops, int doingall)
 {
const char *ops, *aalgo, *ealgo, *keylen_str, *sectorsize_str;
-   char *devname, *p;
+   char *dname, *p;
char args[4096];
struct stat sb;
int fd, error, keylen, sectorsize;
u_long ul;
 
-   devname = strdup(name);
-   p = strrchr(devname, '.');
+   dname = strdup(name);
+   p = strrchr(dname, '.');
if (p == NULL) {
warnx(%s: Malformed device name, name);
return (NULL);
@@ -397,7 +397,7 @@ swap_on_off_geli(char *name, char *mntop
switch (which_prog) {
case SWAPON:
error = run_cmd(fd, %s onetime %s %s, _PATH_GELI, args,
-   devname);
+   dname);
if (error) {
/* eli device found.  Ignore it. */
close(fd);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r252334 - in releng/8.4: . sys/conf sys/dev/fxp sys/dev/virtio/network

2013-06-27 Thread Xin LI
Author: delphij
Date: Fri Jun 28 05:21:59 2013
New Revision: 252334
URL: http://svnweb.freebsd.org/changeset/base/252334

Log:
  Fix a problem where dhclient(8) utility tries to initilaize an
  fxp(4) forever because the driver resets the controller chip
  twice upon initialization. [EN-13:01]
  
  Fix a problem where frames sent to additional MAC addresses are
  not forwarded to the vtnet(4) interface. [EN-13:02]
  
  Approved by:  so (delphij)

Modified:
  releng/8.4/UPDATING
  releng/8.4/sys/conf/newvers.sh
  releng/8.4/sys/dev/fxp/if_fxp.c
  releng/8.4/sys/dev/virtio/network/if_vtnet.c

Modified: releng/8.4/UPDATING
==
--- releng/8.4/UPDATING Fri Jun 28 05:21:21 2013(r252333)
+++ releng/8.4/UPDATING Fri Jun 28 05:21:59 2013(r252334)
@@ -15,6 +15,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
debugging tools present in HEAD were left in place because
sun4v support still needs work to become production ready.
 
+20130628:  p1  FreeBSD-EN-13:01.fxp
+   FreeBSD-EN-13:02.vtnet
+   Fix a problem where dhclient(8) utility tries to initilaize an
+   fxp(4) forever because the driver resets the controller chip
+   twice upon initialization. [EN-13:01]
+
+   Fix a problem where frames sent to additional MAC addresses are
+   not forwarded to the vtnet(4) interface. [EN-13:02]
+
 20130429:
Fix a bug that allows NFS clients to issue READDIR on files.
 

Modified: releng/8.4/sys/conf/newvers.sh
==
--- releng/8.4/sys/conf/newvers.sh  Fri Jun 28 05:21:21 2013
(r252333)
+++ releng/8.4/sys/conf/newvers.sh  Fri Jun 28 05:21:59 2013
(r252334)
@@ -32,7 +32,7 @@
 
 TYPE=FreeBSD
 REVISION=8.4
-BRANCH=RELEASE
+BRANCH=RELEASE-p1
 if [ X${BRANCH_OVERRIDE} != X ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/8.4/sys/dev/fxp/if_fxp.c
==
--- releng/8.4/sys/dev/fxp/if_fxp.c Fri Jun 28 05:21:21 2013
(r252333)
+++ releng/8.4/sys/dev/fxp/if_fxp.c Fri Jun 28 05:21:59 2013
(r252334)
@@ -1074,7 +1074,8 @@ fxp_suspend(device_t dev)
pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE;
sc-flags |= FXP_FLAG_WOL;
/* Reconfigure hardware to accept magic frames. */
-   fxp_init_body(sc, 1);
+   ifp-if_drv_flags = ~IFF_DRV_RUNNING;
+   fxp_init_body(sc, 0);
}
pci_write_config(sc-dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
}
@@ -2140,8 +2141,10 @@ fxp_tick(void *xsc)
 */
if (sc-rx_idle_secs  FXP_MAX_RX_IDLE) {
sc-rx_idle_secs = 0;
-   if ((ifp-if_drv_flags  IFF_DRV_RUNNING) != 0)
+   if ((ifp-if_drv_flags  IFF_DRV_RUNNING) != 0) {
+   ifp-if_drv_flags = ~IFF_DRV_RUNNING;
fxp_init_body(sc, 1);
+   }
return;
}
/*
@@ -2239,6 +2242,7 @@ fxp_watchdog(struct fxp_softc *sc)
device_printf(sc-dev, device timeout\n);
sc-ifp-if_oerrors++;
 
+   sc-ifp-if_drv_flags = ~IFF_DRV_RUNNING;
fxp_init_body(sc, 1);
 }
 
@@ -2273,6 +2277,10 @@ fxp_init_body(struct fxp_softc *sc, int 
int i, prm;
 
FXP_LOCK_ASSERT(sc, MA_OWNED);
+
+   if ((ifp-if_drv_flags  IFF_DRV_RUNNING) != 0)
+   return;
+
/*
 * Cancel any pending I/O
 */
@@ -2812,6 +2820,7 @@ fxp_miibus_statchg(device_t dev)
 */
if (sc-revision == FXP_REV_82557)
return;
+   ifp-if_drv_flags = ~IFF_DRV_RUNNING;
fxp_init_body(sc, 0);
 }
 
@@ -2835,9 +2844,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm
if (ifp-if_flags  IFF_UP) {
if (((ifp-if_drv_flags  IFF_DRV_RUNNING) != 0) 
((ifp-if_flags ^ sc-if_flags) 
-   (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0)
+   (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) {
+   ifp-if_drv_flags = ~IFF_DRV_RUNNING;
fxp_init_body(sc, 0);
-   else if ((ifp-if_drv_flags  IFF_DRV_RUNNING) == 0)
+   } else if ((ifp-if_drv_flags  IFF_DRV_RUNNING) == 0)
fxp_init_body(sc, 1);
} else {
if ((ifp-if_drv_flags  IFF_DRV_RUNNING) != 0)
@@ -2850,8 +2860,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm
case SIOCADDMULTI:
case SIOCDELMULTI:
FXP_LOCK(sc);
-   if ((ifp-if_drv_flags  IFF_DRV_RUNNING) != 0)
+   if ((ifp-if_drv_flags  IFF_DRV_RUNNING) != 0) {
+