svn commit: r308436 - stable/10/sys/amd64/vmm/amd

2016-11-07 Thread Andriy Gapon
Author: avg
Date: Tue Nov  8 07:18:39 2016
New Revision: 308436
URL: https://svnweb.freebsd.org/changeset/base/308436

Log:
  MFC r307903,307904,308039,308050: vmm/svm: iopm_bitmap and msr_bitmap
  must be contiguous in physical memory

Modified:
  stable/10/sys/amd64/vmm/amd/svm.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/vmm/amd/svm.c
==
--- stable/10/sys/amd64/vmm/amd/svm.c   Tue Nov  8 07:18:33 2016
(r308435)
+++ stable/10/sys/amd64/vmm/amd/svm.c   Tue Nov  8 07:18:39 2016
(r308436)
@@ -515,10 +515,11 @@ svm_vminit(struct vm *vm, pmap_t pmap)
 {
struct svm_softc *svm_sc;
struct svm_vcpu *vcpu;
-   vm_paddr_t msrpm_pa, iopm_pa, pml4_pa;  
+   vm_paddr_t msrpm_pa, iopm_pa, pml4_pa;
int i;
 
-   svm_sc = malloc(sizeof (struct svm_softc), M_SVM, M_WAITOK | M_ZERO);
+   svm_sc = contigmalloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO,
+   0, ~(vm_paddr_t)0, PAGE_SIZE, 0);
svm_sc->vm = vm;
svm_sc->nptp = (vm_offset_t)vtophys(pmap->pm_pml4);
 
@@ -535,7 +536,7 @@ svm_vminit(struct vm *vm, pmap_t pmap)
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_GSBASE);
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_FSBASE);
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_KGSBASE);
-   
+
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_STAR);
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_LSTAR);
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_CSTAR);
@@ -2043,7 +2044,7 @@ svm_vmcleanup(void *arg)
 {
struct svm_softc *sc = arg;
 
-   free(sc, M_SVM);
+   contigfree(sc, sizeof (*sc), M_SVM);
 }
 
 static register_t *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308435 - stable/11/sys/amd64/vmm/amd

2016-11-07 Thread Andriy Gapon
Author: avg
Date: Tue Nov  8 07:18:33 2016
New Revision: 308435
URL: https://svnweb.freebsd.org/changeset/base/308435

Log:
  MFC r307903,307904,308039,308050: vmm/svm: iopm_bitmap and msr_bitmap
  must be contiguous in physical memory

Modified:
  stable/11/sys/amd64/vmm/amd/svm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/vmm/amd/svm.c
==
--- stable/11/sys/amd64/vmm/amd/svm.c   Tue Nov  8 06:50:18 2016
(r308434)
+++ stable/11/sys/amd64/vmm/amd/svm.c   Tue Nov  8 07:18:33 2016
(r308435)
@@ -514,10 +514,11 @@ svm_vminit(struct vm *vm, pmap_t pmap)
 {
struct svm_softc *svm_sc;
struct svm_vcpu *vcpu;
-   vm_paddr_t msrpm_pa, iopm_pa, pml4_pa;  
+   vm_paddr_t msrpm_pa, iopm_pa, pml4_pa;
int i;
 
-   svm_sc = malloc(sizeof (struct svm_softc), M_SVM, M_WAITOK | M_ZERO);
+   svm_sc = contigmalloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO,
+   0, ~(vm_paddr_t)0, PAGE_SIZE, 0);
svm_sc->vm = vm;
svm_sc->nptp = (vm_offset_t)vtophys(pmap->pm_pml4);
 
@@ -534,7 +535,7 @@ svm_vminit(struct vm *vm, pmap_t pmap)
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_GSBASE);
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_FSBASE);
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_KGSBASE);
-   
+
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_STAR);
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_LSTAR);
svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_CSTAR);
@@ -2042,7 +2043,7 @@ svm_vmcleanup(void *arg)
 {
struct svm_softc *sc = arg;
 
-   free(sc, M_SVM);
+   contigfree(sc, sizeof (*sc), M_SVM);
 }
 
 static register_t *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys...

2016-11-07 Thread Toomas Soome
Author: tsoome
Date: Tue Nov  8 06:50:18 2016
New Revision: 308434
URL: https://svnweb.freebsd.org/changeset/base/308434

Log:
  Loader paged/pageable data is not always paged.
  
  This change does modify devsw dv_print() to return the int value,
  enabling walkers to interrupt the walk on non zero value from dv_print().
  
  This will allow the pager_print actually to stop displaying data on
  user input, and additionally pager is used in various *dev_print callbacks,
  where it was missing.
  
  For test, lsdev [-v] command should display data by screenfuls and should
  stop when the key 'q' is pressed on pager prompt.
  
  Reviewed by:  allanjude
  Approved by:  allanjude (mentor)
  Differential Revision:https://reviews.freebsd.org/D5461

Modified:
  head/lib/libstand/stand.h
  head/sys/boot/common/dev_net.c
  head/sys/boot/common/module.c
  head/sys/boot/common/part.c
  head/sys/boot/common/util.c
  head/sys/boot/common/util.h
  head/sys/boot/efi/libefi/efinet.c
  head/sys/boot/efi/libefi/efipart.c
  head/sys/boot/efi/loader/main.c
  head/sys/boot/i386/libfirewire/firewire.c
  head/sys/boot/i386/libi386/bioscd.c
  head/sys/boot/i386/libi386/biosdisk.c
  head/sys/boot/i386/libi386/pxe.c
  head/sys/boot/mips/beri/loader/beri_disk_cfi.c
  head/sys/boot/mips/beri/loader/beri_disk_sdcard.c
  head/sys/boot/ofw/libofw/ofw_disk.c
  head/sys/boot/pc98/libpc98/bioscd.c
  head/sys/boot/pc98/libpc98/biosdisk.c
  head/sys/boot/powerpc/kboot/hostdisk.c
  head/sys/boot/powerpc/ps3/ps3cdrom.c
  head/sys/boot/powerpc/ps3/ps3disk.c
  head/sys/boot/uboot/lib/disk.c
  head/sys/boot/usb/storage/umass_loader.c
  head/sys/boot/userboot/userboot/host.c
  head/sys/boot/userboot/userboot/userboot_disk.c
  head/sys/boot/zfs/zfs.c
  head/sys/boot/zfs/zfsimpl.c

Modified: head/lib/libstand/stand.h
==
--- head/lib/libstand/stand.h   Tue Nov  8 06:13:22 2016(r308433)
+++ head/lib/libstand/stand.h   Tue Nov  8 06:50:18 2016(r308434)
@@ -143,7 +143,7 @@ struct devsw {
 int(*dv_open)(struct open_file *f, ...);
 int(*dv_close)(struct open_file *f);
 int(*dv_ioctl)(struct open_file *f, u_long cmd, void 
*data);
-void   (*dv_print)(int verbose);   /* print device information */
+int(*dv_print)(int verbose);   /* print device 
information */
 void   (*dv_cleanup)(void);
 };
 

Modified: head/sys/boot/common/dev_net.c
==
--- head/sys/boot/common/dev_net.c  Tue Nov  8 06:13:22 2016
(r308433)
+++ head/sys/boot/common/dev_net.c  Tue Nov  8 06:50:18 2016
(r308434)
@@ -80,7 +80,7 @@ static intnet_open(struct open_file *, 
 static int net_close(struct open_file *);
 static voidnet_cleanup(void);
 static int net_strategy();
-static voidnet_print(int);
+static int net_print(int);
 
 static int net_getparams(int sock);
 
@@ -325,23 +325,27 @@ exit:
return (0);
 }
 
-static void
+static int
 net_print(int verbose)
 {
struct netif_driver *drv;
int i, d, cnt;
+   int ret = 0;
 
cnt = 0;
for (d = 0; netif_drivers[d]; d++) {
drv = netif_drivers[d];
for (i = 0; i < drv->netif_nifs; i++) {
printf("\t%s%d:", "net", cnt++);
-   if (verbose)
+   if (verbose) {
printf(" (%s%d)", drv->netif_bname,
drv->netif_ifs[i].dif_unit);
+   }
+   if ((ret = pager_output("\n")) != 0)
+   return (ret);
}
}
-   printf("\n");
+   return (ret);
 }
 
 /*

Modified: head/sys/boot/common/module.c
==
--- head/sys/boot/common/module.c   Tue Nov  8 06:13:22 2016
(r308433)
+++ head/sys/boot/common/module.c   Tue Nov  8 06:50:18 2016
(r308434)
@@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[])
 struct kernel_module   *mp;
 struct file_metadata   *md;
 char   lbuf[80];
-intch, verbose;
+intch, verbose, ret = 0;
 
 verbose = 0;
 optind = 1;
@@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[])
 
 pager_open();
 for (fp = preloaded_files; fp; fp = fp->f_next) {
-   sprintf(lbuf, " %p: ", (void *) fp->f_addr);
+   snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr);
pager_output(lbuf);
pager_output(fp->f_name);
-   sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size);
-   pager_output(lbuf);
+   snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type,
+   

svn commit: r308433 - in stable/11/sys: amd64/amd64 amd64/include compat/linprocfs i386/include x86/include x86/x86

2016-11-07 Thread John Baldwin
Author: jhb
Date: Tue Nov  8 06:13:22 2016
New Revision: 308433
URL: https://svnweb.freebsd.org/changeset/base/308433

Log:
  MFC 305836: Remove 'cpu' and 'cpu_class' on amd64.
  
  The 'cpu' and 'cpu_class' variables were always set to the same value
  on amd64 and are legacy holdovers from i386.  Remove them entirely on
  amd64.
  
  Requested by: kib (MFC)

Modified:
  stable/11/sys/amd64/amd64/machdep.c
  stable/11/sys/amd64/include/cputypes.h
  stable/11/sys/compat/linprocfs/linprocfs.c
  stable/11/sys/i386/include/cputypes.h
  stable/11/sys/i386/include/md_var.h
  stable/11/sys/x86/include/cputypes.h
  stable/11/sys/x86/include/x86_var.h
  stable/11/sys/x86/x86/identcpu.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/machdep.c
==
--- stable/11/sys/amd64/amd64/machdep.c Tue Nov  8 05:31:01 2016
(r308432)
+++ stable/11/sys/amd64/amd64/machdep.c Tue Nov  8 06:13:22 2016
(r308433)
@@ -273,7 +273,6 @@ cpu_startup(dummy)
 */
startrtclock();
printcpuinfo();
-   panicifcpuunsupported();
 #ifdef PERFMON
perfmon_init();
 #endif

Modified: stable/11/sys/amd64/include/cputypes.h
==
--- stable/11/sys/amd64/include/cputypes.h  Tue Nov  8 05:31:01 2016
(r308432)
+++ stable/11/sys/amd64/include/cputypes.h  Tue Nov  8 06:13:22 2016
(r308433)
@@ -1,48 +1,6 @@
 /*-
- * Copyright (c) 1993 Christopher G. Demetriou
- * 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.
- * 3. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 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.
- *
- * $FreeBSD$
+ * This file is in the public domain.
  */
-
-#ifndef _MACHINE_CPUTYPES_H_
-#define_MACHINE_CPUTYPES_H_
+/* $FreeBSD$ */
 
 #include 
-
-/*
- * Classes of processor.
- */
-#defineCPUCLASS_X860   /* X86 */
-#defineCPUCLASS_K8 1   /* K8 AMD64 class */
-
-/*
- * Kinds of processor.
- */
-#defineCPU_X86 0   /* Intel */
-#defineCPU_CLAWHAMMER  1   /* AMD Clawhammer */
-#defineCPU_SLEDGEHAMMER2   /* AMD Sledgehammer */
-
-#endif /* !_MACHINE_CPUTYPES_H_ */

Modified: stable/11/sys/compat/linprocfs/linprocfs.c
==
--- stable/11/sys/compat/linprocfs/linprocfs.c  Tue Nov  8 05:31:01 2016
(r308432)
+++ stable/11/sys/compat/linprocfs/linprocfs.c  Tue Nov  8 06:13:22 2016
(r308433)
@@ -218,7 +218,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
char model[128];
uint64_t freq;
size_t size;
-   int class, fqmhz, fqkhz;
+   int fqmhz, fqkhz;
int i;
 
/*
@@ -235,33 +235,6 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
"3dnowext", "3dnow"
};
 
-   switch (cpu_class) {
-#ifdef __i386__
-   case CPUCLASS_286:
-   class = 2;
-   break;
-   case CPUCLASS_386:
-   class = 3;
-   break;
-   case CPUCLASS_486:
-   class = 4;
-   break;
-   case CPUCLASS_586:
-   class = 5;
-   break;
-   case CPUCLASS_686:
-   class = 6;
-   break;
-   default:
-   class = 0;
-   break;
-#else /* __amd64__ */
-   default:
-   class = 15;
-   break;
-#endif
-   }
-
hw_model[0] = CTL_HW;
hw_model[1] = HW_MODEL;
model[0] = '\0';
@@ -286,7 +259,7 @@ 

svn commit: r308432 - in head: bin/echo bin/sleep usr.bin/basename usr.bin/dc usr.bin/dirname usr.bin/fold usr.bin/getopt usr.bin/locate/bigram usr.bin/logname usr.bin/printenv usr.bin/yes

2016-11-07 Thread Conrad E. Meyer
Author: cem
Date: Tue Nov  8 05:31:01 2016
New Revision: 308432
URL: https://svnweb.freebsd.org/changeset/base/308432

Log:
  Capsicumize some trivial stdio programs
  
  Trivially capsicumize some simple programs that just interact with
  stdio.  This list of programs uses 'pledge("stdio")' in OpenBSD.
  
  No objection from:allanjude, emaste, oshogbo
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8307

Modified:
  head/bin/echo/echo.c
  head/bin/sleep/sleep.c
  head/usr.bin/basename/basename.c
  head/usr.bin/dc/dc.c
  head/usr.bin/dirname/dirname.c
  head/usr.bin/fold/fold.c
  head/usr.bin/getopt/getopt.c
  head/usr.bin/locate/bigram/locate.bigram.c
  head/usr.bin/logname/logname.c
  head/usr.bin/printenv/printenv.c
  head/usr.bin/yes/yes.c

Modified: head/bin/echo/echo.c
==
--- head/bin/echo/echo.cTue Nov  8 00:24:49 2016(r308431)
+++ head/bin/echo/echo.cTue Nov  8 05:31:01 2016(r308432)
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -78,6 +80,9 @@ main(int argc, char *argv[])
char newline[] = "\n";
char *progname = argv[0];
 
+   if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS))
+   err(1, "capsicum");
+
/* This utility may NOT do getopt(3) option parsing. */
if (*++argv && !strcmp(*argv, "-n")) {
++argv;

Modified: head/bin/sleep/sleep.c
==
--- head/bin/sleep/sleep.c  Tue Nov  8 00:24:49 2016(r308431)
+++ head/bin/sleep/sleep.c  Tue Nov  8 05:31:01 2016(r308432)
@@ -41,6 +41,7 @@ static char sccsid[] = "@(#)sleep.c   8.3 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -69,6 +70,9 @@ main(int argc, char *argv[])
time_t original;
char buf[2];
 
+   if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS))
+   err(1, "capsicum");
+
if (argc != 2)
usage();
 

Modified: head/usr.bin/basename/basename.c
==
--- head/usr.bin/basename/basename.cTue Nov  8 00:24:49 2016
(r308431)
+++ head/usr.bin/basename/basename.cTue Nov  8 05:31:01 2016
(r308432)
@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)basename.c8
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -64,6 +65,9 @@ main(int argc, char **argv)
 
setlocale(LC_ALL, "");
 
+   if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS))
+   err(1, "capsicum");
+
aflag = 0;
suffix = NULL;
suffixlen = 0;

Modified: head/usr.bin/dc/dc.c
==
--- head/usr.bin/dc/dc.cTue Nov  8 00:24:49 2016(r308431)
+++ head/usr.bin/dc/dc.cTue Nov  8 05:31:01 2016(r308432)
@@ -22,9 +22,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -58,11 +60,11 @@ usage(void)
 }
 
 static void
-procfile(char *fname) {
+procfd(int fd, char *fname) {
struct stat st;
FILE *file;
 
-   file = fopen(fname, "r");
+   file = fdopen(fd, "r");
if (file == NULL)
err(1, "cannot open file %s", fname);
if (fstat(fileno(file), ) == -1)
@@ -80,7 +82,7 @@ procfile(char *fname) {
 int
 main(int argc, char *argv[])
 {
-   int ch;
+   int ch, fd;
bool extended_regs = false, preproc_done = false;
 
/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
@@ -97,7 +99,10 @@ main(int argc, char *argv[])
case 'f':
if (!preproc_done)
init_bmachine(extended_regs);
-   procfile(optarg);
+   fd = open(optarg, O_RDONLY);
+   if (fd < 0)
+   err(1, "cannot open file %s", optarg);
+   procfd(fd, optarg);
preproc_done = true;
break;
case 'x':
@@ -126,12 +131,23 @@ main(int argc, char *argv[])
if (argc > 1)
usage();
if (argc == 1) {
-   procfile(argv[0]);
+   fd = open(argv[0], O_RDONLY);
+   if (fd < 0)
+   err(1, "cannot open file %s", argv[0]);
+
+   if (caph_limit_stream(fd, CAPH_READ) < 0 ||
+   caph_limit_stdio() < 0 ||
+   (cap_enter() < 0 && errno != ENOSYS))
+   err(1, "capsicum");
+
+   procfd(fd, argv[0]);
preproc_done 

svn commit: r308431 - head/sys/dev/nvme

2016-11-07 Thread Scott Long
Author: scottl
Date: Tue Nov  8 00:24:49 2016
New Revision: 308431
URL: https://svnweb.freebsd.org/changeset/base/308431

Log:
  Convert the Q-Pair and PRP list memory allocations to use BUSDMA.  Add a
  bunch of safery belts and error handling in related codepaths.
  
  Reviewed by:  jimharris
  Obtained from:Netflix
  Differential Revision:D8453

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Mon Nov  7 22:41:52 2016
(r308430)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Tue Nov  8 00:24:49 2016
(r308431)
@@ -80,11 +80,12 @@ nvme_ctrlr_allocate_bar(struct nvme_cont
return (0);
 }
 
-static void
+static int
 nvme_ctrlr_construct_admin_qpair(struct nvme_controller *ctrlr)
 {
struct nvme_qpair   *qpair;
uint32_tnum_entries;
+   int error;
 
qpair = >adminq;
 
@@ -105,12 +106,13 @@ nvme_ctrlr_construct_admin_qpair(struct 
 * The admin queue's max xfer size is treated differently than the
 *  max I/O xfer size.  16KB is sufficient here - maybe even less?
 */
-   nvme_qpair_construct(qpair, 
-0, /* qpair ID */
-0, /* vector */
-num_entries,
-NVME_ADMIN_TRACKERS,
-ctrlr);
+   error = nvme_qpair_construct(qpair, 
+0, /* qpair ID */
+0, /* vector */
+num_entries,
+NVME_ADMIN_TRACKERS,
+ctrlr);
+   return (error);
 }
 
 static int
@@ -118,7 +120,7 @@ nvme_ctrlr_construct_io_qpairs(struct nv
 {
struct nvme_qpair   *qpair;
union cap_lo_register   cap_lo;
-   int i, num_entries, num_trackers;
+   int i, error, num_entries, num_trackers;
 
num_entries = NVME_IO_ENTRIES;
TUNABLE_INT_FETCH("hw.nvme.io_entries", _entries);
@@ -163,12 +165,14 @@ nvme_ctrlr_construct_io_qpairs(struct nv
 * For I/O queues, use the controller-wide max_xfer_size
 *  calculated in nvme_attach().
 */
-   nvme_qpair_construct(qpair,
+   error = nvme_qpair_construct(qpair,
 i+1, /* qpair ID */
 ctrlr->msix_enabled ? i+1 : 0, /* vector */
 num_entries,
 num_trackers,
 ctrlr);
+   if (error)
+   return (error);
 
/*
 * Do not bother binding interrupts if we only have one I/O
@@ -1098,7 +1102,8 @@ nvme_ctrlr_construct(struct nvme_control
nvme_ctrlr_setup_interrupts(ctrlr);
 
ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE;
-   nvme_ctrlr_construct_admin_qpair(ctrlr);
+   if (nvme_ctrlr_construct_admin_qpair(ctrlr) != 0)
+   return (ENXIO);
 
ctrlr->cdev = make_dev(_ctrlr_cdevsw, device_get_unit(dev),
UID_ROOT, GID_WHEEL, 0600, "nvme%d", device_get_unit(dev));

Modified: head/sys/dev/nvme/nvme_private.h
==
--- head/sys/dev/nvme/nvme_private.hMon Nov  7 22:41:52 2016
(r308430)
+++ head/sys/dev/nvme/nvme_private.hTue Nov  8 00:24:49 2016
(r308431)
@@ -172,9 +172,8 @@ struct nvme_tracker {
bus_dmamap_tpayload_dma_map;
uint16_tcid;
 
-   uint64_tprp[NVME_MAX_PRP_LIST_ENTRIES];
+   uint64_t*prp;
bus_addr_t  prp_bus_addr;
-   bus_dmamap_tprp_dma_map;
 };
 
 struct nvme_qpair {
@@ -206,10 +205,8 @@ struct nvme_qpair {
bus_dma_tag_t   dma_tag;
bus_dma_tag_t   dma_tag_payload;
 
-   bus_dmamap_tcmd_dma_map;
+   bus_dmamap_tqueuemem_map;
uint64_tcmd_bus_addr;
-
-   bus_dmamap_tcpl_dma_map;
uint64_tcpl_bus_addr;
 
TAILQ_HEAD(, nvme_tracker)  free_tr;
@@ -417,7 +414,7 @@ voidnvme_ctrlr_submit_io_request(struct
 void   nvme_ctrlr_post_failed_request(struct nvme_controller *ctrlr,
   struct nvme_request *req);
 
-void   nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id,
+intnvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id,
 uint16_t vector, uint32_t 

Re: svn commit: r308230 - head/sys/dev/ioat

2016-11-07 Thread Conrad Meyer
Nope.

On Mon, Nov 7, 2016 at 12:17 PM, Ngie Cooper  wrote:
> On Wed, Nov 2, 2016 at 4:18 PM, Conrad E. Meyer  wrote:
>> Author: cem
>> Date: Wed Nov  2 23:18:16 2016
>> New Revision: 308230
>> URL: https://svnweb.freebsd.org/changeset/base/308230
>>
>> Log:
>>   ioat(4): Read CHANSTS register for suspended/halted checks
>>
>>   The device doesn't accurately update the CHANCMP address with the device 
>> state
>>   when the device is suspended or halted.  So, read the CHANSTS register to 
>> check
>>   for those states.
>>
>>   We still need to read the CHANCMP address for the last completed 
>> descriptor.
>>
>>   Sponsored by: Dell EMC Isilon
>
> Did anyone review this change, either external or internal to Isilon?
> Thanks,
> -Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308430 - head/contrib/elftoolchain/libelftc

2016-11-07 Thread Ed Maste
Author: emaste
Date: Mon Nov  7 22:41:52 2016
New Revision: 308430
URL: https://svnweb.freebsd.org/changeset/base/308430

Log:
  libelftc: add elf{32,64}-tradbigmips target emulation names
  
  Reported by:  theraven
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3
  head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c

Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3
==
--- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3  Mon Nov  7 
22:24:37 2016(r308429)
+++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3  Mon Nov  7 
22:41:52 2016(r308430)
@@ -82,6 +82,7 @@ Known descriptor names and their propert
 .It Li elf32-shbig-linux Ta ELF Ta MSB Ta 32
 .It Li elf32-shl-linux Ta ELF Ta LSB Ta 32
 .It Li elf32-sparc Ta ELF Ta MSB Ta 32
+.It Li elf32-tradbigmips Ta ELF Ta MSB Ta 32
 .It Li elf64-alpha Ta ELF Ta LSB Ta 64
 .It Li elf64-alpha-freebsd Ta ELF Ta LSB Ta 64
 .It Li elf64-big Ta ELF Ta MSB Ta 64
@@ -101,6 +102,7 @@ Known descriptor names and their propert
 .It Li elf64-sh64-linux Ta ELF Ta LSB Ta 64
 .It Li elf64-sparc Ta ELF Ta MSB Ta 64
 .It Li elf64-sparc-freebsd Ta ELF Ta MSB Ta 64
+.It Li elf64-tradbigmips Ta ELF Ta MSB Ta 64
 .It Li elf64-x86-64 Ta ELF Ta LSB Ta 64
 .It Li elf64-x86-64-freebsd Ta ELF Ta LSB Ta 64
 .It Li ihex Ta IHEX Ta - Ta -

Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c
==
--- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Nov  7 
22:24:37 2016(r308429)
+++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Nov  7 
22:41:52 2016(r308430)
@@ -195,6 +195,14 @@ struct _Elftc_Bfd_Target _libelftc_targe
},
 
{
+   .bt_name  = "elf32-tradbigmips",
+   .bt_type  = ETF_ELF,
+   .bt_byteorder = ELFDATA2MSB,
+   .bt_elfclass  = ELFCLASS32,
+   .bt_machine   = EM_MIPS,
+   },
+
+   {
.bt_name  = "elf64-alpha",
.bt_type  = ETF_ELF,
.bt_byteorder = ELFDATA2LSB,
@@ -351,6 +359,14 @@ struct _Elftc_Bfd_Target _libelftc_targe
},
 
{
+   .bt_name  = "elf64-tradbigmips",
+   .bt_type  = ETF_ELF,
+   .bt_byteorder = ELFDATA2MSB,
+   .bt_elfclass  = ELFCLASS64,
+   .bt_machine   = EM_MIPS,
+   },
+
+   {
.bt_name  = "elf64-x86-64",
.bt_type  = ETF_ELF,
.bt_byteorder = ELFDATA2LSB,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308429 - head/sys/dev/e1000

2016-11-07 Thread Sean Bruno
Author: sbruno
Date: Mon Nov  7 22:24:37 2016
New Revision: 308429
URL: https://svnweb.freebsd.org/changeset/base/308429

Log:
  The igb driver currently requires a VF interface to have a non-zero MAC
  address, but the associated PF is giving the VF an all zeros MAC address
  when one is not administratively assigned. The driver should check for
  this case and generate a random address, similar to how the linux igbvf
  driver does.
  
  Submitted by: skoumj...@juniper.net (Scott Koumjian)
  MFH:  2 weeks
  Differential Revision:https://reviews.freebsd.org/D8399

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

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Mon Nov  7 21:15:39 2016(r308428)
+++ head/sys/dev/e1000/if_igb.c Mon Nov  7 22:24:37 2016(r308429)
@@ -590,11 +590,20 @@ igb_attach(device_t dev)
error = EIO;
goto err_late;
}
-   /* Check its sanity */
-   if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) {
-   device_printf(dev, "Invalid MAC address\n");
-   error = EIO;
-   goto err_late;
+
+   /* Check its sanity */
+   if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) {
+   if (adapter->vf_ifp) {
+   u8 addr[ETHER_ADDR_LEN];
+   arc4rand(, sizeof(addr), 0);
+   addr[0] &= 0xFE;
+   addr[0] |= 0x02;
+   bcopy(addr, adapter->hw.mac.addr, sizeof(addr));
+   } else {
+   device_printf(dev, "Invalid MAC address\n");
+   error = EIO;
+   goto err_late;
+   }
}
 
/* Setup OS specific network interface */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308428 - in head/sys: conf dev/gpio modules/gpio/gpioled

2016-11-07 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Nov  7 21:15:39 2016
New Revision: 308428
URL: https://svnweb.freebsd.org/changeset/base/308428

Log:
  Refactor FDT part of gpioled driver
  
  - Split driver in two parts: FDT and non-FDT
  - Instead of reattach gpioled nodes to GPIO bus use
  gpio_pin_get_by_ofw_idx and add ofwbus and simplebus as parrent buses
  
  Reviewed by:  loos
  Differential Revision:https://reviews.freebsd.org/D8233

Added:
  head/sys/dev/gpio/gpioled_fdt.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/gpio/gpioled.c
  head/sys/modules/gpio/gpioled/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Nov  7 20:02:18 2016(r308427)
+++ head/sys/conf/files Mon Nov  7 21:15:39 2016(r308428)
@@ -1612,7 +1612,8 @@ dev/gpio/gpiobus.coptional gpio   
\
 dev/gpio/gpioc.c   optional gpio   \
dependency  "gpio_if.h"
 dev/gpio/gpioiic.c optional gpioiic
-dev/gpio/gpioled.c optional gpioled
+dev/gpio/gpioled.c optional gpioled !fdt
+dev/gpio/gpioled_fdt.c optional gpioled fdt
 dev/gpio/gpioregulator.c   optional gpioregulator fdt ext_resources
 dev/gpio/gpiospi.c optional gpiospi
 dev/gpio/gpio_if.m optional gpio

Modified: head/sys/dev/gpio/gpioled.c
==
--- head/sys/dev/gpio/gpioled.c Mon Nov  7 20:02:18 2016(r308427)
+++ head/sys/dev/gpio/gpioled.c Mon Nov  7 21:15:39 2016(r308428)
@@ -39,11 +39,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef FDT
-#include 
-#include 
-#endif
-
 #include 
 #include 
 
@@ -91,66 +86,9 @@ gpioled_control(void *priv, int onoff)
GPIOLED_UNLOCK(sc);
 }
 
-#ifdef FDT
-static void
-gpioled_identify(driver_t *driver, device_t bus)
-{
-   phandle_t child, leds, root;
-
-   root = OF_finddevice("/");
-   if (root == 0)
-   return;
-   for (leds = OF_child(root); leds != 0; leds = OF_peer(leds)) {
-   if (!fdt_is_compatible_strict(leds, "gpio-leds"))
-   continue;
-   /* Traverse the 'gpio-leds' node and add its children. */
-   for (child = OF_child(leds); child != 0; child = 
OF_peer(child)) {
-   if (!OF_hasprop(child, "gpios"))
-   continue;
-   if (ofw_gpiobus_add_fdt_child(bus, driver->name, child) 
== NULL)
-   continue;
-   }
-   }
-}
-#endif
-
 static int
 gpioled_probe(device_t dev)
 {
-#ifdef FDT
-   int match;
-   phandle_t node;
-   char *compat;
-
-   /*
-* We can match against our own node compatible string and also against
-* our parent node compatible string.  The first is normally used to
-* describe leds on a gpiobus and the later when there is a common node
-* compatible with 'gpio-leds' which is used to concentrate all the
-* leds nodes on the dts.
-*/
-   match = 0;
-   if (ofw_bus_is_compatible(dev, "gpioled"))
-   match = 1;
-
-   if (match == 0) {
-   if ((node = ofw_bus_get_node(dev)) == -1)
-   return (ENXIO);
-   if ((node = OF_parent(node)) == -1)
-   return (ENXIO);
-   if (OF_getprop_alloc(node, "compatible", 1,
-   (void **)) == -1)
-   return (ENXIO);
-
-   if (strcasecmp(compat, "gpio-leds") == 0)
-   match = 1;
-
-   OF_prop_free(compat);
-   }
-
-   if (match == 0)
-   return (ENXIO);
-#endif
device_set_desc(dev, "GPIO led");
 
return (BUS_PROBE_DEFAULT);
@@ -161,13 +99,7 @@ gpioled_attach(device_t dev)
 {
struct gpioled_softc *sc;
int state;
-#ifdef FDT
-   phandle_t node;
-   char *default_state;
-   char *name;
-#else
const char *name;
-#endif
 
sc = device_get_softc(dev);
sc->sc_dev = dev;
@@ -176,42 +108,14 @@ gpioled_attach(device_t dev)
 
state = 0;
 
-#ifdef FDT
-   if ((node = ofw_bus_get_node(dev)) == -1)
-   return (ENXIO);
-
-   if (OF_getprop_alloc(node, "default-state",
-   sizeof(char), (void **)_state) != -1) {
-   if (strcasecmp(default_state, "on") == 0)
-   state = 1;
-   else if (strcasecmp(default_state, "off") == 0)
-   state = 0;
-   else if (strcasecmp(default_state, "keep") == 0)
-   state = -1;
-   else {
-   device_printf(dev,
-   "unknown value for default-state in FDT\n");
-   }
-   

Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835

2016-11-07 Thread Oleksandr Tymoshenko

> On Nov 7, 2016, at 11:51 AM, Hans Petter Selasky  wrote:
> 
> On 11/07/16 20:32, Hans Petter Selasky wrote:
>> On 11/07/16 20:23, Oleksandr Tymoshenko wrote:
>>> 
 On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky 
 wrote:
 
 On 11/07/16 18:38, Oleksandr Tymoshenko wrote:
> +bcm2835_audio_unlock(sc);
> +cv_signal(>worker_cv);
 
 
 Shouldn't cv_signal() be done locked, so that you don't loose any
 transactions? CV's only wakeup the treads that are sleeping right
 there and then.
>>> 
>>> Hi Hans,
>>> 
>>> In this case it doesn’t matter. bcm2835_audio_xxx lock functions are
>>> used to keep channel state consistent. The actual audio hw
>>> reprogramming happens in worker thread which only picks up latest
>>> state of the virtual channel, there is no need to run every
>>> transaction in sequence.
>>> 
>> 
>> Hi,
>> 
>> It is not about running in sequence, but that if the worker thread is
>> not sleeping, but on the way to sleep, it will never get woken up unless
>> you use proper locks here!
>> 
>> --HPS
> 
> Hi,
> 
> Also the teardown sequence for the worker thread looks a bit broken, that it 
> doesn't wait for the thread to exit.
> 
> I've made a patch, attached which I think is the right way to do it.
> 
> Try opening and closing /dev/dsp in a loop with some DSP ioctls and see what 
> happens.

Thanks for patch Hans. Looks good to me.  I’ll test and commit it. 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r308230 - head/sys/dev/ioat

2016-11-07 Thread Ngie Cooper
On Wed, Nov 2, 2016 at 4:18 PM, Conrad E. Meyer  wrote:
> Author: cem
> Date: Wed Nov  2 23:18:16 2016
> New Revision: 308230
> URL: https://svnweb.freebsd.org/changeset/base/308230
>
> Log:
>   ioat(4): Read CHANSTS register for suspended/halted checks
>
>   The device doesn't accurately update the CHANCMP address with the device 
> state
>   when the device is suspended or halted.  So, read the CHANSTS register to 
> check
>   for those states.
>
>   We still need to read the CHANCMP address for the last completed descriptor.
>
>   Sponsored by: Dell EMC Isilon

Did anyone review this change, either external or internal to Isilon?
Thanks,
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308427 - head/sys/cddl/dev/dtrace/arm

2016-11-07 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Nov  7 20:02:18 2016
New Revision: 308427
URL: https://svnweb.freebsd.org/changeset/base/308427

Log:
  Fix include order as required post r308415

Modified:
  head/sys/cddl/dev/dtrace/arm/dtrace_asm.S

Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S
==
--- head/sys/cddl/dev/dtrace/arm/dtrace_asm.S   Mon Nov  7 18:29:21 2016
(r308426)
+++ head/sys/cddl/dev/dtrace/arm/dtrace_asm.S   Mon Nov  7 20:02:18 2016
(r308427)
@@ -32,8 +32,8 @@
 #include 
 #include 
 
-#include 
 #include 
+#include 
 
 #include "assym.s"
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835

2016-11-07 Thread Hans Petter Selasky

On 11/07/16 20:32, Hans Petter Selasky wrote:

On 11/07/16 20:23, Oleksandr Tymoshenko wrote:



On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky 
wrote:

On 11/07/16 18:38, Oleksandr Tymoshenko wrote:

+bcm2835_audio_unlock(sc);
+cv_signal(>worker_cv);



Shouldn't cv_signal() be done locked, so that you don't loose any
transactions? CV's only wakeup the treads that are sleeping right
there and then.


Hi Hans,

In this case it doesn’t matter. bcm2835_audio_xxx lock functions are
used to keep channel state consistent. The actual audio hw
reprogramming happens in worker thread which only picks up latest
state of the virtual channel, there is no need to run every
transaction in sequence.



Hi,

It is not about running in sequence, but that if the worker thread is
not sleeping, but on the way to sleep, it will never get woken up unless
you use proper locks here!

--HPS


Hi,

Also the teardown sequence for the worker thread looks a bit broken, 
that it doesn't wait for the thread to exit.


I've made a patch, attached which I think is the right way to do it.

Try opening and closing /dev/dsp in a loop with some DSP ioctls and see 
what happens.


--HPS
Index: sys/arm/broadcom/bcm2835/bcm2835_audio.c
===
--- sys/arm/broadcom/bcm2835/bcm2835_audio.c	(revision 308426)
+++ sys/arm/broadcom/bcm2835/bcm2835_audio.c	(working copy)
@@ -149,6 +149,14 @@
 }
 
 static void
+bcm2835_wakeup_worker(struct bcm2835_audio_info *sc)
+{
+	sx_xlock(>worker_lock);
+	cv_signal(>worker_cv);
+	sx_xunlock(>worker_lock);
+}
+
+static void
 bcm2835_audio_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *msg_handle)
 {
 	struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)param;
@@ -540,6 +548,8 @@
 			}
 		}
 	}
+	sc->unloading = 2;
+	cv_signal(>worker_cv);
 	sx_sunlock(>worker_lock);
 
 	kproc_exit(0);
@@ -586,8 +596,9 @@
 	}
 
 	sc->parameters_update_pending = true;
-	cv_signal(>worker_cv);
 
+	bcm2835_wakeup_worker(sc);
+
 	return ch;
 }
 
@@ -615,7 +626,7 @@
 	sc->parameters_update_pending = true;
 	bcm2835_audio_unlock(sc);
 
-	cv_signal(>worker_cv);
+	bcm2835_wakeup_worker(sc);
 
 	return 0;
 }
@@ -631,7 +642,7 @@
 	sc->parameters_update_pending = true;
 	bcm2835_audio_unlock(sc);
 
-	cv_signal(>worker_cv);
+	bcm2835_wakeup_worker(sc);
 
 	return ch->spd;
 }
@@ -662,8 +673,7 @@
 		bcm2835_audio_unlock(sc);
 		/* kickstart data flow */
 		chn_intr(sc->pch.channel);
-		/* wakeup worker thread */
-		cv_signal(>worker_cv);
+		bcm2835_wakeup_worker(sc);
 		break;
 
 	case PCMTRIG_STOP:
@@ -671,7 +681,7 @@
 		bcm2835_audio_lock(sc);
 		ch->playback_state = PLAYBACK_STOPPING;
 		bcm2835_audio_unlock(sc);
-		cv_signal(>worker_cv);
+		bcm2835_wakeup_worker(sc);
 		break;
 
 	default:
@@ -738,7 +748,8 @@
 		sc->volume = left;
 		sc->controls_update_pending = true;
 		bcm2835_audio_unlock(sc);
-		cv_signal(>worker_cv);
+
+		bcm2835_wakeup_worker(sc);
 		break;
 
 	default:
@@ -776,7 +787,7 @@
 	sc->controls_update_pending = true;
 	bcm2835_audio_unlock(sc);
 
-	cv_signal(>worker_cv);
+	bcm2835_wakeup_worker(sc);
 	device_printf(sc->dev, "destination set to %s\n", dest_description(val));
 
 	return (0);
@@ -898,8 +909,11 @@
 	/* Stop worker thread */
 	sx_xlock(>worker_lock);
 	sc->unloading = 1;
+	cv_signal(>worker_cv);
+	/* Wait for thread to exit */
+	while (sc->unloading != 2)
+		cv_wait_sig(>worker_cv, >worker_lock);
 	sx_xunlock(>worker_lock);
-	cv_signal(>worker_cv);
 
 	r = pcm_unregister(dev);
 	if (r)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835

2016-11-07 Thread Hans Petter Selasky

On 11/07/16 20:23, Oleksandr Tymoshenko wrote:



On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky  wrote:

On 11/07/16 18:38, Oleksandr Tymoshenko wrote:

+   bcm2835_audio_unlock(sc);
+   cv_signal(>worker_cv);



Shouldn't cv_signal() be done locked, so that you don't loose any transactions? 
CV's only wakeup the treads that are sleeping right there and then.


Hi Hans,

In this case it doesn’t matter. bcm2835_audio_xxx lock functions are used to 
keep channel state consistent. The actual audio hw reprogramming happens in 
worker thread which only picks up latest state of the virtual channel, there is 
no need to run every transaction in sequence.



Hi,

It is not about running in sequence, but that if the worker thread is 
not sleeping, but on the way to sleep, it will never get woken up unless 
you use proper locks here!


--HPS

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

Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835

2016-11-07 Thread Oleksandr Tymoshenko

> On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky  wrote:
> 
> On 11/07/16 18:38, Oleksandr Tymoshenko wrote:
>> +bcm2835_audio_unlock(sc);
>> +cv_signal(>worker_cv);
> 
> 
> Shouldn't cv_signal() be done locked, so that you don't loose any 
> transactions? CV's only wakeup the treads that are sleeping right there and 
> then.

Hi Hans, 

In this case it doesn’t matter. bcm2835_audio_xxx lock functions are used to 
keep channel state consistent. The actual audio hw reprogramming happens in 
worker thread which only picks up latest state of the virtual channel, there is 
no need to run every transaction in sequence. 

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

svn commit: r308426 - stable/11/sys/netinet

2016-11-07 Thread Julien Charbon
Author: jch
Date: Mon Nov  7 18:29:21 2016
New Revision: 308426
URL: https://svnweb.freebsd.org/changeset/base/308426

Log:
  MFC r307966:
  
  Remove an extraneous call to soisconnected() in syncache_socket(),
  introduced with r261242.  The useful and expected soisconnected()
  call is done in tcp_do_segment().
  
  Has been found as part of unrelated PR:212920 investigation.
  
  Improve slightly (~2%) the maximum number of TCP accept per second.
  
  Tested by:kevin.bowling_kev009.com, jch
  Approved by:  gnn, hiren
  MFC after:1 week
  Sponsored by: Verisign, Inc
  Differential Revision:https://reviews.freebsd.org/D8072

Modified:
  stable/11/sys/netinet/tcp_syncache.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_syncache.c
==
--- stable/11/sys/netinet/tcp_syncache.cMon Nov  7 18:21:53 2016
(r308425)
+++ stable/11/sys/netinet/tcp_syncache.cMon Nov  7 18:29:21 2016
(r308426)
@@ -918,10 +918,6 @@ syncache_socket(struct syncache *sc, str
tp->t_keepcnt = sototcpcb(lso)->t_keepcnt;
tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp));
 
-   if ((so->so_options & SO_ACCEPTFILTER) == 0) {
-   soisconnected(so);
-   }
-
TCPSTAT_INC(tcps_accepts);
return (so);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835

2016-11-07 Thread Hans Petter Selasky

On 11/07/16 18:38, Oleksandr Tymoshenko wrote:

+   bcm2835_audio_unlock(sc);
+   cv_signal(>worker_cv);



Shouldn't cv_signal() be done locked, so that you don't loose any 
transactions? CV's only wakeup the treads that are sleeping right there 
and then.


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


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

2016-11-07 Thread Alexander Motin
Author: mav
Date: Mon Nov  7 18:21:53 2016
New Revision: 308425
URL: https://svnweb.freebsd.org/changeset/base/308425

Log:
  Add support for EIIOE flag in Additional Element Status.
  
  It was added in SES-3 spec, and its support required to properly link
  the Additional Element Status page data to the original elements.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/cam/scsi/scsi_enc_ses.c
  head/sys/cam/scsi/scsi_ses.h

Modified: head/sys/cam/scsi/scsi_enc_ses.c
==
--- head/sys/cam/scsi/scsi_enc_ses.cMon Nov  7 17:38:39 2016
(r308424)
+++ head/sys/cam/scsi/scsi_enc_ses.cMon Nov  7 18:21:53 2016
(r308425)
@@ -1758,14 +1758,20 @@ ses_process_elm_addlstatus(enc_softc_t *
eip = ses_elm_addlstatus_eip(elm_hdr);
if (eip && !ignore_index) {
struct ses_elm_addlstatus_eip_hdr *eip_hdr;
-   int expected_index;
+   int expected_index, index;
+   ses_elem_index_type_t index_type;
 
eip_hdr = (struct ses_elm_addlstatus_eip_hdr *)elm_hdr;
-   expected_index = iter.individual_element_index;
+   if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) {
+   index_type = SES_ELEM_INDEX_GLOBAL;
+   expected_index = iter.global_element_index;
+   } else {
+   index_type = SES_ELEM_INDEX_INDIVIDUAL;
+   expected_index = iter.individual_element_index;
+   }
titer = iter;
telement = ses_iter_seek_to(,
-  eip_hdr->element_index,
-  SES_ELEM_INDEX_INDIVIDUAL);
+   eip_hdr->element_index, index_type);
if (telement != NULL &&
(ses_typehasaddlstatus(enc, titer.type_index) !=
 TYPE_ADDLSTATUS_NONE ||
@@ -1775,13 +1781,18 @@ ses_process_elm_addlstatus(enc_softc_t *
} else
ignore_index = 1;
 
-   if (iter.individual_element_index > expected_index
+   if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE)
+   index = iter.global_element_index;
+   else
+   index = iter.individual_element_index;
+   if (index > expected_index
 && status_type == TYPE_ADDLSTATUS_MANDATORY) {
-   ENC_VLOG(enc, "%s: provided element "
+   ENC_VLOG(enc, "%s: provided %s element"
"index %d skips mandatory status "
" element at index %d\n",
-   __func__, eip_hdr->element_index,
-   expected_index);
+   __func__, (eip_hdr->byte2 &
+   SES_ADDL_EIP_EIIOE) ? "global " : "",
+   index, expected_index);
}
}
elmpriv = element->elm_private;

Modified: head/sys/cam/scsi/scsi_ses.h
==
--- head/sys/cam/scsi/scsi_ses.hMon Nov  7 17:38:39 2016
(r308424)
+++ head/sys/cam/scsi/scsi_ses.hMon Nov  7 18:21:53 2016
(r308425)
@@ -2413,7 +2413,8 @@ int ses_elm_addlstatus_invalid(struct se
 
 struct ses_elm_addlstatus_eip_hdr {
struct ses_elm_addlstatus_base_hdr base;
-   uint8_t reserved;
+   uint8_t byte2;
+#defineSES_ADDL_EIP_EIIOE  1
uint8_t element_index;
/* NB: This define (currently) applies to all eip=1 headers */
 #defineSES_EIP_HDR_EXTRA_LEN   2
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308424 - head/sys/arm/broadcom/bcm2835

2016-11-07 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Nov  7 17:38:39 2016
New Revision: 308424
URL: https://svnweb.freebsd.org/changeset/base/308424

Log:
  Fix locking in bcm2835_audio driver
  
  - Move all VCHI activity to worker thread: channel methods are called with
  non-sleepable lock held and VCHI uses sleepable lock.
  
  - In worker thread use sx(9) lock instead of mutex(9) for the same reason.
  
  PR:   213801, 205979

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_audio.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_audio.c   Mon Nov  7 17:34:19 
2016(r308423)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c   Mon Nov  7 17:38:39 
2016(r308424)
@@ -104,14 +104,17 @@ struct bcm2835_audio_info {
struct intr_config_hook intr_hook;
 
/* VCHI data */
-   struct mtx vchi_lock;
+   struct sx vchi_lock;
 
VCHI_INSTANCE_T vchi_instance;
VCHI_CONNECTION_T *vchi_connection;
VCHI_SERVICE_HANDLE_T vchi_handle;
 
-   struct mtx data_lock;
-   struct cv data_cv;
+   struct sx worker_lock;
+   struct cv worker_cv;
+
+   bool parameters_update_pending;
+   bool controls_update_pending;
 
/* Unloadign module */
int unloading;
@@ -121,8 +124,8 @@ struct bcm2835_audio_info {
 #define bcm2835_audio_unlock(_ess) snd_mtxunlock((_ess)->lock)
 #define bcm2835_audio_lock_assert(_ess) snd_mtxassert((_ess)->lock)
 
-#define VCHIQ_VCHI_LOCK(sc)mtx_lock(&(sc)->vchi_lock)
-#define VCHIQ_VCHI_UNLOCK(sc)  mtx_unlock(&(sc)->vchi_lock)
+#define VCHIQ_VCHI_LOCK(sc)sx_xlock(&(sc)->vchi_lock)
+#define VCHIQ_VCHI_UNLOCK(sc)  sx_xunlock(&(sc)->vchi_lock)
 
 static const char *
 dest_description(uint32_t dest)
@@ -175,7 +178,7 @@ bcm2835_audio_callback(void *param, cons
chn_intr(sc->pch.channel);
 
if (perr || ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE)
-   cv_signal(>data_cv);
+   cv_signal(>worker_cv);
} else
printf("%s: unknown m.type: %d\n", __func__, m.type);
 }
@@ -261,8 +264,6 @@ bcm2835_audio_start(struct bcm2835_audio
if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) {
vchi_service_use(sc->vchi_handle);
 
-   bcm2835_audio_reset_channel(ch);
-
m.type = VC_AUDIO_MSG_TYPE_START;
ret = vchi_msg_queue(sc->vchi_handle,
, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
@@ -324,7 +325,7 @@ bcm2835_audio_open(struct bcm2835_audio_
 }
 
 static void
-bcm2835_audio_update_controls(struct bcm2835_audio_info *sc)
+bcm2835_audio_update_controls(struct bcm2835_audio_info *sc, uint32_t volume, 
uint32_t dest)
 {
VC_AUDIO_MSG_T m;
int ret, db;
@@ -334,10 +335,10 @@ bcm2835_audio_update_controls(struct bcm
vchi_service_use(sc->vchi_handle);
 
m.type = VC_AUDIO_MSG_TYPE_CONTROL;
-   m.u.control.dest = sc->dest;
-   if (sc->volume > 99)
-   sc->volume = 99;
-   db = db_levels[sc->volume/5];
+   m.u.control.dest = dest;
+   if (volume > 99)
+   volume = 99;
+   db = db_levels[volume/5];
m.u.control.volume = VCHIQ_AUDIO_VOLUME(db);
 
ret = vchi_msg_queue(sc->vchi_handle,
@@ -352,7 +353,7 @@ bcm2835_audio_update_controls(struct bcm
 }
 
 static void
-bcm2835_audio_update_params(struct bcm2835_audio_info *sc, struct 
bcm2835_audio_chinfo *ch)
+bcm2835_audio_update_params(struct bcm2835_audio_info *sc, uint32_t fmt, 
uint32_t speed)
 {
VC_AUDIO_MSG_T m;
int ret;
@@ -362,9 +363,9 @@ bcm2835_audio_update_params(struct bcm28
vchi_service_use(sc->vchi_handle);
 
m.type = VC_AUDIO_MSG_TYPE_CONFIG;
-   m.u.config.channels = AFMT_CHANNEL(ch->fmt);
-   m.u.config.samplerate = ch->spd;
-   m.u.config.bps = AFMT_BIT(ch->fmt);
+   m.u.config.channels = AFMT_CHANNEL(fmt);
+   m.u.config.samplerate = speed;
+   m.u.config.bps = AFMT_BIT(fmt);
 
ret = vchi_msg_queue(sc->vchi_handle,
, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
@@ -474,29 +475,61 @@ bcm2835_audio_worker(void *data)
 {
struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)data;
struct bcm2835_audio_chinfo *ch = >pch;
-   mtx_lock(>data_lock);
+   uint32_t speed, format;
+   uint32_t volume, dest;
+   bool parameters_changed, controls_changed;
+
+   sx_slock(>worker_lock);
while(1) {
 
if (sc->unloading)
break;
 
+   parameters_changed = false;
+   controls_changed = false;
+ 

svn commit: r308423 - head/sys/dev/mpt

2016-11-07 Thread Scott Long
Author: scottl
Date: Mon Nov  7 17:34:19 2016
New Revision: 308423
URL: https://svnweb.freebsd.org/changeset/base/308423

Log:
  Fix the fallout from r308268 (mpt driver causes endless witness warnings in
  VMWare and elsewhere) with the precision of a dull, rusty butter knife.
  
  Reported by:  tuexen
  Obtained from:Netflix

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

Modified: head/sys/dev/mpt/mpt.c
==
--- head/sys/dev/mpt/mpt.c  Mon Nov  7 17:17:46 2016(r308422)
+++ head/sys/dev/mpt/mpt.c  Mon Nov  7 17:34:19 2016(r308423)
@@ -2695,7 +2695,11 @@ mpt_configure_ioc(struct mpt_softc *mpt,
 */
mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1);
 
+   /* XXX Lame Locking! */
+   MPT_UNLOCK(mpt);
error = mpt_dma_buf_alloc(mpt);
+   MPT_LOCK(mpt);
+
if (error != 0) {
mpt_prt(mpt, "mpt_dma_buf_alloc() failed!\n");
return (EIO);
@@ -2745,6 +2749,7 @@ mpt_configure_ioc(struct mpt_softc *mpt,
 * retrieved, we are responsible for re-downloading
 * the firmware after any hard-reset.
 */
+   MPT_UNLOCK(mpt);
mpt->fw_image_size = mpt->ioc_facts.FWImageSize;
error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
@@ -2752,6 +2757,7 @@ mpt_configure_ioc(struct mpt_softc *mpt,
>fw_dmat);
if (error != 0) {
mpt_prt(mpt, "cannot create firmware dma tag\n");
+   MPT_LOCK(mpt);
return (ENOMEM);
}
error = bus_dmamem_alloc(mpt->fw_dmat,
@@ -2760,6 +2766,7 @@ mpt_configure_ioc(struct mpt_softc *mpt,
if (error != 0) {
mpt_prt(mpt, "cannot allocate firmware memory\n");
bus_dma_tag_destroy(mpt->fw_dmat);
+   MPT_LOCK(mpt);
return (ENOMEM);
}
mi.mpt = mpt;
@@ -2768,6 +2775,7 @@ mpt_configure_ioc(struct mpt_softc *mpt,
mpt->fw_image, mpt->fw_image_size, mpt_map_rquest, , 0);
mpt->fw_phys = mi.phys;
 
+   MPT_LOCK(mpt);
error = mpt_upload_fw(mpt);
if (error != 0) {
mpt_prt(mpt, "firmware upload failed.\n");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308420 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src lib/libmagic

2016-11-07 Thread Xin LI
Author: delphij
Date: Mon Nov  7 15:54:47 2016
New Revision: 308420
URL: https://svnweb.freebsd.org/changeset/base/308420

Log:
  MFV r308392: file 5.29.
  
  MFC after:2 weeks

Added:
  head/contrib/file/magic/Magdir/algol68
 - copied unchanged from r308392, vendor/file/dist/magic/Magdir/algol68
  head/contrib/file/magic/Magdir/application
 - copied unchanged from r308392, vendor/file/dist/magic/Magdir/application
  head/contrib/file/magic/Magdir/apt
 - copied unchanged from r308392, vendor/file/dist/magic/Magdir/apt
  head/contrib/file/magic/Magdir/psl
 - copied unchanged from r308392, vendor/file/dist/magic/Magdir/psl
Modified:
  head/contrib/file/ChangeLog
  head/contrib/file/TODO
  head/contrib/file/config.guess
  head/contrib/file/config.sub
  head/contrib/file/configure
  head/contrib/file/configure.ac
  head/contrib/file/doc/file.man
  head/contrib/file/doc/magic.man
  head/contrib/file/ltmain.sh
  head/contrib/file/magic/Magdir/animation
  head/contrib/file/magic/Magdir/apple
  head/contrib/file/magic/Magdir/bioinformatics
  head/contrib/file/magic/Magdir/c-lang
  head/contrib/file/magic/Magdir/claris
  head/contrib/file/magic/Magdir/commands
  head/contrib/file/magic/Magdir/compress
  head/contrib/file/magic/Magdir/cups
  head/contrib/file/magic/Magdir/editors
  head/contrib/file/magic/Magdir/filesystems
  head/contrib/file/magic/Magdir/fonts
  head/contrib/file/magic/Magdir/gcc
  head/contrib/file/magic/Magdir/gnu
  head/contrib/file/magic/Magdir/images
  head/contrib/file/magic/Magdir/jpeg
  head/contrib/file/magic/Magdir/msdos
  head/contrib/file/magic/Magdir/pgp
  head/contrib/file/magic/Magdir/python
  head/contrib/file/magic/Magdir/ruby
  head/contrib/file/magic/Magdir/sgml
  head/contrib/file/magic/Magdir/sql
  head/contrib/file/magic/Makefile.am
  head/contrib/file/magic/Makefile.in
  head/contrib/file/python/magic.py
  head/contrib/file/src/apprentice.c
  head/contrib/file/src/ascmagic.c
  head/contrib/file/src/cdf.c
  head/contrib/file/src/cdf.h
  head/contrib/file/src/compress.c
  head/contrib/file/src/der.c
  head/contrib/file/src/file.c
  head/contrib/file/src/file.h
  head/contrib/file/src/funcs.c
  head/contrib/file/src/magic.c
  head/contrib/file/src/readcdf.c
  head/contrib/file/src/readelf.c
  head/contrib/file/src/softmagic.c
  head/lib/libmagic/config.h
Directory Properties:
  head/contrib/file/   (props changed)

Modified: head/contrib/file/ChangeLog
==
--- head/contrib/file/ChangeLog Mon Nov  7 14:07:11 2016(r308419)
+++ head/contrib/file/ChangeLog Mon Nov  7 15:54:47 2016(r308420)
@@ -1,3 +1,32 @@
+2016-10-25  10:40  Christos Zoulas 
+   
+   * release 5.28
+
+2016-10-24  11:20  Christos Zoulas 
+
+   * der getlength overflow (Jonas Wagner)
+   * multiple magic file load failure (Christoph Biedl)
+
+2016-10-17  11:26  Christos Zoulas 
+
+   * CDF parsing improvements (Guy Helmer)
+
+2016-07-20   7:26  Christos Zoulas 
+
+   * Add support for signed indirect offsets
+
+2016-07-18   7:41  Christos Zoulas 
+
+   * cat /dev/null | file - should print empty (Christoph Biedl)
+
+2016-07-05  15:20  Christos Zoulas 
+
+   * Bump string size from 64 to 96.
+
+2016-06-13  20:20  Christos Zoulas 
+
+   * PR/556: Fix separators on annotations.
+
 2016-06-13  19:40  Christos Zoulas 
 
* release 5.28

Modified: head/contrib/file/TODO
==
--- head/contrib/file/TODO  Mon Nov  7 14:07:11 2016(r308419)
+++ head/contrib/file/TODO  Mon Nov  7 15:54:47 2016(r308420)
@@ -6,7 +6,6 @@ file, not here. More speculative materia
 listed in the BUGS section of the man page had been fixed!)
 
 ---
-
 It would be nice to simplify file considerably. For example,
 reimplement the apprentice and non-pattern magic methods in Python,
 and compile the magic patterns to a giant regex (or something similar;
@@ -15,8 +14,23 @@ small amount of C is needed (because fas
 required for soft magic, not the more detailed information given by
 hard-wired routines). In this regard, note that hplip, which is
 BSD-licensed, has a magic reimplementation in Python.
-
+---
 Read the kerberos magic entry for more ideas.
-
+---
 Write a string merger to make magic entry sizes dynamic.
 Strings will be converted to offsets from the string table.
+---
+Programming language support, we can introduce the concept of a group
+of rules where n rules need to match before the rule is positive. This
+could require structural changes to the matching code :-(
+
+0  group   2   # require 2 matches
+# rule 1
+>0 
+...
+# rule 2
+>0 
+...
+
+christos
+

Modified: head/contrib/file/config.guess

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

2016-11-07 Thread John Baldwin
On Monday, November 07, 2016 07:02:23 AM Sean Bruno wrote:
> 
> On 11/05/16 17:16, John Baldwin wrote:
> > On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote:
> >> Author: sbruno
> >> Date: Sat Nov  5 16:30:42 2016
> >> New Revision: 308345
> >> URL: https://svnweb.freebsd.org/changeset/base/308345
> >>
> >> Log:
> >>   r295133 attempted to deactivate TSO in the 100Mbit link case with this
> >>   adapter to work around bugs in TSO handling at this speed.
> >>   
> >>   em_init_locked is called during first boot of the adapter and will
> >>   see that link_speed is unitialized, effectively turning off tso for
> >>   all cards at all speeds, which I believe was *not* the intent.
> >>   
> >>   Move the handling of TSO deactivation to the link handler where we can
> >>   more effectively make the decision about what to do.  In addition,
> >>   completely purge the TSO capabilities instead of disabling just CSUM_TSO.
> >>   
> >>   Thanks to jhb for explanation of the hw capabilites api.
> >>   
> >>   Thanks to royger and cognet for testing the 100Mbit failure case to
> >>   ensure that their adapters do indeed still work.
> >>   
> >>   MFC after:   1 week
> >>   Sponsored by:Limelight Networks
> >>
> >> Modified:
> >>   head/sys/dev/e1000/if_em.c
> >>
> >> Modified: head/sys/dev/e1000/if_em.c
> >> ==
> >> --- head/sys/dev/e1000/if_em.c Sat Nov  5 16:23:33 2016
> >> (r308344)
> >> +++ head/sys/dev/e1000/if_em.c Sat Nov  5 16:30:42 2016
> >> (r308345)
> >> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1);
> >>  #define MAX_INTS_PER_SEC  8000
> >>  #define DEFAULT_ITR   (10/(MAX_INTS_PER_SEC * 256))
> >>  
> >> -/* Allow common code without TSO */
> >> -#ifndef CSUM_TSO
> >> -#define CSUM_TSO  0
> >> -#endif
> >> -
> >>  #define TSO_WORKAROUND4
> >>  
> >>  static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver 
> >> parameters");
> >> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter)
> >>if_clearhwassist(ifp);
> >>if (if_getcapenable(ifp) & IFCAP_TXCSUM)
> >>if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0);
> >> -  /* 
> >> -  ** There have proven to be problems with TSO when not
> >> -  ** at full gigabit speed, so disable the assist automatically
> >> -  ** when at lower speeds.  -jfv
> >> -  */
> >> -  if (if_getcapenable(ifp) & IFCAP_TSO4) {
> >> -  if (adapter->link_speed == SPEED_1000)
> >> -  if_sethwassistbits(ifp, CSUM_TSO, 0);
> >> -  }
> >> +
> >> +  if (if_getcapenable(ifp) & IFCAP_TSO4)
> >> +  if_sethwassistbits(ifp, CSUM_TSO, 0);
> > 
> > Does this always disable TSO?  Should this part be removed entirely?
> > (That is, it seems like this would disable TSO even on Gigabit links).
> > 
> 
> I was confused by this question.  The old code *always* disabled TSO
> because link_speed was always 0 here on boot.  My intention is to ensure
> that CSUM_TSO is set if IFCAP_TSO4 is set.

Oh, I misread the code.   It is setting CSUM_TSO and clearing 0.  I think you
probably don't need this as the flag can only be set in capenable by an
ioctl handler that sets the flag to true (and the calling ioctl code should
update hwassist for you).

Oh, the driver does 'if_clearhwassist()' above this.  How... unfortunate.
I think that since you are now handling this in 'update_link_status' that
you can instead remove this whole block starting with 'if_clearhwassist()'
and ending with the 'if_sethwassist' for CSUM_TSO.  That is, you can now
leave if_hwasssist alone in em_init_locked() and not change it.

> >>/* Configure for OS presence */
> >>em_init_manageability(adapter);
> >> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad
> >>if (link_check && (adapter->link_active == 0)) {
> >>e1000_get_speed_and_duplex(hw, >link_speed,
> >>>link_duplex);
> >> +  /* 
> >> +  ** There have proven to be problems with TSO when not
> >> +  ** at full gigabit speed, so disable the assist automatically
> >> +  ** when at lower speeds.  -jfv
> >> +  */
> >> +  if (adapter->link_speed != SPEED_1000) {
> >> +  if_sethwassistbits(ifp, 0, CSUM_TSO);
> >> +  if_setcapenablebit(ifp, 0, IFCAP_TSO4);
> >> +  if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4);
> >> +
> >> +  }
> > 
> > Even though I suggested it, I wonder if it wouldn't be better to only
> > modify if_capenable and not if_capabilities, that way the admin can
> > decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving
> > an adapter from 100 to 1G).
> > 
> 
> I spent several hours trying to come up with logic that would allow me
> to allow the user to do this.  I am open to suggestions here, but it
> would require quite a bit more finesse than my "big hammer" approach.

I think you just need to remove 

svn commit: r308419 - head/tools/tools/nanobsd/embedded

2016-11-07 Thread Andrew Turner
Author: andrew
Date: Mon Nov  7 14:07:11 2016
New Revision: 308419
URL: https://svnweb.freebsd.org/changeset/base/308419

Log:
  Use the armv6 GENERIC in the qemu nanobsd image.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/tools/tools/nanobsd/embedded/qemu-armv7.cfg

Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg
==
--- head/tools/tools/nanobsd/embedded/qemu-armv7.cfgMon Nov  7 12:10:17 
2016(r308418)
+++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfgMon Nov  7 14:07:11 
2016(r308419)
@@ -29,7 +29,7 @@
 
 NANO_ARCH=armv6
 NANO_DRIVE=vtbd0
-NANO_KERNEL=VIRT
+NANO_KERNEL=GENERIC
 NANO_NAME=qemu-armv7
 NANO_LAYOUT=std-uefi-bios
 NANO_CPUTYPE=cortexa
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-11-07 Thread Sean Bruno


On 11/06/16 23:37, Sepherosa Ziehau wrote:
> On Sun, Nov 6, 2016 at 7:16 AM, John Baldwin  wrote:
>> On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote:
>>> Author: sbruno
>>> Date: Sat Nov  5 16:30:42 2016
>>> New Revision: 308345
>>> URL: https://svnweb.freebsd.org/changeset/base/308345
>>>
>>> Log:
>>>   r295133 attempted to deactivate TSO in the 100Mbit link case with this
>>>   adapter to work around bugs in TSO handling at this speed.
>>>
>>>   em_init_locked is called during first boot of the adapter and will
>>>   see that link_speed is unitialized, effectively turning off tso for
>>>   all cards at all speeds, which I believe was *not* the intent.
>>>
>>>   Move the handling of TSO deactivation to the link handler where we can
>>>   more effectively make the decision about what to do.  In addition,
>>>   completely purge the TSO capabilities instead of disabling just CSUM_TSO.
>>>
>>>   Thanks to jhb for explanation of the hw capabilites api.
>>>
>>>   Thanks to royger and cognet for testing the 100Mbit failure case to
>>>   ensure that their adapters do indeed still work.
>>>
>>>   MFC after:  1 week
>>>   Sponsored by:   Limelight Networks
>>>
>>> Modified:
>>>   head/sys/dev/e1000/if_em.c
>>>
>>> Modified: head/sys/dev/e1000/if_em.c
>>> ==
>>> --- head/sys/dev/e1000/if_em.cSat Nov  5 16:23:33 2016
>>> (r308344)
>>> +++ head/sys/dev/e1000/if_em.cSat Nov  5 16:30:42 2016
>>> (r308345)
>>> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1);
>>>  #define MAX_INTS_PER_SEC 8000
>>>  #define DEFAULT_ITR  (10/(MAX_INTS_PER_SEC * 256))
>>>
>>> -/* Allow common code without TSO */
>>> -#ifndef CSUM_TSO
>>> -#define CSUM_TSO 0
>>> -#endif
>>> -
>>>  #define TSO_WORKAROUND   4
>>>
>>>  static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver 
>>> parameters");
>>> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter)
>>>   if_clearhwassist(ifp);
>>>   if (if_getcapenable(ifp) & IFCAP_TXCSUM)
>>>   if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0);
>>> - /*
>>> - ** There have proven to be problems with TSO when not
>>> - ** at full gigabit speed, so disable the assist automatically
>>> - ** when at lower speeds.  -jfv
>>> - */
>>> - if (if_getcapenable(ifp) & IFCAP_TSO4) {
>>> - if (adapter->link_speed == SPEED_1000)
>>> - if_sethwassistbits(ifp, CSUM_TSO, 0);
>>> - }
>>> +
>>> + if (if_getcapenable(ifp) & IFCAP_TSO4)
>>> + if_sethwassistbits(ifp, CSUM_TSO, 0);
>>
>> Does this always disable TSO?  Should this part be removed entirely?
>> (That is, it seems like this would disable TSO even on Gigabit links).
>>
>>>   /* Configure for OS presence */
>>>   em_init_manageability(adapter);
>>> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad
>>>   if (link_check && (adapter->link_active == 0)) {
>>>   e1000_get_speed_and_duplex(hw, >link_speed,
>>>   >link_duplex);
>>> + /*
>>> + ** There have proven to be problems with TSO when not
>>> + ** at full gigabit speed, so disable the assist automatically
>>> + ** when at lower speeds.  -jfv
>>> + */
>>> + if (adapter->link_speed != SPEED_1000) {
>>> + if_sethwassistbits(ifp, 0, CSUM_TSO);
>>> + if_setcapenablebit(ifp, 0, IFCAP_TSO4);
>>> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4);
>>> +
>>> + }
>>
>> Even though I suggested it, I wonder if it wouldn't be better to only
>> modify if_capenable and not if_capabilities, that way the admin can
>> decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving
>> an adapter from 100 to 1G).
> 
> I believe simply clearing CSUM_TSO should work for the TCP stack;
> messing administrative like capenable and hwcaps does not sound
> correct to me.
> 

I don't disagree, but I also don't have an opinion.  What I didn't want,
was a continuation of the half disabled/half enabled TSO code path that
we had prior to this change.

> As for this patch, do you need to re-enable TSO once link speed
> becomes 1000Mbps?

Probably?  There wasn't a clear way to flip this back on that I could
find that would catch the case of "link speed was 100 and is now 1000".


BTW, since the link status check/update is async w/
> the TX path, does this really work, if there are TSO packets pending
> on the TX rings (let alone inflight TSO packets from the TCP stack)
> when the link speed changed to 100Mbps?

TSO packets that are "pending" will continue out their path, AFAIK.  I
don't believe that a link speed change from 1000 to 100 is a very common
occurrence, but I'm willing to change the code to something more
"graceful" if you have an idea of how to do it.

sean




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

2016-11-07 Thread Sean Bruno


On 11/05/16 17:16, John Baldwin wrote:
> On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote:
>> Author: sbruno
>> Date: Sat Nov  5 16:30:42 2016
>> New Revision: 308345
>> URL: https://svnweb.freebsd.org/changeset/base/308345
>>
>> Log:
>>   r295133 attempted to deactivate TSO in the 100Mbit link case with this
>>   adapter to work around bugs in TSO handling at this speed.
>>   
>>   em_init_locked is called during first boot of the adapter and will
>>   see that link_speed is unitialized, effectively turning off tso for
>>   all cards at all speeds, which I believe was *not* the intent.
>>   
>>   Move the handling of TSO deactivation to the link handler where we can
>>   more effectively make the decision about what to do.  In addition,
>>   completely purge the TSO capabilities instead of disabling just CSUM_TSO.
>>   
>>   Thanks to jhb for explanation of the hw capabilites api.
>>   
>>   Thanks to royger and cognet for testing the 100Mbit failure case to
>>   ensure that their adapters do indeed still work.
>>   
>>   MFC after: 1 week
>>   Sponsored by:  Limelight Networks
>>
>> Modified:
>>   head/sys/dev/e1000/if_em.c
>>
>> Modified: head/sys/dev/e1000/if_em.c
>> ==
>> --- head/sys/dev/e1000/if_em.c   Sat Nov  5 16:23:33 2016
>> (r308344)
>> +++ head/sys/dev/e1000/if_em.c   Sat Nov  5 16:30:42 2016
>> (r308345)
>> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1);
>>  #define MAX_INTS_PER_SEC8000
>>  #define DEFAULT_ITR (10/(MAX_INTS_PER_SEC * 256))
>>  
>> -/* Allow common code without TSO */
>> -#ifndef CSUM_TSO
>> -#define CSUM_TSO0
>> -#endif
>> -
>>  #define TSO_WORKAROUND  4
>>  
>>  static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver 
>> parameters");
>> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter)
>>  if_clearhwassist(ifp);
>>  if (if_getcapenable(ifp) & IFCAP_TXCSUM)
>>  if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0);
>> -/* 
>> -** There have proven to be problems with TSO when not
>> -** at full gigabit speed, so disable the assist automatically
>> -** when at lower speeds.  -jfv
>> -*/
>> -if (if_getcapenable(ifp) & IFCAP_TSO4) {
>> -if (adapter->link_speed == SPEED_1000)
>> -if_sethwassistbits(ifp, CSUM_TSO, 0);
>> -}
>> +
>> +if (if_getcapenable(ifp) & IFCAP_TSO4)
>> +if_sethwassistbits(ifp, CSUM_TSO, 0);
> 
> Does this always disable TSO?  Should this part be removed entirely?
> (That is, it seems like this would disable TSO even on Gigabit links).
> 

I was confused by this question.  The old code *always* disabled TSO
because link_speed was always 0 here on boot.  My intention is to ensure
that CSUM_TSO is set if IFCAP_TSO4 is set.


>>  /* Configure for OS presence */
>>  em_init_manageability(adapter);
>> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad
>>  if (link_check && (adapter->link_active == 0)) {
>>  e1000_get_speed_and_duplex(hw, >link_speed,
>>  >link_duplex);
>> +/* 
>> +** There have proven to be problems with TSO when not
>> +** at full gigabit speed, so disable the assist automatically
>> +** when at lower speeds.  -jfv
>> +*/
>> +if (adapter->link_speed != SPEED_1000) {
>> +if_sethwassistbits(ifp, 0, CSUM_TSO);
>> +if_setcapenablebit(ifp, 0, IFCAP_TSO4);
>> +if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4);
>> +
>> +}
> 
> Even though I suggested it, I wonder if it wouldn't be better to only
> modify if_capenable and not if_capabilities, that way the admin can
> decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving
> an adapter from 100 to 1G).
> 

I spent several hours trying to come up with logic that would allow me
to allow the user to do this.  I am open to suggestions here, but it
would require quite a bit more finesse than my "big hammer" approach.

sean



signature.asc
Description: OpenPGP digital signature


svn commit: r308418 - in stable/11: share/man/man4 sys/amd64/amd64 sys/amd64/include sys/ddb sys/i386/i386 sys/i386/include sys/x86/include

2016-11-07 Thread Konstantin Belousov
Author: kib
Date: Mon Nov  7 12:10:17 2016
New Revision: 308418
URL: https://svnweb.freebsd.org/changeset/base/308418

Log:
  Merge bde improvements for ddb on x86, mostly for single-stepping and
  vm86 mode.
  
  MFC r304085 (by bde):
  Fix the variables $esp, $ds, $es, $fs, $gs and $ss in vm86 mode.  Fix
  PC_REGS() so that printing of instructions works in some useful cases.
  
  MFC r304962 (by bde):
  Expand error messages: print symbol names, parentheses and shift tokens,
  and negative shift counts.  Fix error messages.
  
  MFC r305612 (by bde):
  Fix single-stepping of instructions emulated by vm86.
  
  MFC r305661 (by bde):
  Give the full syntax of the 'count' arg for all commmands that support
  it. Give the full syntax of the 'addr' arg for these commands and some
  others.  Rename it from 'address' for the generic command. Fix
  description of how 'count' is supposed to work for the 'break'
  command.
  
  Don't (mis)describe the syntax of the comma for the 'step' command.
  
  Expand the description for the generic command.
  
  Give the full syntax for the 'examine' command.  It was also missing
  the possible values for the modifier.
  
  MFC r305663 (by bde):
  Fix stopping when the specified breakpoint count is reached.
  
  MFC r305665 (by bde):
  Pass the trap type and code down from db_trap() to db_stop_at_pc() so
  that the latter can easily determine what the trap type actually is
  after callers are fixed to encode the type unambigously.
  
  MFC r305807 (by bde):
  Use the MI macro TRAPF_USERMODE() instead of open-coded checks for
  SEL_UPL and sometimes PSL_VM.  Fix logic errors in treating vm86
  bioscall mode as kernel mode.  The main place checked all the
  necessary flags, but put the necessary parentheses for the PSL_VM and
  PCB_VM86CALL checks in the wrong place.
  
  MFC r305811 (by bz):
  Try to fix LINT builds after r305807.
  
  MFC r305840 (by bde):
  Abort single stepping in ddb if the trap is not for single-stepping.
  
  MFC r305862 (by bde):
  Ifdef the new dr6 variable for KDB.
  
  MFC r305864 (by bde):
  Statically initialize the run mode to the one that will become current
  on first entry. Don't reset to the run mode to STEP_NONE when
  stopping, and remove STEP_NONE.
  
  MFC r305865 (by bde):
  Fix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the
  i386-only section, and fix a comment about the amd64 kernel trapframe
  not having stackregs.
  
  MFC r305897 (by bde):
  Silently ignore unexpected single-step traps.
  
  MFC r306311 (by bde):
  Determine the operand/address size of %cs in a new function
  db_segsize().  Use db_segsize() to set the default operand/address
  size for disassembling.
  
  Fix db_print_loc_and_inst() to ask for the normal format and not the
  alternate in normal operation. Use db_segsize() to avoid trying to
  print a garbage stack trace if %cs is 16 bits.

Modified:
  stable/11/share/man/man4/ddb.4
  stable/11/sys/amd64/amd64/trap.c
  stable/11/sys/amd64/include/db_machdep.h
  stable/11/sys/ddb/db_examine.c
  stable/11/sys/ddb/db_expr.c
  stable/11/sys/ddb/db_main.c
  stable/11/sys/ddb/db_run.c
  stable/11/sys/ddb/ddb.h
  stable/11/sys/i386/i386/db_disasm.c
  stable/11/sys/i386/i386/db_interface.c
  stable/11/sys/i386/i386/db_trace.c
  stable/11/sys/i386/i386/trap.c
  stable/11/sys/i386/i386/vm86.c
  stable/11/sys/i386/include/db_machdep.h
  stable/11/sys/x86/include/frame.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/ddb.4
==
--- stable/11/share/man/man4/ddb.4  Mon Nov  7 11:56:18 2016
(r308417)
+++ stable/11/share/man/man4/ddb.4  Mon Nov  7 12:10:17 2016
(r308418)
@@ -146,25 +146,32 @@ to be the same as
 .Pp
 The general command syntax is:
 .Ar command Ns Op Li / Ns Ar modifier
-.Ar address Ns Op Li , Ns Ar count
+.Oo Ar addr Oc Ns Op Li , Ns Ar count
 .Pp
 A blank line repeats the previous command from the address
 .Va next
 with
 count 1 and no modifiers.
 Specifying
-.Ar address
+.Ar addr
 sets
 .Va dot
 to the address.
 Omitting
-.Ar address
+.Ar addr
 uses
 .Va dot .
 A missing
 .Ar count
 is taken
 to be 1 for printing commands or infinity for stack traces.
+A
+.Ar count
+of -1 is equivalent to a missing
+.Ar count .
+Options that are supplied but not supported by the given
+.Ar command
+are usually ignored.
 .Pp
 The
 .Nm
@@ -204,8 +211,14 @@ browse through the history buffer, and m
 current line.
 .Sh COMMANDS
 .Bl -tag -width indent -compact
-.It Ic examine
-.It Ic x
+.It Xo
+.Ic examine Ns Op Li / Ns Cm AISabcdghilmorsuxz ...
+.Oo Ar addr Oc Ns Op Li , Ns Ar count
+.Xc
+.It Xo
+.Ic x   Ns Op Li / Ns Cm AISabcdghilmorsuxz ...
+.Oo Ar addr Oc Ns Op Li , Ns Ar count
+.Xc
 Display the addressed locations according to the formats in the modifier.
 Multiple modifier formats display multiple locations.
 If no format is specified, the last format specified for 

svn commit: r308417 - head/sys/arm/ti

2016-11-07 Thread Andrew Turner
Author: andrew
Date: Mon Nov  7 11:56:18 2016
New Revision: 308417
URL: https://svnweb.freebsd.org/changeset/base/308417

Log:
  Fix the order of includes so machine/asm.h is first.
  
  MFC after:1 week
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/ti/ti_smc.S

Modified: head/sys/arm/ti/ti_smc.S
==
--- head/sys/arm/ti/ti_smc.SMon Nov  7 11:39:45 2016(r308416)
+++ head/sys/arm/ti/ti_smc.SMon Nov  7 11:56:18 2016(r308417)
@@ -22,10 +22,11 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+
.cpu cortex-a8
.arch_extension sec
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308416 - head/sys/dev/mlx5/mlx5_en

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 11:39:45 2016
New Revision: 308416
URL: https://svnweb.freebsd.org/changeset/base/308416

Log:
  Add timer to watch the RQ when we are out of mbufs.
  
  The firmware/hardware does not generate additional completion
  events unless we post new buffers. Use a timer to try to post
  more buffers in case we are temporarily out of mbufs. Else
  the receive schedule completely stops.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==
--- head/sys/dev/mlx5/mlx5_en/en.h  Mon Nov  7 11:35:14 2016
(r308415)
+++ head/sys/dev/mlx5/mlx5_en/en.h  Mon Nov  7 11:39:45 2016
(r308416)
@@ -478,6 +478,7 @@ struct mlx5e_rq {
struct mlx5_wq_ctrl wq_ctrl;
u32 rqn;
struct mlx5e_channel *channel;
+   struct callout watchdog;
 } __aligned(MLX5E_CACHELINE_SIZE);
 
 struct mlx5e_sq_mbuf {

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cMon Nov  7 11:35:14 2016
(r308415)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cMon Nov  7 11:39:45 2016
(r308416)
@@ -855,7 +855,13 @@ err_destroy_rq:
 static void
 mlx5e_close_rq(struct mlx5e_rq *rq)
 {
+   mtx_lock(>mtx);
rq->enabled = 0;
+   callout_stop(>watchdog);
+   mtx_unlock(>mtx);
+
+   callout_drain(>watchdog);
+
mlx5e_modify_rq(rq, MLX5_RQC_STATE_RDY, MLX5_RQC_STATE_ERR);
 }
 
@@ -1439,6 +1445,8 @@ mlx5e_chan_mtx_init(struct mlx5e_channel
 
mtx_init(>rq.mtx, "mlx5rx", MTX_NETWORK_LOCK, MTX_DEF);
 
+   callout_init_mtx(>rq.watchdog, >rq.mtx, 0);
+
for (tc = 0; tc < c->num_tc; tc++) {
struct mlx5e_sq *sq = c->sq + tc;
 

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c  Mon Nov  7 11:35:14 2016
(r308415)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c  Mon Nov  7 11:39:45 2016
(r308416)
@@ -82,9 +82,10 @@ mlx5e_post_rx_wqes(struct mlx5e_rq *rq)
while (!mlx5_wq_ll_is_full(>wq)) {
struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(>wq, 
rq->wq.head);
 
-   if (unlikely(mlx5e_alloc_rx_wqe(rq, wqe, rq->wq.head)))
+   if (unlikely(mlx5e_alloc_rx_wqe(rq, wqe, rq->wq.head))) {
+   callout_reset_curcpu(>watchdog, 1, (void 
*)_post_rx_wqes, rq);
break;
-
+   }
mlx5_wq_ll_push(>wq, be16_to_cpu(wqe->next.next_wqe_index));
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308415 - head/sys/arm/include

2016-11-07 Thread Stanislav Galabov
Author: sgalabov
Date: Mon Nov  7 11:35:14 2016
New Revision: 308415
URL: https://svnweb.freebsd.org/changeset/base/308415

Log:
  Generate an error if machine/armreg.h is included without sys/cdefs.h
  
  machine/armreg.h requires access to the __ARM_ARCH macro, which is not
  always properly defined (especially by gcc 4.2.1). We should include
  sys/cdefs.h in order to get the definitions in machine/acle-compat.h,
  which would properly define the __ARM_ARCH macro in these cases.
  
  So, in cases where machine/armreg.h is included without _SYS_CDEFS_H_
  being defined - generate an #error.
  
  Reviewed by:  andrew
  Sponsored by: Smartcom - Bulgaria AD
  Differential Revision:https://reviews.freebsd.org/D8460

Modified:
  head/sys/arm/include/armreg.h

Modified: head/sys/arm/include/armreg.h
==
--- head/sys/arm/include/armreg.h   Mon Nov  7 11:28:50 2016
(r308414)
+++ head/sys/arm/include/armreg.h   Mon Nov  7 11:35:14 2016
(r308415)
@@ -41,6 +41,10 @@
 #ifndef MACHINE_ARMREG_H
 #define MACHINE_ARMREG_H
 
+#ifndef _SYS_CDEFS_H_
+#error Please include sys/cdefs.h before including machine/armreg.h
+#endif
+
 #define INSN_SIZE  4
 #define INSN_COND_MASK 0xf000  /* Condition mask */
 #define PSR_MODE0x001f  /* mode mask */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308414 - in head/sys/dev/mlx5: . mlx5_core

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 11:28:50 2016
New Revision: 308414
URL: https://svnweb.freebsd.org/changeset/base/308414

Log:
  Add more firmware related structures and update existing ones in the
  MLX5 core module. Update the set and query diagnostics counter API.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx5/device.h
  head/sys/dev/mlx5/driver.h
  head/sys/dev/mlx5/mlx5_core/mlx5_port.c
  head/sys/dev/mlx5/mlx5_ifc.h
  head/sys/dev/mlx5/qp.h

Modified: head/sys/dev/mlx5/device.h
==
--- head/sys/dev/mlx5/device.h  Mon Nov  7 11:26:25 2016(r308413)
+++ head/sys/dev/mlx5/device.h  Mon Nov  7 11:28:50 2016(r308414)
@@ -1271,9 +1271,11 @@ enum {
MLX5_RFC_2819_COUNTERS_GROUP  = 0x2,
MLX5_RFC_3635_COUNTERS_GROUP  = 0x3,
MLX5_ETHERNET_EXTENDED_COUNTERS_GROUP = 0x5,
+   MLX5_ETHERNET_DISCARD_COUNTERS_GROUP  = 0x6,
MLX5_PER_PRIORITY_COUNTERS_GROUP  = 0x10,
MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11,
MLX5_PHYSICAL_LAYER_COUNTERS_GROUP= 0x12,
+   MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20,
 };
 
 enum {

Modified: head/sys/dev/mlx5/driver.h
==
--- head/sys/dev/mlx5/driver.h  Mon Nov  7 11:26:25 2016(r308413)
+++ head/sys/dev/mlx5/driver.h  Mon Nov  7 11:28:50 2016(r308414)
@@ -120,6 +120,7 @@ enum {
MLX5_REG_QETCR   = 0x4005,
MLX5_REG_QPDP= 0x4007,
MLX5_REG_QTCT= 0x400A,
+   MLX5_REG_QHLL= 0x4016,
MLX5_REG_DCBX_PARAM  = 0x4020,
MLX5_REG_DCBX_APP= 0x4021,
MLX5_REG_PCAP= 0x5001,
@@ -954,9 +955,11 @@ int mlx5_modify_port_cong_params(struct 
 void *in, int in_size);
 int mlx5_query_port_cong_statistics(struct mlx5_core_dev *mdev, int clear,
void *out, int out_size);
-int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size);
-int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples,
-  u16 sample_index, void *out, int out_size);
+int mlx5_set_diagnostic_params(struct mlx5_core_dev *mdev, void *in,
+  int in_size);
+int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev,
+  u8 num_of_samples, u16 sample_index,
+  void *out, int out_size);
 static inline u32 mlx5_mkey_to_idx(u32 mkey)
 {
return mkey >> 8;

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Nov  7 11:26:25 2016
(r308413)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Nov  7 11:28:50 2016
(r308414)
@@ -831,28 +831,32 @@ int mlx5_query_port_cong_statistics(stru
  out, out_size);
 }
 
-int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size)
+int mlx5_set_diagnostic_params(struct mlx5_core_dev *mdev, void *in,
+  int in_size)
 {
-   u32 out[MLX5_ST_SZ_DW(set_diagnostics_out)];
+   u32 out[MLX5_ST_SZ_DW(set_diagnostic_params_out)];
 
memset(out, 0, sizeof(out));
 
-   MLX5_SET(set_diagnostics_in, in, opcode, MLX5_CMD_OP_SET_DIAGNOSTICS);
+   MLX5_SET(set_diagnostic_params_in, in, opcode,
+MLX5_CMD_OP_SET_DIAGNOSTICS);
 
return mlx5_cmd_exec_check_status(mdev, in, in_size, out, sizeof(out));
 }
 
-int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples,
-  u16 sample_index, void *out, int out_size)
+int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev,
+  u8 num_of_samples, u16 sample_index,
+  void *out, int out_size)
 {
-   u32 in[MLX5_ST_SZ_DW(query_diagnostics_in)];
+   u32 in[MLX5_ST_SZ_DW(query_diagnostic_counters_in)];
 
memset(in, 0, sizeof(in));
 
-   MLX5_SET(query_diagnostics_in, in, opcode,
+   MLX5_SET(query_diagnostic_counters_in, in, opcode,
 MLX5_CMD_OP_QUERY_DIAGNOSTICS);
-   MLX5_SET(query_diagnostics_in, in, num_of_samples, num_of_samples);
-   MLX5_SET(query_diagnostics_in, in, sample_index, sample_index);
+   MLX5_SET(query_diagnostic_counters_in, in, num_of_samples,
+num_of_samples);
+   MLX5_SET(query_diagnostic_counters_in, in, sample_index, sample_index);
 
return mlx5_cmd_exec_check_status(mdev, in, sizeof(in), out, out_size);
 }

Modified: head/sys/dev/mlx5/mlx5_ifc.h
==
--- head/sys/dev/mlx5/mlx5_ifc.hMon Nov  7 11:26:25 

svn commit: r308413 - head/sys/dev/mlx5/mlx5_core

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 11:26:25 2016
New Revision: 308413
URL: https://svnweb.freebsd.org/changeset/base/308413

Log:
  Query flow table capabilities according to the correct capability bit
  for infiniband.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_fw.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c   Mon Nov  7 11:22:50 2016
(r308412)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c   Mon Nov  7 11:26:25 2016
(r308413)
@@ -167,7 +167,11 @@ int mlx5_query_hca_caps(struct mlx5_core
return err;
}
 
-   if (MLX5_CAP_GEN(dev, nic_flow_table)) {
+   if ((MLX5_CAP_GEN(dev, port_type) ==
+   MLX5_CMD_HCA_CAP_PORT_TYPE_ETHERNET &&
+   MLX5_CAP_GEN(dev, nic_flow_table)) ||
+   (MLX5_CAP_GEN(dev, port_type) == MLX5_CMD_HCA_CAP_PORT_TYPE_IB &&
+   MLX5_CAP_GEN(dev, ipoib_enhanced_offloads))) {
err = mlx5_core_get_caps(dev, MLX5_CAP_FLOW_TABLE,
 HCA_CAP_OPMOD_GET_CUR);
if (err)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308412 - head/sys/dev/mlx5

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 11:22:50 2016
New Revision: 308412
URL: https://svnweb.freebsd.org/changeset/base/308412

Log:
  Correct checksum fields in the "mlx5_mini_cqe8" structure. The fields
  in question are currently not used.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx5/device.h

Modified: head/sys/dev/mlx5/device.h
==
--- head/sys/dev/mlx5/device.h  Mon Nov  7 11:20:13 2016(r308411)
+++ head/sys/dev/mlx5/device.h  Mon Nov  7 11:22:50 2016(r308412)
@@ -1348,15 +1348,16 @@ struct mlx5_ifc_mcia_reg_bits {
 
 struct mlx5_mini_cqe8 {
union {
-   u32 rx_hash_result;
-   u32 checksum;
+   __be32 rx_hash_result;
+   __be16 checksum;
+   __be16 rsvd;
struct {
-   u16 wqe_counter;
+   __be16 wqe_counter;
u8  s_wqe_opcode;
u8  reserved;
} s_wqe_info;
};
-   u32 byte_cnt;
+   __be32 byte_cnt;
 };
 
 enum {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308411 - head/sys/dev/mlx5/mlx5_core

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 11:20:13 2016
New Revision: 308411
URL: https://svnweb.freebsd.org/changeset/base/308411

Log:
  Ensure the firmware is notified of any host memory allocation
  failures. Else firmware commands may time out waiting for host
  memory.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cMon Nov  7 11:16:23 
2016(r308410)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cMon Nov  7 11:20:13 
2016(r308411)
@@ -246,13 +246,14 @@ static int give_pages(struct mlx5_core_d
int inlen;
u64 addr;
int err;
-   int i;
+   int i = 0;
 
inlen = sizeof(*in) + npages * sizeof(in->pas[0]);
in = mlx5_vzalloc(inlen);
if (!in) {
mlx5_core_warn(dev, "vzalloc failed %d\n", inlen);
-   return -ENOMEM;
+   err = -ENOMEM;
+   goto out_alloc;
}
memset(, 0, sizeof(out));
 
@@ -263,7 +264,7 @@ retry:
if (err == -ENOMEM)
err = alloc_system_page(dev, func_id);
if (err)
-   goto out_4k;
+   goto out_alloc;
 
goto retry;
}
@@ -301,12 +302,11 @@ out_alloc:
memset(, 0, sizeof(out));
nin->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_MANAGE_PAGES);
nin->hdr.opmod = cpu_to_be16(MLX5_PAGES_CANT_GIVE);
+   nin->func_id = cpu_to_be16(func_id);
if (mlx5_cmd_exec(dev, nin, sizeof(*nin), , sizeof(out)))
mlx5_core_warn(dev, "page notify failed\n");
kfree(nin);
}
-
-out_4k:
for (i--; i >= 0; i--)
free_4k(dev, be64_to_cpu(in->pas[i]));
 out_free:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308410 - stable/11/share/man/man4

2016-11-07 Thread Konstantin Belousov
Author: kib
Date: Mon Nov  7 11:16:23 2016
New Revision: 308410
URL: https://svnweb.freebsd.org/changeset/base/308410

Log:
  MFC r302797 (by markj):
  Document DDB's "alltrace" and "show all trace" commands.

Modified:
  stable/11/share/man/man4/ddb.4
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/ddb.4
==
--- stable/11/share/man/man4/ddb.4  Mon Nov  7 11:15:40 2016
(r308409)
+++ stable/11/share/man/man4/ddb.4  Mon Nov  7 11:16:23 2016
(r308410)
@@ -60,7 +60,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 6, 2016
+.Dd July 13, 2016
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -535,6 +535,11 @@ modifier will alter the display to show 
 addresses for the process and not show other information.
 .\"
 .Pp
+.It Ic show Cm all trace
+.It Ic alltrace
+.Xc
+Show a stack trace for every thread in the system.
+.Pp
 .It Ic show Cm all ttys
 Show all TTY's within the system.
 Output is similar to
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308409 - head/sys/dev/mlx5/mlx5_core

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 11:15:40 2016
New Revision: 308409
URL: https://svnweb.freebsd.org/changeset/base/308409

Log:
  When a firmware command times out do not free the command structure to
  avoid use after free.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Mon Nov  7 11:01:09 2016
(r308408)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Mon Nov  7 11:15:40 2016
(r308409)
@@ -1245,8 +1245,11 @@ static int cmd_exec_helper(struct mlx5_c
 
err = mlx5_cmd_invoke(dev, inb, outb, out, out_size, callback, context,
  pages_queue, );
-   if (err)
+   if (err) {
+   if (err == -ETIMEDOUT)
+   return err;
goto out_out;
+   }
 
mlx5_core_dbg(dev, "err %d, status %d\n", err, status);
if (status) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-11-07 Thread Andrew Turner
Author: andrew
Date: Mon Nov  7 11:01:09 2016
New Revision: 308408
URL: https://svnweb.freebsd.org/changeset/base/308408

Log:
  Include machine/armreg.h after machine/asm.h to ensure __ARM_ARCH is
  defined.
  
  MFC after:1 week
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/arm/cpufunc_asm_sheeva.S
  head/sys/arm/arm/cpufunc_asm_xscale.S
  head/sys/arm/arm/cpufunc_asm_xscale_c3.S
  head/sys/arm/arm/fiq_subr.S
  head/sys/arm/arm/setstack.s

Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S
==
--- head/sys/arm/arm/cpufunc_asm_sheeva.S   Mon Nov  7 10:55:56 2016
(r308407)
+++ head/sys/arm/arm/cpufunc_asm_sheeva.S   Mon Nov  7 11:01:09 2016
(r308408)
@@ -29,10 +29,10 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 
 .Lsheeva_cache_line_size:

Modified: head/sys/arm/arm/cpufunc_asm_xscale.S
==
--- head/sys/arm/arm/cpufunc_asm_xscale.S   Mon Nov  7 10:55:56 2016
(r308407)
+++ head/sys/arm/arm/cpufunc_asm_xscale.S   Mon Nov  7 11:01:09 2016
(r308408)
@@ -71,10 +71,11 @@
  *
  * XScale assembly functions for CPU / MMU / TLB specific operations
  */
-#include 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+
 /*
  * Size of the XScale core D-cache.
  */

Modified: head/sys/arm/arm/cpufunc_asm_xscale_c3.S
==
--- head/sys/arm/arm/cpufunc_asm_xscale_c3.SMon Nov  7 10:55:56 2016
(r308407)
+++ head/sys/arm/arm/cpufunc_asm_xscale_c3.SMon Nov  7 11:01:09 2016
(r308408)
@@ -73,10 +73,11 @@
  * XScale core 3 assembly functions for CPU / MMU / TLB specific operations
  */
 
-#include 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+
 /*
  * Size of the XScale core D-cache.
  */

Modified: head/sys/arm/arm/fiq_subr.S
==
--- head/sys/arm/arm/fiq_subr.S Mon Nov  7 10:55:56 2016(r308407)
+++ head/sys/arm/arm/fiq_subr.S Mon Nov  7 11:01:09 2016(r308408)
@@ -37,10 +37,11 @@
  */
 
 
-#include 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+
 /*
  * MODE_CHANGE_NOP should be inserted between a mode change and a
  * banked register (R8--R15) access.

Modified: head/sys/arm/arm/setstack.s
==
--- head/sys/arm/arm/setstack.s Mon Nov  7 10:55:56 2016(r308407)
+++ head/sys/arm/arm/setstack.s Mon Nov  7 11:01:09 2016(r308408)
@@ -48,10 +48,11 @@
  *
  */
 
-#include 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+
 /* To set the stack pointer for a particular mode we must switch
  * to that mode update the banked r13 and then switch back.
  * This routine provides an easy way of doing this for any mode
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308407 - head/sys/kern

2016-11-07 Thread Konstantin Belousov
Author: kib
Date: Mon Nov  7 10:55:56 2016
New Revision: 308407
URL: https://svnweb.freebsd.org/changeset/base/308407

Log:
  vn_fullpath1() checked VV_ROOT and then unreferenced
  vp->v_mount->mnt_vnodecovered unlocked.  This allowed unmount to race.
  Lock vnode after we noticed the VV_ROOT flag.  See comments for
  explanation why unlocked check for the flag is considered safe.
  
  Reported and tested by:   avg
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Mon Nov  7 10:54:56 2016(r308406)
+++ head/sys/kern/vfs_cache.c   Mon Nov  7 10:55:56 2016(r308407)
@@ -2245,17 +2245,35 @@ vn_fullpath1(struct thread *td, struct v
slash_prefixed = 1;
}
while (vp != rdir && vp != rootvnode) {
-   if (vp->v_vflag & VV_ROOT) {
-   if (vp->v_iflag & VI_DOOMED) {  /* forced unmount */
-   vrele(vp);
+   /*
+* The vp vnode must be already fully constructed,
+* since it is either found in namecache or obtained
+* from VOP_VPTOCNP().  We may test for VV_ROOT safely
+* without obtaining the vnode lock.
+*/
+   if ((vp->v_vflag & VV_ROOT) != 0) {
+   vn_lock(vp, LK_RETRY | LK_SHARED);
+
+   /*
+* With the vnode locked, check for races with
+* unmount, forced or not.  Note that we
+* already verified that vp is not equal to
+* the root vnode, which means that
+* mnt_vnodecovered can be NULL only for the
+* case of unmount.
+*/
+   if ((vp->v_iflag & VI_DOOMED) != 0 ||
+   (vp1 = vp->v_mount->mnt_vnodecovered) == NULL ||
+   vp1->v_mountedhere != vp->v_mount) {
+   vput(vp);
error = ENOENT;
SDT_PROBE3(vfs, namecache, fullpath, return,
error, vp, NULL);
break;
}
-   vp1 = vp->v_mount->mnt_vnodecovered;
+
vref(vp1);
-   vrele(vp);
+   vput(vp);
vp = vp1;
continue;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-11-07 Thread Stanislav Galabov
Author: sgalabov
Date: Mon Nov  7 10:54:56 2016
New Revision: 308406
URL: https://svnweb.freebsd.org/changeset/base/308406

Log:
  Only include sys/boot.h if LINUX_BOOT_ABI is defined
  
  Only include sys/boot.h if LINUX_BOOT_ABI is defined in
  sys/arm/arm/machdep.c
  
  Not doing this prevents kernels that do not define LINUX_BOOT_ABI from
  being build with gcc (at least 4.2.1).
  
  Reviewed by:  mmel
  Sponsored by: Smartcom - Bulgaria AD
  Differential Revision:https://reviews.freebsd.org/D8459

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

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Mon Nov  7 10:26:44 2016(r308405)
+++ head/sys/arm/arm/machdep.c  Mon Nov  7 10:54:56 2016(r308406)
@@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#if defined(LINUX_BOOT_ABI)
 #include 
+#endif
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308405 - head/sys/arm/conf

2016-11-07 Thread Andrew Turner
Author: andrew
Date: Mon Nov  7 10:26:44 2016
New Revision: 308405
URL: https://svnweb.freebsd.org/changeset/base/308405

Log:
  Start to deorbit the kernel configs in GENERIC by marking them with
  NO_UNIVERSE. This stops them from being built with the universe,
  tinderbox, and related targets.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/conf/ALLWINNER
  head/sys/arm/conf/RPI2

Modified: head/sys/arm/conf/ALLWINNER
==
--- head/sys/arm/conf/ALLWINNER Mon Nov  7 09:27:05 2016(r308404)
+++ head/sys/arm/conf/ALLWINNER Mon Nov  7 10:26:44 2016(r308405)
@@ -18,6 +18,8 @@
 # in NOTES.
 #
 # $FreeBSD$
+#
+#NO_UNIVERSE
 
 ident  ALLWINNER
 

Modified: head/sys/arm/conf/RPI2
==
--- head/sys/arm/conf/RPI2  Mon Nov  7 09:27:05 2016(r308404)
+++ head/sys/arm/conf/RPI2  Mon Nov  7 10:26:44 2016(r308405)
@@ -17,6 +17,8 @@
 # in NOTES.
 #
 # $FreeBSD$
+#
+#NO_UNIVERSE
 
 ident  RPI2
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308404 - in stable/8/sys: dev/puc dev/usb dev/usb/controller kern mips/atheros mips/cavium/usb mips/rmi

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 09:27:05 2016
New Revision: 308404
URL: https://svnweb.freebsd.org/changeset/base/308404

Log:
  MFC r307518:
  Fix device delete child function.
  
  When detaching device trees parent devices must be detached prior to
  detaching its children. This is because parent devices can have
  pointers to the child devices in their softcs which are not
  invalidated by device_delete_child(). This can cause use after free
  issues and panic().
  
  Device drivers implementing trees, must ensure its detach function
  detaches or deletes all its children before returning.
  
  While at it remove now redundant device_detach() calls before
  device_delete_child() and device_delete_children(), mostly in
  the USB controller drivers.
  
  Tested by:Jan Henrik Sylvester 
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D8070

Modified:
  stable/8/sys/dev/puc/puc.c
  stable/8/sys/dev/usb/controller/at91dci_atmelarm.c
  stable/8/sys/dev/usb/controller/atmegadci_atmelarm.c
  stable/8/sys/dev/usb/controller/ehci_ixp4xx.c
  stable/8/sys/dev/usb/controller/ehci_pci.c
  stable/8/sys/dev/usb/controller/musb_otg_atmelarm.c
  stable/8/sys/dev/usb/controller/ohci_pci.c
  stable/8/sys/dev/usb/controller/uhci_pci.c
  stable/8/sys/dev/usb/controller/uss820dci_atmelarm.c
  stable/8/sys/dev/usb/controller/xhci_pci.c
  stable/8/sys/dev/usb/usb_device.c
  stable/8/sys/kern/subr_bus.c
  stable/8/sys/mips/atheros/ar71xx_ehci.c
  stable/8/sys/mips/atheros/ar71xx_ohci.c
  stable/8/sys/mips/cavium/usb/octusb_octeon.c
  stable/8/sys/mips/rmi/xls_ehci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/arm/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/puc/   (props changed)
  stable/8/sys/dev/usb/   (props changed)
  stable/8/sys/kern/   (props changed)
  stable/8/sys/mips/   (props changed)

Modified: stable/8/sys/dev/puc/puc.c
==
--- stable/8/sys/dev/puc/puc.c  Mon Nov  7 09:23:07 2016(r308403)
+++ stable/8/sys/dev/puc/puc.c  Mon Nov  7 09:27:05 2016(r308404)
@@ -412,8 +412,7 @@ puc_bfe_detach(device_t dev)
port = >sc_port[idx];
if (port->p_dev == NULL)
continue;
-   if (device_detach(port->p_dev) == 0) {
-   device_delete_child(dev, port->p_dev);
+   if (device_delete_child(dev, port->p_dev) == 0) {
if (port->p_rres != NULL)
rman_release_resource(port->p_rres);
if (port->p_ires != NULL)

Modified: stable/8/sys/dev/usb/controller/at91dci_atmelarm.c
==
--- stable/8/sys/dev/usb/controller/at91dci_atmelarm.c  Mon Nov  7 09:23:07 
2016(r308403)
+++ stable/8/sys/dev/usb/controller/at91dci_atmelarm.c  Mon Nov  7 09:27:05 
2016(r308404)
@@ -261,14 +261,8 @@ static int
 at91_udp_detach(device_t dev)
 {
struct at91_udp_softc *sc = device_get_softc(dev);
-   device_t bdev;
int err;
 
-   if (sc->sc_dci.sc_bus.bdev) {
-   bdev = sc->sc_dci.sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(dev, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_all_children(dev);
 

Modified: stable/8/sys/dev/usb/controller/atmegadci_atmelarm.c
==
--- stable/8/sys/dev/usb/controller/atmegadci_atmelarm.cMon Nov  7 
09:23:07 2016(r308403)
+++ stable/8/sys/dev/usb/controller/atmegadci_atmelarm.cMon Nov  7 
09:27:05 2016(r308404)
@@ -154,14 +154,8 @@ static int
 atmegadci_detach(device_t dev)
 {
struct atmegadci_super_softc *sc = device_get_softc(dev);
-   device_t bdev;
int err;
 
-   if (sc->sc_otg.sc_bus.bdev) {
-   bdev = sc->sc_otg.sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(dev, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_all_children(dev);
 

Modified: stable/8/sys/dev/usb/controller/ehci_ixp4xx.c
==
--- stable/8/sys/dev/usb/controller/ehci_ixp4xx.c   Mon Nov  7 09:23:07 
2016(r308403)
+++ stable/8/sys/dev/usb/controller/ehci_ixp4xx.c   Mon Nov  7 09:27:05 
2016(r308404)
@@ -206,14 +206,8 @@ ehci_ixp_detach(device_t self)
 {
struct ixp_ehci_softc *isc = device_get_softc(self);
ehci_softc_t *sc = >base;
-   device_t bdev;
int err;
 
-   if (sc->sc_bus.bdev) {
-   bdev = sc->sc_bus.bdev;
-   

svn commit: r308403 - in stable/9/sys: dev/puc dev/usb dev/usb/controller kern mips/atheros mips/cavium/usb mips/rmi mips/rt305x

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 09:23:07 2016
New Revision: 308403
URL: https://svnweb.freebsd.org/changeset/base/308403

Log:
  MFC r307518:
  Fix device delete child function.
  
  When detaching device trees parent devices must be detached prior to
  detaching its children. This is because parent devices can have
  pointers to the child devices in their softcs which are not
  invalidated by device_delete_child(). This can cause use after free
  issues and panic().
  
  Device drivers implementing trees, must ensure its detach function
  detaches or deletes all its children before returning.
  
  While at it remove now redundant device_detach() calls before
  device_delete_child() and device_delete_children(), mostly in
  the USB controller drivers.
  
  Tested by:Jan Henrik Sylvester 
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D8070

Modified:
  stable/9/sys/dev/puc/puc.c
  stable/9/sys/dev/usb/controller/at91dci_atmelarm.c
  stable/9/sys/dev/usb/controller/atmegadci_atmelarm.c
  stable/9/sys/dev/usb/controller/ehci_ixp4xx.c
  stable/9/sys/dev/usb/controller/ehci_mv.c
  stable/9/sys/dev/usb/controller/ehci_pci.c
  stable/9/sys/dev/usb/controller/musb_otg_atmelarm.c
  stable/9/sys/dev/usb/controller/ohci_pci.c
  stable/9/sys/dev/usb/controller/ohci_s3c24x0.c
  stable/9/sys/dev/usb/controller/uhci_pci.c
  stable/9/sys/dev/usb/controller/uss820dci_atmelarm.c
  stable/9/sys/dev/usb/controller/xhci_pci.c
  stable/9/sys/dev/usb/usb_device.c
  stable/9/sys/kern/subr_bus.c
  stable/9/sys/mips/atheros/ar71xx_ehci.c
  stable/9/sys/mips/atheros/ar71xx_ohci.c
  stable/9/sys/mips/cavium/usb/octusb_octeon.c
  stable/9/sys/mips/rmi/xls_ehci.c
  stable/9/sys/mips/rt305x/rt305x_dotg.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/dev/puc/   (props changed)

Modified: stable/9/sys/dev/puc/puc.c
==
--- stable/9/sys/dev/puc/puc.c  Mon Nov  7 09:19:04 2016(r308402)
+++ stable/9/sys/dev/puc/puc.c  Mon Nov  7 09:23:07 2016(r308403)
@@ -412,8 +412,7 @@ puc_bfe_detach(device_t dev)
port = >sc_port[idx];
if (port->p_dev == NULL)
continue;
-   if (device_detach(port->p_dev) == 0) {
-   device_delete_child(dev, port->p_dev);
+   if (device_delete_child(dev, port->p_dev) == 0) {
if (port->p_rres != NULL)
rman_release_resource(port->p_rres);
if (port->p_ires != NULL)

Modified: stable/9/sys/dev/usb/controller/at91dci_atmelarm.c
==
--- stable/9/sys/dev/usb/controller/at91dci_atmelarm.c  Mon Nov  7 09:19:04 
2016(r308402)
+++ stable/9/sys/dev/usb/controller/at91dci_atmelarm.c  Mon Nov  7 09:23:07 
2016(r308403)
@@ -262,14 +262,8 @@ static int
 at91_udp_detach(device_t dev)
 {
struct at91_udp_softc *sc = device_get_softc(dev);
-   device_t bdev;
int err;
 
-   if (sc->sc_dci.sc_bus.bdev) {
-   bdev = sc->sc_dci.sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(dev, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(dev);
 

Modified: stable/9/sys/dev/usb/controller/atmegadci_atmelarm.c
==
--- stable/9/sys/dev/usb/controller/atmegadci_atmelarm.cMon Nov  7 
09:19:04 2016(r308402)
+++ stable/9/sys/dev/usb/controller/atmegadci_atmelarm.cMon Nov  7 
09:23:07 2016(r308403)
@@ -155,14 +155,8 @@ static int
 atmegadci_detach(device_t dev)
 {
struct atmegadci_super_softc *sc = device_get_softc(dev);
-   device_t bdev;
int err;
 
-   if (sc->sc_otg.sc_bus.bdev) {
-   bdev = sc->sc_otg.sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(dev, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(dev);
 

Modified: stable/9/sys/dev/usb/controller/ehci_ixp4xx.c
==
--- stable/9/sys/dev/usb/controller/ehci_ixp4xx.c   Mon Nov  7 09:19:04 
2016(r308402)
+++ stable/9/sys/dev/usb/controller/ehci_ixp4xx.c   Mon Nov  7 09:23:07 
2016(r308403)
@@ -207,14 +207,8 @@ ehci_ixp_detach(device_t self)
 {
struct ixp_ehci_softc *isc = device_get_softc(self);
ehci_softc_t *sc = >base;
-   device_t bdev;
int err;
 
-   if (sc->sc_bus.bdev) {
-   bdev = sc->sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(self, bdev);
-   

svn commit: r308402 - in stable/10/sys: arm/allwinner arm/cavium/cns11xx arm/ti/usb arm/xilinx dev/puc dev/usb dev/usb/controller kern mips/atheros mips/cavium/usb mips/rmi mips/rt305x

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 09:19:04 2016
New Revision: 308402
URL: https://svnweb.freebsd.org/changeset/base/308402

Log:
  MFC r307518:
  Fix device delete child function.
  
  When detaching device trees parent devices must be detached prior to
  detaching its children. This is because parent devices can have
  pointers to the child devices in their softcs which are not
  invalidated by device_delete_child(). This can cause use after free
  issues and panic().
  
  Device drivers implementing trees, must ensure its detach function
  detaches or deletes all its children before returning.
  
  While at it remove now redundant device_detach() calls before
  device_delete_child() and device_delete_children(), mostly in
  the USB controller drivers.
  
  Tested by:Jan Henrik Sylvester 
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D8070

Modified:
  stable/10/sys/arm/allwinner/a10_ehci.c
  stable/10/sys/arm/cavium/cns11xx/ehci_ebus.c
  stable/10/sys/arm/cavium/cns11xx/ohci_ec.c
  stable/10/sys/arm/ti/usb/omap_ehci.c
  stable/10/sys/arm/xilinx/zy7_ehci.c
  stable/10/sys/dev/puc/puc.c
  stable/10/sys/dev/usb/controller/at91dci_atmelarm.c
  stable/10/sys/dev/usb/controller/at91dci_fdt.c
  stable/10/sys/dev/usb/controller/atmegadci_atmelarm.c
  stable/10/sys/dev/usb/controller/dwc_otg_fdt.c
  stable/10/sys/dev/usb/controller/ehci_ixp4xx.c
  stable/10/sys/dev/usb/controller/ehci_mv.c
  stable/10/sys/dev/usb/controller/ehci_pci.c
  stable/10/sys/dev/usb/controller/musb_otg_atmelarm.c
  stable/10/sys/dev/usb/controller/ohci_pci.c
  stable/10/sys/dev/usb/controller/ohci_s3c24x0.c
  stable/10/sys/dev/usb/controller/uhci_pci.c
  stable/10/sys/dev/usb/controller/uss820dci_atmelarm.c
  stable/10/sys/dev/usb/controller/xhci_pci.c
  stable/10/sys/dev/usb/usb_device.c
  stable/10/sys/kern/subr_bus.c
  stable/10/sys/mips/atheros/ar71xx_ehci.c
  stable/10/sys/mips/atheros/ar71xx_ohci.c
  stable/10/sys/mips/cavium/usb/octusb_octeon.c
  stable/10/sys/mips/rmi/xls_ehci.c
  stable/10/sys/mips/rt305x/rt305x_dotg.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/arm/allwinner/a10_ehci.c
==
--- stable/10/sys/arm/allwinner/a10_ehci.c  Mon Nov  7 08:36:06 2016
(r308401)
+++ stable/10/sys/arm/allwinner/a10_ehci.c  Mon Nov  7 09:19:04 2016
(r308402)
@@ -224,15 +224,9 @@ static int
 a10_ehci_detach(device_t self)
 {
ehci_softc_t *sc = device_get_softc(self);
-   device_t bdev;
int err;
uint32_t reg_value = 0;
 
-   if (sc->sc_bus.bdev) {
-   bdev = sc->sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(self, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(self);
 

Modified: stable/10/sys/arm/cavium/cns11xx/ehci_ebus.c
==
--- stable/10/sys/arm/cavium/cns11xx/ehci_ebus.cMon Nov  7 08:36:06 
2016(r308401)
+++ stable/10/sys/arm/cavium/cns11xx/ehci_ebus.cMon Nov  7 09:19:04 
2016(r308402)
@@ -184,14 +184,8 @@ static int
 ehci_ebus_detach(device_t self)
 {
ehci_softc_t *sc = device_get_softc(self);
-   device_t bdev;
int err;
 
-   if (sc->sc_bus.bdev) {
-   bdev = sc->sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(self, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(self);
 

Modified: stable/10/sys/arm/cavium/cns11xx/ohci_ec.c
==
--- stable/10/sys/arm/cavium/cns11xx/ohci_ec.c  Mon Nov  7 08:36:06 2016
(r308401)
+++ stable/10/sys/arm/cavium/cns11xx/ohci_ec.c  Mon Nov  7 09:19:04 2016
(r308402)
@@ -177,14 +177,8 @@ static int
 ohci_ec_detach(device_t dev)
 {
struct ec_ohci_softc *sc = device_get_softc(dev);
-   device_t bdev;
int err;
 
-   if (sc->sc_ohci.sc_bus.bdev) {
-   bdev = sc->sc_ohci.sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(dev, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(dev);
 

Modified: stable/10/sys/arm/ti/usb/omap_ehci.c
==
--- stable/10/sys/arm/ti/usb/omap_ehci.cMon Nov  7 08:36:06 2016
(r308401)
+++ stable/10/sys/arm/ti/usb/omap_ehci.cMon Nov  7 09:19:04 2016
(r308402)
@@ -939,15 +939,8 @@ omap_ehci_detach(device_t dev)
 {
struct omap_ehci_softc *isc = device_get_softc(dev);
ehci_softc_t *sc = >base;
-   device_t bdev;
int err;

-   if 

svn commit: r308401 - in stable/11/sys: arm/allwinner arm/at91 arm/cavium/cns11xx arm/samsung/exynos arm/ti/am335x arm/ti/usb arm/xilinx boot/kshim dev/puc dev/usb dev/usb/controller dev/usb/video ...

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 08:36:06 2016
New Revision: 308401
URL: https://svnweb.freebsd.org/changeset/base/308401

Log:
  MFC r307518:
  Fix device delete child function.
  
  When detaching device trees parent devices must be detached prior to
  detaching its children. This is because parent devices can have
  pointers to the child devices in their softcs which are not
  invalidated by device_delete_child(). This can cause use after free
  issues and panic().
  
  Device drivers implementing trees, must ensure its detach function
  detaches or deletes all its children before returning.
  
  While at it remove now redundant device_detach() calls before
  device_delete_child() and device_delete_children(), mostly in
  the USB controller drivers.
  
  Tested by:Jan Henrik Sylvester 
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D8070

Modified:
  stable/11/sys/arm/allwinner/a10_ehci.c
  stable/11/sys/arm/at91/at91_ohci.c
  stable/11/sys/arm/at91/at91_ohci_fdt.c
  stable/11/sys/arm/cavium/cns11xx/ehci_ebus.c
  stable/11/sys/arm/cavium/cns11xx/ohci_ec.c
  stable/11/sys/arm/samsung/exynos/exynos5_xhci.c
  stable/11/sys/arm/ti/am335x/am335x_musb.c
  stable/11/sys/arm/ti/usb/omap_ehci.c
  stable/11/sys/arm/xilinx/zy7_ehci.c
  stable/11/sys/boot/kshim/bsd_kernel.c
  stable/11/sys/dev/puc/puc.c
  stable/11/sys/dev/usb/controller/at91dci_atmelarm.c
  stable/11/sys/dev/usb/controller/at91dci_fdt.c
  stable/11/sys/dev/usb/controller/atmegadci_atmelarm.c
  stable/11/sys/dev/usb/controller/dwc_otg_fdt.c
  stable/11/sys/dev/usb/controller/ehci_ixp4xx.c
  stable/11/sys/dev/usb/controller/ehci_mv.c
  stable/11/sys/dev/usb/controller/ehci_pci.c
  stable/11/sys/dev/usb/controller/generic_ehci.c
  stable/11/sys/dev/usb/controller/generic_ohci.c
  stable/11/sys/dev/usb/controller/musb_otg_atmelarm.c
  stable/11/sys/dev/usb/controller/ohci_pci.c
  stable/11/sys/dev/usb/controller/ohci_s3c24x0.c
  stable/11/sys/dev/usb/controller/saf1761_otg_boot.c
  stable/11/sys/dev/usb/controller/saf1761_otg_fdt.c
  stable/11/sys/dev/usb/controller/uhci_pci.c
  stable/11/sys/dev/usb/controller/uss820dci_atmelarm.c
  stable/11/sys/dev/usb/controller/xhci_mv.c
  stable/11/sys/dev/usb/controller/xhci_pci.c
  stable/11/sys/dev/usb/usb_device.c
  stable/11/sys/dev/usb/video/udl.c
  stable/11/sys/kern/subr_bus.c
  stable/11/sys/mips/atheros/ar71xx_ehci.c
  stable/11/sys/mips/atheros/ar71xx_ohci.c
  stable/11/sys/mips/cavium/usb/octusb_octeon.c
  stable/11/sys/mips/mediatek/mtk_dotg.c
  stable/11/sys/mips/mediatek/mtk_ehci.c
  stable/11/sys/mips/mediatek/mtk_ohci.c
  stable/11/sys/mips/mediatek/mtk_xhci.c
  stable/11/sys/mips/rmi/xls_ehci.c
  stable/11/sys/mips/rt305x/rt305x_dotg.c
  stable/11/sys/mips/rt305x/rt305x_ehci.c
  stable/11/sys/mips/rt305x/rt305x_ohci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/allwinner/a10_ehci.c
==
--- stable/11/sys/arm/allwinner/a10_ehci.c  Mon Nov  7 08:26:19 2016
(r308400)
+++ stable/11/sys/arm/allwinner/a10_ehci.c  Mon Nov  7 08:36:06 2016
(r308401)
@@ -278,17 +278,11 @@ a10_ehci_detach(device_t self)
struct aw_ehci_softc *aw_sc = device_get_softc(self);
ehci_softc_t *sc = _sc->sc;
const struct aw_ehci_conf *conf;
-   device_t bdev;
int err;
uint32_t reg_value = 0;
 
conf = USB_CONF(self);
 
-   if (sc->sc_bus.bdev) {
-   bdev = sc->sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(self, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(self);
 

Modified: stable/11/sys/arm/at91/at91_ohci.c
==
--- stable/11/sys/arm/at91/at91_ohci.c  Mon Nov  7 08:26:19 2016
(r308400)
+++ stable/11/sys/arm/at91/at91_ohci.c  Mon Nov  7 08:36:06 2016
(r308401)
@@ -165,14 +165,8 @@ static int
 ohci_atmelarm_detach(device_t dev)
 {
struct at91_ohci_softc *sc = device_get_softc(dev);
-   device_t bdev;
int err;
 
-   if (sc->sc_ohci.sc_bus.bdev) {
-   bdev = sc->sc_ohci.sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(dev, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(dev);
 

Modified: stable/11/sys/arm/at91/at91_ohci_fdt.c
==
--- stable/11/sys/arm/at91/at91_ohci_fdt.c  Mon Nov  7 08:26:19 2016
(r308400)
+++ stable/11/sys/arm/at91/at91_ohci_fdt.c  Mon Nov  7 08:36:06 2016
(r308401)
@@ -171,14 +171,8 @@ static int
 ohci_at91_fdt_detach(device_t dev)
 {
struct at91_ohci_softc *sc = device_get_softc(dev);
-   

svn commit: r308400 - stable/9/sys/ofed/drivers/net/mlx4

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 08:26:19 2016
New Revision: 308400
URL: https://svnweb.freebsd.org/changeset/base/308400

Log:
  MFC r308031:
  Fix indentation and remove duplicate queue stopped stats increment.
  
  Found by: Ryan Stone 
  Sponsored by: Mellanox Technologies

Modified:
  stable/9/sys/ofed/drivers/net/mlx4/en_tx.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ofed/drivers/net/mlx4/en_tx.c
==
--- stable/9/sys/ofed/drivers/net/mlx4/en_tx.c  Mon Nov  7 08:24:29 2016
(r308399)
+++ stable/9/sys/ofed/drivers/net/mlx4/en_tx.c  Mon Nov  7 08:26:19 2016
(r308400)
@@ -703,20 +703,19 @@ static int mlx4_en_xmit(struct mlx4_en_p
 
/* check if TX ring is full */
if (unlikely(mlx4_en_tx_ring_is_full(ring))) {
-   /* every full native Tx ring stops queue */
-   if (ring->blocked == 0)
-   atomic_add_int(>blocked, 1);
-   /* Set HW-queue-is-full flag */
-   atomic_set_int(>if_drv_flags, IFF_DRV_OACTIVE);
-   priv->port_stats.queue_stopped++;
-   ring->blocked = 1;
+   /* every full native Tx ring stops queue */
+   if (ring->blocked == 0)
+   atomic_add_int(>blocked, 1);
+   /* Set HW-queue-is-full flag */
+   atomic_set_int(>if_drv_flags, IFF_DRV_OACTIVE);
priv->port_stats.queue_stopped++;
+   ring->blocked = 1;
ring->queue_stopped++;
 
/* Use interrupts to find out when queue opened */
mlx4_en_arm_cq(priv, priv->tx_cq[tx_ind]);
return (ENOBUFS);
-}
+   }
 
/* sanity check we are not wrapping around */
KASSERT(((~ring->prod) & ring->size_mask) >=
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308399 - stable/10/sys/ofed/drivers/net/mlx4

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 08:24:29 2016
New Revision: 308399
URL: https://svnweb.freebsd.org/changeset/base/308399

Log:
  MFC r308031:
  Fix indentation and remove duplicate queue stopped stats increment.
  
  Found by: Ryan Stone 
  Sponsored by: Mellanox Technologies

Modified:
  stable/10/sys/ofed/drivers/net/mlx4/en_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/ofed/drivers/net/mlx4/en_tx.c
==
--- stable/10/sys/ofed/drivers/net/mlx4/en_tx.c Mon Nov  7 08:22:44 2016
(r308398)
+++ stable/10/sys/ofed/drivers/net/mlx4/en_tx.c Mon Nov  7 08:24:29 2016
(r308399)
@@ -702,20 +702,19 @@ static int mlx4_en_xmit(struct mlx4_en_p
 
/* check if TX ring is full */
if (unlikely(mlx4_en_tx_ring_is_full(ring))) {
-   /* every full native Tx ring stops queue */
-   if (ring->blocked == 0)
-   atomic_add_int(>blocked, 1);
-   /* Set HW-queue-is-full flag */
-   atomic_set_int(>if_drv_flags, IFF_DRV_OACTIVE);
-   priv->port_stats.queue_stopped++;
-   ring->blocked = 1;
+   /* every full native Tx ring stops queue */
+   if (ring->blocked == 0)
+   atomic_add_int(>blocked, 1);
+   /* Set HW-queue-is-full flag */
+   atomic_set_int(>if_drv_flags, IFF_DRV_OACTIVE);
priv->port_stats.queue_stopped++;
+   ring->blocked = 1;
ring->queue_stopped++;
 
/* Use interrupts to find out when queue opened */
mlx4_en_arm_cq(priv, priv->tx_cq[tx_ind]);
return (ENOBUFS);
-}
+   }
 
/* sanity check we are not wrapping around */
KASSERT(((~ring->prod) & ring->size_mask) >=
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308398 - stable/11/sys/ofed/drivers/net/mlx4

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 08:22:44 2016
New Revision: 308398
URL: https://svnweb.freebsd.org/changeset/base/308398

Log:
  MFC r308031:
  Fix indentation and remove duplicate queue stopped stats increment.
  
  Found by: Ryan Stone 
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/ofed/drivers/net/mlx4/en_tx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ofed/drivers/net/mlx4/en_tx.c
==
--- stable/11/sys/ofed/drivers/net/mlx4/en_tx.c Mon Nov  7 08:18:51 2016
(r308397)
+++ stable/11/sys/ofed/drivers/net/mlx4/en_tx.c Mon Nov  7 08:22:44 2016
(r308398)
@@ -707,20 +707,19 @@ static int mlx4_en_xmit(struct mlx4_en_p
 
/* check if TX ring is full */
if (unlikely(mlx4_en_tx_ring_is_full(ring))) {
-   /* every full native Tx ring stops queue */
-   if (ring->blocked == 0)
-   atomic_add_int(>blocked, 1);
-   /* Set HW-queue-is-full flag */
-   atomic_set_int(>if_drv_flags, IFF_DRV_OACTIVE);
-   priv->port_stats.queue_stopped++;
-   ring->blocked = 1;
+   /* every full native Tx ring stops queue */
+   if (ring->blocked == 0)
+   atomic_add_int(>blocked, 1);
+   /* Set HW-queue-is-full flag */
+   atomic_set_int(>if_drv_flags, IFF_DRV_OACTIVE);
priv->port_stats.queue_stopped++;
+   ring->blocked = 1;
ring->queue_stopped++;
 
/* Use interrupts to find out when queue opened */
mlx4_en_arm_cq(priv, priv->tx_cq[tx_ind]);
return (ENOBUFS);
-}
+   }
 
/* sanity check we are not wrapping around */
KASSERT(((~ring->prod) & ring->size_mask) >=
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308397 - stable/8/sys/dev/usb/input

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 08:18:51 2016
New Revision: 308397
URL: https://svnweb.freebsd.org/changeset/base/308397

Log:
  MFC r308144 and r308165:
  Fixes for virtual T-axis buttons.
  
  Make sure the virtual T-axis buttons gets cleared for USB mice which has
  less than 6 buttons.
  
  Make sure the virtual T-axis buttons generate button release event(s)
  for continuous tilting.
  
  PR:   213919
  PR:   213957

Modified:
  stable/8/sys/dev/usb/input/ums.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/usb/   (props changed)

Modified: stable/8/sys/dev/usb/input/ums.c
==
--- stable/8/sys/dev/usb/input/ums.cMon Nov  7 08:17:23 2016
(r308396)
+++ stable/8/sys/dev/usb/input/ums.cMon Nov  7 08:18:51 2016
(r308397)
@@ -258,8 +258,11 @@ ums_intr_callback(struct usb_xfer *xfer,
}
 
if ((info->sc_flags & UMS_FLAG_T_AXIS) &&
-   (id == info->sc_iid_t))
+   (id == info->sc_iid_t)) {
dt -= hid_get_data(buf, len, >sc_loc_t);
+   /* T-axis is translated into button presses */
+   buttons_found |= (1UL << 5) | (1UL << 6);
+   }
 
for (i = 0; i < info->sc_buttons; i++) {
uint32_t mask;
@@ -287,10 +290,13 @@ ums_intr_callback(struct usb_xfer *xfer,
dx, dy, dz, dt, dw, buttons);
 
/* translate T-axis into button presses until further */
-   if (dt > 0)
+   if (dt > 0) {
+   ums_put_queue(sc, 0, 0, 0, 0, buttons);
buttons |= 1UL << 5;
-   else if (dt < 0)
+   } else if (dt < 0) {
+   ums_put_queue(sc, 0, 0, 0, 0, buttons);
buttons |= 1UL << 6;
+   }
 
sc->sc_status.button = buttons;
sc->sc_status.dx += dx;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308396 - stable/9/sys/dev/usb/input

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 08:17:23 2016
New Revision: 308396
URL: https://svnweb.freebsd.org/changeset/base/308396

Log:
  MFC r308144 and r308165:
  Fixes for virtual T-axis buttons.
  
  Make sure the virtual T-axis buttons gets cleared for USB mice which has
  less than 6 buttons.
  
  Make sure the virtual T-axis buttons generate button release event(s)
  for continuous tilting.
  
  PR:   213919
  PR:   213957

Modified:
  stable/9/sys/dev/usb/input/ums.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/usb/input/ums.c
==
--- stable/9/sys/dev/usb/input/ums.cMon Nov  7 08:15:58 2016
(r308395)
+++ stable/9/sys/dev/usb/input/ums.cMon Nov  7 08:17:23 2016
(r308396)
@@ -258,8 +258,11 @@ ums_intr_callback(struct usb_xfer *xfer,
}
 
if ((info->sc_flags & UMS_FLAG_T_AXIS) &&
-   (id == info->sc_iid_t))
+   (id == info->sc_iid_t)) {
dt -= hid_get_data(buf, len, >sc_loc_t);
+   /* T-axis is translated into button presses */
+   buttons_found |= (1UL << 5) | (1UL << 6);
+   }
 
for (i = 0; i < info->sc_buttons; i++) {
uint32_t mask;
@@ -287,10 +290,13 @@ ums_intr_callback(struct usb_xfer *xfer,
dx, dy, dz, dt, dw, buttons);
 
/* translate T-axis into button presses until further */
-   if (dt > 0)
+   if (dt > 0) {
+   ums_put_queue(sc, 0, 0, 0, 0, buttons);
buttons |= 1UL << 5;
-   else if (dt < 0)
+   } else if (dt < 0) {
+   ums_put_queue(sc, 0, 0, 0, 0, buttons);
buttons |= 1UL << 6;
+   }
 
sc->sc_status.button = buttons;
sc->sc_status.dx += dx;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308395 - stable/10/sys/dev/usb/input

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 08:15:58 2016
New Revision: 308395
URL: https://svnweb.freebsd.org/changeset/base/308395

Log:
  MFC r308144 and r308165:
  Fixes for virtual T-axis buttons.
  
  Make sure the virtual T-axis buttons gets cleared for USB mice which has
  less than 6 buttons.
  
  Make sure the virtual T-axis buttons generate button release event(s)
  for continuous tilting.
  
  PR:   213919
  PR:   213957

Modified:
  stable/10/sys/dev/usb/input/ums.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/input/ums.c
==
--- stable/10/sys/dev/usb/input/ums.c   Mon Nov  7 08:14:29 2016
(r308394)
+++ stable/10/sys/dev/usb/input/ums.c   Mon Nov  7 08:15:58 2016
(r308395)
@@ -258,8 +258,11 @@ ums_intr_callback(struct usb_xfer *xfer,
}
 
if ((info->sc_flags & UMS_FLAG_T_AXIS) &&
-   (id == info->sc_iid_t))
+   (id == info->sc_iid_t)) {
dt -= hid_get_data(buf, len, >sc_loc_t);
+   /* T-axis is translated into button presses */
+   buttons_found |= (1UL << 5) | (1UL << 6);
+   }
 
for (i = 0; i < info->sc_buttons; i++) {
uint32_t mask;
@@ -287,10 +290,13 @@ ums_intr_callback(struct usb_xfer *xfer,
dx, dy, dz, dt, dw, buttons);
 
/* translate T-axis into button presses until further */
-   if (dt > 0)
+   if (dt > 0) {
+   ums_put_queue(sc, 0, 0, 0, 0, buttons);
buttons |= 1UL << 5;
-   else if (dt < 0)
+   } else if (dt < 0) {
+   ums_put_queue(sc, 0, 0, 0, 0, buttons);
buttons |= 1UL << 6;
+   }
 
sc->sc_status.button = buttons;
sc->sc_status.dx += dx;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308394 - stable/11/sys/dev/usb/input

2016-11-07 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Nov  7 08:14:29 2016
New Revision: 308394
URL: https://svnweb.freebsd.org/changeset/base/308394

Log:
  MFC r308144 and r308165:
  Fixes for virtual T-axis buttons.
  
  Make sure the virtual T-axis buttons gets cleared for USB mice which has
  less than 6 buttons.
  
  Make sure the virtual T-axis buttons generate button release event(s)
  for continuous tilting.
  
  PR:   213919
  PR:   213957

Modified:
  stable/11/sys/dev/usb/input/ums.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/input/ums.c
==
--- stable/11/sys/dev/usb/input/ums.c   Mon Nov  7 07:27:12 2016
(r308393)
+++ stable/11/sys/dev/usb/input/ums.c   Mon Nov  7 08:14:29 2016
(r308394)
@@ -295,8 +295,11 @@ ums_intr_callback(struct usb_xfer *xfer,
}
 
if ((info->sc_flags & UMS_FLAG_T_AXIS) &&
-   (id == info->sc_iid_t))
+   (id == info->sc_iid_t)) {
dt -= hid_get_data(buf, len, >sc_loc_t);
+   /* T-axis is translated into button presses */
+   buttons_found |= (1UL << 5) | (1UL << 6);
+   }
 
for (i = 0; i < info->sc_buttons; i++) {
uint32_t mask;
@@ -327,10 +330,13 @@ ums_intr_callback(struct usb_xfer *xfer,
dx, dy, dz, dt, dw, buttons);
 
/* translate T-axis into button presses until further */
-   if (dt > 0)
+   if (dt > 0) {
+   ums_put_queue(sc, 0, 0, 0, 0, buttons);
buttons |= 1UL << 5;
-   else if (dt < 0)
+   } else if (dt < 0) {
+   ums_put_queue(sc, 0, 0, 0, 0, buttons);
buttons |= 1UL << 6;
+   }
 
sc->sc_status.button = buttons;
sc->sc_status.dx += dx;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"