svn commit: r322487 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Aug 14 05:55:16 2017 New Revision: 322487 URL: https://svnweb.freebsd.org/changeset/base/322487 Log: hyperv/hn: Re-set datapath after synthetic parts reattached. Do this even for non-transparent mode VF. Better safe than sorry. MFC after:3 days Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D11981 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 14 05:46:50 2017 (r322486) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 14 05:55:16 2017 (r322487) @@ -3403,7 +3403,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) */ hn_resume(sc); - if (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED) { + if ((sc->hn_flags & HN_FLAG_RXVF) || + (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) { /* * Since we have reattached the NVS part, * change the datapath to VF again; in case ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322486 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Aug 14 05:46:50 2017 New Revision: 322486 URL: https://svnweb.freebsd.org/changeset/base/322486 Log: hyperv/hn: Minor cleanup MFC after:3 days Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D11979 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 14 05:40:52 2017 (r322485) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 14 05:46:50 2017 (r322486) @@ -580,6 +580,12 @@ hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { }; #endif /* !RSS */ +static const struct hyperv_guidhn_guid = { + .hv_guid = { + 0x63, 0x51, 0x61, 0xf8, 0x3e, 0xdf, 0xc5, 0x46, + 0x91, 0x3f, 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e } +}; + static device_method_t hn_methods[] = { /* Device interface */ DEVMETHOD(device_probe, hn_probe), @@ -1711,18 +1717,11 @@ hn_ifnet_lnkevent(void *xsc, struct ifnet *ifp, int li if_link_state_change(sc->hn_ifp, link_state); } -/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ -static const struct hyperv_guid g_net_vsc_device_type = { - .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, - 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E} -}; - static int hn_probe(device_t dev) { - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, - _net_vsc_device_type) == 0) { + if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, _guid) == 0) { device_set_desc(dev, "Hyper-V Network Interface"); return BUS_PROBE_DEFAULT; } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322485 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Aug 14 05:40:52 2017 New Revision: 322485 URL: https://svnweb.freebsd.org/changeset/base/322485 Log: hyperv/hn: Fix/enhance receiving path when VF is activated. - Update hn(4)'s stats properly for non-transparent mode VF. - Allow BPF tapping to hn(4) for non-transparent mode VF. - Don't setup mbuf hash, if 'options RSS' is set. In Azure, when VF is activated, TCP SYN and SYN|ACK go through hn(4) while the rest of segments and ACKs belonging to the same TCP 4-tuple go through the VF. So don't setup mbuf hash, if a VF is activated and 'options RSS' is not enabled. hn(4) and the VF may use neither the same RSS hash key nor the same RSS hash function, so the hash value for packets belonging to the same flow could be different! - Disable LRO. hn(4) will only receive broadcast packets, multicast packets, TCP SYN and SYN|ACK (in Azure), LRO is useless for these packet types. For non-transparent, we definitely _cannot_ enable LRO at all, since the LRO flush will use hn(4) as the receiving interface; i.e. hn_ifp->if_input(hn_ifp, m). While I'm here, remove unapplied comment and minor style change. MFC after:3 days Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D11978 Modified: head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 14 05:31:51 2017 (r322484) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 14 05:40:52 2017 (r322485) @@ -282,6 +282,8 @@ static bool hn_xpnt_vf_isready(struct hn_softc *); static voidhn_xpnt_vf_setready(struct hn_softc *); static voidhn_xpnt_vf_init_taskfunc(void *, int); static voidhn_xpnt_vf_init(struct hn_softc *); +static voidhn_xpnt_vf_setenable(struct hn_softc *); +static voidhn_xpnt_vf_setdisable(struct hn_softc *, bool); static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); @@ -1427,6 +1429,40 @@ hn_xpnt_vf_isready(struct hn_softc *sc) } static void +hn_xpnt_vf_setenable(struct hn_softc *sc) +{ + int i; + + HN_LOCK_ASSERT(sc); + + /* NOTE: hn_vf_lock for hn_transmit()/hn_qflush() */ + rm_wlock(>hn_vf_lock); + sc->hn_xvf_flags |= HN_XVFFLAG_ENABLED; + rm_wunlock(>hn_vf_lock); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_rx_flags |= HN_RX_FLAG_XPNT_VF; +} + +static void +hn_xpnt_vf_setdisable(struct hn_softc *sc, bool clear_vf) +{ + int i; + + HN_LOCK_ASSERT(sc); + + /* NOTE: hn_vf_lock for hn_transmit()/hn_qflush() */ + rm_wlock(>hn_vf_lock); + sc->hn_xvf_flags &= ~HN_XVFFLAG_ENABLED; + if (clear_vf) + sc->hn_vf_ifp = NULL; + rm_wunlock(>hn_vf_lock); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_rx_flags &= ~HN_RX_FLAG_XPNT_VF; +} + +static void hn_xpnt_vf_init(struct hn_softc *sc) { int error; @@ -1459,10 +1495,8 @@ hn_xpnt_vf_init(struct hn_softc *sc) */ hn_nvs_set_datapath(sc, HN_NVS_DATAPATH_VF); - /* NOTE: hn_vf_lock for hn_transmit()/hn_qflush() */ - rm_wlock(>hn_vf_lock); - sc->hn_xvf_flags |= HN_XVFFLAG_ENABLED; - rm_wunlock(>hn_vf_lock); + /* Mark transparent mode VF as enabled. */ + hn_xpnt_vf_setenable(sc); } static void @@ -1648,11 +1682,8 @@ hn_ifnet_detevent(void *xsc, struct ifnet *ifp) hn_resume_mgmt(sc); } - /* NOTE: hn_vf_lock for hn_transmit()/hn_qflush() */ - rm_wlock(>hn_vf_lock); - sc->hn_xvf_flags &= ~HN_XVFFLAG_ENABLED; - sc->hn_vf_ifp = NULL; - rm_wunlock(>hn_vf_lock); + /* Mark transparent mode VF as disabled. */ + hn_xpnt_vf_setdisable(sc, true /* clear hn_vf_ifp */); rm_wlock(_vfmap_lock); @@ -2994,13 +3025,16 @@ static int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_rxinfo *info) { - struct ifnet *ifp; + struct ifnet *ifp, *hn_ifp = rxr->hn_ifp; struct mbuf *m_new; int size, do_lro = 0, do_csum = 1; int hash_type; - /* If the VF is active, inject the packet through the VF */ - ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : rxr->hn_ifp; + /* +* If the non-transparent mode VF is active, inject this packet +* into the VF. +*/ + ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : hn_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* @@ -3014,10 +3048,15 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int return (0); } +
svn commit: r322484 - head/usr.bin/calendar/calendars
Author: bhughes (ports committer) Date: Mon Aug 14 05:31:51 2017 New Revision: 322484 URL: https://svnweb.freebsd.org/changeset/base/322484 Log: Add myself Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdMon Aug 14 05:30:02 2017(r322483) +++ head/usr.bin/calendar/calendars/calendar.freebsdMon Aug 14 05:31:51 2017(r322484) @@ -242,6 +242,7 @@ 06/26 Brian Somersborn in Dundrum, Dublin, Ireland, 1967 06/28 Mark Santcroos born in Rotterdam, the Netherlands, 1979 06/28 Xin Li born in Beijing, People's Republic of China, 1982 +06/28 Bradley T. Hughes born in Amarillo, Texas, United States, 1977 06/29 Wilfredo Sanchez Vega born in Majaguez, Puerto Rico, United States, 1972 06/29 Daniel Harris born in Lubbock, Texas, United States, 1985 06/29 Andrew Pantyukhin born in Moscow, Russian Federation, 1985 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322483 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Aug 14 05:30:02 2017 New Revision: 322483 URL: https://svnweb.freebsd.org/changeset/base/322483 Log: hyperv/hn: Update VF's ibytes properly under transparent VF mode. While, I'm here add comment about why updating VF's imcast stat is not necessary. MFC after:3 days Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D11948 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 14 04:48:35 2017 (r322482) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Aug 14 05:30:02 2017 (r322483) @@ -1266,16 +1266,37 @@ hn_xpnt_vf_input(struct ifnet *vf_ifp, struct mbuf *m) rm_runlock(_vfmap_lock, ); if (hn_ifp != NULL) { - /* -* Fix up rcvif and go through hn(4)'s if_input and -* increase ipackets. -*/ for (mn = m; mn != NULL; mn = mn->m_nextpkt) { - /* Allow tapping on the VF. */ + /* +* Allow tapping on the VF. +*/ ETHER_BPF_MTAP(vf_ifp, mn); + + /* +* Update VF stats. +*/ + if ((vf_ifp->if_capenable & IFCAP_HWSTATS) == 0) { + if_inc_counter(vf_ifp, IFCOUNTER_IBYTES, + mn->m_pkthdr.len); + } + /* +* XXX IFCOUNTER_IMCAST +* This stat updating is kinda invasive, since it +* requires two checks on the mbuf: the length check +* and the ethernet header check. As of this write, +* all multicast packets go directly to hn(4), which +* makes imcast stat updating in the VF a try in vian. +*/ + + /* +* Fix up rcvif and increase hn(4)'s ipackets. +*/ mn->m_pkthdr.rcvif = hn_ifp; if_inc_counter(hn_ifp, IFCOUNTER_IPACKETS, 1); } + /* +* Go through hn(4)'s if_input. +*/ hn_ifp->if_input(hn_ifp, m); } else { /* ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322479 - head/sys/dev/iicbus
Author: ian Date: Mon Aug 14 02:23:10 2017 New Revision: 322479 URL: https://svnweb.freebsd.org/changeset/base/322479 Log: Add hinted attachment for non-FDT systems. Also, print a message if setting up the timer fails, because on some types of chips that's the first attempt to access the device. If the chip is missing/non-responsive then you'd get a driver that attached and didn't register the rtc, with no clue about why. On other chip types there are inits that come before timer setup, and they already print messages about errors. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c == --- head/sys/dev/iicbus/nxprtc.cMon Aug 14 00:12:14 2017 (r322478) +++ head/sys/dev/iicbus/nxprtc.cMon Aug 14 02:23:10 2017 (r322479) @@ -191,15 +191,26 @@ struct nxprtc_softc { u_int chiptype; /* Type of PCF85xx chip */ uint8_t secaddr;/* Address of seconds register */ uint8_t tmcaddr;/* Address of timer count register */ - uint8_t slave_addr; /* PCF85xx slave address */ booluse_timer; /* Use timer for fractional sec */ }; #defineSC_F_CPOL (1 << 0)/* Century bit means 19xx */ #defineSC_F_AMPM (1 << 1)/* Use PM flag in hours reg */ +/* + * We use the compat_data table to look up hint strings in the non-FDT case, so + * define the struct locally when we don't get it from ofw_bus_subr.h. + */ #ifdef FDT -static struct ofw_compat_data compat_data[] = { +typedef struct ofw_compat_data nxprtc_compat_data; +#else +typedef struct { + const char *ocd_str; + uintptr_t ocd_data; +} nxprtc_compat_data; +#endif + +static nxprtc_compat_data compat_data[] = { {"nxp,pca2129", TYPE_PCA2129}, {"nxp,pca8565", TYPE_PCA8565}, {"nxp,pcf2127", TYPE_PCF2127}, @@ -214,7 +225,6 @@ static struct ofw_compat_data compat_data[] = { {NULL, TYPE_NONE}, }; -#endif static int read_reg(struct nxprtc_softc *sc, uint8_t reg, uint8_t *val) @@ -476,19 +486,25 @@ nxprtc_start(void *dev) case TYPE_PCF2127: if (pcf8523_start(sc) != 0) return; - if (pcf2127_start_timer(sc) != 0) + if (pcf2127_start_timer(sc) != 0) { + device_printf(sc->dev, "cannot set up timer\n"); return; + } break; case TYPE_PCF8523: if (pcf8523_start(sc) != 0) return; - if (pcf8523_start_timer(sc) != 0) + if (pcf8523_start_timer(sc) != 0) { + device_printf(sc->dev, "cannot set up timer\n"); return; + } break; case TYPE_PCA8565: case TYPE_PCF8563: - if (pcf8563_start_timer(sc) != 0) + if (pcf8563_start_timer(sc) != 0) { + device_printf(sc->dev, "cannot set up timer\n"); return; + } break; default: device_printf(sc->dev, "missing init code for this chiptype\n"); @@ -685,24 +701,59 @@ errout: } static int -nxprtc_probe(device_t dev) +nxprtc_get_chiptype(device_t dev) { +#ifdef FDT + + return (ofw_bus_search_compatible(dev, compat_data)->ocd_data); +#else + nxprtc_compat_data *cdata; + const char *htype; int chiptype; + /* +* If given a chiptype hint string, loop through the ofw compat data +* comparing the hinted chip type to the compat strings. The table end +* marker ocd_data is TYPE_NONE. +*/ + if (resource_string_value(device_get_name(dev), + device_get_unit(dev), "compatible", ) == 0) { + for (cdata = compat_data; cdata->ocd_str != NULL; ++cdata) { + if (strcmp(htype, cdata->ocd_str) == 0) + break; + } + chiptype = cdata->ocd_data; + } else + chiptype = TYPE_NONE; + + /* +* On non-FDT systems the historical behavior of this driver was to +* assume a PCF8563; keep doing that for compatibility. +*/ + if (chiptype == TYPE_NONE) + return (TYPE_PCF8563); + else + return (chiptype); +#endif +} + +static int +nxprtc_probe(device_t dev) +{ + int chiptype, rv; + #ifdef FDT if (!ofw_bus_status_okay(dev)) return (ENXIO); - - chiptype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - if (chiptype == TYPE_NONE) - return (ENXIO); + rv = BUS_PROBE_GENERIC; #else - /* Historically the non-FDT driver supports only PCF8563. */ -
svn commit: r322478 - head/sys/arm/conf
Author: ian Date: Mon Aug 14 00:12:14 2017 New Revision: 322478 URL: https://svnweb.freebsd.org/changeset/base/322478 Log: Add back the drivers for Dallas/Maxim ds13xx and Seiko S35390x now that they've been rewritten/fixed to not cause panics by doing i2c transfers before interrupts are available. PR: 221227 Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC == --- head/sys/arm/conf/GENERIC Mon Aug 14 00:00:24 2017(r322477) +++ head/sys/arm/conf/GENERIC Mon Aug 14 00:12:14 2017(r322478) @@ -139,9 +139,11 @@ device twl_clks# twl external clocks # i2c RTCs device ds1307 # Dallas DS1307 RTC and compatible +device ds13rtc # All Dallas/Maxim DS13xx RTCs device ds1672 # Dallas DS1672 RTC device ds3231 # Dallas DS3231 RTC + temperature device nxprtc # NXP RTCs: PCA/PFC212x PCA/PCF85xx +device s35390a # Seiko s3539x RTCs # GPIO device gpio ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322477 - in head/sys: dev/iicbus modules/i2c modules/i2c/s35390a
Author: ian Date: Mon Aug 14 00:00:24 2017 New Revision: 322477 URL: https://svnweb.freebsd.org/changeset/base/322477 Log: Minor fixes and enhancements for the s35390a i2c RTC driver... - Add FDT probe code. - Do i2c transfers with exclusive bus ownership. - Use config_intrhook_oneshot() to defer chip setup because some i2c busses can't do transfers without interrupts. - Add a detach() routine. - Add to module build. Added: head/sys/modules/i2c/s35390a/ head/sys/modules/i2c/s35390a/Makefile (contents, props changed) Modified: head/sys/dev/iicbus/s35390a.c head/sys/modules/i2c/Makefile Modified: head/sys/dev/iicbus/s35390a.c == --- head/sys/dev/iicbus/s35390a.c Sun Aug 13 22:07:42 2017 (r322476) +++ head/sys/dev/iicbus/s35390a.c Mon Aug 14 00:00:24 2017 (r322477) @@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$"); * Driver for Seiko Instruments S-35390A Real-time Clock */ +#include "opt_platform.h" + #include #include #include @@ -69,6 +71,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #include "clock_if.h" #include "iicbus_if.h" @@ -159,7 +167,7 @@ s390rtc_read(device_t dev, uint8_t reg, uint8_t *buf, int i; int error; - error = iicbus_transfer(dev, msg, 1); + error = iicbus_transfer_excl(dev, msg, 1, IIC_WAIT); if (error) return (error); @@ -188,13 +196,20 @@ s390rtc_write(device_t dev, uint8_t reg, uint8_t *buf, for (i = 0; i < len; ++i) buf[i] = bitreverse(buf[i]); - return (iicbus_transfer(dev, msg, 1)); + return (iicbus_transfer_excl(dev, msg, 1, IIC_WAIT)); } static int s390rtc_probe(device_t dev) { +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "sii,s35390a")) + return (ENXIO); +#else if (iicbus_get_addr(dev) != S390_ADDR) { if (bootverbose) device_printf(dev, "slave address mismatch. " @@ -202,35 +217,35 @@ s390rtc_probe(device_t dev) S390_ADDR); return (ENXIO); } - device_set_desc(dev, "Seiko Instruments S-35390A Real-time Clock"); +#endif + device_set_desc(dev, "Seiko Instruments S-35390A RTC"); - return (BUS_PROBE_SPECIFIC); + return (BUS_PROBE_DEFAULT); } -static int -s390rtc_attach(device_t dev) +static void +s390rtc_start(void *arg) { - struct s390rtc_softc *sc; + device_t dev; uint8_t reg; int error; - sc = device_get_softc(dev); - sc->sc_dev = dev; - sc->sc_addr = iicbus_get_addr(dev); + dev = arg; /* Reset the chip and turn on 24h mode, after power-off or battery. */ error = s390rtc_read(dev, S390_STATUS1, , 1); if (error) { device_printf(dev, "%s: cannot read status1 register\n", __func__); - return (error); + return; } if (reg & (S390_ST1_POC | S390_ST1_BLD)) { reg |= S390_ST1_24H | S390_ST1_RESET; error = s390rtc_write(dev, S390_STATUS1, , 1); if (error) { - device_printf(dev, "%s: cannot initialize\n", __func__); - return (error); + device_printf(dev, + "%s: cannot initialize\n", __func__); + return; } } @@ -239,7 +254,7 @@ s390rtc_attach(device_t dev) if (error) { device_printf(dev, "%s: cannot read status2 register\n", __func__); - return (error); + return; } if (reg & S390_ST2_TEST) { reg &= ~S390_ST2_TEST; @@ -247,15 +262,36 @@ s390rtc_attach(device_t dev) if (error) { device_printf(dev, "%s: cannot disable the test mode\n", __func__); - return (error); + return; } } clock_register(dev, 100); /* 1 second resolution */ +} + +static int +s390rtc_attach(device_t dev) +{ + struct s390rtc_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + config_intrhook_oneshot(s390rtc_start, dev); + return (0); } static int +s390rtc_detach(device_t dev) +{ + + clock_unregister(dev); + return (0); +} + +static int s390rtc_gettime(device_t dev, struct timespec *ts) { uint8_t bcd[S390_RT1_NBYTES]; @@ -310,6 +346,7 @@ s390rtc_settime(device_t dev, struct timespec *ts) static device_method_t s390rtc_methods[] = { DEVMETHOD(device_probe, s390rtc_probe),
svn commit: r322476 - in head/sys: conf dev/iicbus mips/conf mips/rmi
Author: ian Date: Sun Aug 13 22:07:42 2017 New Revision: 322476 URL: https://svnweb.freebsd.org/changeset/base/322476 Log: Remove the old ds1374 driver and use the ds13rtc driver instead. Adjust several mips config files accordingly. Deleted: head/sys/dev/iicbus/ds1374.c Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/mips/conf/XLP.hints head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 head/sys/mips/conf/std.XLP head/sys/mips/rmi/xlr_i2c.c Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Sun Aug 13 21:45:46 2017(r322475) +++ head/sys/conf/NOTES Sun Aug 13 22:07:42 2017(r322476) @@ -2524,7 +2524,6 @@ deviceiicoc # OpenCores I2C controller support # I2C peripheral devices # device ds1307 # Dallas DS1307 RTC and compatible -device ds1374 # Dallas DS1374 RTC device ds13rtc # All Dallas/Maxim ds13xx chips device ds1672 # Dallas DS1672 RTC device ds3231 # Dallas DS3231 RTC + temperature Modified: head/sys/conf/files == --- head/sys/conf/files Sun Aug 13 21:45:46 2017(r322475) +++ head/sys/conf/files Sun Aug 13 22:07:42 2017(r322476) @@ -1752,8 +1752,7 @@ dev/ida/ida_disk.coptional ida dev/ida/ida_pci.c optional ida pci dev/iicbus/ad7418.coptional ad7418 dev/iicbus/ds1307.coptional ds1307 -dev/iicbus/ds1374.coptional ds1374 -dev/iicbus/ds13rtc.c optional ds13rtc | ds133x +dev/iicbus/ds13rtc.c optional ds13rtc | ds133x | ds1374 dev/iicbus/ds1672.coptional ds1672 dev/iicbus/ds3231.coptional ds3231 dev/iicbus/icee.c optional icee Modified: head/sys/mips/conf/XLP.hints == --- head/sys/mips/conf/XLP.hintsSun Aug 13 21:45:46 2017 (r322475) +++ head/sys/mips/conf/XLP.hintsSun Aug 13 22:07:42 2017 (r322476) @@ -1,5 +1,6 @@ # $FreeBSD$ # RTC -hint.ds1374_rtc.0.at="iicbus1" -hint.ds1374_rtc.0.addr=0xd0 +hint.ds13rtc.0.at="iicbus1" +hint.ds13rtc.0.addr=0xd0 +hint.ds13rtc.0.compatible="dallas,ds1374" Modified: head/sys/mips/conf/XLR == --- head/sys/mips/conf/XLR Sun Aug 13 21:45:46 2017(r322475) +++ head/sys/mips/conf/XLR Sun Aug 13 22:07:42 2017(r322476) @@ -136,7 +136,7 @@ device ic device iic device iicbb device iicbus -device ds1374 # RTC on XLR boards +device ds13rtc # RTC on XLR boards device max6657 # Temparature sensor on XLR boards device at24co2n# EEPROM on XLR boards Modified: head/sys/mips/conf/XLR64 == --- head/sys/mips/conf/XLR64Sun Aug 13 21:45:46 2017(r322475) +++ head/sys/mips/conf/XLR64Sun Aug 13 22:07:42 2017(r322476) @@ -110,7 +110,7 @@ device ic device iic device iicbb device iicbus -device ds1374 # RTC on XLR boards +device ds13rtc # RTC on XLR boards device max6657 # Temparature sensor on XLR boards device at24co2n# EEPROM on XLR boards Modified: head/sys/mips/conf/XLRN32 == --- head/sys/mips/conf/XLRN32 Sun Aug 13 21:45:46 2017(r322475) +++ head/sys/mips/conf/XLRN32 Sun Aug 13 22:07:42 2017(r322476) @@ -114,7 +114,7 @@ device ic device iic device iicbb device iicbus -device ds1374 # RTC on XLR boards +device ds13rtc # RTC on XLR boards device max6657 # Temparature sensor on XLR boards device at24co2n# EEPROM on XLR boards Modified: head/sys/mips/conf/std.XLP == --- head/sys/mips/conf/std.XLP Sun Aug 13 21:45:46 2017(r322475) +++ head/sys/mips/conf/std.XLP Sun Aug 13 22:07:42 2017(r322476) @@ -95,7 +95,7 @@ deviceumass # Requires scbus and da device iic device iicbus device iicoc -device ds1374 # RTC on XLP boards +device ds13rtc # RTC on XLP boards # Crypto device crypto Modified: head/sys/mips/rmi/xlr_i2c.c == --- head/sys/mips/rmi/xlr_i2c.c Sun Aug 13 21:45:46 2017(r322475) +++ head/sys/mips/rmi/xlr_i2c.c Sun
svn commit: r322475 - head/sys/dev/iicbus
Author: ian Date: Sun Aug 13 21:45:46 2017 New Revision: 322475 URL: https://svnweb.freebsd.org/changeset/base/322475 Log: Change "chiptype" to "compatible". Making the hint name the same as the FDT property name should make it easier to document the list of names accepted by both configuration mechanisms. Modified: head/sys/dev/iicbus/ds13rtc.c Modified: head/sys/dev/iicbus/ds13rtc.c == --- head/sys/dev/iicbus/ds13rtc.c Sun Aug 13 21:11:48 2017 (r322474) +++ head/sys/dev/iicbus/ds13rtc.c Sun Aug 13 21:45:46 2017 (r322475) @@ -495,7 +495,7 @@ ds13rtc_get_chiptype(device_t dev) * We can only attach if provided a chiptype hint string. */ if (resource_string_value(device_get_name(dev), - device_get_unit(dev), "chiptype", ) != 0) + device_get_unit(dev), "compatible", ) != 0) return (TYPE_NONE); /* ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322474 - head/contrib/llvm/tools/lld/ELF
Author: emaste Date: Sun Aug 13 21:11:48 2017 New Revision: 322474 URL: https://svnweb.freebsd.org/changeset/base/322474 Log: lld: Add `-z muldefs` option. Obtained from:LLVM r310757 Modified: head/contrib/llvm/tools/lld/ELF/Driver.cpp Modified: head/contrib/llvm/tools/lld/ELF/Driver.cpp == --- head/contrib/llvm/tools/lld/ELF/Driver.cpp Sun Aug 13 21:02:40 2017 (r322473) +++ head/contrib/llvm/tools/lld/ELF/Driver.cpp Sun Aug 13 21:11:48 2017 (r322474) @@ -615,7 +615,8 @@ static bool getCompressDebugSections(opt::InputArgList // Initializes Config members by the command line options. void LinkerDriver::readConfigs(opt::InputArgList ) { - Config->AllowMultipleDefinition = Args.hasArg(OPT_allow_multiple_definition); + Config->AllowMultipleDefinition = + Args.hasArg(OPT_allow_multiple_definition) || hasZOption(Args, "muldefs"); Config->AuxiliaryList = getArgs(Args, OPT_auxiliary); Config->Bsymbolic = Args.hasArg(OPT_Bsymbolic); Config->BsymbolicFunctions = Args.hasArg(OPT_Bsymbolic_functions); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322473 - in head/sys: conf dev/iicbus modules/i2c modules/i2c/ds13rtc
Author: ian Date: Sun Aug 13 21:02:40 2017 New Revision: 322473 URL: https://svnweb.freebsd.org/changeset/base/322473 Log: Add a new driver, ds13rtc, that handles all DS13xx series i2c RTC chips. This driver supports only basic timekeeping functionality. It completely replaces the ds133x driver. It can also replace the ds1374 driver, but that will take a few other changes in MIPS code and config, and will be committed separately. It does NOT replace the existing ds1307 driver, which provides access to some of the extended features on the 1307 chip, such as controlling the square wave output signal. If both ds1307 and ds13rtc drivers are present, the ds1307 driver will outbid and win control of the device. This driver can be configured with FDT data, or by using hints on non-FDT systems. In addition to the standard hints for i2c devices, it requires a "chiptype" string of the form "dallas,ds13xx" where 'xx' is the chip id (i.e., the same format as FDT compat strings). Added: head/sys/dev/iicbus/ds13rtc.c (contents, props changed) head/sys/modules/i2c/ds13rtc/ head/sys/modules/i2c/ds13rtc/Makefile (contents, props changed) Deleted: head/sys/dev/iicbus/ds133x.c Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/modules/i2c/Makefile Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Sun Aug 13 19:35:48 2017(r322472) +++ head/sys/conf/NOTES Sun Aug 13 21:02:40 2017(r322473) @@ -2524,8 +2524,8 @@ deviceiicoc # OpenCores I2C controller support # I2C peripheral devices # device ds1307 # Dallas DS1307 RTC and compatible -device ds133x # Dallas DS1337, DS1338 and DS1339 RTC device ds1374 # Dallas DS1374 RTC +device ds13rtc # All Dallas/Maxim ds13xx chips device ds1672 # Dallas DS1672 RTC device ds3231 # Dallas DS3231 RTC + temperature device icee# AT24Cxxx and compatible EEPROMs Modified: head/sys/conf/files == --- head/sys/conf/files Sun Aug 13 19:35:48 2017(r322472) +++ head/sys/conf/files Sun Aug 13 21:02:40 2017(r322473) @@ -1752,8 +1752,8 @@ dev/ida/ida_disk.coptional ida dev/ida/ida_pci.c optional ida pci dev/iicbus/ad7418.coptional ad7418 dev/iicbus/ds1307.coptional ds1307 -dev/iicbus/ds133x.coptional ds133x dev/iicbus/ds1374.coptional ds1374 +dev/iicbus/ds13rtc.c optional ds13rtc | ds133x dev/iicbus/ds1672.coptional ds1672 dev/iicbus/ds3231.coptional ds3231 dev/iicbus/icee.c optional icee Added: head/sys/dev/iicbus/ds13rtc.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/ds13rtc.c Sun Aug 13 21:02:40 2017 (r322473) @@ -0,0 +1,629 @@ +/*- + * Copyright (c) 2017 Ian Lepore+ * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for Dallas/Maxim DS13xx real-time clock/calendar chips: + * + * - DS1307 = Original/basic rtc + 56 bytes ram; 5v only. + * - DS1308 = Updated 1307, available in 1.8v-5v variations. + * - DS1337 = Like 1308, integrated xtal, 32khz output on at powerup. + * - DS1338 = Like 1308, integrated xtal. + * - DS1339 = Like 1337, integrated xtal, integrated trickle charger. + * - DS1340 = Like 1338, ST
Re: svn commit: r322465 - in head: share/man/man9 sys/kern sys/sys
On Sun, 2017-08-13 at 11:41 -0700, Conrad Meyer wrote: > On Sun, Aug 13, 2017 at 11:10 AM, Ian Leporewrote: > > > > Author: ian > > Date: Sun Aug 13 18:10:24 2017 > > New Revision: 322465 > > URL: https://svnweb.freebsd.org/changeset/base/322465 > > > > Log: > > Add config_intrhook_oneshot(): schedule an intrhook function and > > unregister > > it automatically after it runs. > > > > The config_intrhook mechanism allows a driver to stall the boot > > process > > until device(s) required for booting are available, by not > > allowing system > > inits to proceed until all intrhook functions have been > > unregistered. > > Virtually all existing code simply unregisters from within the > > hook function > > when it gets called. > > > > This new function makes that common usage more convenient. > > Instead of > > allocating and filling in a struct, passing it to a function that > > might (in > > theory) fail, and checking the return code, now a driver can > > simply call > > this cannot-fail routine, passing just the intrhook function and > > its arg. > > > > Differential Revision:https://reviews.freebsd.org/D11963 > Reviewed by: cem, bcr (manpages) As indicated in the referenced differential revision. -- Ian ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r322465 - in head: share/man/man9 sys/kern sys/sys
On Sun, Aug 13, 2017 at 11:10 AM, Ian Leporewrote: > Author: ian > Date: Sun Aug 13 18:10:24 2017 > New Revision: 322465 > URL: https://svnweb.freebsd.org/changeset/base/322465 > > Log: > Add config_intrhook_oneshot(): schedule an intrhook function and unregister > it automatically after it runs. > > The config_intrhook mechanism allows a driver to stall the boot process > until device(s) required for booting are available, by not allowing system > inits to proceed until all intrhook functions have been unregistered. > Virtually all existing code simply unregisters from within the hook function > when it gets called. > > This new function makes that common usage more convenient. Instead of > allocating and filling in a struct, passing it to a function that might (in > theory) fail, and checking the return code, now a driver can simply call > this cannot-fail routine, passing just the intrhook function and its arg. > > Differential Revision:https://reviews.freebsd.org/D11963 Reviewed by: cem, bcr (manpages) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322471 - head/usr.bin/calendar/calendars
Author: ohauer (ports committer) Date: Sun Aug 13 18:59:19 2017 New Revision: 322471 URL: https://svnweb.freebsd.org/changeset/base/322471 Log: - Add myswlf Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdSun Aug 13 18:54:51 2017(r322470) +++ head/usr.bin/calendar/calendars/calendar.freebsdSun Aug 13 18:59:19 2017(r322471) @@ -386,6 +386,7 @@ 10/26 Matthew Ahrensborn in United States, 1979 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 +10/30 Olli Hauer born in Sindelfingen, Germany, 1968 10/31 Taras Korenko born in Cherkasy region, Ukraine, 1980 11/03 Ryan Stone born in Ottawa, Ontario, Canada, 1985 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322470 - head/sys/arm64/arm64
Author: andrew Date: Sun Aug 13 18:54:51 2017 New Revision: 322470 URL: https://svnweb.freebsd.org/changeset/base/322470 Log: Add support for multiple GICv3 ITS devices. For this we add sc_irq_base and sc_irq_length to the softc to handle the base number of IRQs available, make gicv3_get_nirqs return the number of available interrupt IDs, and limit which CPUs we send interrupts to based on the numa domain. The last point is only strictly needed on a dual socket ThunderX where we are unable to send MSI/MSI-X interrupts between sockets. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gic_v3.c == --- head/sys/arm64/arm64/gic_v3.c Sun Aug 13 18:41:37 2017 (r322469) +++ head/sys/arm64/arm64/gic_v3.c Sun Aug 13 18:54:51 2017 (r322470) @@ -374,7 +374,7 @@ gic_v3_read_ivar(device_t dev, device_t child, int whi switch (which) { case GICV3_IVAR_NIRQS: - *result = sc->gic_nirqs; + *result = (NIRQ - sc->gic_nirqs) / sc->gic_nchildren; return (0); case GICV3_IVAR_REDIST_VADDR: *result = (uintptr_t)rman_get_virtual( Modified: head/sys/arm64/arm64/gic_v3_fdt.c == --- head/sys/arm64/arm64/gic_v3_fdt.c Sun Aug 13 18:41:37 2017 (r322469) +++ head/sys/arm64/arm64/gic_v3_fdt.c Sun Aug 13 18:54:51 2017 (r322470) @@ -266,10 +266,12 @@ static int gic_v3_ofw_bus_attach(device_t dev) { struct gic_v3_ofw_devinfo *di; + struct gic_v3_softc *sc; device_t child; phandle_t parent, node; pcell_t addr_cells, size_cells; + sc = device_get_softc(dev); parent = ofw_bus_get_node(dev); if (parent > 0) { addr_cells = 2; @@ -320,6 +322,7 @@ gic_v3_ofw_bus_attach(device_t dev) continue; } + sc->gic_nchildren++; device_set_ivars(child, di); } } Modified: head/sys/arm64/arm64/gicv3_its.c == --- head/sys/arm64/arm64/gicv3_its.cSun Aug 13 18:41:37 2017 (r322469) +++ head/sys/arm64/arm64/gicv3_its.cSun Aug 13 18:54:51 2017 (r322470) @@ -228,6 +228,9 @@ struct gicv3_its_softc { struct intr_pic *sc_pic; struct resource *sc_its_res; + cpuset_tsc_cpus; + u_int gic_irq_cpu; + struct its_ptable sc_its_ptab[GITS_BASER_NUM]; struct its_col *sc_its_cols[MAXCPU];/* Per-CPU collections */ @@ -245,6 +248,8 @@ struct gicv3_its_softc { vmem_t *sc_irq_alloc; struct gicv3_its_irqsrc *sc_irqs; + u_int sc_irq_base; + u_int sc_irq_length; struct mtx sc_its_dev_lock; TAILQ_HEAD(its_dev_list, its_dev) sc_its_dev_list; @@ -274,8 +279,6 @@ static const struct { }, }; -static u_int gic_irq_cpu; - #definegic_its_read_4(sc, reg) \ bus_read_4((sc)->sc_its_res, (reg)) #definegic_its_read_8(sc, reg) \ @@ -555,7 +558,7 @@ gicv3_its_pendtables_init(struct gicv3_its_softc *sc) int i; for (i = 0; i < mp_ncpus; i++) { - if (CPU_ISSET(i, _cpus) == 0) + if (CPU_ISSET(i, >sc_cpus) == 0) continue; sc->sc_pend_base[i] = (vm_offset_t)contigmalloc( @@ -578,6 +581,9 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) u_int cpuid; int domain; + if (!CPU_ISSET(PCPU_GET(cpuid), >sc_cpus)) + return (0); + if (bus_get_domain(dev, ) == 0) { if (PCPU_GET(domain) != domain) return (0); @@ -683,7 +689,7 @@ gicv3_its_attach(device_t dev) struct gicv3_its_softc *sc; const char *name; uint32_t iidr; - int err, i, rid; + int domain, err, i, rid; sc = device_get_softc(dev); @@ -718,12 +724,20 @@ gicv3_its_attach(device_t dev) /* Protects access to the ITS command circular buffer. */ mtx_init(>sc_its_cmd_lock, "ITS cmd lock", NULL, MTX_SPIN); + if (bus_get_domain(dev, ) == 0) { + CPU_ZERO(>sc_cpus); + if (domain < MAXMEMDOM) + CPU_COPY(_domain[domain], >sc_cpus); + } else { + CPU_COPY(_cpus, >sc_cpus); + } + /* Allocate the command circular buffer */ gicv3_its_cmdq_init(sc); /* Allocate the per-CPU collections */ for (int cpu = 0; cpu < mp_ncpus; cpu++) - if (CPU_ISSET(cpu, _cpus) != 0) + if (CPU_ISSET(cpu,
svn commit: r322465 - in head: share/man/man9 sys/kern sys/sys
Author: ian Date: Sun Aug 13 18:10:24 2017 New Revision: 322465 URL: https://svnweb.freebsd.org/changeset/base/322465 Log: Add config_intrhook_oneshot(): schedule an intrhook function and unregister it automatically after it runs. The config_intrhook mechanism allows a driver to stall the boot process until device(s) required for booting are available, by not allowing system inits to proceed until all intrhook functions have been unregistered. Virtually all existing code simply unregisters from within the hook function when it gets called. This new function makes that common usage more convenient. Instead of allocating and filling in a struct, passing it to a function that might (in theory) fail, and checking the return code, now a driver can simply call this cannot-fail routine, passing just the intrhook function and its arg. Differential Revision:https://reviews.freebsd.org/D11963 Modified: head/share/man/man9/Makefile head/share/man/man9/config_intrhook.9 head/sys/kern/subr_autoconf.c head/sys/sys/kernel.h Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileSun Aug 13 18:09:22 2017 (r322464) +++ head/share/man/man9/MakefileSun Aug 13 18:10:24 2017 (r322465) @@ -669,7 +669,8 @@ MLINKS+=condvar.9 cv_broadcast.9 \ condvar.9 cv_wait_unlock.9 \ condvar.9 cv_wmesg.9 MLINKS+=config_intrhook.9 config_intrhook_disestablish.9 \ - config_intrhook.9 config_intrhook_establish.9 + config_intrhook.9 config_intrhook_establish.9 \ + config_intrhook.9 config_intrhook_oneshot.9 MLINKS+=contigmalloc.9 contigfree.9 MLINKS+=casuword.9 casueword.9 \ casuword.9 casueword32.9 \ Modified: head/share/man/man9/config_intrhook.9 == --- head/share/man/man9/config_intrhook.9 Sun Aug 13 18:09:22 2017 (r322464) +++ head/share/man/man9/config_intrhook.9 Sun Aug 13 18:10:24 2017 (r322465) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2006 +.Dd August 10, 2017 .Dt CONFIG_INTRHOOK 9 .Os .Sh NAME @@ -35,10 +35,13 @@ but before root is mounted .Sh SYNOPSIS .In sys/kernel.h +.Vt typedef void (*ich_func_t)(void *arg); .Ft int .Fn config_intrhook_establish "struct intr_config_hook *hook" .Ft void .Fn config_intrhook_disestablish "struct intr_config_hook *hook" +.Ft void +.Fn config_intrhook_oneshot "ich_func_t func" "void *arg" .Sh DESCRIPTION The .Fn config_intrhook_establish @@ -51,6 +54,18 @@ The .Fn config_intrhook_disestablish function removes the entry from the hook queue. .Pp +The +.Fn config_intrhook_oneshot +function schedules a function to be run as described for +.Fn config_intrhook_establish ; +the entry is automatically removed from the hook queue +after that function runs. +This is appropriate when additional device configuration must be done +after interrupts are enabled, but there is no need to stall the +boot process after that. +This function allocates memory using M_WAITOK; do not call this while +holding any non-sleepable locks. +.Pp Before root is mounted, all the previously established hooks are run. The boot process is then stalled until all handlers remove their hook @@ -71,8 +86,8 @@ This structure is defined as follows: .Bd -literal struct intr_config_hook { TAILQ_ENTRY(intr_config_hook) ich_links;/* Private */ - void(*ich_func)(void *arg); /* function to call */ - void*ich_arg; /* Argument to call */ + ich_func_t ich_func; /* function to call */ + void*ich_arg; /* Argument to call */ }; .Ed .Pp Modified: head/sys/kern/subr_autoconf.c == --- head/sys/kern/subr_autoconf.c Sun Aug 13 18:09:22 2017 (r322464) +++ head/sys/kern/subr_autoconf.c Sun Aug 13 18:10:24 2017 (r322465) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -63,6 +64,27 @@ MTX_SYSINIT(intr_config_hook, _config_hook_lock, static void run_interrupt_driven_config_hooks(void); /* + * Private data and a shim function for implementing config_interhook_oneshot(). + */ +struct oneshot_config_hook { + struct intr_config_hook + och_hook; /* Must be first */ + ich_func_t och_func; + void*och_arg; +}; + +static void +config_intrhook_oneshot_func(void *arg) +{ + struct oneshot_config_hook *ohook; + + ohook = arg; + ohook->och_func(ohook->och_arg); + config_intrhook_disestablish(>och_hook); + free(ohook, M_DEVBUF); +} + +/* * If we wait too long for an interrupt-driven config hook to return, print * a diagnostic.
svn commit: r322464 - head/sys/geom/journal
Author: mckusick Date: Sun Aug 13 18:09:22 2017 New Revision: 322464 URL: https://svnweb.freebsd.org/changeset/base/322464 Log: When read requests are sent from a filesystem running above g_journal, the g_journal level needs to check whether it is holding a newer copy of the block than that which exists on the disk. If so, it needs to return its copy. If not, it should pass the request down to the disk to fulfill. It currently considers six queues: 0) delayed queue, 1) unsent (current queue), 2) in-flight to the journal (flush queue), 3) active journal (active queue), 4) inactive journal (inactive queue), and 5) inflight to the disk (copy queue). Checking on two of these queues is unnecessary: 0) The delayed requests should not be used for reads because they have not yet been entered into the journal, so their value should reflect the disk contents, not the future contents that are not yet committed. 2) Because all the bio's in the flush queue are also found on the active queue, there is no need to inspect the flush queue for reads since they will be found when searching the active queue. Submitted by: Dr. Andreas LongwitzDiscussed with: kib MFC after: 1 week Modified: head/sys/geom/journal/g_journal.c Modified: head/sys/geom/journal/g_journal.c == --- head/sys/geom/journal/g_journal.c Sun Aug 13 18:06:38 2017 (r322463) +++ head/sys/geom/journal/g_journal.c Sun Aug 13 18:09:22 2017 (r322464) @@ -1514,49 +1514,10 @@ g_journal_read_find(struct bio *head, int sorted, stru } /* - * Try to find requested data in cache. - */ -static struct bio * -g_journal_read_queue_find(struct bio_queue *head, struct bio *pbp, off_t ostart, -off_t oend) -{ - off_t cstart, cend; - struct bio *bp; - - TAILQ_FOREACH(bp, head, bio_queue) { - cstart = MAX(ostart, bp->bio_offset); - cend = MIN(oend, bp->bio_offset + bp->bio_length); - if (cend <= ostart) - continue; - else if (cstart >= oend) - continue; - KASSERT(bp->bio_data != NULL, - ("%s: bio_data == NULL", __func__)); - GJ_DEBUG(3, "READ(%p): (%jd, %jd) (bp=%p)", head, cstart, cend, - bp); - bcopy(bp->bio_data + cstart - bp->bio_offset, - pbp->bio_data + cstart - pbp->bio_offset, cend - cstart); - pbp->bio_completed += cend - cstart; - if (pbp->bio_completed == pbp->bio_length) { - /* -* Cool, the whole request was in cache, deliver happy -* message. -*/ - g_io_deliver(pbp, 0); - return (pbp); - } - break; - } - return (bp); -} - -/* - * This function is used for colecting data on read. + * This function is used for collecting data on read. * The complexity is because parts of the data can be stored in four different * places: - * - in delayed requests * - in memory - the data not yet send to the active journal provider - * - in requests which are going to be sent to the active journal * - in the active journal * - in the inactive journal * - in the data provider @@ -1574,20 +1535,14 @@ g_journal_read(struct g_journal_softc *sc, struct bio cstart = cend = -1; bp = NULL; head = NULL; - for (i = 0; i <= 5; i++) { + for (i = 1; i <= 5; i++) { switch (i) { - case 0: /* Delayed requests. */ - head = NULL; - sorted = 0; - break; case 1: /* Not-yet-send data. */ head = sc->sc_current_queue; sorted = 1; break; - case 2: /* In-flight to the active journal. */ - head = sc->sc_flush_queue; - sorted = 0; - break; + case 2: /* Skip flush queue as they are also in active queue */ + continue; case 3: /* Active journal. */ head = sc->sc_active.jj_queue; sorted = 1; @@ -1606,10 +1561,7 @@ g_journal_read(struct g_journal_softc *sc, struct bio default: panic("gjournal %s: i=%d", __func__, i); } - if (i == 0) - bp = g_journal_read_queue_find(>sc_delayed_queue.queue, pbp, ostart, oend); - else - bp = g_journal_read_find(head, sorted, pbp, ostart, oend); + bp = g_journal_read_find(head, sorted, pbp, ostart, oend); if (bp
svn commit: r322463 - head/sys/geom/journal
Author: mckusick Date: Sun Aug 13 18:06:38 2017 New Revision: 322463 URL: https://svnweb.freebsd.org/changeset/base/322463 Log: Eliminate a variable that is only ever set. Submitted by: Dr. Andreas LongwitzDiscussed with: kib MFC after: 1 week Modified: head/sys/geom/journal/g_journal.c Modified: head/sys/geom/journal/g_journal.c == --- head/sys/geom/journal/g_journal.c Sun Aug 13 17:30:03 2017 (r322462) +++ head/sys/geom/journal/g_journal.c Sun Aug 13 18:06:38 2017 (r322463) @@ -1236,7 +1236,7 @@ g_journal_flush(struct g_journal_softc *sc) struct g_provider *pp; struct bio **bioq; struct bio *bp, *fbp, *pbp; - off_t joffset, size; + off_t joffset; u_char *data, hash[16]; MD5_CTX ctx; u_int i; @@ -1244,7 +1244,6 @@ g_journal_flush(struct g_journal_softc *sc) if (sc->sc_current_count == 0) return; - size = 0; pp = sc->sc_jprovider; GJ_VALIDATE_OFFSET(sc->sc_journal_offset, sc); joffset = sc->sc_journal_offset; @@ -1294,7 +1293,6 @@ g_journal_flush(struct g_journal_softc *sc) ent->je_offset = bp->bio_offset; ent->je_joffset = joffset; ent->je_length = bp->bio_length; - size += ent->je_length; data = bp->bio_data; if (sc->sc_flags & GJF_DEVICE_CHECKSUM) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322459 - in head/sys: kern sys
Author: alc Date: Sun Aug 13 16:39:49 2017 New Revision: 322459 URL: https://svnweb.freebsd.org/changeset/base/322459 Log: The *_meta_* functions include a radix parameter, a blk parameter, and another parameter that identifies a starting point in the memory address block. Radix is a power of two, blk is a multiple of radix, and the starting point is in the range [blk, blk+radix), so that blk can always be computed from the other two. This change drops the blk parameter from the meta functions and computes it instead. (On amd64, for example, this change reduces subr_blist.o's text size by 7%.) It also makes the radix parameters unsigned to address concerns that the calculation of '-radix' might overflow without the -fwrapv option. (See https://reviews.freebsd.org/D11819.) Submitted by: Doug MooreMFC after:1 week Differential Revision:https://reviews.freebsd.org/D11964 Modified: head/sys/kern/subr_blist.c head/sys/sys/blist.h Modified: head/sys/kern/subr_blist.c == --- head/sys/kern/subr_blist.c Sun Aug 13 15:15:40 2017(r322458) +++ head/sys/kern/subr_blist.c Sun Aug 13 16:39:49 2017(r322459) @@ -123,16 +123,16 @@ void panic(const char *ctl, ...); */ static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count, daddr_t cursor); -static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, - daddr_t radix, daddr_t cursor); +static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, + u_daddr_t radix); static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count); static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, - daddr_t radix, daddr_t blk); + u_daddr_t radix); static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest, daddr_t count); static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, - daddr_t radix, daddr_t blk); + u_daddr_t radix); static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count); #ifndef _KERNEL static voidblst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, @@ -247,8 +247,8 @@ blist_alloc(blist_t bl, daddr_t count) * reduce the hint, stopping further iterations. */ while (count <= bl->bl_root->bm_bighint) { - blk = blst_meta_alloc(bl->bl_root, 0, count, bl->bl_radix, - bl->bl_cursor); + blk = blst_meta_alloc(bl->bl_root, bl->bl_cursor, count, + bl->bl_radix); if (blk != SWAPBLK_NONE) { bl->bl_cursor = blk + count; return (blk); @@ -280,7 +280,7 @@ void blist_free(blist_t bl, daddr_t blkno, daddr_t count) { - blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix, 0); + blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix); } /* @@ -293,7 +293,7 @@ daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count) { - return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix, 0)); + return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix)); } /* @@ -447,13 +447,13 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count * and we have a few optimizations strewn in as well. */ static daddr_t -blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, daddr_t radix, -daddr_t cursor) +blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix) { - daddr_t i, next_skip, r, skip; + daddr_t blk, i, next_skip, r, skip; int child; bool scan_from_start; + blk = cursor & -radix; if (radix == BLIST_BMAP_RADIX) return (blst_leaf_alloc(scan, blk, count, cursor)); if (scan->u.bmu_avail < count) { @@ -505,8 +505,8 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t c /* * The allocation might fit in the i'th subtree. */ - r = blst_meta_alloc([i], blk, count, radix, - cursor > blk ? cursor : blk); + r = blst_meta_alloc([i], + cursor > blk ? cursor : blk, count, radix); if (r != SWAPBLK_NONE) { scan->u.bmu_avail -= count; return (r); @@ -574,10 +574,9 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) * range). */ static void -blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, daddr_t radix, -daddr_t blk) +blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, u_daddr_t
svn commit: r322458 - head/lib/libc/sys
Author: tuexen Date: Sun Aug 13 15:15:40 2017 New Revision: 322458 URL: https://svnweb.freebsd.org/changeset/base/322458 Log: Fix minor formatting issue. Modified: head/lib/libc/sys/getsockopt.2 Modified: head/lib/libc/sys/getsockopt.2 == --- head/lib/libc/sys/getsockopt.2 Sun Aug 13 14:50:38 2017 (r322457) +++ head/lib/libc/sys/getsockopt.2 Sun Aug 13 15:15:40 2017 (r322458) @@ -188,7 +188,7 @@ The following options are recognized in .It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)" .It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)" .It Dv SO_TS_CLOCK Ta "set specific format of timestamp returned by SO_TIMESTAMP" -.It Dv SO_MAX_PACING_RATE "set the maximum transmit rate in bytes per second for the socket" +.It Dv SO_MAX_PACING_RATE Ta "set the maximum transmit rate in bytes per second for the socket" .El .Pp .Dv SO_DEBUG ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322457 - head/sys/x86/acpica
Author: royger Date: Sun Aug 13 14:50:38 2017 New Revision: 322457 URL: https://svnweb.freebsd.org/changeset/base/322457 Log: srat: use pmap_unmapbios To match the pmap_mapbios. Reported by: jhb MFC with: r322403 Modified: head/sys/x86/acpica/srat.c Modified: head/sys/x86/acpica/srat.c == --- head/sys/x86/acpica/srat.c Sun Aug 13 14:42:23 2017(r322456) +++ head/sys/x86/acpica/srat.c Sun Aug 13 14:50:38 2017(r322457) @@ -536,7 +536,7 @@ srat_set_cpus(void *dummy) } /* Last usage of the cpus array, unmap it. */ - pmap_unmapdev((vm_offset_t)cpus, sizeof(*cpus) * (max_apic_id + 1)); + pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * (max_apic_id + 1)); cpus = NULL; } SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322456 - head/lib/libc/x86/sys
Author: kib Date: Sun Aug 13 14:42:23 2017 New Revision: 322456 URL: https://svnweb.freebsd.org/changeset/base/322456 Log: Fix a regression in r321608. On i386 with CPUID but without SSE2, set lfence_works to LMB_NONE instead of looping. Reported and tested by: Andre AlbsmeierSponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/lib/libc/x86/sys/__vdso_gettc.c Modified: head/lib/libc/x86/sys/__vdso_gettc.c == --- head/lib/libc/x86/sys/__vdso_gettc.cSun Aug 13 14:36:10 2017 (r322455) +++ head/lib/libc/x86/sys/__vdso_gettc.cSun Aug 13 14:42:23 2017 (r322456) @@ -101,6 +101,7 @@ init_fence(void) #if defined(__i386__) u_int cpuid_supported, p[4]; + lfence_works = LMB_NONE; __asm __volatile( " pushfl\n" " popl%%eax\n" @@ -121,8 +122,7 @@ init_fence(void) cpuidp(0x1, p); if ((p[3] & CPUID_SSE2) != 0) lfence_works = select_lmb(); - } else - lfence_works = LMB_NONE; + } #elif defined(__amd64__) lfence_works = select_lmb(); #else ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322455 - head/bin/sh/tests/invocation
Author: jilles Date: Sun Aug 13 14:36:10 2017 New Revision: 322455 URL: https://svnweb.freebsd.org/changeset/base/322455 Log: sh: Add test for sh -c with missing command string. This already works correctly. Added: head/bin/sh/tests/invocation/sh-c-missing1.0 (contents, props changed) Modified: head/bin/sh/tests/invocation/Makefile Modified: head/bin/sh/tests/invocation/Makefile == --- head/bin/sh/tests/invocation/Makefile Sun Aug 13 07:40:05 2017 (r322454) +++ head/bin/sh/tests/invocation/Makefile Sun Aug 13 14:36:10 2017 (r322455) @@ -8,6 +8,7 @@ TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} ATF_TESTS_SH= functional_test ${PACKAGE}FILES+= sh-ac1.0 +${PACKAGE}FILES+= sh-c-missing1.0 ${PACKAGE}FILES+= sh-c1.0 ${PACKAGE}FILES+= sh-ca1.0 ${PACKAGE}FILES+= sh-fca1.0 Added: head/bin/sh/tests/invocation/sh-c-missing1.0 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/invocation/sh-c-missing1.0Sun Aug 13 14:36:10 2017(r322455) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +! echo echo bad | ${SH} -c 2>/dev/null ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"