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

2014-02-05 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Feb  5 08:02:52 2014
New Revision: 261505
URL: http://svnweb.freebsd.org/changeset/base/261505

Log:
  Fix a regression issue. Contiguous single segment allocations above
  PAGE_SIZE bytes should only use one USB page structure. Fixes a
  problem with some external drivers.
  
  MFC after:2 days

Modified:
  head/sys/dev/usb/usb_busdma.c

Modified: head/sys/dev/usb/usb_busdma.c
==
--- head/sys/dev/usb/usb_busdma.c   Wed Feb  5 04:39:03 2014
(r261504)
+++ head/sys/dev/usb/usb_busdma.c   Wed Feb  5 08:02:52 2014
(r261505)
@@ -452,7 +452,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_
goto done;
}
 #endif
-   while (1) {
+   while (pc->ismultiseg) {
off += USB_PAGE_SIZE;
if (off >= (segs->ds_len + rem)) {
/* page crossing */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261506 - head/sys/dev/usb/wlan

2014-02-05 Thread Kevin Lo
Author: kevlo
Date: Wed Feb  5 08:09:02 2014
New Revision: 261506
URL: http://svnweb.freebsd.org/changeset/base/261506

Log:
  Correct setting R92C_TXAGC_MCS11_MCS08 register.

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

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cWed Feb  5 08:02:52 2014
(r261505)
+++ head/sys/dev/usb/wlan/if_urtwn.cWed Feb  5 08:09:02 2014
(r261506)
@@ -2489,7 +2489,7 @@ urtwn_write_txpower(struct urtwn_softc *
SM(R92C_TXAGC_MCS07,  power[19]));
urtwn_bb_write(sc, R92C_TXAGC_MCS11_MCS08(chain),
SM(R92C_TXAGC_MCS08,  power[20]) |
-   SM(R92C_TXAGC_MCS08,  power[21]) |
+   SM(R92C_TXAGC_MCS09,  power[21]) |
SM(R92C_TXAGC_MCS10,  power[22]) |
SM(R92C_TXAGC_MCS11,  power[23]));
urtwn_bb_write(sc, R92C_TXAGC_MCS15_MCS12(chain),
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261507 - head/sys/dev/sound/pci/hda

2014-02-05 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Feb  5 08:27:02 2014
New Revision: 261507
URL: http://svnweb.freebsd.org/changeset/base/261507

Log:
  Add more quirks for making builtin audio speakers work with more
  MacBookPro's. Only tested with MacBookPro 9,2.
  
  Obtained from:Linux
  MFC after:1 week

Modified:
  head/sys/dev/sound/pci/hda/hdaa_patches.c
  head/sys/dev/sound/pci/hda/hdac.h

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- head/sys/dev/sound/pci/hda/hdaa_patches.c   Wed Feb  5 08:09:02 2014
(r261506)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c   Wed Feb  5 08:27:02 2014
(r261507)
@@ -107,9 +107,18 @@ static const struct {
{ APPLE_INTEL_MAC, HDA_CODEC_STAC9221, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) | HDAA_GPIO_SET(1) },
+   { APPLE_MACBOOKAIR31, HDA_CODEC_CS4206, HDA_MATCH_ALL,
+   0, 0,
+   HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) },
{ APPLE_MACBOOKPRO55, HDA_CODEC_CS4206, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) },
+   { APPLE_MACBOOKPRO71, HDA_CODEC_CS4206, HDA_MATCH_ALL,
+   0, 0,
+   HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) },
+   { HDA_INTEL_MACBOOKPRO92, HDA_CODEC_CS4206, HDA_MATCH_ALL,
+   0, 0,
+   HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) },
{ DELL_D630_SUBVENDOR, HDA_CODEC_STAC9205X, HDA_MATCH_ALL,
0, 0,
HDAA_GPIO_SET(0) },

Modified: head/sys/dev/sound/pci/hda/hdac.h
==
--- head/sys/dev/sound/pci/hda/hdac.h   Wed Feb  5 08:09:02 2014
(r261506)
+++ head/sys/dev/sound/pci/hda/hdac.h   Wed Feb  5 08:27:02 2014
(r261507)
@@ -58,6 +58,7 @@
 #define HDA_INTEL_82801JD  HDA_MODEL_CONSTRUCT(INTEL, 0x3a6e)
 #define HDA_INTEL_PCH  HDA_MODEL_CONSTRUCT(INTEL, 0x3b56)
 #define HDA_INTEL_PCH2 HDA_MODEL_CONSTRUCT(INTEL, 0x3b57)
+#define HDA_INTEL_MACBOOKPRO92 HDA_MODEL_CONSTRUCT(INTEL, 0x7270)
 #define HDA_INTEL_SCH  HDA_MODEL_CONSTRUCT(INTEL, 0x811b)
 #define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20)
 #define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8c21)
@@ -266,7 +267,9 @@
  * (see HDA_CODEC_STAC9221 below).
  */
 #define APPLE_INTEL_MAC0x76808384
+#define APPLE_MACBOOKAIR31 0x0d9410de
 #define APPLE_MACBOOKPRO55 0xcb7910de
+#define APPLE_MACBOOKPRO71 0xcb8910de
 
 /* LG Electronics */
 #define LG_VENDORID0x1854
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261508 - head/sys/dev/sound/pci/hda

2014-02-05 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Feb  5 08:29:24 2014
New Revision: 261508
URL: http://svnweb.freebsd.org/changeset/base/261508

Log:
  Use system macro instead of own hand-rolled one.

Modified:
  head/sys/dev/sound/pci/hda/hdaa_patches.c

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- head/sys/dev/sound/pci/hda/hdaa_patches.c   Wed Feb  5 08:27:02 2014
(r261507)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c   Wed Feb  5 08:29:24 2014
(r261508)
@@ -142,7 +142,6 @@ static const struct {
0, HDAA_QUIRK_OVREF,
0 }
 };
-#define HDAC_QUIRKS_LEN (sizeof(hdac_quirks) / sizeof(hdac_quirks[0]))
 
 static void
 hdac_pin_patch(struct hdaa_widget *w)
@@ -466,7 +465,7 @@ hdaa_patch(struct hdaa_devinfo *devinfo)
/*
 * Quirks
 */
-   for (i = 0; i < HDAC_QUIRKS_LEN; i++) {
+   for (i = 0; i < nitems(hdac_quirks); i++) {
if (!(HDA_DEV_MATCH(hdac_quirks[i].model, subid) &&
HDA_DEV_MATCH(hdac_quirks[i].id, id) &&
HDA_DEV_MATCH(hdac_quirks[i].subsystemid, subsystemid)))
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261511 - head/usr.sbin/pwd_mkdb

2014-02-05 Thread Dag-Erling Smørgrav
Author: des
Date: Wed Feb  5 09:28:02 2014
New Revision: 261511
URL: http://svnweb.freebsd.org/changeset/base/261511

Log:
  Add an example of the most common use case.
  
  MFC after:1 week

Modified:
  head/usr.sbin/pwd_mkdb/pwd_mkdb.8

Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8
==
--- head/usr.sbin/pwd_mkdb/pwd_mkdb.8   Wed Feb  5 08:42:59 2014
(r261510)
+++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8   Wed Feb  5 09:28:02 2014
(r261511)
@@ -28,7 +28,7 @@
 .\"@(#)pwd_mkdb.8  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd February 28, 2005
+.Dd February 5, 2014
 .Dt PWD_MKDB 8
 .Os
 .Sh NAME
@@ -143,6 +143,12 @@ The current password file.
 .It Pa /etc/passwd
 A Version 7 format password file.
 .El
+.Sh EXAMPLES
+Regenerate the password database after manually editing or replacing
+the password file:
+.Bd -literal -offset -indent
+/usr/sbin/pwd_mkdb /etc/master.passwd
+.Ed
 .Sh COMPATIBILITY
 Previous versions of the system had a program similar to
 .Nm ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261512 - head/usr.bin/nfsstat

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 14:33:22 2014
New Revision: 261512
URL: http://svnweb.freebsd.org/changeset/base/261512

Log:
  Partially revert r52493 and change client side interval statistics to
  report the actual number of RPCs issued, not the theoretical number
  that would be issued if all caching was disabled.
  
  Reviewed by:  rmacklem
  MFC after:2 weeks

Modified:
  head/usr.bin/nfsstat/nfsstat.c

Modified: head/usr.bin/nfsstat/nfsstat.c
==
--- head/usr.bin/nfsstat/nfsstat.c  Wed Feb  5 09:28:02 2014
(r261511)
+++ head/usr.bin/nfsstat/nfsstat.c  Wed Feb  5 14:33:22 2014
(r261512)
@@ -604,14 +604,15 @@ sidewaysintpr(u_int interval, int client
if (clientOnly) {
printf("%s %6d %6d %6d %6d %6d %6d %6d %6d",
((clientOnly && serverOnly) ? "Client:" : ""),
-   DELTA(attrcache_hits) + DELTA(attrcache_misses),
-   DELTA(lookupcache_hits) + DELTA(lookupcache_misses),
-   DELTA(biocache_readlinks),
-   DELTA(biocache_reads),
-   DELTA(biocache_writes),
-   
nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME],
-   DELTA(accesscache_hits) + DELTA(accesscache_misses),
-   DELTA(biocache_readdirs)
+   DELTA(rpccnt[NFSPROC_GETATTR]),
+   DELTA(rpccnt[NFSPROC_LOOKUP]),
+   DELTA(rpccnt[NFSPROC_READLINK]),
+   DELTA(rpccnt[NFSPROC_READ]),
+   DELTA(rpccnt[NFSPROC_WRITE]),
+   DELTA(rpccnt[NFSPROC_RENAME]),
+   DELTA(rpccnt[NFSPROC_ACCESS]),
+   DELTA(rpccnt[NFSPROC_READDIR]) +
+   DELTA(rpccnt[NFSPROC_READDIRPLUS])
);
if (widemode) {
printf(" %s %s %s %s %s %s",
@@ -993,15 +994,15 @@ exp_sidewaysintpr(u_int interval, int cl
if (clientOnly) {
printf("%s %6d %6d %6d %6d %6d %6d %6d %6d",
((clientOnly && serverOnly) ? "Client:" : ""),
-   DELTA(attrcache_hits) + DELTA(attrcache_misses),
-   DELTA(lookupcache_hits) + DELTA(lookupcache_misses),
-   DELTA(biocache_readlinks),
-   DELTA(biocache_reads),
-   DELTA(biocache_writes),
-   nfsstats.rpccnt[NFSPROC_RENAME] -
-   lastst.rpccnt[NFSPROC_RENAME],
-   DELTA(accesscache_hits) + DELTA(accesscache_misses),
-   DELTA(biocache_readdirs)
+   DELTA(rpccnt[NFSPROC_GETATTR]),
+   DELTA(rpccnt[NFSPROC_LOOKUP]),
+   DELTA(rpccnt[NFSPROC_READLINK]),
+   DELTA(rpccnt[NFSPROC_READ]),
+   DELTA(rpccnt[NFSPROC_WRITE]),
+   DELTA(rpccnt[NFSPROC_RENAME]),
+   DELTA(rpccnt[NFSPROC_ACCESS]),
+   DELTA(rpccnt[NFSPROC_READDIR]) +
+   DELTA(rpccnt[NFSPROC_READDIRPLUS])
);
if (widemode) {
printf(" %s %s %s %s %s %s",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261513 - in head/sys: arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv conf dev/fdt dev/ofw dev/powermac_nvram mips/beri mips/mips powerpc/mambo powerpc/mpc85xx powerpc/ofw powerp...

2014-02-05 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Feb  5 14:44:22 2014
New Revision: 261513
URL: http://svnweb.freebsd.org/changeset/base/261513

Log:
  Move Open Firmware device root on PowerPC, ARM, and MIPS systems to
  a sub-node of nexus (ofwbus) rather than direct attach under nexus. This
  fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier.
  SPARC is unchanged.
  
  Reviewed by:  imp, ian

Added:
  head/sys/dev/ofw/ofwbus.c
 - copied, changed from r261490, head/sys/dev/ofw/ofw_nexus.c
Deleted:
  head/sys/dev/fdt/fdtbus.c
  head/sys/dev/ofw/ofw_nexus.c
  head/sys/dev/ofw/ofw_nexus.h
Modified:
  head/sys/arm/arm/nexus.c
  head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
  head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
  head/sys/arm/freescale/imx/tzic.c
  head/sys/arm/mv/mv_localbus.c
  head/sys/arm/mv/mv_pci.c
  head/sys/conf/files
  head/sys/conf/files.powerpc
  head/sys/dev/fdt/simplebus.c
  head/sys/dev/powermac_nvram/powermac_nvram.c
  head/sys/mips/beri/beri_simplebus.c
  head/sys/mips/mips/nexus.c
  head/sys/powerpc/mambo/mambo.c
  head/sys/powerpc/mpc85xx/lbc.c
  head/sys/powerpc/mpc85xx/pci_mpc85xx.c
  head/sys/powerpc/ofw/ofw_cpu.c
  head/sys/powerpc/ofw/openpic_ofw.c
  head/sys/powerpc/powermac/cpcht.c
  head/sys/powerpc/powermac/grackle.c
  head/sys/powerpc/powermac/smu.c
  head/sys/powerpc/powermac/uninorth.c
  head/sys/powerpc/powermac/uninorthpci.c
  head/sys/powerpc/powerpc/nexus.c
  head/sys/powerpc/pseries/rtas_dev.c
  head/sys/powerpc/pseries/rtas_pci.c
  head/sys/powerpc/pseries/vdevice.c
  head/sys/powerpc/pseries/xics.c
  head/sys/powerpc/psim/iobus.c

Modified: head/sys/arm/arm/nexus.c
==
--- head/sys/arm/arm/nexus.cWed Feb  5 14:33:22 2014(r261512)
+++ head/sys/arm/arm/nexus.cWed Feb  5 14:44:22 2014(r261513)
@@ -63,11 +63,11 @@ __FBSDID("$FreeBSD$");
 #include "opt_platform.h"
 
 #ifdef FDT
-#include 
 #include 
 #include 
 #include "ofw_bus_if.h"
-#else
+#endif
+
 static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
 
 struct nexus_device {
@@ -84,7 +84,6 @@ staticint nexus_print_child(device_t, d
 static device_t nexus_add_child(device_t, u_int, const char *, int);
 static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
 u_long, u_long, u_long, u_int);
-#endif
 static int nexus_activate_resource(device_t, device_t, int, int,
 struct resource *);
 static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig,
@@ -102,7 +101,6 @@ static int nexus_ofw_map_intr(device_t d
 #endif
 
 static device_method_t nexus_methods[] = {
-#ifndef FDT
/* Device interface */
DEVMETHOD(device_probe, nexus_probe),
DEVMETHOD(device_attach,nexus_attach),
@@ -110,7 +108,6 @@ static device_method_t nexus_methods[] =
DEVMETHOD(bus_print_child,  nexus_print_child),
DEVMETHOD(bus_add_child,nexus_add_child),
DEVMETHOD(bus_alloc_resource,   nexus_alloc_resource),
-#endif
DEVMETHOD(bus_activate_resource,nexus_activate_resource),
DEVMETHOD(bus_config_intr,  nexus_config_intr),
DEVMETHOD(bus_deactivate_resource,  nexus_deactivate_resource),
@@ -123,19 +120,13 @@ static device_method_t nexus_methods[] =
 };
 
 static devclass_t nexus_devclass;
-#ifndef FDT
 static driver_t nexus_driver = {
"nexus",
nexus_methods,
1   /* no softc */
 };
-#else
-DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods,
-sizeof(struct ofw_nexus_softc), ofw_nexus_driver);
-#endif
 DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
 
-#ifndef FDT
 static int
 nexus_probe(device_t dev)
 {
@@ -235,7 +226,6 @@ nexus_alloc_resource(device_t bus, devic
 
return (rv);
 }
-#endif
 
 static int
 nexus_config_intr(device_t dev, int irq, enum intr_trigger trig,

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c  Wed Feb  5 14:33:22 2014
(r261512)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c  Wed Feb  5 14:44:22 2014
(r261513)
@@ -361,7 +361,7 @@ static driver_t bcm_fb_driver = {
sizeof(struct bcmsc_softc),
 };
 
-DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0);
+DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0);
 
 /*
  * Video driver routines and glue.

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Feb  5 14:33:22 2014
(r261512)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Feb  5 14:44:22 2014
(r261513)
@@ -315,4 +315,4 @@ static driver_t bcm_fb_driver = {
sizeof(struct bcmsc_softc),
 };
 
-DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_dev

svn commit: r261514 - head/usr.bin/nfsstat

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 14:44:59 2014
New Revision: 261514
URL: http://svnweb.freebsd.org/changeset/base/261514

Log:
  Use the DELTA() macro to tidy the server-side interval stats code a bit.
  
  MFC after:2 weeks

Modified:
  head/usr.bin/nfsstat/nfsstat.c

Modified: head/usr.bin/nfsstat/nfsstat.c
==
--- head/usr.bin/nfsstat/nfsstat.c  Wed Feb  5 14:44:22 2014
(r261513)
+++ head/usr.bin/nfsstat/nfsstat.c  Wed Feb  5 14:44:59 2014
(r261514)
@@ -1025,24 +1025,15 @@ exp_sidewaysintpr(u_int interval, int cl
if (serverOnly) {
printf("%s %6d %6d %6d %6d %6d %6d %6d %6d",
((clientOnly && serverOnly) ? "Server:" : ""),
-   nfsstats.srvrpccnt[NFSV4OP_GETATTR] -
-   lastst.srvrpccnt[NFSV4OP_GETATTR],
-   nfsstats.srvrpccnt[NFSV4OP_LOOKUP] -
-   lastst.srvrpccnt[NFSV4OP_LOOKUP],
-   nfsstats.srvrpccnt[NFSV4OP_READLINK] -
-   lastst.srvrpccnt[NFSV4OP_READLINK],
-   nfsstats.srvrpccnt[NFSV4OP_READ] -
-   lastst.srvrpccnt[NFSV4OP_READ],
-   nfsstats.srvrpccnt[NFSV4OP_WRITE] -
-   lastst.srvrpccnt[NFSV4OP_WRITE],
-   nfsstats.srvrpccnt[NFSV4OP_RENAME] -
-   lastst.srvrpccnt[NFSV4OP_RENAME],
-   nfsstats.srvrpccnt[NFSV4OP_ACCESS] -
-   lastst.srvrpccnt[NFSV4OP_ACCESS],
-   (nfsstats.srvrpccnt[NFSV4OP_READDIR] -
-lastst.srvrpccnt[NFSV4OP_READDIR]) +
-   (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] -
-lastst.srvrpccnt[NFSV4OP_READDIRPLUS]));
+   DELTA(srvrpccnt[NFSV4OP_GETATTR]),
+   DELTA(srvrpccnt[NFSV4OP_LOOKUP]),
+   DELTA(srvrpccnt[NFSV4OP_READLINK]),
+   DELTA(srvrpccnt[NFSV4OP_READ]),
+   DELTA(srvrpccnt[NFSV4OP_WRITE]),
+   DELTA(srvrpccnt[NFSV4OP_RENAME]),
+   DELTA(srvrpccnt[NFSV4OP_ACCESS]),
+   DELTA(srvrpccnt[NFSV4OP_READDIR]) +
+   DELTA(srvrpccnt[NFSV4OP_READDIRPLUS]));
printf("\n");
}
lastst = nfsstats;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261515 - head/sys/dev/isp

2014-02-05 Thread Alexander Motin
Author: mav
Date: Wed Feb  5 16:22:02 2014
New Revision: 261515
URL: http://svnweb.freebsd.org/changeset/base/261515

Log:
  Fix I/O freezes in some cases, caused by r257916.
  
  Delaying isp_reqodx update, we should be ready to update it every time
  we read it.  Otherwise requests using several indexes may be requeued
  ndefinitely without ever updating the variable.
  
  MFC after:3 days

Modified:
  head/sys/dev/isp/isp_library.c

Modified: head/sys/dev/isp/isp_library.c
==
--- head/sys/dev/isp/isp_library.c  Wed Feb  5 14:44:59 2014
(r261514)
+++ head/sys/dev/isp/isp_library.c  Wed Feb  5 16:22:02 2014
(r261515)
@@ -144,7 +144,9 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe,
while (seg < nsegs) {
nxtnxt = ISP_NXT_QENTRY(nxt, RQUEST_QUEUE_LEN(isp));
if (nxtnxt == isp->isp_reqodx) {
-   return (CMD_EAGAIN);
+   isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp);
+   if (nxtnxt == isp->isp_reqodx)
+   return (CMD_EAGAIN);
}
ISP_MEMZERO(storage, QENTRY_LEN);
qe1 = ISP_QUEUE_ENTRY(isp->isp_rquest, nxt);
@@ -2210,7 +2212,9 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void *
while (seg < nsegs) {
nxtnxt = ISP_NXT_QENTRY(nxt, RQUEST_QUEUE_LEN(isp));
if (nxtnxt == isp->isp_reqodx) {
-   return (CMD_EAGAIN);
+   isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp);
+   if (nxtnxt == isp->isp_reqodx)
+   return (CMD_EAGAIN);
}
ISP_MEMZERO(storage, QENTRY_LEN);
qe1 = ISP_QUEUE_ENTRY(isp->isp_rquest, nxt);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261516 - head/sys/boot/fdt/dts

2014-02-05 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Feb  5 17:08:55 2014
New Revision: 261516
URL: http://svnweb.freebsd.org/changeset/base/261516

Log:
  Add the missing ')' at end of sentence.  Reword it to use a more common
  idiom.
  
  Reviewed by:  imp (on freebsd-embedded@)
  Approved by:  adrian (mentor, implicit)

Modified:
  head/sys/boot/fdt/dts/bindings-gpio.txt

Modified: head/sys/boot/fdt/dts/bindings-gpio.txt
==
--- head/sys/boot/fdt/dts/bindings-gpio.txt Wed Feb  5 16:22:02 2014
(r261515)
+++ head/sys/boot/fdt/dts/bindings-gpio.txt Wed Feb  5 17:08:55 2014
(r261516)
@@ -82,7 +82,7 @@ dir:
 
 flags:
0x  IN_NONE
-   0x0001  IN_POL_LOW  Polarity low (inverted input value.
+   0x0001  IN_POL_LOW  Polarity low (active-low).
0x0002  IN_IRQ_EDGE Interrupt, edge triggered.
0x0004  IN_IRQ_LEVELInterrupt, level triggered.

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


svn commit: r261517 - head/sys/boot/i386/pxeldr

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 17:22:54 2014
New Revision: 261517
URL: http://svnweb.freebsd.org/changeset/base/261517

Log:
  Similar to r130943 for cdboot.S, update the license on this file to a
  stock 2-clause BSD license.
  
  MFC after:1 week

Modified:
  head/sys/boot/i386/pxeldr/pxeldr.S

Modified: head/sys/boot/i386/pxeldr/pxeldr.S
==
--- head/sys/boot/i386/pxeldr/pxeldr.S  Wed Feb  5 17:08:55 2014
(r261516)
+++ head/sys/boot/i386/pxeldr/pxeldr.S  Wed Feb  5 17:22:54 2014
(r261517)
@@ -2,15 +2,26 @@
  * Copyright (c) 2000 John Baldwin
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are freely
- * permitted provided that the above copyright notice and this
- * paragraph and the following disclaimer are duplicated in all
- * such forms.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
  *
- * This software is provided "AS IS" and without any express or
- * implied warranties, including, without limitation, the implied
- * warranties of merchantability and fitness for a particular
- * purpose.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  *
  * $FreeBSD$
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261518 - head/share/man/man3

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 17:41:00 2014
New Revision: 261518
URL: http://svnweb.freebsd.org/changeset/base/261518

Log:
  - Update a few places to account for va_copy().
  - Create a separate 'return values' section and move some statements about
return values to that section.
  - Note that each invocation of va_start() and va_copy() must be paired with
va_end() in the same function.
  
  MFC after:1 week

Modified:
  head/share/man/man3/stdarg.3

Modified: head/share/man/man3/stdarg.3
==
--- head/share/man/man3/stdarg.3Wed Feb  5 17:22:54 2014
(r261517)
+++ head/share/man/man3/stdarg.3Wed Feb  5 17:41:00 2014
(r261518)
@@ -59,7 +59,7 @@ The include file
 .In stdarg.h
 declares a type
 .Pq Em va_list
-and defines three macros for stepping
+and defines four macros for stepping
 through a list of arguments whose number and types are not known to
 the called function.
 .Pp
@@ -77,7 +77,8 @@ The
 macro initializes
 .Fa ap
 for subsequent use by
-.Fn va_arg
+.Fn va_arg ,
+.Fn va_copy ,
 and
 .Fn va_end ,
 and must be called first.
@@ -93,10 +94,6 @@ macro, it should not be declared as a re
 function or an array type.
 .Pp
 The
-.Fn va_start
-macro returns no value.
-.Pp
-The
 .Fn va_arg
 macro expands to an expression that has the type and value of the next
 argument in the call.
@@ -105,7 +102,9 @@ The parameter
 is the
 .Em va_list Fa ap
 initialized by
-.Fn va_start .
+.Fn va_start
+or
+.Fn va_copy .
 Each call to
 .Fn va_arg
 modifies
@@ -152,18 +151,28 @@ the same number of times as called with
 .Fa src .
 .Pp
 The
-.Fn va_copy
-macro returns no value.
+.Fn va_end
+macro cleans up any state associated with the variable argument list
+.Fa ap .
 .Pp
-The
+Each invocation of
+.Fn va_start
+or
+.Fn va_copy
+must be paired with a corresponding invocation of
 .Fn va_end
-macro handles a normal return from the function whose variable argument
-list was initialized by
-.Fn va_start .
+in the same function.
+.Sh RETURN VALUES
+The
+.Fn va_arg
+macro returns the value of the next argument.
 .Pp
 The
+.Fn va_start ,
+.Fn va_copy ,
+and
 .Fn va_end
-macro returns no value.
+macros return no value.
 .Sh EXAMPLES
 The function
 .Em foo
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261520 - in head: sbin/hastd sys/boot/i386/cdboot sys/dev/pci sys/kern sys/sys sys/x86/acpica sys/x86/include sys/x86/isa sys/x86/x86

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 18:13:27 2014
New Revision: 261520
URL: http://svnweb.freebsd.org/changeset/base/261520

Log:
  Drop the 3rd clause from all 3 clause BSD licenses where I am the sole
  holder to convert them to 2 clause BSD licenses.
  
  MFC after:1 week

Modified:
  head/sbin/hastd/refcnt.h
  head/sys/boot/i386/cdboot/cdboot.S
  head/sys/dev/pci/vga_pci.c
  head/sys/kern/kern_ktr.c
  head/sys/kern/kern_rwlock.c
  head/sys/kern/subr_lock.c
  head/sys/kern/subr_sleepqueue.c
  head/sys/kern/subr_smp.c
  head/sys/sys/_rwlock.h
  head/sys/sys/refcount.h
  head/sys/sys/rwlock.h
  head/sys/sys/sleepqueue.h
  head/sys/sys/turnstile.h
  head/sys/x86/acpica/madt.c
  head/sys/x86/include/apicvar.h
  head/sys/x86/isa/atpic.c
  head/sys/x86/isa/elcr.c
  head/sys/x86/x86/intr_machdep.c
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/mptable_pci.c

Modified: head/sbin/hastd/refcnt.h
==
--- head/sbin/hastd/refcnt.hWed Feb  5 18:11:46 2014(r261519)
+++ head/sbin/hastd/refcnt.hWed Feb  5 18:13:27 2014(r261520)
@@ -10,9 +10,6 @@
  * 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. Neither the name of the author nor the names of any co-contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

Modified: head/sys/boot/i386/cdboot/cdboot.S
==
--- head/sys/boot/i386/cdboot/cdboot.S  Wed Feb  5 18:11:46 2014
(r261519)
+++ head/sys/boot/i386/cdboot/cdboot.S  Wed Feb  5 18:13:27 2014
(r261520)
@@ -10,9 +10,6 @@
 # 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. Neither the name of the author nor the names of any co-contributors
-#may be used to endorse or promote products derived from this software
-#without specific prior written permission.
 #
 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

Modified: head/sys/dev/pci/vga_pci.c
==
--- head/sys/dev/pci/vga_pci.c  Wed Feb  5 18:11:46 2014(r261519)
+++ head/sys/dev/pci/vga_pci.c  Wed Feb  5 18:13:27 2014(r261520)
@@ -10,9 +10,6 @@
  * 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. Neither the name of the author nor the names of any co-contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

Modified: head/sys/kern/kern_ktr.c
==
--- head/sys/kern/kern_ktr.cWed Feb  5 18:11:46 2014(r261519)
+++ head/sys/kern/kern_ktr.cWed Feb  5 18:13:27 2014(r261520)
@@ -10,9 +10,6 @@
  * 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. Neither the name of the author nor the names of any co-contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

Modified: head/sys/kern/kern_rwlock.c
==
--- head/sys/kern/kern_rwlock.c Wed Feb  5 18:11:46 2014(r261519)
+++ head/sys/kern/kern_rwlock.c Wed Feb  5 18:13:27 2014(r261520)
@@ -10,9 +10,6 @@
  * 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. Neither the name of the author nor the names of any co-contributors
- *may be used to endorse or promote products derived from this software
- *without

svn commit: r261519 - head/sys/x86/x86

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 18:11:46 2014
New Revision: 261519
URL: http://svnweb.freebsd.org/changeset/base/261519

Log:
  Move a warning about LINT pins configured with a level trigger under
  bootverbose.

Modified:
  head/sys/x86/x86/local_apic.c

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Wed Feb  5 17:41:00 2014
(r261518)
+++ head/sys/x86/x86/local_apic.c   Wed Feb  5 18:11:46 2014
(r261519)
@@ -199,7 +199,7 @@ lvt_mode(struct lapic *la, u_int pin, ui
case APIC_LVT_DM_SMI:
case APIC_LVT_DM_INIT:
case APIC_LVT_DM_EXTINT:
-   if (!lvt->lvt_edgetrigger) {
+   if (!lvt->lvt_edgetrigger && bootverbose) {
printf("lapic%u: Forcing LINT%u to edge trigger\n",
la->la_id, pin);
value |= APIC_LVT_TM;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261521 - head/tools/build/mk

2014-02-05 Thread Antoine Brodin
Author: antoine
Date: Wed Feb  5 18:16:18 2014
New Revision: 261521
URL: http://svnweb.freebsd.org/changeset/base/261521

Log:
  Add files to remove WITHOUT_NIS
  
  PR:   186412

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Wed Feb  5 18:13:27 
2014(r261520)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Wed Feb  5 18:16:18 
2014(r261521)
@@ -3321,9 +3321,60 @@ OLD_FILES+=usr/bin/nc
 OLD_FILES+=usr/share/man/man1/nc.1.gz
 .endif
 
-#.if ${MK_NIS} == no
-# to be filled in
-#.endif
+.if ${MK_NIS} == no
+OLD_FILES+=usr/bin/ypcat
+OLD_FILES+=usr/bin/ypchfn
+OLD_FILES+=usr/bin/ypchpass
+OLD_FILES+=usr/bin/ypchsh
+OLD_FILES+=usr/bin/ypmatch
+OLD_FILES+=usr/bin/yppasswd
+OLD_FILES+=usr/bin/ypwhich
+OLD_FILES+=usr/include/ypclnt.h
+OLD_FILES+=usr/lib/libypclnt.a
+OLD_FILES+=usr/lib/libypclnt.so
+OLD_LIBS+=usr/lib/libypclnt.so.4
+OLD_FILES+=usr/lib/libypclnt_p.a
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
+OLD_FILES+=usr/lib32/libypclnt.a
+OLD_FILES+=usr/lib32/libypclnt.so
+OLD_LIBS+=usr/lib32/libypclnt.so.4
+OLD_FILES+=usr/lib32/libypclnt_p.a
+.endif
+OLD_FILES+=usr/libexec/mknetid
+OLD_FILES+=usr/libexec/yppwupdate
+OLD_FILES+=usr/libexec/ypxfr
+OLD_FILES+=usr/sbin/rpc.yppasswdd
+OLD_FILES+=usr/sbin/rpc.ypupdated
+OLD_FILES+=usr/sbin/rpc.ypxfrd
+OLD_FILES+=usr/sbin/yp_mkdb
+OLD_FILES+=usr/sbin/ypbind
+OLD_FILES+=usr/sbin/ypinit
+OLD_FILES+=usr/sbin/yppoll
+OLD_FILES+=usr/sbin/yppush
+OLD_FILES+=usr/sbin/ypserv
+OLD_FILES+=usr/sbin/ypset
+OLD_FILES+=usr/share/man/man1/ypcat.1.gz
+OLD_FILES+=usr/share/man/man1/ypchfn.1.gz
+OLD_FILES+=usr/share/man/man1/ypchpass.1.gz
+OLD_FILES+=usr/share/man/man1/ypchsh.1.gz
+OLD_FILES+=usr/share/man/man1/ypmatch.1.gz
+OLD_FILES+=usr/share/man/man1/yppasswd.1.gz
+OLD_FILES+=usr/share/man/man1/ypwhich.1.gz
+OLD_FILES+=usr/share/man/man5/netid.5.gz
+OLD_FILES+=usr/share/man/man8/mknetid.8.gz
+OLD_FILES+=usr/share/man/man8/rpc.yppasswdd.8.gz
+OLD_FILES+=usr/share/man/man8/rpc.ypxfrd.8.gz
+OLD_FILES+=usr/share/man/man8/yp_mkdb.8.gz
+OLD_FILES+=usr/share/man/man8/ypbind.8.gz
+OLD_FILES+=usr/share/man/man8/ypinit.8.gz
+OLD_FILES+=usr/share/man/man8/yppoll.8.gz
+OLD_FILES+=usr/share/man/man8/yppush.8.gz
+OLD_FILES+=usr/share/man/man8/ypserv.8.gz
+OLD_FILES+=usr/share/man/man8/ypset.8.gz
+OLD_FILES+=usr/share/man/man8/ypxfr.8.gz
+OLD_FILES+=var/yp/Makefile
+OLD_FILES+=var/yp/Makefile.dist
+.endif
 
 #.if ${MK_NLS} == no
 # to be filled in
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261522 - head/sys/boot/i386/gptboot

2014-02-05 Thread Warren Block
Author: wblock (doc committer)
Date: Wed Feb  5 18:26:30 2014
New Revision: 261522
URL: http://svnweb.freebsd.org/changeset/base/261522

Log:
  Describe the use of a freebsd-boot GPT partition, brought up by Scot
  Hetzel  on the -doc mailing list.
  
  Also modify the Author section to be clear that I wrote the man page,
  not gptboot.
  
  MFC after:3 days

Modified:
  head/sys/boot/i386/gptboot/gptboot.8

Modified: head/sys/boot/i386/gptboot/gptboot.8
==
--- head/sys/boot/i386/gptboot/gptboot.8Wed Feb  5 18:16:18 2014
(r261521)
+++ head/sys/boot/i386/gptboot/gptboot.8Wed Feb  5 18:26:30 2014
(r261522)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 3, 2013
+.Dd February 5, 2014
 .Dt GPTBOOT 8
 .Os
 .Sh NAME
@@ -190,12 +190,18 @@ parameters for the boot blocks
 .El
 .Sh EXAMPLES
 .Nm
-is typically installed in combination with a
+is installed in a
+.Cm freebsd-boot
+partition, usually the first partition on the disk.
+A
 .Dq protective MBR
 .Po
 see
 .Xr gpart 8
-.Pc .
+.Pc
+is typically installed in combination with
+.Nm .
+.Pp
 Install
 .Nm
 on the
@@ -235,4 +241,5 @@ gpart set -a bootonce -i 2 ada0
 .Nm
 appeared in FreeBSD 7.1.
 .Sh AUTHORS
-Warren Block 
+.An
+This manual page written by Warren Block .
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261523 - head/sys/dev/pci

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 19:23:05 2014
New Revision: 261523
URL: http://svnweb.freebsd.org/changeset/base/261523

Log:
  Fix a typo.

Modified:
  head/sys/dev/pci/pci_subr.c

Modified: head/sys/dev/pci/pci_subr.c
==
--- head/sys/dev/pci/pci_subr.c Wed Feb  5 18:26:30 2014(r261522)
+++ head/sys/dev/pci/pci_subr.c Wed Feb  5 19:23:05 2014(r261523)
@@ -151,7 +151,7 @@ pcib_child_name(device_t child)
 /*
  * Some Host-PCI bridge drivers know which resource ranges they can
  * decode and should only allocate subranges to child PCI devices.
- * This API provides a way to manage this.  The bridge drive should
+ * This API provides a way to manage this.  The bridge driver should
  * initialize this structure during attach and call
  * pcib_host_res_decodes() on each resource range it decodes.  It can
  * then use pcib_host_res_alloc() and pcib_host_res_adjust() as helper
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261524 - head/sys/dev/pci

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 19:24:16 2014
New Revision: 261524
URL: http://svnweb.freebsd.org/changeset/base/261524

Log:
  Properly set the alignment flags when allocating the initial range for a
  BAR.  This only really matters when pci_do_realloc_bars is enabled and
  the initial allocation of a specific range fails.
  
  MFC after:1 week

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

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Feb  5 19:23:05 2014(r261523)
+++ head/sys/dev/pci/pci.c  Wed Feb  5 19:24:16 2014(r261524)
@@ -2742,7 +2742,7 @@ pci_add_map(device_t bus, device_t dev, 
struct pci_map *pm;
pci_addr_t base, map, testval;
pci_addr_t start, end, count;
-   int barlen, basezero, maprange, mapsize, type;
+   int barlen, basezero, flags, maprange, mapsize, type;
uint16_t cmd;
struct resource *res;
 
@@ -2848,6 +2848,9 @@ pci_add_map(device_t bus, device_t dev, 
}
 
count = (pci_addr_t)1 << mapsize;
+   flags = RF_ALIGNMENT_LOG2(mapsize);
+   if (prefetch)
+   flags |= RF_PREFETCHABLE;
if (basezero || base == pci_mapbase(testval)) {
start = 0;  /* Let the parent decide. */
end = ~0ul;
@@ -2864,7 +2867,7 @@ pci_add_map(device_t bus, device_t dev, 
 * pci_alloc_resource().
 */
res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count,
-   prefetch ? RF_PREFETCHABLE : 0);
+   flags);
if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) {
/*
 * If the allocation fails, try to allocate a resource for
@@ -2875,7 +2878,7 @@ pci_add_map(device_t bus, device_t dev, 
resource_list_delete(rl, type, reg);
resource_list_add(rl, type, reg, 0, ~0ul, count);
res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul,
-   count, prefetch ? RF_PREFETCHABLE : 0);
+   count, flags);
}
if (res == NULL) {
/*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r261511 - head/usr.sbin/pwd_mkdb

2014-02-05 Thread John Baldwin
On Wednesday, February 05, 2014 09:28:02 AM Dag-Erling SmXXrgrav wrote:
> Author: des
> Date: Wed Feb  5 09:28:02 2014
> New Revision: 261511
> URL: http://svnweb.freebsd.org/changeset/base/261511
> 
> Log:
>   Add an example of the most common use case.
> 
>   MFC after:  1 week

I've always used -p to update /etc/passwd as well.

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


Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail

2014-02-05 Thread John Baldwin
On Monday, February 03, 2014 03:53:36 PM Doug Ambrisko wrote:
> On Fri, Jan 31, 2014 at 06:28:27PM -0700, James Gritton wrote:
> | On 1/31/2014 2:30 PM, Alexander Leidinger wrote:
> | > On Fri, 31 Jan 2014 12:34:48 + (GMT)
> | > 
> | > Robert Watson  wrote:
> | >> On Wed, 29 Jan 2014, Alexander Leidinger wrote:
> |  It does.  I included a warning in jail.8 that this will pretty
> |  much undo jail security.  There are still reasons some may want to
> |  do this, but it's definitely not for everyone or even most people.
> | >>> 
> | >>> It only "unjails" (= basically the same security level as the
> | >>> jail-host with the added benefit of the flexibility of a jail like
> | >>> easy moving from one system to another) the jail which has this
> | >>> flag set. All other jails without the flag can not "escape" to the
> | >>> host.
> | >>> 
> | >>> I also have to add that just setting this flag does not give access
> | >>> to the host, you also have to configure a non-default devfs rule
> | >>> for this jail (to have the devices appear in the jail).
> | >> 
> | >> This is not correct: devices do not need to be delegated in devfs for
> | >> PRIV_IO to allow bypass of the Jail security model, due to sysarch()
> | >> and the Linux-emulated equivalent, which turn out direct I/O access
> | >> from a user process without use of a device node.
> | > 
> | > Ok, then it is just the non-default flag, not the additional devfs part.
> | > 
> | > I agree with your other post that we are better of to document better
> | > what it means if an admin allows kmem access for a specific jail.
> | 
> | I second the documentation route.  Yes, it's true that this option
> | makes a totally insecure jail - at least one lacking the expected jail
> | security additions.  But I think that while security is one of the
> | primary purposes of jails, it's not the only purpose.  It should be
> | possible to have a trusted "master jail" that still takes advantage of
> | the encapsulation while allowing otherwise unsupported features such
> | as a desktop.
> | 
> | The distinction of whether certain devices are required to break out
> | of a jail with allow.kmem is something of a red herring - the fact is
> | that anyone who wants this level of access is going to have the
> | devices in place anyway.
> | 
> | I suppose "obviate" wasn't the best word for the situation.  Maybe
> | something that starts with "WARNING: ..." is in order.
> 
> It's unfortunate that vimage requires jail.  I want to use vimage but
> not have the security restrictions of a jail.  To do this I patched
> jail to basically let everything through.  It would be nice to be
> able to run jail in an insecure mode which I understand is a contradition.
> I do use the jail infrastructure to set the uname*/getosreldate so
> that a specific jail thinks it is FreeBSD version blah.  Then I can ssh
> into that jail and pkg_add things, make ports etc.  I use this on
> my laptop running current on the base.  My other jails run various
> versions of FreeBSD.  I don't care about security in this case.

There are certainly use cases for a "job" (imagine in a compute cluster). 
Jails have some nice properties in that you can wait6/waitid for a jail, you 
can forcefully kill an entire jail, and you can apply resource limits to a 
jail collectively.

I think having a "kmem" flag for jails is a hack and not the right approach.  
It does make a jail useless security-wise, but by masquerading as a flag, it 
implies that it is only partially violating security which gives a false sense 
of security.

A short term solution that would permit non-security jails without having to 
do the longer term work that Robert would like might be to add a new per-jail 
flag that in effect means "no security at all".  You would then modify one 
place (prison_priv_check() in kern_jail.c) to treat a jail with this flag set 
as if it wasn't jailed at all.  This would clearly communicate to a user what 
they were doing by enabling this flag (jail --root-me-please), and it would 
also avoid future proliferation of new flags to add more optional and obscure 
holes in jails.

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


Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail

2014-02-05 Thread Doug Ambrisko
On Wed, Feb 05, 2014 at 02:05:29PM -0500, John Baldwin wrote:
| On Monday, February 03, 2014 03:53:36 PM Doug Ambrisko wrote:
| > On Fri, Jan 31, 2014 at 06:28:27PM -0700, James Gritton wrote:
| > | On 1/31/2014 2:30 PM, Alexander Leidinger wrote:
| > | > On Fri, 31 Jan 2014 12:34:48 + (GMT)
| > | > 
| > | > Robert Watson  wrote:
| > | >> On Wed, 29 Jan 2014, Alexander Leidinger wrote:
| > |  It does.  I included a warning in jail.8 that this will pretty
| > |  much undo jail security.  There are still reasons some may want to
| > |  do this, but it's definitely not for everyone or even most people.
| > | >>> 
| > | >>> It only "unjails" (= basically the same security level as the
| > | >>> jail-host with the added benefit of the flexibility of a jail like
| > | >>> easy moving from one system to another) the jail which has this
| > | >>> flag set. All other jails without the flag can not "escape" to the
| > | >>> host.
| > | >>> 
| > | >>> I also have to add that just setting this flag does not give access
| > | >>> to the host, you also have to configure a non-default devfs rule
| > | >>> for this jail (to have the devices appear in the jail).
| > | >> 
| > | >> This is not correct: devices do not need to be delegated in devfs for
| > | >> PRIV_IO to allow bypass of the Jail security model, due to sysarch()
| > | >> and the Linux-emulated equivalent, which turn out direct I/O access
| > | >> from a user process without use of a device node.
| > | > 
| > | > Ok, then it is just the non-default flag, not the additional devfs part.
| > | > 
| > | > I agree with your other post that we are better of to document better
| > | > what it means if an admin allows kmem access for a specific jail.
| > | 
| > | I second the documentation route.  Yes, it's true that this option
| > | makes a totally insecure jail - at least one lacking the expected jail
| > | security additions.  But I think that while security is one of the
| > | primary purposes of jails, it's not the only purpose.  It should be
| > | possible to have a trusted "master jail" that still takes advantage of
| > | the encapsulation while allowing otherwise unsupported features such
| > | as a desktop.
| > | 
| > | The distinction of whether certain devices are required to break out
| > | of a jail with allow.kmem is something of a red herring - the fact is
| > | that anyone who wants this level of access is going to have the
| > | devices in place anyway.
| > | 
| > | I suppose "obviate" wasn't the best word for the situation.  Maybe
| > | something that starts with "WARNING: ..." is in order.
| > 
| > It's unfortunate that vimage requires jail.  I want to use vimage but
| > not have the security restrictions of a jail.  To do this I patched
| > jail to basically let everything through.  It would be nice to be
| > able to run jail in an insecure mode which I understand is a contradition.
| > I do use the jail infrastructure to set the uname*/getosreldate so
| > that a specific jail thinks it is FreeBSD version blah.  Then I can ssh
| > into that jail and pkg_add things, make ports etc.  I use this on
| > my laptop running current on the base.  My other jails run various
| > versions of FreeBSD.  I don't care about security in this case.
| 
| There are certainly use cases for a "job" (imagine in a compute cluster). 
| Jails have some nice properties in that you can wait6/waitid for a jail, you 
| can forcefully kill an entire jail, and you can apply resource limits to a 
| jail collectively.
| 
| I think having a "kmem" flag for jails is a hack and not the right approach.  
| It does make a jail useless security-wise, but by masquerading as a flag, it 
| implies that it is only partially violating security which gives a false 
sense 
| of security.
| 
| A short term solution that would permit non-security jails without having to 
| do the longer term work that Robert would like might be to add a new per-jail 
| flag that in effect means "no security at all".  You would then modify one 
| place (prison_priv_check() in kern_jail.c) to treat a jail with this flag set 
| as if it wasn't jailed at all.  This would clearly communicate to a user what 
| they were doing by enabling this flag (jail --root-me-please), and it would 
| also avoid future proliferation of new flags to add more optional and obscure 
| holes in jails.

That is what my local patch/hack does, first line of prison_priv_check is
just to return 0.  So no security which is fine for what I use it for.
As mentioned the jail infrastructure does have some nice features even with
security turned off.

Thanks,

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


Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail

2014-02-05 Thread Robert N. M. Watson

On 5 Feb 2014, at 19:05, John Baldwin  wrote:

> A short term solution that would permit non-security jails without having to 
> do the longer term work that Robert would like might be to add a new per-jail 
> flag that in effect means "no security at all".  You would then modify one 
> place (prison_priv_check() in kern_jail.c) to treat a jail with this flag set 
> as if it wasn't jailed at all.  This would clearly communicate to a user what 
> they were doing by enabling this flag (jail --root-me-please), and it would 
> also avoid future proliferation of new flags to add more optional and obscure 
> holes in jails.

One path to this goal would be to better differentiate the idea of a 'jail' 
from a more generic notion of a 'container'. I'm a bit loath to use the latter 
term due to conflicts with the Linux convention which uses 'container' to refer 
to something more like our 'jail', but in many ways it would be useful. You 
could imagine having two variations on the jail(8) command: today's jail(8) 
with security properties, and a new container(8) from the same man page, but 
with only virtualisation, not security properties.

In general, there are two objections being raised here, which I think you 
capture well: (1) an architectural concern about appropriate implementation and 
its implications, and (2) appropriate presentation/documentation for the user 
to prevent the significant surprise they will get when they turn on an option 
without understanding its implications.

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


svn commit: r261525 - head/usr.bin/netstat

2014-02-05 Thread Bjoern A. Zeeb
Author: bz
Date: Wed Feb  5 20:43:03 2014
New Revision: 261525
URL: http://svnweb.freebsd.org/changeset/base/261525

Log:
  Print the MD5 signature information introduced in r221023 in the
  TCP statistics output.
  
  MFC after:3 weeks

Modified:
  head/usr.bin/netstat/inet.c

Modified: head/usr.bin/netstat/inet.c
==
--- head/usr.bin/netstat/inet.c Wed Feb  5 19:24:16 2014(r261524)
+++ head/usr.bin/netstat/inet.c Wed Feb  5 20:43:03 2014(r261525)
@@ -723,6 +723,17 @@ tcp_stats(u_long off, const char *name, 
p(tcps_ecn_ect1, "\t%ju packet%s with ECN ECT(1) bit set\n");
p(tcps_ecn_shs, "\t%ju successful ECN handshake%s\n");
p(tcps_ecn_rcwnd, "\t%ju time%s ECN reduced the congestion window\n");
+
+   p(tcps_sig_rcvgoodsig,
+"\t%ju packet%s with valid tcp-md5 signature received\n");
+   p(tcps_sig_rcvbadsig,
+"\t%ju packet%s with invalid tcp-md5 signature received\n");
+   p(tcps_sig_err_buildsig,
+"\t%ju packet%s with tcp-md5 signature mismatch\n");
+   p(tcps_sig_err_sigopt,
+"\t%ju packet%s with unexpected tcp-md5 signature received\n");
+   p(tcps_sig_err_nosigopt,
+"\t%ju packet%s without expected tcp-md5 signature received\n");
 #undef p
 #undef p1a
 #undef p2
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261526 - head/sys/dev/pci

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 20:47:49 2014
New Revision: 261526
URL: http://svnweb.freebsd.org/changeset/base/261526

Log:
  Simplify pci_reserve_map() by calling resource_list_reserve() to allocate
  the resource after creating a resource list entry rather than reimplementing
  it by hand.
  
  MFC after:1 week

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

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Feb  5 20:43:03 2014(r261525)
+++ head/sys/dev/pci/pci.c  Wed Feb  5 20:47:49 2014(r261526)
@@ -4177,7 +4177,6 @@ pci_reserve_map(device_t dev, device_t c
 {
struct pci_devinfo *dinfo = device_get_ivars(child);
struct resource_list *rl = &dinfo->resources;
-   struct resource_list_entry *rle;
struct resource *res;
struct pci_map *pm;
pci_addr_t map, testval;
@@ -4250,23 +4249,16 @@ pci_reserve_map(device_t dev, device_t c
 * Allocate enough resource, and then write back the
 * appropriate BAR for that resource.
 */
-   res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid,
-   start, end, count, flags & ~RF_ACTIVE);
+   resource_list_add(rl, type, *rid, start, end, count);
+   res = resource_list_reserve(rl, dev, child, type, rid, start, end,
+   count, flags & ~RF_ACTIVE);
if (res == NULL) {
+   resource_list_delete(rl, type, *rid);
device_printf(child,
"%#lx bytes of rid %#x res %d failed (%#lx, %#lx).\n",
count, *rid, type, start, end);
goto out;
}
-   resource_list_add(rl, type, *rid, start, end, count);
-   rle = resource_list_find(rl, type, *rid);
-   if (rle == NULL)
-   panic("pci_reserve_map: unexpectedly can't find resource.");
-   rle->res = res;
-   rle->start = rman_get_start(res);
-   rle->end = rman_get_end(res);
-   rle->count = count;
-   rle->flags = RLE_RESERVED;
if (bootverbose)
device_printf(child,
"Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261527 - head/sys/dev/pci

2014-02-05 Thread John Baldwin
Author: jhb
Date: Wed Feb  5 20:52:12 2014
New Revision: 261527
URL: http://svnweb.freebsd.org/changeset/base/261527

Log:
  Add two tunables to ignore certain firmware-assigned resources.  These
  are mostly useful for debugging.
  - hw.pci.clear_bars ignores all firmware-assigned ranges for BARs when
set.
  - hw.pci.clear_pcib ignores all firmware-assigned ranges for PCI-PCI
bridge I/O windows when set.
  
  MFC after:1 week

Modified:
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Feb  5 20:47:49 2014(r261526)
+++ head/sys/dev/pci/pci.c  Wed Feb  5 20:52:12 2014(r261527)
@@ -332,6 +332,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_
 Disable this if you depend on BIOS emulation of USB devices, that is\n\
 you use USB devices (like keyboard or mouse) but do not load USB drivers");
 
+static int pci_clear_bars;
+TUNABLE_INT("hw.pci.clear_bars", &pci_clear_bars);
+SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0,
+"Ignore firmware-assigned resources for BARs.");
+
 static int
 pci_has_quirk(uint32_t devid, int quirk)
 {
@@ -2851,7 +2856,7 @@ pci_add_map(device_t bus, device_t dev, 
flags = RF_ALIGNMENT_LOG2(mapsize);
if (prefetch)
flags |= RF_PREFETCHABLE;
-   if (basezero || base == pci_mapbase(testval)) {
+   if (basezero || base == pci_mapbase(testval) || pci_clear_bars) {
start = 0;  /* Let the parent decide. */
end = ~0ul;
} else {

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Wed Feb  5 20:47:49 2014(r261526)
+++ head/sys/dev/pci/pci_pci.c  Wed Feb  5 20:52:12 2014(r261527)
@@ -103,6 +103,12 @@ DEFINE_CLASS_0(pcib, pcib_driver, pcib_m
 DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL);
 
 #ifdef NEW_PCIB
+SYSCTL_DECL(_hw_pci);
+
+static int pci_clear_pcib;
+TUNABLE_INT("hw.pci.clear_pcib", &pci_clear_pcib);
+SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0,
+"Clear firmware-assigned resources for PCI-PCI bridge I/O windows.");
 
 /*
  * Is a resource from a child device sub-allocated from one of our
@@ -416,6 +422,19 @@ pcib_probe_windows(struct pcib_softc *sc
 
dev = sc->dev;
 
+   if (pci_clear_pcib) {
+   pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1);
+   pci_write_config(dev, PCIR_IOBASEH_1, 0x, 2);
+   pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1);
+   pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2);
+   pci_write_config(dev, PCIR_MEMBASE_1, 0x, 2);
+   pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2);
+   pci_write_config(dev, PCIR_PMBASEL_1, 0x, 2);
+   pci_write_config(dev, PCIR_PMBASEH_1, 0x, 4);
+   pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2);
+   pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4);
+   }
+
/* Determine if the I/O port window is implemented. */
val = pci_read_config(dev, PCIR_IOBASEL_1, 1);
if (val == 0) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261528 - head/sys/dev/ed

2014-02-05 Thread Marius Strobl
Author: marius
Date: Wed Feb  5 22:21:08 2014
New Revision: 261528
URL: http://svnweb.freebsd.org/changeset/base/261528

Log:
  Add bus space barriers for page switches missed in r260050.

Modified:
  head/sys/dev/ed/if_ed.c
  head/sys/dev/ed/if_ed_hpp.c

Modified: head/sys/dev/ed/if_ed.c
==
--- head/sys/dev/ed/if_ed.c Wed Feb  5 20:52:12 2014(r261527)
+++ head/sys/dev/ed/if_ed.c Wed Feb  5 22:21:08 2014(r261528)
@@ -420,7 +420,11 @@ ed_stop_hw(struct ed_softc *sc)
/*
 * Stop everything on the interface, and select page 0 registers.
 */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
/*
 * Wait for interface to enter stopped state, but limit # of checks to
@@ -528,7 +532,11 @@ ed_init_locked(struct ed_softc *sc)
/*
 * Set interface for page 0, Remote DMA complete, Stopped
 */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
if (sc->isa16bit)
/*
@@ -649,7 +657,11 @@ ed_xmit(struct ed_softc *sc)
/*
 * Set NIC for page 0 register access
 */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
/*
 * Set TX buffer start page
@@ -666,7 +678,11 @@ ed_xmit(struct ed_softc *sc)
/*
 * Set page 0, Remote DMA complete, Transmit Packet, and *Start*
 */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_TXP | ED_CR_STA);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
sc->xmit_busy = 1;
 
/*
@@ -913,7 +929,11 @@ ed_rint(struct ed_softc *sc)
/*
 * Set NIC to page 0 registers to update boundry register
 */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_BNRY, boundry);
 
/*
@@ -947,7 +967,11 @@ edintr(void *arg)
/*
 * Set NIC to page 0 registers
 */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
/*
 * loop until there are no more new interrupts.  When the card goes
@@ -1165,7 +1189,11 @@ edintr(void *arg)
 * set in the transmit routine, is *okay* - it is 'edge'
 * triggered from low to high)
 */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
/*
 * If the Network Talley Counters overflow, read them to reset
@@ -1367,7 +1395,11 @@ ed_pio_readmem(struct ed_softc *sc, bus_
 {
/* Regular Novell cards */
/* select page 0 registers */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
/* round up to a word */
if (amount & 1)
@@ -1400,7 +1432,11 @@ ed_pio_writemem(struct ed_softc *sc, uin
int maxwait = 200;  /* about 240us */
 
/* select page 0 registers */
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA);
+   ed_nic_barrier(sc, ED_P0_CR, 1,
+   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
/* reset remote DMA complete flag */
ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC);
@@ -1457,7 +1493,11 @@ ed_pio_write_mbufs(struct 

svn commit: r261529 - head/sys/pci

2014-02-05 Thread Marius Strobl
Author: marius
Date: Wed Feb  5 22:27:49 2014
New Revision: 261529
URL: http://svnweb.freebsd.org/changeset/base/261529

Log:
  Try to make the style used here consistent.

Modified:
  head/sys/pci/if_rlreg.h

Modified: head/sys/pci/if_rlreg.h
==
--- head/sys/pci/if_rlreg.h Wed Feb  5 22:21:08 2014(r261528)
+++ head/sys/pci/if_rlreg.h Wed Feb  5 22:27:49 2014(r261529)
@@ -163,7 +163,6 @@
 #defineRL_LOOPTEST_ON_CPLUS0x0006
 
 /* Known revision codes. */
-
 #defineRL_HWREV_8169   0x
 #defineRL_HWREV_8169S  0x0080
 #defineRL_HWREV_8110S  0x0400
@@ -329,8 +328,8 @@
 #defineRL_RXSTAT_INDIV 0x4000
 #defineRL_RXSTAT_MULTI 0x8000
 #defineRL_RXSTAT_LENMASK   0x
+#defineRL_RXSTAT_UNFINISHED0xFFF0  /* DMA still in 
progress */
 
-#defineRL_RXSTAT_UNFINISHED0xFFF0  /* DMA still in 
progress */
 /*
  * Command register.
  */
@@ -361,6 +360,7 @@
 #defineRL_PARA7C   0x7C
 #defineRL_PARA7C_DEF   0xcb38de43
 #defineRL_PARA7C_RETUNE0xfb38de03
+
 /*
  * EEPROM control register
  */
@@ -473,11 +473,9 @@
  */
 
 /* RL_DUMPSTATS_LO register */
-
 #defineRL_DUMPSTATS_START  0x0008
 
 /* Transmit start register */
-
 #defineRL_TXSTART_SWI  0x01/* generate TX interrupt */
 #defineRL_TXSTART_START0x40/* start normal queue transmit 
*/
 #defineRL_TXSTART_HPRIO_START  0x80/* start hi prio queue transmit 
*/
@@ -496,7 +494,6 @@
 #defineRL_BUSWIDTH_64BITS  0x08
 
 /* C+ mode command register */
-
 #defineRL_CPLUSCMD_TXENB   0x0001  /* enable C+ transmit mode */
 #defineRL_CPLUSCMD_RXENB   0x0002  /* enable C+ receive mode */
 #defineRL_CPLUSCMD_PCI_MRW 0x0008  /* enable PCI multi-read/write 
*/
@@ -514,7 +511,6 @@
 #defineRL_CPLUSCMD_BIST_ENB0x8000  /* 8168C/CP */
 
 /* C+ early transmit threshold */
-
 #defineRL_EARLYTXTHRESH_CNT0x003F  /* byte count times 8 */
 
 /* Timer interrupt register */
@@ -528,7 +524,6 @@
 /*
  * Gigabit PHY access register (8169 only)
  */
-
 #defineRL_PHYAR_PHYDATA0x
 #defineRL_PHYAR_PHYREG 0x001F
 #defineRL_PHYAR_BUSY   0x8000
@@ -559,7 +554,6 @@
  * For reception, there's just one large buffer where the chip stores
  * all received packets.
  */
-
 #defineRL_RX_BUF_SZRL_RXBUF_64
 #defineRL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13))
 #defineRL_TX_LIST_CNT  4
@@ -642,11 +636,10 @@ struct rl_hwrev {
 
 /*
  * RX/TX descriptor definition. When large send mode is enabled, the
- * lower 11 bits of the TX rl_cmd word are used to hold the MSS, and
+ * lower 11 bits of the TX rl_cmdstat word are used to hold the MSS, and
  * the checksum offload bits are disabled. The structure layout is
  * the same for RX and TX descriptors
  */
-
 struct rl_desc {
uint32_trl_cmdstat;
uint32_trl_vlanctl;
@@ -679,7 +672,6 @@ struct rl_desc {
  * Error bits are valid only on the last descriptor of a frame
  * (i.e. RL_TDESC_CMD_EOF == 1)
  */
-
 #defineRL_TDESC_STAT_COLCNT0x000F  /* collision count */
 #defineRL_TDESC_STAT_EXCESSCOL 0x0010  /* excessive collisions 
*/
 #defineRL_TDESC_STAT_LINKFAIL  0x0020  /* link faulure */
@@ -691,7 +683,6 @@ struct rl_desc {
 /*
  * RX descriptor cmd/vlan definitions
  */
-
 #defineRL_RDESC_CMD_EOR0x4000
 #defineRL_RDESC_CMD_OWN0x8000
 #defineRL_RDESC_CMD_BUFLEN 0x1FFF
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261530 - head/lib/libstand

2014-02-05 Thread Ian Lepore
Author: ian
Date: Wed Feb  5 22:53:58 2014
New Revision: 261530
URL: http://svnweb.freebsd.org/changeset/base/261530

Log:
  Set the malloc alignment to 64 bytes on platforms that use the U-Boot API
  device drivers.  Recent versions of u-boot run with the MMU enabled, and
  require DMA-based I/O to be aligned to cache line boundaries.
  
  These changes are based on a patch originally submitted by Juergen Weiss,
  but I reworked them and thus any problems are purely my fault.
  
  Submitted by: "Juergen Weiss" 
  Reviewed by:  imp, nwhitehorn, jhb

Modified:
  head/lib/libstand/sbrk.c
  head/lib/libstand/zalloc.c
  head/lib/libstand/zalloc_defs.h
  head/lib/libstand/zalloc_mem.h

Modified: head/lib/libstand/sbrk.c
==
--- head/lib/libstand/sbrk.cWed Feb  5 22:27:49 2014(r261529)
+++ head/lib/libstand/sbrk.cWed Feb  5 22:53:58 2014(r261530)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include "stand.h"
+#include "zalloc_defs.h"
 
 static size_t  maxheap, heapsize = 0;
 static void*heapbase;
@@ -40,8 +41,9 @@ static void   *heapbase;
 void
 setheap(void *base, void *top)
 {
-/* Align start address to 16 bytes for the malloc code. Sigh. */
-heapbase = (void *)(((uintptr_t)base + 15) & ~15);
+/* Align start address for the malloc code.  Sigh. */
+heapbase = (void *)(((uintptr_t)base + MALLOCALIGN_MASK) & 
+~MALLOCALIGN_MASK);
 maxheap = (char *)top - (char *)heapbase;
 }
 

Modified: head/lib/libstand/zalloc.c
==
--- head/lib/libstand/zalloc.c  Wed Feb  5 22:27:49 2014(r261529)
+++ head/lib/libstand/zalloc.c  Wed Feb  5 22:53:58 2014(r261530)
@@ -71,6 +71,15 @@ __FBSDID("$FreeBSD$");
 #include "zalloc_defs.h"
 
 /*
+ * Objects in the pool must be aligned to at least the size of struct MemNode.
+ * They must also be aligned to MALLOCALIGN, which should normally be larger
+ * than the struct, so assert that to be so at compile time.
+ */
+typedef char assert_align[(sizeof(struct MemNode) <= MALLOCALIGN) ? 1 : -1];
+
+#defineMEMNODE_SIZE_MASK   MALLOCALIGN_MASK
+
+/*
  * znalloc() - allocate memory (without zeroing) from pool.  Call reclaim
  * and retry if appropriate, return NULL if unable to allocate
  * memory.

Modified: head/lib/libstand/zalloc_defs.h
==
--- head/lib/libstand/zalloc_defs.h Wed Feb  5 22:27:49 2014
(r261529)
+++ head/lib/libstand/zalloc_defs.h Wed Feb  5 22:53:58 2014
(r261530)
@@ -52,18 +52,26 @@
 #define BLKEXTENDMASK  (BLKEXTEND - 1)
 
 /*
- * required malloc alignment.  Just hardwire to 16.
+ * Required malloc alignment.
  *
- * Note: if we implement a more sophisticated realloc, we should ensure that
- * MALLOCALIGN is at least as large as MemNode.
+ * Embedded platforms using the u-boot API drivers require that all I/O buffers
+ * be on a cache line sized boundary.  The worst case size for that is 64 
bytes.
+ * For other platforms, 16 bytes works fine.  The alignment also must be at
+ * least sizeof(struct MemNode); this is asserted in zalloc.c.
  */
 
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
+#defineMALLOCALIGN 64
+#else
+#defineMALLOCALIGN 16
+#endif
+#defineMALLOCALIGN_MASK(MALLOCALIGN - 1)
+
 typedef struct Guard {
 size_t ga_Bytes;
 size_t ga_Magic;   /* must be at least 32 bits */
 } Guard;
 
-#define MALLOCALIGN16
 #define GAMAGIC0x55FF44FD
 #define GAFREE 0x5F54F4DF
 

Modified: head/lib/libstand/zalloc_mem.h
==
--- head/lib/libstand/zalloc_mem.h  Wed Feb  5 22:27:49 2014
(r261529)
+++ head/lib/libstand/zalloc_mem.h  Wed Feb  5 22:53:58 2014
(r261530)
@@ -48,8 +48,6 @@ typedef struct MemPool {
 uintptr_t  mp_Used;
 } MemPool;
 
-#define MEMNODE_SIZE_MASK   ((sizeof(MemNode) <= 8) ? 7 : 15)
-
 #define ZNOTE_FREE 0
 #define ZNOTE_REUSE1
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261531 - in head/sys: dev/re pci

2014-02-05 Thread Marius Strobl
Author: marius
Date: Wed Feb  5 23:13:40 2014
New Revision: 261531
URL: http://svnweb.freebsd.org/changeset/base/261531

Log:
  - Implement the RX EARLYOFF and RXDV GATED bits as done by RealTek's Linux
driver as version 8.037.00 for RTL8168{E-VL,EP,F,G,GU} and RTL8111B. This
makes reception of packets work with the RTL8168G (HW rev. 0x4c00) in
my Shuttle DS47.
  - Consistently use RL_MSI_MESSAGES.
  In joint forces with: yongari
  
  MFC after:5 days

Modified:
  head/sys/dev/re/if_re.c
  head/sys/pci/if_rlreg.h

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Wed Feb  5 22:53:58 2014(r261530)
+++ head/sys/dev/re/if_re.c Wed Feb  5 23:13:40 2014(r261531)
@@ -656,6 +656,10 @@ re_set_rxmode(struct rl_softc *sc)
ifp = sc->rl_ifp;
 
rxfilt = RL_RXCFG_CONFIG | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_BROAD;
+   if ((sc->rl_flags & RL_FLAG_EARLYOFF) != 0)
+   rxfilt |= RL_RXCFG_EARLYOFF;
+   else if ((sc->rl_flags & RL_FLAG_EARLYOFFV2) != 0)
+   rxfilt |= RL_RXCFG_EARLYOFFV2;
 
if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
if (ifp->if_flags & IFF_PROMISC)
@@ -1265,7 +1269,7 @@ re_attach(device_t dev)
msic = 0;
/* Prefer MSI-X to MSI. */
if (msixc > 0) {
-   msixc = 1;
+   msixc = RL_MSI_MESSAGES;
rid = PCIR_BAR(4);
sc->rl_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
&rid, RF_ACTIVE);
@@ -1275,7 +1279,7 @@ re_attach(device_t dev)
}
if (sc->rl_res_pba != NULL &&
pci_alloc_msix(dev, &msixc) == 0) {
-   if (msixc == 1) {
+   if (msixc == RL_MSI_MESSAGES) {
device_printf(dev, "Using %d MSI-X message\n",
msixc);
sc->rl_flags |= RL_FLAG_MSIX;
@@ -1292,7 +1296,7 @@ re_attach(device_t dev)
}
/* Prefer MSI to INTx. */
if (msixc == 0 && msic > 0) {
-   msic = 1;
+   msic = RL_MSI_MESSAGES;
if (pci_alloc_msi(dev, &msic) == 0) {
if (msic == RL_MSI_MESSAGES) {
device_printf(dev, "Using %d MSI message\n",
@@ -1463,16 +1467,24 @@ re_attach(device_t dev)
RL_FLAG_WOL_MANLINK;
break;
case RL_HWREV_8168E_VL:
-   case RL_HWREV_8168EP:
case RL_HWREV_8168F:
-   case RL_HWREV_8168G:
+   sc->rl_flags |= RL_FLAG_EARLYOFF;
+   /* FALLTHROUGH */
case RL_HWREV_8411:
-   case RL_HWREV_8411B:
sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR |
RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP |
RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 |
RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK;
break;
+   case RL_HWREV_8168EP:
+   case RL_HWREV_8168G:
+   case RL_HWREV_8411B:
+   sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR |
+   RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP |
+   RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 |
+   RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK |
+   RL_FLAG_EARLYOFFV2 | RL_FLAG_RXDV_GATED;
+   break;
case RL_HWREV_8168GU:
if (pci_get_device(dev) == RT_DEVICEID_8101E) {
/* RTL8106EUS */
@@ -1482,7 +1494,8 @@ re_attach(device_t dev)
 
sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR |
RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP |
-   RL_FLAG_AUTOPAD | RL_FLAG_CMDSTOP_WAIT_TXQ;
+   RL_FLAG_AUTOPAD | RL_FLAG_CMDSTOP_WAIT_TXQ |
+   RL_FLAG_EARLYOFFV2 | RL_FLAG_RXDV_GATED;
break;
case RL_HWREV_8169_8110SB:
case RL_HWREV_8169_8110SBL:
@@ -3170,6 +3183,10 @@ re_init_locked(struct rl_softc *sc)
CSR_WRITE_4(sc, RL_TXLIST_ADDR_LO,
RL_ADDR_LO(sc->rl_ldata.rl_tx_list_addr));
 
+   if ((sc->rl_flags & RL_FLAG_RXDV_GATED) != 0)
+   CSR_WRITE_4(sc, RL_MISC, CSR_READ_4(sc, RL_MISC) &
+   ~0x0008);
+
/*
 * Enable transmit and receive.
 */

Modified: head/sys/pci/if_rlreg.h
==
--- head/sys/pci/if_rlreg.h Wed Feb  5 22:53:58 2014(r261530)
+++ head/sys/pci/if_rlreg.h Wed Feb  5 23:13:40 2014(r261531)
@@ -145,6 +145,7 @@
 #defineRL_PMCH 0x006F  /* 8 bits */
 #defineRL_MAXRXPKTLEN  0x00DA  /* 16 bits, chip multiplies by 
8 */
 #defineRL_INTRMOD  0x00E

Re: svn commit: r261216 - head/sys/dev/pccbb

2014-02-05 Thread Gavin Atkinson
On Tue, 4 Feb 2014, John Baldwin wrote:
> On Sunday, February 02, 2014 5:34:58 pm Gavin Atkinson wrote:
> > On Mon, 27 Jan 2014, John Baldwin wrote:
> > > Author: jhb
> > > Date: Mon Jan 27 19:49:52 2014
> > > New Revision: 261216
> > > URL: http://svnweb.freebsd.org/changeset/base/261216
> > > 
> > > Log:
> > >   Explicitly enable I/O and memory decoding in the bridge's command 
> > > register
> > >   when activating an I/O or memory window on the CardBus bridge.
> > 
> > This fixes some, but not all of my machines.  One in particular, a Toshiba 
> > M5 laptop, remains broken by r254263 even with this change.  Specificaly, 
> > the laptop does not notice when a card is inserted.
> > 
> > The attached minimal patch gets things working again, though I don't know 
> > if is the correct fix or if a more involved fix is required.
> > 
> > dmesg before and after that patch:
> > 
> > http://people.freebsd.org/~gavin/m5-dmesg-before.txt
> > http://people.freebsd.org/~gavin/m5-dmesg-after.txt
> > 
> > The only difference is the cbb register dump, the one bit that I am 
> > setting in the patch.
> 
> Your patch effectively reverts r254263.  It may be the correct thing to do,
> but the question is why. :)  Can you provide 'pciconf -lbc' output for this
> device?  (You can just do 'pciconf -lbc pccbb0' in HEAD now)

Full "pciconf -lbc" output at 
http://people.freebsd.org/~gavin/m5-pciconf-lbc.txt

It's the same both with and without my hack-patch.

Thanks,

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


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

2014-02-05 Thread Navdeep Parhar
Author: np
Date: Thu Feb  6 02:34:29 2014
New Revision: 261533
URL: http://svnweb.freebsd.org/changeset/base/261533

Log:
  cxgbe(4): Use the port's tx channel to identify it to t4_clr_port_stats.
  
  MFC after:3 days

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Feb  6 02:12:39 2014
(r261532)
+++ head/sys/dev/cxgbe/t4_main.cThu Feb  6 02:34:29 2014
(r261533)
@@ -7778,11 +7778,11 @@ t4_ioctl(struct cdev *dev, unsigned long
 
if (port_id >= sc->params.nports)
return (EINVAL);
+   pi = sc->port[port_id];
 
/* MAC stats */
-   t4_clr_port_stats(sc, port_id);
+   t4_clr_port_stats(sc, pi->tx_chan);
 
-   pi = sc->port[port_id];
if (pi->flags & PORT_INIT_DONE) {
struct sge_rxq *rxq;
struct sge_txq *txq;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261534 - head/tools/tools/cxgbetool

2014-02-05 Thread Navdeep Parhar
Author: np
Date: Thu Feb  6 02:36:12 2014
New Revision: 261534
URL: http://svnweb.freebsd.org/changeset/base/261534

Log:
  cxgbetool: Display the congestion channel map in hex.
  
  MFC after:1 week

Modified:
  head/tools/tools/cxgbetool/cxgbetool.c

Modified: head/tools/tools/cxgbetool/cxgbetool.c
==
--- head/tools/tools/cxgbetool/cxgbetool.c  Thu Feb  6 02:34:29 2014
(r261533)
+++ head/tools/tools/cxgbetool/cxgbetool.c  Thu Feb  6 02:36:12 2014
(r261534)
@@ -1368,7 +1368,7 @@ show_sge_context(const struct t4_sge_con
FIELD1("CngDBPHdr:", 6),
FIELD1("CngDBPData:", 5),
FIELD1("CngIMSG:", 4),
-   FIELD("CngChMap:", 0, 3),
+   { "CngChMap:", 0, 3, 0, 1, 0},
{ NULL }
};
static struct field_desc t5_conm[] = {
@@ -1377,7 +1377,7 @@ show_sge_context(const struct t4_sge_con
FIELD1("CngDBPHdr:", 18),
FIELD1("CngDBPData:", 17),
FIELD1("CngIMSG:", 16),
-   FIELD("CngChMap:", 0, 15),
+   { "CngChMap:", 0, 15, 0, 1, 0},
{ NULL }
};
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261535 - head/sys/dev/mfi

2014-02-05 Thread Mark Johnston
Author: markj
Date: Thu Feb  6 02:54:04 2014
New Revision: 261535
URL: http://svnweb.freebsd.org/changeset/base/261535

Log:
  Add support for MegaRAID Fury cards. The main change needed to boot from a
  9341-4i controller was to ensure that scatter/gather lists are ended with
  an end-of-list marker. Both the mrsas and Linux megaraid_sas drivers use
  this marker with Invader cards as well, so we do the same thing, though
  it is apparently not strictly necessary.
  
  Reviewed by:  ambrisko
  Tested by:ambrisko (Invader card)
  MFC after:3 weeks
  Sponsored by: Sandvine Inc.

Modified:
  head/sys/dev/mfi/mfi_pci.c
  head/sys/dev/mfi/mfi_tbolt.c
  head/sys/dev/mfi/mfivar.h

Modified: head/sys/dev/mfi/mfi_pci.c
==
--- head/sys/dev/mfi/mfi_pci.c  Thu Feb  6 02:36:12 2014(r261534)
+++ head/sys/dev/mfi/mfi_pci.c  Thu Feb  6 02:54:04 2014(r261535)
@@ -136,7 +136,8 @@ struct mfi_ident {
{0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| 
MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25DB080"},
{0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| 
MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25NB008"},
{0x1000, 0x005b, 0x, 0x, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| 
MFI_FLAGS_MRSAS, "ThunderBolt"},
-   {0x1000, 0x005d, 0x, 0x, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| 
MFI_FLAGS_MRSAS, "Invader"},
+   {0x1000, 0x005d, 0x, 0x, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| 
MFI_FLAGS_MRSAS| MFI_FLAGS_INVADER, "Invader"},
+   {0x1000, 0x005f, 0x, 0x, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| 
MFI_FLAGS_MRSAS| MFI_FLAGS_FURY, "Fury"},
{0x1000, 0x0060, 0x1028, 0x, MFI_FLAGS_1078,  "Dell PERC 6"},
{0x1000, 0x0060, 0x, 0x, MFI_FLAGS_1078,  "LSI MegaSAS 1078"},
{0x1000, 0x0071, 0x, 0x, MFI_FLAGS_SKINNY, "Drake Skinny"},

Modified: head/sys/dev/mfi/mfi_tbolt.c
==
--- head/sys/dev/mfi/mfi_tbolt.cThu Feb  6 02:36:12 2014
(r261534)
+++ head/sys/dev/mfi/mfi_tbolt.cThu Feb  6 02:54:04 2014
(r261535)
@@ -850,7 +850,8 @@ mfi_tbolt_build_ldio(struct mfi_softc *s
io_request = cmd->io_request;
io_request->RaidContext.TargetID = device_id;
io_request->RaidContext.Status = 0;
-   io_request->RaidContext.exStatus =0;
+   io_request->RaidContext.exStatus = 0;
+   io_request->RaidContext.regLockFlags = 0;
 
start_lba_lo = mfi_cmd->cm_frame->io.lba_lo;
start_lba_hi = mfi_cmd->cm_frame->io.lba_hi;
@@ -945,6 +946,7 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc,
uint8_t i, sg_processed, sg_to_process;
uint8_t sge_count, sge_idx;
union mfi_sgl *os_sgl;
+   pMpi25IeeeSgeChain64_t sgl_end;
 
/*
 * Return 0 if there is no data transfer
@@ -968,6 +970,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc,
else
sge_idx = sge_count;
 
+   if (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY)) {
+   sgl_end = sgl_ptr + (sc->max_SGEs_in_main_message - 1);
+   sgl_end->Flags = 0;
+   }
+
for (i = 0; i < sge_idx; i++) {
/*
 * For 32bit BSD we are getting 32 bit SGL's from OS
@@ -981,7 +988,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc,
sgl_ptr->Length = os_sgl->sg32[i].len;
sgl_ptr->Address = os_sgl->sg32[i].addr;
}
-   sgl_ptr->Flags = 0;
+   if (i == sge_count - 1 &&
+   (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY)))
+   sgl_ptr->Flags = MPI25_IEEE_SGE_FLAGS_END_OF_LIST;
+   else
+   sgl_ptr->Flags = 0;
sgl_ptr++;
cmd->io_request->ChainOffset = 0;
}
@@ -996,8 +1007,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc,
sg_chain = sgl_ptr;
/* Prepare chain element */
sg_chain->NextChainOffset = 0;
-   sg_chain->Flags = (MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT |
-   MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR);
+   if (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY))
+   sg_chain->Flags = MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT;
+   else
+   sg_chain->Flags = MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT |
+   MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR;
sg_chain->Length =  (sizeof(MPI2_SGE_IO_UNION) *
(sge_count - sg_processed));
sg_chain->Address = cmd->sg_frame_phys_addr;
@@ -1010,7 +1024,13 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc,
sgl_ptr->Length = os_sgl->sg32[i].len;
sgl_ptr->Address = os_sgl->sg32[i].addr;

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

2014-02-05 Thread Navdeep Parhar
Author: np
Date: Thu Feb  6 03:21:43 2014
New Revision: 261536
URL: http://svnweb.freebsd.org/changeset/base/261536

Log:
  cxgbe(4): The T5 allows for a different freelist starvation threshold
  for queues with buffer packing.  Use the correct value to calculate a
  freelist's low water mark.
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hThu Feb  6 02:54:04 2014
(r261535)
+++ head/sys/dev/cxgbe/adapter.hThu Feb  6 03:21:43 2014
(r261536)
@@ -517,6 +517,7 @@ struct sge {
int timer_val[SGE_NTIMERS];
int counter_val[SGE_NCOUNTERS];
int fl_starve_threshold;
+   int fl_starve_threshold2;
int eq_s_qpp;
int iq_s_qpp;
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Thu Feb  6 02:54:04 2014(r261535)
+++ head/sys/dev/cxgbe/t4_sge.c Thu Feb  6 03:21:43 2014(r261536)
@@ -569,6 +569,10 @@ t4_read_chip_settings(struct adapter *sc
 
r = t4_read_reg(sc, A_SGE_CONM_CTRL);
s->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1;
+   if (is_t4(sc))
+   s->fl_starve_threshold2 = s->fl_starve_threshold;
+   else
+   s->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1;
 
/* egress queues: log2 of # of doorbells per BAR2 page */
r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF);
@@ -2233,7 +2237,9 @@ alloc_iq_fl(struct port_info *pi, struct
return (rc);
}
fl->needed = fl->cap;
-   fl->lowat = roundup2(sc->sge.fl_starve_threshold, 8);
+   fl->lowat = fl->flags & FL_BUF_PACKING ?
+   roundup2(sc->sge.fl_starve_threshold2, 8) :
+   roundup2(sc->sge.fl_starve_threshold, 8);
 
c.iqns_to_fl0congen |=
htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) |
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261537 - in head/sys/dev/cxgbe: . common

2014-02-05 Thread Navdeep Parhar
Author: np
Date: Thu Feb  6 03:30:12 2014
New Revision: 261537
URL: http://svnweb.freebsd.org/changeset/base/261537

Log:
  cxgbe(4): Use the rx channel map (instead of the tx channel map) as the
  congestion channel map.
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/common/t4_hw.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hThu Feb  6 03:21:43 2014
(r261536)
+++ head/sys/dev/cxgbe/adapter.hThu Feb  6 03:30:12 2014
(r261537)
@@ -210,6 +210,7 @@ struct port_info {
uint8_t  mod_type;
uint8_t  port_id;
uint8_t  tx_chan;
+   uint8_t  rx_chan_map;   /* rx MPS channel bitmap */
 
/* These need to be int as they are used in sysctl */
int ntxq;   /* # of tx queues */

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Thu Feb  6 03:21:43 2014
(r261536)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Thu Feb  6 03:30:12 2014
(r261537)
@@ -5650,6 +5650,7 @@ int __devinit t4_port_init(struct port_i
 
p->viid = ret;
p->tx_chan = j;
+   p->rx_chan_map = get_mps_bg_map(adap, j);
p->lport = j;
p->rss_size = rss_size;
t4_os_set_hw_addr(adap, p->port_id, addr);

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Thu Feb  6 03:21:43 2014(r261536)
+++ head/sys/dev/cxgbe/t4_sge.c Thu Feb  6 03:30:12 2014(r261537)
@@ -2474,7 +2474,7 @@ tnl_cong(struct port_info *pi)
else if (cong_drop == 1)
return (0);
else
-   return (1 << pi->tx_chan);
+   return (pi->rx_chan_map);
 }
 
 static int
@@ -2581,7 +2581,7 @@ alloc_ofld_rxq(struct port_info *pi, str
char name[16];
 
rc = alloc_iq_fl(pi, &ofld_rxq->iq, &ofld_rxq->fl, intr_idx,
-   1 << pi->tx_chan);
+   pi->rx_chan_map);
if (rc != 0)
return (rc);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2014-02-05 Thread Alexander Motin
Author: mav
Date: Thu Feb  6 03:54:58 2014
New Revision: 261538
URL: http://svnweb.freebsd.org/changeset/base/261538

Log:
  Make CTL block backend return proper error code for operations unsupposed
  by the underlying device.
  
  MFC after:2 weeks

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

Modified: head/sys/cam/ctl/ctl_backend_block.c
==
--- head/sys/cam/ctl/ctl_backend_block.cThu Feb  6 03:30:12 2014
(r261537)
+++ head/sys/cam/ctl/ctl_backend_block.cThu Feb  6 03:54:58 2014
(r261538)
@@ -510,6 +510,7 @@ ctl_be_block_biodone(struct bio *bio)
struct ctl_be_block_io *beio;
struct ctl_be_block_lun *be_lun;
union ctl_io *io;
+   int error;
 
beio = bio->bio_caller1;
be_lun = beio->lun;
@@ -517,8 +518,9 @@ ctl_be_block_biodone(struct bio *bio)
 
DPRINTF("entered\n");
 
+   error = bio->bio_error;
mtx_lock(&be_lun->lock);
-   if (bio->bio_error != 0)
+   if (error != 0)
beio->num_errors++;
 
beio->num_bios_done++;
@@ -550,7 +552,9 @@ ctl_be_block_biodone(struct bio *bio)
 * entire I/O with a medium error.
 */
if (beio->num_errors > 0) {
-   if (beio->bio_cmd == BIO_FLUSH) {
+   if (error == EOPNOTSUPP) {
+   ctl_set_invalid_opcode(&io->scsiio);
+   } else if (beio->bio_cmd == BIO_FLUSH) {
/* XXX KDM is there is a better error here? */
ctl_set_internal_failure(&io->scsiio,
 /*sks_valid*/ 1,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"