Date: Sun, 24 Sep 2017 19:48:46 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323975 - in projects/runtime-coverage: contrib/one-true-awk share/man/man4 share/misc share/mk sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/freescale/imx sys/arm/ti sys/contrib/ipfilt... Message-ID: <201709241948.v8OJmkSb010864@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Sun Sep 24 19:48:46 2017 New Revision: 323975 URL: https://svnweb.freebsd.org/changeset/base/323975 Log: MFhead@r323974 Deleted: projects/runtime-coverage/sys/arm/conf/VIRT Modified: projects/runtime-coverage/contrib/one-true-awk/lib.c projects/runtime-coverage/contrib/one-true-awk/run.c projects/runtime-coverage/share/man/man4/mpr.4 projects/runtime-coverage/share/man/man4/mps.4 projects/runtime-coverage/share/misc/committers-src.dot projects/runtime-coverage/share/mk/bsd.lib.mk projects/runtime-coverage/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c projects/runtime-coverage/sys/arm/conf/GENERIC projects/runtime-coverage/sys/arm/freescale/imx/files.imx6 projects/runtime-coverage/sys/arm/ti/ti_sdhci.c projects/runtime-coverage/sys/contrib/ipfilter/netinet/ip_nat.c projects/runtime-coverage/sys/dev/mpr/mpr.c projects/runtime-coverage/sys/dev/mps/mps.c projects/runtime-coverage/sys/dev/sdhci/fsl_sdhci.c projects/runtime-coverage/sys/dev/sdhci/sdhci.c projects/runtime-coverage/sys/dev/sdhci/sdhci.h projects/runtime-coverage/sys/dev/sdhci/sdhci_pci.c projects/runtime-coverage/sys/dev/ti/if_ti.c projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c projects/runtime-coverage/sys/vm/vm_page.c projects/runtime-coverage/sys/vm/vm_page.h projects/runtime-coverage/tools/tools/nanobsd/defaults.sh projects/runtime-coverage/usr.bin/calendar/calendars/calendar.freebsd Directory Properties: projects/runtime-coverage/ (props changed) projects/runtime-coverage/contrib/one-true-awk/ (props changed) projects/runtime-coverage/sys/contrib/ipfilter/ (props changed) Modified: projects/runtime-coverage/contrib/one-true-awk/lib.c ============================================================================== --- projects/runtime-coverage/contrib/one-true-awk/lib.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/contrib/one-true-awk/lib.c Sun Sep 24 19:48:46 2017 (r323975) @@ -62,6 +62,7 @@ void recinit(unsigned int n) || (fldtab = (Cell **) malloc((nfields+1) * sizeof(Cell *))) == NULL || (fldtab[0] = (Cell *) malloc(sizeof(Cell))) == NULL ) FATAL("out of space for $0 and fields"); + *record = '\0'; *fldtab[0] = dollar0; fldtab[0]->sval = record; fldtab[0]->nval = tostring("0"); @@ -616,7 +617,7 @@ void eprint(void) /* try to print context around error static int been_here = 0; extern char ebuf[], *ep; - if (compile_time == 2 || compile_time == 0 || been_here++ > 0) + if (compile_time == 2 || compile_time == 0 || been_here++ > 0 || ebuf == ep) return; p = ep - 1; if (p > ebuf && *p == '\n') Modified: projects/runtime-coverage/contrib/one-true-awk/run.c ============================================================================== --- projects/runtime-coverage/contrib/one-true-awk/run.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/contrib/one-true-awk/run.c Sun Sep 24 19:48:46 2017 (r323975) @@ -918,7 +918,7 @@ int format(char **pbuf, int *pbufsize, const char *s, break; case 'c': if (isnum(x)) { - if (getfval(x)) + if ((int)getfval(x)) sprintf(p, fmt, (int) getfval(x)); else { *p++ = '\0'; /* explicit null byte */ Modified: projects/runtime-coverage/share/man/man4/mpr.4 ============================================================================== --- projects/runtime-coverage/share/man/man4/mpr.4 Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/share/man/man4/mpr.4 Sun Sep 24 19:48:46 2017 (r323975) @@ -337,31 +337,41 @@ dev.mpr.X.use_phy_num The same set of values are valid as when setting this tunable for all adapters. .Pp .Sh DEBUGGING -To enable debugging prints from the -.Nm -driver, set the -.Bd -literal -offset indent -hw.mpr.X.debug_level -.Ed -.Pp -tunable, either in +Driver diagnostic printing is controlled in .Xr loader.conf 5 -or by using -.Xr sysctl 8 . -These bits have the described effects: -.Bd -literal -offset indent -0x0001 Enable informational prints (set by default). -0x0002 Enable prints for driver faults (set by default). -0x0004 Enable prints for controller events. -0x0008 Enable prints for controller logging. -0x0010 Enable prints for tracing recovery operations. -0x0020 Enable prints for parameter errors and programming bugs. -0x0040 Enable prints for system initialization operations. -0x0080 Enable prints for more detailed information. -0x0100 Enable prints for user-generated commands (IOCTL). -0x0200 Enable prints for device mapping. -0x0400 Enable prints for tracing through driver functions. -.Ed +by using the global +.Va hw.mpr.debug_level +and per-device +.Va dev.mpr.X.debug_level +tunables. +One can alter the debug level for any adapter at run-time using the +.Xr sysctl 8 +variable +.Va dev.mpr.X.debug_level . +.Pp +All +.Va debug_level +variables can be named by either an integer value or a text string. +Multiple values can be specified together by either ORing the +integer values or by providing a comma-separated list of names. +The current +.Va debug_level +status is reported in both formats for convenience. +The following levels are available: +.Bl -column "FlagXX" "NameXXXX" "Description" -offset indent +.It Em Flag Ta Em Name Ta Em Description +.It 0x0001 Ta info Ta Basic information (enabled by default) +.It 0x0002 Ta fault Ta Driver faults (enabled by default) +.It 0x0004 Ta event Ta Controller events +.It 0x0008 Ta log Ta Logging data from controller +.It 0x0010 Ta recovery Ta Tracing of recovery operations +.It 0x0020 Ta error Ta Parameter errors and programming bugs +.It 0x0040 Ta init Ta System initialization operations +.It 0x0080 Ta xinfo Ta More detailed information +.It 0x0100 Ta user Ta Tracing of user-generated commands (IOCTL) +.It 0x0200 Ta mapping Ta Tracing of device mapping +.It 0x0400 Ta trace Ta Tracing through driver functions +.El .Sh SEE ALSO .Xr cam 4 , .Xr cd 4 , Modified: projects/runtime-coverage/share/man/man4/mps.4 ============================================================================== --- projects/runtime-coverage/share/man/man4/mps.4 Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/share/man/man4/mps.4 Sun Sep 24 19:48:46 2017 (r323975) @@ -313,31 +313,41 @@ dev.mps.X.use_phy_num The same set of values are valid as when setting this tunable for all adapters. .Pp .Sh DEBUGGING -To enable debugging prints from the -.Nm -driver, set the -.Bd -literal -offset indent -hw.mps.X.debug_level -.Ed -.Pp -tunable, either in +Driver diagnostic printing is controlled in .Xr loader.conf 5 -or by using -.Xr sysctl 8 . -These bits have the described effects: -.Bd -literal -offset indent -0x0001 Enable informational prints (set by default). -0x0002 Enable prints for driver faults (set by default). -0x0004 Enable prints for controller events. -0x0008 Enable prints for controller logging. -0x0010 Enable prints for tracing recovery operations. -0x0020 Enable prints for parameter errors and programming bugs. -0x0040 Enable prints for system initialization operations. -0x0080 Enable prints for more detailed information. -0x0100 Enable prints for user-generated commands (IOCTL). -0x0200 Enable prints for device mapping. -0x0400 Enable prints for tracing through driver functions. -.Ed +by using the global +.Va hw.mps.debug_level +and per-device +.Va dev.mps.X.debug_level +tunables. +One can alter the debug level for any adapter at run-time using the +.Xr sysctl 8 +variable +.Va dev.mps.X.debug_level . +.Pp +All +.Va debug_level +variables can be named by either an integer value or a text string. +Multiple values can be specified together by either ORing the +integer values or by providing a comma-separated list of names. +The current +.Va debug_level +status is reported in both formats for convenience. +The following levels are available: +.Bl -column "FlagXX" "NameXXXX" "Description" -offset indent +.It Em Flag Ta Em Name Ta Em Description +.It 0x0001 Ta info Ta Basic information (enabled by default) +.It 0x0002 Ta fault Ta Driver faults (enabled by default) +.It 0x0004 Ta event Ta Controller events +.It 0x0008 Ta log Ta Logging data from controller +.It 0x0010 Ta recovery Ta Tracing of recovery operations +.It 0x0020 Ta error Ta Parameter errors and programming bugs +.It 0x0040 Ta init Ta System initialization operations +.It 0x0080 Ta xinfo Ta More detailed information +.It 0x0100 Ta user Ta Tracing of user-generated commands (IOCTL) +.It 0x0200 Ta mapping Ta Tracing of device mapping +.It 0x0400 Ta trace Ta Tracing through driver functions +.El .Sh SEE ALSO .Xr cam 4 , .Xr cd 4 , Modified: projects/runtime-coverage/share/misc/committers-src.dot ============================================================================== --- projects/runtime-coverage/share/misc/committers-src.dot Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/share/misc/committers-src.dot Sun Sep 24 19:48:46 2017 (r323975) @@ -167,6 +167,7 @@ fabient [label="Fabien Thomas\nfabient@FreeBSD.org\n20 fanf [label="Tony Finch\nfanf@FreeBSD.org\n2002/05/05"] fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"] flz [label="Florent Thoumie\nflz@FreeBSD.org\n2006/03/30"] +fsu [label="Fedor Uporov\nfsu@FreeBSD.org\n2017/08/28"] gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2010/02/02"] gad [label="Garance A. Drosehn\ngad@FreeBSD.org\n2000/10/27"] gallatin [label="Andrew Gallatin\ngallatin@FreeBSD.org\n1999/01/15"] @@ -689,6 +690,8 @@ obrien -> groudier obrien -> gshapiro obrien -> kan obrien -> sam + +pfg -> fsu peter -> asmodai peter -> jayanth Modified: projects/runtime-coverage/share/mk/bsd.lib.mk ============================================================================== --- projects/runtime-coverage/share/mk/bsd.lib.mk Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/share/mk/bsd.lib.mk Sun Sep 24 19:48:46 2017 (r323975) @@ -311,7 +311,11 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a +.if ${MK_COVERAGE} != "no" lib${LIB_PRIVATE}${LIB}_pic.a: ${SPOBJS} +.else +lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} +.endif @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${SPOBJS} ${ARADD} Modified: projects/runtime-coverage/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- projects/runtime-coverage/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -255,11 +255,7 @@ bcm_sdhci_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); -#ifdef MMCCAM - sdhci_cam_start_slot(&sc->sc_slot); -#else sdhci_start_slot(&sc->sc_slot); -#endif return (0); Modified: projects/runtime-coverage/sys/arm/conf/GENERIC ============================================================================== --- projects/runtime-coverage/sys/arm/conf/GENERIC Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/arm/conf/GENERIC Sun Sep 24 19:48:46 2017 (r323975) @@ -40,11 +40,13 @@ files "../allwinner/a83t/files.a83t" files "../allwinner/h3/files.h3" files "../broadcom/bcm2835/files.bcm2836" files "../broadcom/bcm2835/files.bcm283x" +files "../freescale/imx/files.imx6" files "../nvidia/tegra124/files.tegra124" files "../qemu/files.qemu" files "../ti/files.ti" files "../ti/am335x/files.am335x" files "../ti/omap4/files.omap4" +files "../xilinx/files.zynq7" options SOC_ALLWINNER_A10 options SOC_ALLWINNER_A13 @@ -116,6 +118,7 @@ device pty device snp device md # Memory "disks" device random # Entropy device +device firmware # firmware assist module device pl310 # PL310 L2 cache controller device psci @@ -128,6 +131,7 @@ device p2wi # Allwinner Push-Pull Two Wire device axp209 # AXP209 Power Management Unit device axp81x # AXP813/818 Power Management Unit device bcm2835_bsc +device fsliic # Freescale i2c/iic device icee # AT24Cxxx and compatible EEPROMs device sy8106a # SY8106A Buck Regulator device ti_i2c @@ -171,6 +175,7 @@ device ti_adc # reboot automatically because the boot loader might have enabled the # watchdog. device ti_wdt +device imxwdt # Watchdog. WARNING: can't be disabled!!! device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) @@ -186,6 +191,7 @@ device ehci device dwcotg # DWC OTG controller device musb +device axe # USB-Ethernet device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" device ukbd # Allow keyboard like HIDs to control console @@ -205,8 +211,10 @@ device miibus device awg # 10/100/1000 integrated EMAC controller device cpsw # TI Common Platform Ethernet Switch (CPSW) +device cgem # Zynq-7000 gig ethernet device device dwc # 10/100/1000 integrated GMAC controller device emac # 10/100 integrated EMAC controller +device ffec # Freescale Fast Ethernet Controller device smsc # SMSC LAN91C111 # Sound support @@ -230,6 +238,7 @@ device ti_pruss device ti_mbox # DMA controller +device fslsdma device ti_sdma # Extensible Firmware Interface @@ -237,4 +246,4 @@ options EFI # Flattened Device Tree options FDT # Configure using FDT/DTB data -makeoptions MODULES_EXTRA="dtb/allwinner dtb/am335x dtb/nvidia dtb/rpi dtb/omap4" +makeoptions MODULES_EXTRA="dtb/allwinner dtb/am335x dtb/imx6 dtb/nvidia dtb/rpi dtb/zynq dtb/omap4" Modified: projects/runtime-coverage/sys/arm/freescale/imx/files.imx6 ============================================================================== --- projects/runtime-coverage/sys/arm/freescale/imx/files.imx6 Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/arm/freescale/imx/files.imx6 Sun Sep 24 19:48:46 2017 (r323975) @@ -22,7 +22,7 @@ arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c optional imx_gpt arm/freescale/imx/imx_gpio.c optional gpio arm/freescale/imx/imx_i2c.c optional fsliic -arm/freescale/imx/imx6_sdma.c optional sdma +arm/freescale/imx/imx6_sdma.c optional fslsdma arm/freescale/imx/imx6_audmux.c optional sound arm/freescale/imx/imx6_ssi.c optional sound arm/freescale/imx/imx6_ahci.c optional ahci Modified: projects/runtime-coverage/sys/arm/ti/ti_sdhci.c ============================================================================== --- projects/runtime-coverage/sys/arm/ti/ti_sdhci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/arm/ti/ti_sdhci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -683,11 +683,7 @@ ti_sdhci_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); -#ifdef MMCCAM - sdhci_cam_start_slot(&sc->slot); -#else sdhci_start_slot(&sc->slot); -#endif return (0); fail: Modified: projects/runtime-coverage/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- projects/runtime-coverage/sys/contrib/ipfilter/netinet/ip_nat.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/contrib/ipfilter/netinet/ip_nat.c Sun Sep 24 19:48:46 2017 (r323975) @@ -6093,7 +6093,7 @@ ipf_nat_icmpquerytype(icmptype) { case ICMP_ECHOREPLY: case ICMP_ECHO: - /* route advertisement/soliciation is currently unsupported: */ + /* route advertisement/solicitation is currently unsupported: */ /* it would require rewriting the ICMP data section */ case ICMP_TSTAMP: case ICMP_TSTAMPREPLY: Modified: projects/runtime-coverage/sys/dev/mpr/mpr.c ============================================================================== --- projects/runtime-coverage/sys/dev/mpr/mpr.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/mpr/mpr.c Sun Sep 24 19:48:46 2017 (r323975) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include <sys/taskqueue.h> #include <sys/endian.h> #include <sys/eventhandler.h> +#include <sys/sbuf.h> #include <machine/bus.h> #include <machine/resource.h> @@ -105,6 +106,9 @@ static int mpr_reregister_events(struct mpr_softc *sc) static void mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm); static int mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int sleep_flag); +static int mpr_debug_sysctl(SYSCTL_HANDLER_ARGS); +static void mpr_parse_debug(struct mpr_softc *sc, char *list); + SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD, 0, "MPR Driver Parameters"); MALLOC_DEFINE(M_MPR, "mpr", "mpr driver memory"); @@ -1591,7 +1595,7 @@ mpr_init_queues(struct mpr_softc *sc) void mpr_get_tunables(struct mpr_softc *sc) { - char tmpstr[80]; + char tmpstr[80], mpr_debug[80]; /* XXX default to some debugging for now */ sc->mpr_debug = MPR_INFO | MPR_FAULT; @@ -1611,7 +1615,9 @@ mpr_get_tunables(struct mpr_softc *sc) /* * Grab the global variables. */ - TUNABLE_INT_FETCH("hw.mpr.debug_level", &sc->mpr_debug); + bzero(mpr_debug, 80); + if (TUNABLE_STR_FETCH("hw.mpr.debug_level", mpr_debug, 80) != 0) + mpr_parse_debug(sc, mpr_debug); TUNABLE_INT_FETCH("hw.mpr.disable_msix", &sc->disable_msix); TUNABLE_INT_FETCH("hw.mpr.disable_msi", &sc->disable_msi); TUNABLE_INT_FETCH("hw.mpr.max_msix", &sc->max_msix); @@ -1628,7 +1634,9 @@ mpr_get_tunables(struct mpr_softc *sc) /* Grab the unit-instance variables */ snprintf(tmpstr, sizeof(tmpstr), "dev.mpr.%d.debug_level", device_get_unit(sc->mpr_dev)); - TUNABLE_INT_FETCH(tmpstr, &sc->mpr_debug); + bzero(mpr_debug, 80); + if (TUNABLE_STR_FETCH(tmpstr, mpr_debug, 80) != 0) + mpr_parse_debug(sc, mpr_debug); snprintf(tmpstr, sizeof(tmpstr), "dev.mpr.%d.disable_msix", device_get_unit(sc->mpr_dev)); @@ -1714,9 +1722,9 @@ mpr_setup_sysctl(struct mpr_softc *sc) sysctl_tree = sc->sysctl_tree; } - SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "debug_level", CTLFLAG_RW, &sc->mpr_debug, 0, - "mpr debug level"); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "debug_level", CTLTYPE_STRING | CTLFLAG_RW, sc, 0, + mpr_debug_sysctl, "A", "mpr debug level"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "disable_msix", CTLFLAG_RD, &sc->disable_msix, 0, @@ -1807,6 +1815,104 @@ mpr_setup_sysctl(struct mpr_softc *sc) SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "prp_page_alloc_fail", CTLFLAG_RD, &sc->prp_page_alloc_fail, "PRP page allocation failures"); +} + +static struct mpr_debug_string { + char *name; + int flag; +} mpr_debug_strings[] = { + {"info", MPR_INFO}, + {"fault", MPR_FAULT}, + {"event", MPR_EVENT}, + {"log", MPR_LOG}, + {"recovery", MPR_RECOVERY}, + {"error", MPR_ERROR}, + {"init", MPR_INIT}, + {"xinfo", MPR_XINFO}, + {"user", MPR_USER}, + {"mapping", MPR_MAPPING}, + {"trace", MPR_TRACE} +}; + +static int +mpr_debug_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct mpr_softc *sc; + struct mpr_debug_string *string; + struct sbuf sbuf; + char *buffer; + size_t sz; + int i, len, debug, error; + + sc = (struct mpr_softc *)arg1; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + debug = sc->mpr_debug; + + sbuf_printf(&sbuf, "%#x", debug); + + sz = sizeof(mpr_debug_strings) / sizeof(mpr_debug_strings[0]); + for (i = 0; i < sz; i++) { + string = &mpr_debug_strings[i]; + if (debug & string->flag) + sbuf_printf(&sbuf, ",%s", string->name); + } + + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); + + if (error || req->newptr == NULL) + return (error); + + len = req->newlen - req->newidx; + if (len == 0) + return (0); + + buffer = malloc(len, M_MPR, M_ZERO|M_WAITOK); + error = SYSCTL_IN(req, buffer, len); + + mpr_parse_debug(sc, buffer); + + free(buffer, M_MPR); + return (error); +} + +static void +mpr_parse_debug(struct mpr_softc *sc, char *list) +{ + struct mpr_debug_string *string; + char *token, *endtoken; + size_t sz; + int flags, i; + + if (list == NULL || *list == '\0') + return; + + flags = 0; + sz = sizeof(mpr_debug_strings) / sizeof(mpr_debug_strings[0]); + while ((token = strsep(&list, ":,")) != NULL) { + + /* Handle integer flags */ + flags |= strtol(token, &endtoken, 0); + if (token != endtoken) + continue; + + /* Handle text flags */ + for (i = 0; i < sz; i++) { + string = &mpr_debug_strings[i]; + if (strcasecmp(token, string->name) == 0) { + flags |= string->flag; + break; + } + } + } + + sc->mpr_debug = flags; + return; } int Modified: projects/runtime-coverage/sys/dev/mps/mps.c ============================================================================== --- projects/runtime-coverage/sys/dev/mps/mps.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/mps/mps.c Sun Sep 24 19:48:46 2017 (r323975) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include <sys/taskqueue.h> #include <sys/endian.h> #include <sys/eventhandler.h> +#include <sys/sbuf.h> #include <machine/bus.h> #include <machine/resource.h> @@ -102,6 +103,9 @@ static int mps_reregister_events(struct mps_softc *sc) static void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm); static int mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mps_wait_db_ack(struct mps_softc *sc, int timeout, int sleep_flag); +static int mps_debug_sysctl(SYSCTL_HANDLER_ARGS); +static void mps_parse_debug(struct mps_softc *sc, char *list); + SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); MALLOC_DEFINE(M_MPT2, "mps", "mpt2 driver memory"); @@ -1452,7 +1456,7 @@ mps_init_queues(struct mps_softc *sc) void mps_get_tunables(struct mps_softc *sc) { - char tmpstr[80]; + char tmpstr[80], mps_debug[80]; /* XXX default to some debugging for now */ sc->mps_debug = MPS_INFO|MPS_FAULT; @@ -1472,7 +1476,9 @@ mps_get_tunables(struct mps_softc *sc) /* * Grab the global variables. */ - TUNABLE_INT_FETCH("hw.mps.debug_level", &sc->mps_debug); + bzero(mps_debug, 80); + if (TUNABLE_STR_FETCH("hw.mps.debug_level", mps_debug, 80) != 0) + mps_parse_debug(sc, mps_debug); TUNABLE_INT_FETCH("hw.mps.disable_msix", &sc->disable_msix); TUNABLE_INT_FETCH("hw.mps.disable_msi", &sc->disable_msi); TUNABLE_INT_FETCH("hw.mps.max_msix", &sc->max_msix); @@ -1489,7 +1495,9 @@ mps_get_tunables(struct mps_softc *sc) /* Grab the unit-instance variables */ snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.debug_level", device_get_unit(sc->mps_dev)); - TUNABLE_INT_FETCH(tmpstr, &sc->mps_debug); + bzero(mps_debug, 80); + if (TUNABLE_STR_FETCH(tmpstr, mps_debug, 80) != 0) + mps_parse_debug(sc, mps_debug); snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.disable_msix", device_get_unit(sc->mps_dev)); @@ -1576,9 +1584,9 @@ mps_setup_sysctl(struct mps_softc *sc) sysctl_tree = sc->sysctl_tree; } - SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "debug_level", CTLFLAG_RW, &sc->mps_debug, 0, - "mps debug level"); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "debug_level", CTLTYPE_STRING | CTLFLAG_RW, sc, 0, + mps_debug_sysctl, "A", "mps debug level"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "disable_msix", CTLFLAG_RD, &sc->disable_msix, 0, @@ -1669,6 +1677,104 @@ mps_setup_sysctl(struct mps_softc *sc) SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "use_phy_num", CTLFLAG_RD, &sc->use_phynum, 0, "Use the phy number for enumeration"); +} + +struct mps_debug_string { + char *name; + int flag; +} mps_debug_strings[] = { + {"info", MPS_INFO}, + {"fault", MPS_FAULT}, + {"event", MPS_EVENT}, + {"log", MPS_LOG}, + {"recovery", MPS_RECOVERY}, + {"error", MPS_ERROR}, + {"init", MPS_INIT}, + {"xinfo", MPS_XINFO}, + {"user", MPS_USER}, + {"mapping", MPS_MAPPING}, + {"trace", MPS_TRACE} +}; + +static int +mps_debug_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct mps_softc *sc; + struct mps_debug_string *string; + struct sbuf sbuf; + char *buffer; + size_t sz; + int i, len, debug, error; + + sc = (struct mps_softc *)arg1; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + debug = sc->mps_debug; + + sbuf_printf(&sbuf, "%#x", debug); + + sz = sizeof(mps_debug_strings) / sizeof(mps_debug_strings[0]); + for (i = 0; i < sz; i++) { + string = &mps_debug_strings[i]; + if (debug & string->flag) + sbuf_printf(&sbuf, ",%s", string->name); + } + + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); + + if (error || req->newptr == NULL) + return (error); + + len = req->newlen - req->newidx; + if (len == 0) + return (0); + + buffer = malloc(len, M_MPT2, M_ZERO|M_WAITOK); + error = SYSCTL_IN(req, buffer, len); + + mps_parse_debug(sc, buffer); + + free(buffer, M_MPT2); + return (error); +} + +static void +mps_parse_debug(struct mps_softc *sc, char *list) +{ + struct mps_debug_string *string; + char *token, *endtoken; + size_t sz; + int flags, i; + + if (list == NULL || *list == '\0') + return; + + flags = 0; + sz = sizeof(mps_debug_strings) / sizeof(mps_debug_strings[0]); + while ((token = strsep(&list, ":,")) != NULL) { + + /* Handle integer flags */ + flags |= strtol(token, &endtoken, 0); + if (token != endtoken) + continue; + + /* Handle text flags */ + for (i = 0; i < sz; i++) { + string = &mps_debug_strings[i]; + if (strcasecmp(token, string->name) == 0) { + flags |= string->flag; + break; + } + } + } + + sc->mps_debug = flags; + return; } int Modified: projects/runtime-coverage/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- projects/runtime-coverage/sys/dev/sdhci/fsl_sdhci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/sdhci/fsl_sdhci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -913,11 +913,7 @@ fsl_sdhci_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); -#ifdef MMCCAM - sdhci_cam_start_slot(&sc->slot); -#else sdhci_start_slot(&sc->slot); -#endif return (0); Modified: projects/runtime-coverage/sys/dev/sdhci/sdhci.c ============================================================================== --- projects/runtime-coverage/sys/dev/sdhci/sdhci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/sdhci/sdhci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -1051,12 +1051,14 @@ no_tuning: return (0); } +#ifndef MMCCAM void sdhci_start_slot(struct sdhci_slot *slot) { sdhci_card_task(slot, 0); } +#endif int sdhci_cleanup_slot(struct sdhci_slot *slot) @@ -2383,7 +2385,7 @@ sdhci_generic_write_ivar(device_t bus, device_t child, #ifdef MMCCAM void -sdhci_cam_start_slot(struct sdhci_slot *slot) +sdhci_start_slot(struct sdhci_slot *slot) { if ((slot->devq = cam_simq_alloc(1)) == NULL) { goto fail; Modified: projects/runtime-coverage/sys/dev/sdhci/sdhci.h ============================================================================== --- projects/runtime-coverage/sys/dev/sdhci/sdhci.h Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/sdhci/sdhci.h Sun Sep 24 19:48:46 2017 (r323975) @@ -430,9 +430,4 @@ bool sdhci_generic_get_card_present(device_t brdev, st void sdhci_generic_set_uhs_timing(device_t brdev, struct sdhci_slot *slot); void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); -#ifdef MMCCAM -/* CAM-related */ -void sdhci_cam_start_slot(struct sdhci_slot *slot); -#endif - #endif /* __SDHCI_H__ */ Modified: projects/runtime-coverage/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- projects/runtime-coverage/sys/dev/sdhci/sdhci_pci.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/sdhci/sdhci_pci.c Sun Sep 24 19:48:46 2017 (r323975) @@ -395,11 +395,7 @@ sdhci_pci_attach(device_t dev) pci_enable_busmaster(dev); /* Process cards detection. */ for (i = 0; i < sc->num_slots; i++) { -#ifdef MMCCAM - sdhci_cam_start_slot(&sc->slots[i]); -#else sdhci_start_slot(&sc->slots[i]); -#endif } return (0); Modified: projects/runtime-coverage/sys/dev/ti/if_ti.c ============================================================================== --- projects/runtime-coverage/sys/dev/ti/if_ti.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/dev/ti/if_ti.c Sun Sep 24 19:48:46 2017 (r323975) @@ -1621,7 +1621,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct m } sf[i] = sf_buf_alloc(frame, SFB_NOWAIT); if (sf[i] == NULL) { - vm_page_unwire(frame, PQ_INACTIVE); + vm_page_unwire(frame, PQ_NONE); vm_page_free(frame); device_printf(sc->ti_dev, "buffer allocation " "failed -- packet dropped!\n"); Modified: projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/fs/nfsclient/nfs_clcomsubs.c Sun Sep 24 19:48:46 2017 (r323975) @@ -344,7 +344,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu struct mbuf *mp, *mp2, *firstmp; int xfer, left, mlen; int uiosiz, clflg, rem; - char *cp, *tcp; + char *tcp; KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); @@ -396,19 +396,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu uiop->uio_iov->iov_len -= uiosiz; siz -= uiosiz; } - if (rem > 0) { - if (rem > M_TRAILINGSPACE(mp)) { - NFSMGET(mp); - mbuf_setlen(mp, 0); - mbuf_setnext(mp2, mp); - } - cp = NFSMTOD(mp, caddr_t) + mbuf_len(mp); - for (left = 0; left < rem; left++) - *cp++ = '\0'; - mbuf_setlen(mp, mbuf_len(mp) + rem); - if (cpp != NULL) - *cpp = cp; - } else if (cpp != NULL) + if (cpp != NULL) *cpp = NFSMTOD(mp, caddr_t) + mbuf_len(mp); if (mbp != NULL) *mbp = mp; Modified: projects/runtime-coverage/sys/vm/vm_page.c ============================================================================== --- projects/runtime-coverage/sys/vm/vm_page.c Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/vm/vm_page.c Sun Sep 24 19:48:46 2017 (r323975) @@ -3081,23 +3081,25 @@ vm_page_unswappable(vm_page_t m) * vm_page_try_to_free() * * Attempt to free the page. If we cannot free it, we do nothing. - * 1 is returned on success, 0 on failure. + * true is returned on success, false on failure. */ -int +bool vm_page_try_to_free(vm_page_t m) { - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); if (m->object != NULL) VM_OBJECT_ASSERT_WLOCKED(m->object); - if (m->dirty || m->hold_count || m->wire_count || + if (m->dirty != 0 || m->hold_count != 0 || m->wire_count != 0 || (m->oflags & VPO_UNMANAGED) != 0 || vm_page_busied(m)) - return (0); - pmap_remove_all(m); - if (m->dirty) - return (0); + return (false); + if (m->object != NULL && m->object->ref_count != 0) { + pmap_remove_all(m); + if (m->dirty != 0) + return (false); + } vm_page_free(m); - return (1); + return (true); } /* Modified: projects/runtime-coverage/sys/vm/vm_page.h ============================================================================== --- projects/runtime-coverage/sys/vm/vm_page.h Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/sys/vm/vm_page.h Sun Sep 24 19:48:46 2017 (r323975) @@ -477,7 +477,6 @@ void vm_page_change_lock(vm_page_t m, struct mtx **mtx vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, vm_page_t *ma, int count); -int vm_page_try_to_free (vm_page_t); void vm_page_deactivate (vm_page_t); void vm_page_deactivate_noreuse(vm_page_t); void vm_page_dequeue(vm_page_t m); @@ -513,6 +512,7 @@ void vm_page_set_valid_range(vm_page_t m, int base, in int vm_page_sleep_if_busy(vm_page_t m, const char *msg); vm_offset_t vm_page_startup(vm_offset_t vaddr); void vm_page_sunbusy(vm_page_t m); +bool vm_page_try_to_free(vm_page_t m); int vm_page_trysbusy(vm_page_t m); void vm_page_unhold_pages(vm_page_t *ma, int count); void vm_page_unswappable(vm_page_t m); Modified: projects/runtime-coverage/tools/tools/nanobsd/defaults.sh ============================================================================== --- projects/runtime-coverage/tools/tools/nanobsd/defaults.sh Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/tools/tools/nanobsd/defaults.sh Sun Sep 24 19:48:46 2017 (r323975) @@ -749,7 +749,7 @@ cust_install_files ( ) ( cust_pkgng ( ) ( mkdir -p ${NANO_WORLDDIR}/usr/local/etc local PKG_CONF="${NANO_WORLDDIR}/usr/local/etc/pkg.conf" - local PKGCMD="env ASSUME_ALWAYS_YES=YES PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg" + local PKGCMD="env BATCH=YES ASSUME_ALWAYS_YES=YES PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg" # Ensure pkg.conf points pkg to where the package meta data lives. touch ${PKG_CONF} Modified: projects/runtime-coverage/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- projects/runtime-coverage/usr.bin/calendar/calendars/calendar.freebsd Sun Sep 24 19:43:31 2017 (r323974) +++ projects/runtime-coverage/usr.bin/calendar/calendars/calendar.freebsd Sun Sep 24 19:48:46 2017 (r323975) @@ -419,6 +419,7 @@ 11/23 Luca Pizzamiglio <pizzamig@FreeBSD.org> born in Casalpusterlengo, Italy, 1978 11/24 Andrey Zakhvatov <andy@FreeBSD.org> born in Chelyabinsk, Russian Federation, 1974 11/24 Daniel Gerzo <danger@FreeBSD.org> born in Bratislava, Slovakia, 1986 +11/25 Fedor Uporov <fsu@FreeBSD.org> born in Yalta, Crimea, USSR, 1988 11/28 Nik Clayton <nik@FreeBSD.org> born in Peterborough, United Kingdom, 1973 11/28 Stanislav Sedov <stas@FreeBSD.org> born in Chelyabinsk, USSR, 1985 12/01 Hajimu Umemoto <ume@FreeBSD.org> born in Nara, Japan, 1961
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709241948.v8OJmkSb010864>