svn commit: r261795 - head/sys/dev/usb/controller
Author: hselasky Date: Wed Feb 12 08:04:38 2014 New Revision: 261795 URL: http://svnweb.freebsd.org/changeset/base/261795 Log: Issue doorbell twice before finally freeing the DMA descriptors. This should fix DMA descriptor caching issues seen with the EHCI controller found in Google Chromebook C720 during removal and insertion of USB devices. MFC after:1 week Reported by: Matthew Dillon at DragonFlyBSD Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c == --- head/sys/dev/usb/controller/ehci.c Wed Feb 12 07:51:14 2014 (r261794) +++ head/sys/dev/usb/controller/ehci.c Wed Feb 12 08:04:38 2014 (r261795) @@ -2261,10 +2261,26 @@ ehci_device_bulk_enter(struct usb_xfer * } static void +ehci_doorbell_async(struct ehci_softc *sc) +{ + uint32_t temp; + + /* +* XXX Performance quirk: Some Host Controllers have a too low +* interrupt rate. Issue an IAAD to stimulate the Host +* Controller after queueing the BULK transfer. +* +* XXX Force the host controller to refresh any QH caches. +*/ + temp = EOREAD4(sc, EHCI_USBCMD); + if (!(temp & EHCI_CMD_IAAD)) + EOWRITE4(sc, EHCI_USBCMD, temp | EHCI_CMD_IAAD); +} + +static void ehci_device_bulk_start(struct usb_xfer *xfer) { ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - uint32_t temp; /* setup TD's and QH */ ehci_setup_standard_chain(xfer, &sc->sc_async_p_last); @@ -2279,13 +2295,7 @@ ehci_device_bulk_start(struct usb_xfer * if (sc->sc_flags & EHCI_SCFLG_IAADBUG) return; - /* XXX Performance quirk: Some Host Controllers have a too low -* interrupt rate. Issue an IAAD to stimulate the Host -* Controller after queueing the BULK transfer. -*/ - temp = EOREAD4(sc, EHCI_USBCMD); - if (!(temp & EHCI_CMD_IAAD)) - EOWRITE4(sc, EHCI_USBCMD, temp | EHCI_CMD_IAAD); + ehci_doorbell_async(sc); } static const struct usb_pipe_methods ehci_device_bulk_methods = @@ -3902,6 +3912,41 @@ ehci_set_hw_power(struct usb_bus *bus) return; } +static void +ehci_start_dma_delay_second(struct usb_xfer *xfer) +{ + struct ehci_softc *sc = EHCI_BUS2SC(xfer->xroot->bus); + + DPRINTF("\n"); + + /* trigger doorbell */ + ehci_doorbell_async(sc); + + /* give the doorbell 4ms */ + usbd_transfer_timeout_ms(xfer, + (void (*)(void *))&usb_dma_delay_done_cb, 4); +} + +/* + * Ring the doorbell twice before freeing any DMA descriptors. Some host + * controllers apparently cache the QH descriptors and need a message + * that the cache needs to be discarded. + */ +static void +ehci_start_dma_delay(struct usb_xfer *xfer) +{ + struct ehci_softc *sc = EHCI_BUS2SC(xfer->xroot->bus); + + DPRINTF("\n"); + + /* trigger doorbell */ + ehci_doorbell_async(sc); + + /* give the doorbell 4ms */ + usbd_transfer_timeout_ms(xfer, + (void (*)(void *))&ehci_start_dma_delay_second, 4); +} + static const struct usb_bus_methods ehci_bus_methods = { .endpoint_init = ehci_ep_init, @@ -3914,4 +3959,5 @@ static const struct usb_bus_methods ehci .set_hw_power_sleep = ehci_set_hw_power_sleep, .roothub_exec = ehci_roothub_exec, .xfer_poll = ehci_do_poll, + .start_dma_delay = ehci_start_dma_delay, }; ___ 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: r261796 - head/lib/libkvm
Author: glebius Date: Wed Feb 12 09:41:17 2014 New Revision: 261796 URL: http://svnweb.freebsd.org/changeset/base/261796 Log: While it isn't too late and kvm_read_zpcpu() function isn't yet used outside libkvm(3), change its order of arguments, so that it is the same as in kvm_read(). Sponsored by: Nginx, Inc. Modified: head/lib/libkvm/kvm.h head/lib/libkvm/kvm_getpcpu.3 head/lib/libkvm/kvm_pcpu.c Modified: head/lib/libkvm/kvm.h == --- head/lib/libkvm/kvm.h Wed Feb 12 08:04:38 2014(r261795) +++ head/lib/libkvm/kvm.h Wed Feb 12 09:41:17 2014(r261796) @@ -88,7 +88,7 @@ kvm_t *kvm_open kvm_t *kvm_openfiles (const char *, const char *, const char *, int, char *); ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t); -ssize_t kvm_read_zpcpu(kvm_t *, void *, u_long, size_t, int); +ssize_t kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int); ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); __END_DECLS Modified: head/lib/libkvm/kvm_getpcpu.3 == --- head/lib/libkvm/kvm_getpcpu.3 Wed Feb 12 08:04:38 2014 (r261795) +++ head/lib/libkvm/kvm_getpcpu.3 Wed Feb 12 09:41:17 2014 (r261796) @@ -50,7 +50,7 @@ .Ft void * .Fn kvm_getpcpu "kvm_t *kd" "int cpu" .Ft ssize_t -.Fn kvm_read_zpcpu "kvm_t *kd" "void *buf" "u_long base" "size_t size" "int cpu" +.Fn kvm_read_zpcpu "kvm_t *kd" "u_long base" "void *buf" "size_t size" "int cpu" .Ft uint64_t .Fn kvm_counter_u64_fetch "kvm_t *kd" "u_long base" .Sh DESCRIPTION Modified: head/lib/libkvm/kvm_pcpu.c == --- head/lib/libkvm/kvm_pcpu.c Wed Feb 12 08:04:38 2014(r261795) +++ head/lib/libkvm/kvm_pcpu.c Wed Feb 12 09:41:17 2014(r261796) @@ -306,7 +306,7 @@ kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu) * Obtain a per-CPU copy for given cpu from UMA_ZONE_PCPU allocation. */ ssize_t -kvm_read_zpcpu(kvm_t *kd, void *buf, u_long base, size_t size, int cpu) +kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size_t size, int cpu) { return (kvm_read(kd, (uintptr_t)(base + sizeof(struct pcpu) * cpu), @@ -327,7 +327,7 @@ kvm_counter_u64_fetch(kvm_t *kd, u_long r = 0; for (int i = 0; i < mp_ncpus; i++) { - if (kvm_read_zpcpu(kd, &c, base, sizeof(c), i) != sizeof(c)) + if (kvm_read_zpcpu(kd, base, &c, sizeof(c), i) != sizeof(c)) return (0); r += c; } ___ 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: r261797 - in head: sbin/ipfw usr.bin/kdump usr.sbin/bsnmpd/modules
Author: glebius Date: Wed Feb 12 09:59:48 2014 New Revision: 261797 URL: http://svnweb.freebsd.org/changeset/base/261797 Log: Fix world build WITHOUT_PF. Sponsored by: Nginx, Inc. Modified: head/sbin/ipfw/Makefile head/sbin/ipfw/ipfw2.h head/usr.bin/kdump/Makefile head/usr.bin/kdump/mkioctls head/usr.sbin/bsnmpd/modules/Makefile Modified: head/sbin/ipfw/Makefile == --- head/sbin/ipfw/Makefile Wed Feb 12 09:41:17 2014(r261796) +++ head/sbin/ipfw/Makefile Wed Feb 12 09:59:48 2014(r261797) @@ -1,8 +1,16 @@ # $FreeBSD$ +.include + PROG= ipfw -SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c altq.c +SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c WARNS?=2 + +.if ${MK_PF} != "no" +SRCS+= altq.c +CFLAGS+=-DPF +.endif + DPADD= ${LIBUTIL} LDADD= -lutil MAN= ipfw.8 Modified: head/sbin/ipfw/ipfw2.h == --- head/sbin/ipfw/ipfw2.h Wed Feb 12 09:41:17 2014(r261796) +++ head/sbin/ipfw/ipfw2.h Wed Feb 12 09:59:48 2014(r261797) @@ -268,11 +268,14 @@ void ipfw_flush(int force); void ipfw_zero(int ac, char *av[], int optname); void ipfw_list(int ac, char *av[], int show_counters); +#ifdef PF /* altq.c */ void altq_set_enabled(int enabled); u_int32_t altq_name_to_qid(const char *name); - void print_altq_cmd(struct _ipfw_insn_altq *altqptr); +#else +#define NO_ALTQ +#endif /* dummynet.c */ void dummynet_list(int ac, char *av[], int show_counters); Modified: head/usr.bin/kdump/Makefile == --- head/usr.bin/kdump/Makefile Wed Feb 12 09:41:17 2014(r261796) +++ head/usr.bin/kdump/Makefile Wed Feb 12 09:59:48 2014(r261797) @@ -20,6 +20,10 @@ LDADD+= -lcapsicum -lnv CFLAGS+=-DHAVE_LIBCAPSICUM .endif +.if ${MK_PF} != "no" +CFLAGS+=-DPF +.endif + .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" SRCS+= linux_syscalls.c .endif Modified: head/usr.bin/kdump/mkioctls == --- head/usr.bin/kdump/mkioctls Wed Feb 12 09:41:17 2014(r261796) +++ head/usr.bin/kdump/mkioctls Wed Feb 12 09:59:48 2014(r261797) @@ -21,7 +21,8 @@ LC_ALL=C; export LC_ALL # XXX should we use an ANSI cpp? ioctl_includes=$( cd $includedir - find -H -s * -name '*.h' | grep -v '.*disk.*\.h' | \ + find -H -s * -name '*.h' | \ + egrep -v '(.*disk.*|net/pfvar|net/if_pfsync)\.h' | \ xargs egrep -l \ '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | awk '{printf("#include <%s>\\n", $1)}' @@ -54,7 +55,10 @@ BEGIN { print "#include " print "#include " print "#include " + print "#ifdef PF" print "#include " + print "#include " + print "#endif" print "#include " print "#include " print "#include " Modified: head/usr.sbin/bsnmpd/modules/Makefile == --- head/usr.sbin/bsnmpd/modules/Makefile Wed Feb 12 09:41:17 2014 (r261796) +++ head/usr.sbin/bsnmpd/modules/Makefile Wed Feb 12 09:59:48 2014 (r261797) @@ -13,12 +13,15 @@ SUBDIR= ${_snmp_atm} \ snmp_hast \ snmp_hostres \ snmp_mibII \ - snmp_pf \ snmp_target \ snmp_usm \ snmp_vacm \ snmp_wlan +.if ${MK_PF} != "no" +SUBDIR+=snmp_pf +.endif + .if ${MK_NETGRAPH_SUPPORT} != "no" SUBDIR+=snmp_netgraph .endif ___ 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: r261796 - head/lib/libkvm
On Wed, 12 Feb 2014, Gleb Smirnoff wrote: Log: While it isn't too late and kvm_read_zpcpu() function isn't yet used outside libkvm(3), change its order of arguments, so that it is the same as in kvm_read(). This also fixes some but not all namespace pollution. Modified: head/lib/libkvm/kvm.h == --- head/lib/libkvm/kvm.h Wed Feb 12 08:04:38 2014(r261795) +++ head/lib/libkvm/kvm.h Wed Feb 12 09:41:17 2014(r261796) @@ -88,7 +88,7 @@ kvm_t *kvm_open kvm_t*kvm_openfiles (const char *, const char *, const char *, int, char *); ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t); -ssize_t kvm_read_zpcpu(kvm_t *, void *, u_long, size_t, int); This shouldn't even have compiled, but someone broke kvm.h by changing its include of to . +ssize_t kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int); This fixes one dependency on the namespace pollution. ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); __END_DECLS Modified: head/lib/libkvm/kvm_getpcpu.3 == --- head/lib/libkvm/kvm_getpcpu.3 Wed Feb 12 08:04:38 2014 (r261795) +++ head/lib/libkvm/kvm_getpcpu.3 Wed Feb 12 09:41:17 2014 (r261796) @@ -50,7 +50,7 @@ .Ft void * .Fn kvm_getpcpu "kvm_t *kd" "int cpu" .Ft ssize_t -.Fn kvm_read_zpcpu "kvm_t *kd" "void *buf" "u_long base" "size_t size" "int cpu" +.Fn kvm_read_zpcpu "kvm_t *kd" "u_long base" "void *buf" "size_t size" "int cpu" This doesn't fix the documentation saying to use the namespace pollution for the changed function... .Ft uint64_t .Fn kvm_counter_u64_fetch "kvm_t *kd" "u_long base" ...or for other functions. This bug was missing in both the header and the man page for all of the older functions that use unsigned long (kvm_read(), kvm_uread() and kvm_write()). kvm.h otherwise depends on the full pollution of only for the declaration uint64_t. It should declare this itself like it does for all the other non-underscored typedefed types that it uses. .Sh DESCRIPTION Modified: head/lib/libkvm/kvm_pcpu.c == --- head/lib/libkvm/kvm_pcpu.c Wed Feb 12 08:04:38 2014(r261795) +++ head/lib/libkvm/kvm_pcpu.c Wed Feb 12 09:41:17 2014(r261796) @@ -306,7 +306,7 @@ kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu) * Obtain a per-CPU copy for given cpu from UMA_ZONE_PCPU allocation. */ ssize_t -kvm_read_zpcpu(kvm_t *kd, void *buf, u_long base, size_t size, int cpu) +kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size_t size, int cpu) { return (kvm_read(kd, (uintptr_t)(base + sizeof(struct pcpu) * cpu), @@ -327,7 +327,7 @@ kvm_counter_u64_fetch(kvm_t *kd, u_long r = 0; for (int i = 0; i < mp_ncpus; i++) { - if (kvm_read_zpcpu(kd, &c, base, sizeof(c), i) != sizeof(c)) + if (kvm_read_zpcpu(kd, base, &c, sizeof(c), i) != sizeof(c)) return (0); r += c; } The implementation can reasonably use u_long after including for itself. In fact, it is a style bug to not do so. In old versions, libkvm/*.c had 1 instance of the style bug 'unsigned foo' and 105 instances of u_foo. Now it is even cleaner -- it has 0 instances of the style bug and 196 instances of u_foo. It mostly includes by including . One newer file has the style bug of including both, and another newer file is sophisticated and includes only . kvm_getfiles(3) documents a prerequesite for bogusly. This should be under the _KERNEL ifdef. And the kernel ifdef shouldn't be in the synopsis since it is not needed for calling the function but only for interpretation of the data returned by the function. It also fails to document the data format (which is an unusable mixture of struct xfile and struct file). It also fails to document the complete brokenness of this function (the function now returns with an error without actually reading any data). This is harmless because the function is never used in /usr/src. Bruce ___ 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: r261799 - head/lib/libkvm
Author: emaste Date: Wed Feb 12 15:57:38 2014 New Revision: 261799 URL: http://svnweb.freebsd.org/changeset/base/261799 Log: Add bounds check for pteindex / pdeindex Modified: head/lib/libkvm/kvm_minidump_amd64.c Modified: head/lib/libkvm/kvm_minidump_amd64.c == --- head/lib/libkvm/kvm_minidump_amd64.cWed Feb 12 13:55:30 2014 (r261798) +++ head/lib/libkvm/kvm_minidump_amd64.cWed Feb 12 15:57:38 2014 (r261799) @@ -214,6 +214,8 @@ _kvm_minidump_vatop_v1(kvm_t *kd, u_long if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT; + if (pteindex >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + goto invalid; pte = vm->page_map[pteindex]; if (((u_long)pte & PG_V) == 0) { _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid"); @@ -264,6 +266,8 @@ _kvm_minidump_vatop(kvm_t *kd, u_long va if (va >= vm->hdr.kernbase) { pdeindex = (va - vm->hdr.kernbase) >> PDRSHIFT; + if (pdeindex >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + goto invalid; pde = vm->page_map[pdeindex]; if (((u_long)pde & PG_V) == 0) { _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid"); ___ 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: r261800 - head/share/man/man9
Author: wblock (doc committer) Date: Wed Feb 12 16:39:56 2014 New Revision: 261800 URL: http://svnweb.freebsd.org/changeset/base/261800 Log: Remove obsolete vnode(9) man page references. PR: docs/186537 Submitted by: Miklos Magyari MFC after:3 days Modified: head/share/man/man9/vnode.9 Modified: head/share/man/man9/vnode.9 == --- head/share/man/man9/vnode.9 Wed Feb 12 15:57:38 2014(r261799) +++ head/share/man/man9/vnode.9 Wed Feb 12 16:39:56 2014(r261800) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2010 +.Dd February 12, 2014 .Dt VNODE 9 .Os .Sh NAME @@ -69,11 +69,8 @@ and the .Va v_holdcnt of a vnode reaches zero then the vnode will be put on the freelist and may be reused for another file, possibly in another file system. -The transition to and from the freelist is handled by -.Xr getnewvnode 9 , -.Xr vfree 9 -and -.Xr vbusy 9 . +The transition from the freelist is handled by +.Xr getnewvnode 9 . The third is a count of the number of clients which are writing into the file. It is maintained by the @@ -82,9 +79,9 @@ and .Xr close 2 system calls. .Pp -Any call which returns a vnode (e.g.\& +Any call which returns a vnode (e.g.,\& .Xr vget 9 , -.Xr VOP_LOOKUP 9 +.Xr VOP_LOOKUP 9 , etc.) will increase the .Va v_usecount ___ 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: r261796 - head/lib/libkvm
Bruce, On Thu, Feb 13, 2014 at 01:52:07AM +1100, Bruce Evans wrote: B> > --- head/lib/libkvm/kvm_getpcpu.3 Wed Feb 12 08:04:38 2014 (r261795) B> > +++ head/lib/libkvm/kvm_getpcpu.3 Wed Feb 12 09:41:17 2014 (r261796) B> > @@ -50,7 +50,7 @@ B> > .Ft void * B> > .Fn kvm_getpcpu "kvm_t *kd" "int cpu" B> > .Ft ssize_t B> > -.Fn kvm_read_zpcpu "kvm_t *kd" "void *buf" "u_long base" "size_t size" "int cpu" B> > +.Fn kvm_read_zpcpu "kvm_t *kd" "u_long base" "void *buf" "size_t size" "int cpu" B> B> This doesn't fix the documentation saying to use the namespace pollution for B> the changed function... B> B> > .Ft uint64_t B> > .Fn kvm_counter_u64_fetch "kvm_t *kd" "u_long base" B> B> ...or for other functions. B> B> This bug was missing in both the header and the man page for all of the B> older functions that use unsigned long (kvm_read(), kvm_uread() and B> kvm_write()). B> B> kvm.h otherwise depends on the full pollution of only for the B> declaration uint64_t. It should declare this itself like it does for all B> the other non-underscored typedefed types that it uses. I'm sorry, Bruce, but my position is the same as before on this. I think that C99 types must be supported by compiler. While they are not, requiring a header that declares C99 types is okay. Typedefing a standard type manually looks for me more ugly than header requirement. -- Totus tuus, Glebius. ___ 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: r261801 - head/contrib/libc++/include
Author: dim Date: Wed Feb 12 18:14:49 2014 New Revision: 261801 URL: http://svnweb.freebsd.org/changeset/base/261801 Log: An ABI incompatibility crept into the libc++ 3.4 import in r261283. It was caused by upstream libc++ commit r194536, which aimed to make the headers more standards-compliant, by making std::pair's copy constructor trivial. Unfortunately, this could cause certain C++ applications using shared libraries built against the previous version of libc++ to crash. Fix the ABI incompatibility by making std::pair's copy constructor non-trivial again. Please note: Any C++ applications or shared libraries built with libc++ between r261283 and this revision should be recompiled. Reported by: stefanf MFC after:3 weeks X-MFC-With: r261283 Modified: head/contrib/libc++/include/__config Modified: head/contrib/libc++/include/__config == --- head/contrib/libc++/include/__configWed Feb 12 16:39:56 2014 (r261800) +++ head/contrib/libc++/include/__configWed Feb 12 18:14:49 2014 (r261801) @@ -567,7 +567,7 @@ template struct __static_asse #define _LIBCPP_WCTYPE_IS_MASK #endif -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) #ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR # define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 0 #endif ___ 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: r261802 - head
Author: dim Date: Wed Feb 12 18:16:56 2014 New Revision: 261802 URL: http://svnweb.freebsd.org/changeset/base/261802 Log: Add a note to UPDATING about the ABI compatibility fix done in r261801. Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Wed Feb 12 18:14:49 2014(r261801) +++ head/UPDATING Wed Feb 12 18:16:56 2014(r261802) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140212: + An ABI incompatibility crept into the libc++ 3.4 import in r261283. + This could cause certain C++ applications using shared libraries built + against the previous version of libc++ to crash. The incompatibility + has now been fixed, but any C++ applications or shared libraries built + between r261283 and r261801 should be recompiled. + 20140128: The libelf and libdwarf libraries have been updated to newer versions from upstream. Shared library version numbers for ___ 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: r261801 - head/contrib/libc++/include
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-02-12 13:14:50 -0500, Dimitry Andric wrote: > Author: dim Date: Wed Feb 12 18:14:49 2014 New Revision: 261801 > URL: http://svnweb.freebsd.org/changeset/base/261801 > > Log: An ABI incompatibility crept into the libc++ 3.4 import in > r261283. It was caused by upstream libc++ commit r194536, which > aimed to make the headers more standards-compliant, by making > std::pair's copy constructor trivial. Unfortunately, this could > cause certain C++ applications using shared libraries built against > the previous version of libc++ to crash. > > Fix the ABI incompatibility by making std::pair's copy constructor > non-trivial again. > > Please note: Any C++ applications or shared libraries built with > libc++ between r261283 and this revision should be recompiled. > > Reported by: stefanf MFC after: 3 weeks X-MFC-With: r261283 > > Modified: head/contrib/libc++/include/__config > > Modified: head/contrib/libc++/include/__config > == > > - --- head/contrib/libc++/include/__config Wed Feb 12 16:39:56 2014 (r261800) > +++ head/contrib/libc++/include/__config Wed Feb 12 18:14:49 2014 > (r261801) @@ -567,7 +567,7 @@ template struct > __static_asse #define _LIBCPP_WCTYPE_IS_MASK #endif > > -#if defined(__APPLE__) +#if defined(__APPLE__) || > defined(__FreeBSD__) #ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR # > define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 0 #endif It seems Apple removed it later. http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131125/094181.html Do you know what they did? Jung-uk Kim -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.22 (FreeBSD) iQEcBAEBAgAGBQJS+8CMAAoJEHyflib82/FGHckH/3knT4PPbIwJ8vgTqtENbp7o Z9nK2UVwdk9EpXwx0d8Uy2eX6hs/2c5xEKqHHuuGlFBjHmwDUBsaW6746y8lWVaD VtOtwRAN/wxyocA9kGscFBJv/dhmXpkvNUELjyQIOdgNWKdr5yYkOVF/blfpMTpn 49RIyFTj5IgxoedTp48lykpmYV95PF0TciqFFB8s78xCMVritHNzqk4au02z1olf LmKLdmVHKqoU4wSMbmxzF+dv6MyfqkTtBxqV8HFUtVluHg2zhMZghPA0atmyMho3 7jlIFEYvjNmSVdicvXFtlmw61rE2XoKGx7G9m2hs1xLfyFTeYPpLxh2TWZaAHq4= =o9xx -END PGP SIGNATURE- ___ 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: r261801 - head/contrib/libc++/include
On 12 Feb 2014, at 18:42, Jung-uk Kim wrote: > It seems Apple removed it later. > > http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131125/094181.html > > Do you know what they did? They decided to break ABI compatibility with the version of XCode that ships with the bug. This is probably not an option for us, although we might consider it for FreeBSD 11 with a library version bump (it would still be a lot of pain, as you wouldn't be able to mix C++ libraries), but probably not unless we see bug reports related to our slight standards non-compliance (std::pair having an explicit constructor) causing real problems. David ___ 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: r261803 - head/sys/arm/arm
Author: ian Date: Wed Feb 12 18:55:26 2014 New Revision: 261803 URL: http://svnweb.freebsd.org/changeset/base/261803 Log: On armv6 and later, use the WriteNotRead bit of the fault status register to decide what protections are required by the faulting access. The old code disassembled the faulting instruction, and there are a lot of new instructions that aren't handled. The old code is still used for armv4/5 which doesn't have the WNR bit) Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c == --- head/sys/arm/arm/trap.c Wed Feb 12 18:16:56 2014(r261802) +++ head/sys/arm/arm/trap.c Wed Feb 12 18:55:26 2014(r261803) @@ -386,17 +386,16 @@ data_abort_handler(struct trapframe *tf) } /* -* We need to know whether the page should be mapped -* as R or R/W. The MMU does not give us the info as -* to whether the fault was caused by a read or a write. -* -* However, we know that a permission fault can only be -* the result of a write to a read-only location, so -* we can deal with those quickly. -* -* Otherwise we need to disassemble the instruction -* responsible to determine if it was a write. +* We need to know whether the page should be mapped as R or R/W. On +* armv6 and later the fault status register indicates whether the +* access was a read or write. Prior to armv6, we know that a +* permission fault can only be the result of a write to a read-only +* location, so we can deal with those quickly. Otherwise we need to +* disassemble the faulting instruction to determine if it was a write. */ +#ifdef _ARM_ARCH_6 + ftype = (fsr & FAULT_WNR) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; +#else if (IS_PERMISSION_FAULT(fsr)) ftype = VM_PROT_WRITE; else { @@ -412,6 +411,7 @@ data_abort_handler(struct trapframe *tf) else ftype = VM_PROT_READ; } +#endif } /* ___ 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: r261801 - head/contrib/libc++/include
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-02-12 13:47:57 -0500, David Chisnall wrote: > On 12 Feb 2014, at 18:42, Jung-uk Kim wrote: > >> It seems Apple removed it later. >> >> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131125/094181.html >> >> >> Do you know what they did? > > They decided to break ABI compatibility with the version of XCode > that ships with the bug. This is probably not an option for us, > although we might consider it for FreeBSD 11 with a library version > bump (it would still be a lot of pain, as you wouldn't be able to > mix C++ libraries), but probably not unless we see bug reports > related to our slight standards non-compliance (std::pair having an > explicit constructor) causing real problems. I see. I am not a big fan of library version bump but standard compliance is also very important for us, too. Hmm... :-( Jung-uk Kim -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.22 (FreeBSD) iQEcBAEBAgAGBQJS+8VwAAoJEHyflib82/FG3XIIAJbKQU4vLxe0d0YiJfZELtU5 WyAVfjXN3rIivtddiOyEQkdPU5MwiNrmIbY4JaVaPc3uUa/7fsWCEn29s167Pe+v A45vE6TU7zegbbI/9JgZXmtv+j+2GJXUunk6pGWGpbII2Hys6MQFiNnoZb7opOrL XT2uIb7vAix7m+H/llpDRbryXXx5f2cZje0JjhuorxoMdm2awuLgoMQgr790Au6M E8BFzJjmprEV6BHX13TC5mj5SR59H3c6/ZX/4bBaxEIOQY9YrftVNejkXVoh+c8J C9ADVcb1uZoIWY7ICYpCKI+NCdp6oQ3Yrss75VYg0LYEPL8H+EXjNSUrUHc518o= =hQn+ -END PGP SIGNATURE- ___ 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: r261804 - head/sys/sys
Author: np Date: Wed Feb 12 19:07:59 2014 New Revision: 261804 URL: http://svnweb.freebsd.org/changeset/base/261804 Log: Provide additional information in some panic strings. MFC after:1 week Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h == --- head/sys/sys/mbuf.h Wed Feb 12 18:55:26 2014(r261803) +++ head/sys/sys/mbuf.h Wed Feb 12 19:07:59 2014(r261804) @@ -531,7 +531,7 @@ m_gettype(int size) type = EXT_JUMBO16; break; default: - panic("%s: invalid cluster size", __func__); + panic("%s: invalid cluster size %d", __func__, size); } return (type); @@ -580,7 +580,7 @@ m_getzone(int size) zone = zone_jumbo16; break; default: - panic("%s: invalid cluster size", __func__); + panic("%s: invalid cluster size %d", __func__, size); } return (zone); @@ -725,7 +725,7 @@ m_cljset(struct mbuf *m, void *cl, int t zone = zone_jumbo16; break; default: - panic("%s: unknown cluster type", __func__); + panic("%s: unknown cluster type %d", __func__, type); break; } ___ 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: r261805 - head/lib/libkvm
Author: glebius Date: Wed Feb 12 19:22:48 2014 New Revision: 261805 URL: http://svnweb.freebsd.org/changeset/base/261805 Log: Add kvm_getncpus() to obtain mp_ncpus. Sponsored by: Nginx, Inc. Modified: head/lib/libkvm/kvm.h head/lib/libkvm/kvm_getpcpu.3 head/lib/libkvm/kvm_pcpu.c Modified: head/lib/libkvm/kvm.h == --- head/lib/libkvm/kvm.h Wed Feb 12 19:07:59 2014(r261804) +++ head/lib/libkvm/kvm.h Wed Feb 12 19:22:48 2014(r261805) @@ -77,6 +77,7 @@ char *kvm_geterr(kvm_t *); char*kvm_getfiles(kvm_t *, int, int, int *); int kvm_getloadavg(kvm_t *, double [], int); int kvm_getmaxcpu(kvm_t *); +int kvm_getncpus(kvm_t *); void*kvm_getpcpu(kvm_t *, int); uint64_t kvm_counter_u64_fetch(kvm_t *, u_long); struct kinfo_proc * Modified: head/lib/libkvm/kvm_getpcpu.3 == --- head/lib/libkvm/kvm_getpcpu.3 Wed Feb 12 19:07:59 2014 (r261804) +++ head/lib/libkvm/kvm_getpcpu.3 Wed Feb 12 19:22:48 2014 (r261805) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2013 +.Dd February 12, 2014 .Dt KVM_GETPCPU 3 .Os .Sh NAME @@ -47,6 +47,8 @@ .Fn kvm_dpcpu_setcpu "kvm_t *kd" "u_int cpu" .Ft int .Fn kvm_getmaxcpu "kvm_t *kd" +.Ft int +.Fn kvm_getncpus "kvm_t *kd" .Ft void * .Fn kvm_getpcpu "kvm_t *kd" "int cpu" .Ft ssize_t @@ -73,6 +75,10 @@ The function returns the maximum number of CPUs supported by the kernel. .Pp The +.Fn kvm_getncpus +function returns the current number of CPUs in the kernel. +.Pp +The .Fn kvm_getpcpu function returns a buffer holding the per-CPU data for a single CPU. This buffer is described by the Modified: head/lib/libkvm/kvm_pcpu.c == --- head/lib/libkvm/kvm_pcpu.c Wed Feb 12 19:07:59 2014(r261804) +++ head/lib/libkvm/kvm_pcpu.c Wed Feb 12 19:22:48 2014(r261805) @@ -173,6 +173,16 @@ kvm_getmaxcpu(kvm_t *kd) return (maxcpu); } +int +kvm_getncpus(kvm_t *kd) +{ + + if (mp_ncpus == 0) + if (_kvm_pcpu_init(kd) < 0) + return (-1); + return (mp_ncpus); +} + static int _kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu, int report_error) { ___ 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: r261808 - in head/sys/arm: arm include
Author: ian Date: Wed Feb 12 19:59:30 2014 New Revision: 261808 URL: http://svnweb.freebsd.org/changeset/base/261808 Log: Use the right symbols for determining arm architecture. Include the necessary header file which has the new FAULT_WNR symbol defined in it. Modified: head/sys/arm/arm/trap.c head/sys/arm/include/armreg.h Modified: head/sys/arm/arm/trap.c == --- head/sys/arm/arm/trap.c Wed Feb 12 19:51:12 2014(r261807) +++ head/sys/arm/arm/trap.c Wed Feb 12 19:59:30 2014(r261808) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -393,7 +394,7 @@ data_abort_handler(struct trapframe *tf) * location, so we can deal with those quickly. Otherwise we need to * disassemble the faulting instruction to determine if it was a write. */ -#ifdef _ARM_ARCH_6 +#if ARM_ARCH_6 || ARM_ARCH_7A ftype = (fsr & FAULT_WNR) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; #else if (IS_PERMISSION_FAULT(fsr)) @@ -411,8 +412,8 @@ data_abort_handler(struct trapframe *tf) else ftype = VM_PROT_READ; } -#endif } +#endif /* * See if the fault is as a result of ref/mod emulation, Modified: head/sys/arm/include/armreg.h == --- head/sys/arm/include/armreg.h Wed Feb 12 19:51:12 2014 (r261807) +++ head/sys/arm/include/armreg.h Wed Feb 12 19:59:30 2014 (r261808) @@ -404,6 +404,8 @@ #define FAULT_PERM_P0x0f /* Permission -- Page */ #defineFAULT_IMPRECISE 0x400 /* Imprecise exception (XSCALE) */ +#defineFAULT_EXTERNAL 0x400 /* External abort (armv6+) */ +#defineFAULT_WNR 0x800 /* Write-not-Read access (armv6+) */ /* * Address of the vector page, low and high versions. ___ 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: r261810 - head/sys/arm/arm
Author: ian Date: Wed Feb 12 20:09:27 2014 New Revision: 261810 URL: http://svnweb.freebsd.org/changeset/base/261810 Log: Use the same logic as the x86 platforms to avoid trying perform fault fixup while in a critical section or while holding a non-sleepable lock. Reviewed by: cognet Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c == --- head/sys/arm/arm/trap.c Wed Feb 12 20:06:26 2014(r261809) +++ head/sys/arm/arm/trap.c Wed Feb 12 20:09:27 2014(r261810) @@ -422,6 +422,10 @@ data_abort_handler(struct trapframe *tf) #ifdef DEBUG last_fault_code = fsr; #endif + if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, + NULL, "Kernel page fault") != 0) + goto fatal_pagefault; + if (pmap_fault_fixup(vmspace_pmap(td->td_proc->p_vmspace), va, ftype, user)) { goto out; @@ -444,6 +448,7 @@ data_abort_handler(struct trapframe *tf) } if (__predict_true(error == 0)) goto out; +fatal_pagefault: if (user == 0) { if (pcb->pcb_onfault) { tf->tf_r0 = error; ___ 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: r261811 - head/sys/vm
Author: glebius Date: Wed Feb 12 20:11:20 2014 New Revision: 261811 URL: http://svnweb.freebsd.org/changeset/base/261811 Log: Fix function name in KASSERT(). Submitted by: hiren Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c == --- head/sys/vm/vm_object.c Wed Feb 12 20:09:27 2014(r261810) +++ head/sys/vm/vm_object.c Wed Feb 12 20:11:20 2014(r261811) @@ -676,8 +676,7 @@ vm_object_destroy(vm_object_t object) if (object->cred != NULL) { KASSERT(object->type == OBJT_DEFAULT || object->type == OBJT_SWAP, - ("vm_object_terminate: non-swap obj %p has cred", -object)); + ("%s: non-swap obj %p has cred", __func__, object)); swap_release_by_cred(object->charge, object->cred); object->charge = 0; crfree(object->cred); ___ 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: r261814 - head/sys/dev/sdhci
Author: ian Date: Wed Feb 12 22:25:08 2014 New Revision: 261814 URL: http://svnweb.freebsd.org/changeset/base/261814 Log: Fix the definition of the SDHCI_STATE_DAT and SDHCI_STATE_CMD fields, and add SDHCI_RETUNE_REQUEST. None of these are actually used in the code yet. Modified: head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.h == --- head/sys/dev/sdhci/sdhci.h Wed Feb 12 21:10:40 2014(r261813) +++ head/sys/dev/sdhci/sdhci.h Wed Feb 12 22:25:08 2014(r261814) @@ -104,6 +104,7 @@ #define SDHCI_CMD_INHIBIT 0x0001 #define SDHCI_DAT_INHIBIT 0x0002 #define SDHCI_DAT_ACTIVE 0x0004 +#define SDHCI_RETUNE_REQUEST 0x0008 #define SDHCI_DOING_WRITE 0x0100 #define SDHCI_DOING_READ 0x0200 #define SDHCI_SPACE_AVAILABLE 0x0400 @@ -112,8 +113,8 @@ #define SDHCI_CARD_STABLE 0x0002 #define SDHCI_CARD_PIN0x0004 #define SDHCI_WRITE_PROTECT 0x0008 -#define SDHCI_STATE_DAT 0x0070 -#define SDHCI_STATE_CMD 0x0080 +#define SDHCI_STATE_DAT_MASK 0x00f0 +#define SDHCI_STATE_CMD 0x0100 #define SDHCI_HOST_CONTROL 0x28 #define SDHCI_CTRL_LED0x01 ___ 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: r261801 - head/contrib/libc++/include
On Wed, 12 Feb 2014 14:03:12 -0500 Jung-uk Kim wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 2014-02-12 13:47:57 -0500, David Chisnall wrote: > > On 12 Feb 2014, at 18:42, Jung-uk Kim wrote: > > > >> It seems Apple removed it later. > >> > >> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131125/094181.html > >> > >> > >> > Do you know what they did? > > > > They decided to break ABI compatibility with the version of XCode > > that ships with the bug. This is probably not an option for us, > > although we might consider it for FreeBSD 11 with a library version > > bump (it would still be a lot of pain, as you wouldn't be able to > > mix C++ libraries), but probably not unless we see bug reports > > related to our slight standards non-compliance (std::pair having an > > explicit constructor) causing real problems. > > I see. I am not a big fan of library version bump but standard > compliance is also very important for us, too. Hmm... :-( > The refusal to use tools that are there precisely to help to help with the binary compatibility in favor of mindless library bumps is just sad. -- Alexander Kabaev signature.asc Description: PGP signature
svn commit: r261815 - head/sys/arm/freescale/imx
Author: ian Date: Thu Feb 13 02:38:16 2014 New Revision: 261815 URL: http://svnweb.freebsd.org/changeset/base/261815 Log: Write translation code for the SDHCI_PRESENT_STATE register. Freescale moved some bits around in their version of the register, adjust things so that the sdhci code sees the standard layout. Modified: head/sys/arm/freescale/imx/imx_sdhci.c Modified: head/sys/arm/freescale/imx/imx_sdhci.c == --- head/sys/arm/freescale/imx/imx_sdhci.c Wed Feb 12 22:25:08 2014 (r261814) +++ head/sys/arm/freescale/imx/imx_sdhci.c Thu Feb 13 02:38:16 2014 (r261815) @@ -89,6 +89,27 @@ struct imx_sdhci_softc { #define SDHC_VEND_HCKEN(1 << 12) #define SDHC_VEND_PEREN(1 << 13) +#defineSDHC_PRES_STATE 0x24 +#define SDHC_PRES_CIHB (1 << 0) +#define SDHC_PRES_CDIHB (1 << 1) +#define SDHC_PRES_DLA (1 << 2) +#define SDHC_PRES_SDSTB (1 << 3) +#define SDHC_PRES_IPGOFF(1 << 4) +#define SDHC_PRES_HCKOFF(1 << 5) +#define SDHC_PRES_PEROFF(1 << 6) +#define SDHC_PRES_SDOFF (1 << 7) +#define SDHC_PRES_WTA (1 << 8) +#define SDHC_PRES_RTA (1 << 9) +#define SDHC_PRES_BWEN (1 << 10) +#define SDHC_PRES_BREN (1 << 11) +#define SDHC_PRES_RTR (1 << 12) +#define SDHC_PRES_CINST (1 << 16) +#define SDHC_PRES_CDPL (1 << 18) +#define SDHC_PRES_WPSPL (1 << 19) +#define SDHC_PRES_CLSL (1 << 23) +#define SDHC_PRES_DLSL_SHIFT24 +#define SDHC_PRES_DLSL_MASK (0xffU << SDHC_PRES_DLSL_SHIFT) + #defineSDHC_PROT_CTRL 0x28 #define SDHC_PROT_LED (1 << 0) #define SDHC_PROT_WIDTH_1BIT (0 << 1) @@ -254,8 +275,8 @@ imx_sdhci_read_2(device_t dev, struct sd wrk32 = RD4(sc, SDHC_VEND_SPEC); if (wrk32 & SDHC_VEND_FRC_SDCLK_ON) val32 |= SDHCI_CLOCK_INT_EN | SDHCI_CLOCK_CARD_EN; - wrk32 = RD4(sc, SDHCI_PRESENT_STATE); - if (wrk32 & 0x08) + wrk32 = RD4(sc, SDHC_PRES_STATE); + if (wrk32 & SDHC_PRES_SDSTB) val32 |= SDHCI_CLOCK_INT_STABLE; val32 |= sc->sdclockreg_freq_bits; return (val32); @@ -268,7 +289,9 @@ static uint32_t imx_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct imx_sdhci_softc *sc = device_get_softc(dev); - uint32_t val32; + uint32_t val32, wrk32; + + val32 = RD4(sc, off); /* * The hardware leaves the base clock frequency out of the capabilities @@ -280,7 +303,6 @@ imx_sdhci_read_4(device_t dev, struct sd * doesn't yet handle (1.8v, suspend/resume, etc). */ if (off == SDHCI_CAPABILITIES) { - val32 = RD4(sc, off); val32 &= ~SDHCI_CAN_VDD_180; val32 &= ~SDHCI_CAN_DO_SUSPEND; val32 |= SDHCI_CAN_DO_8BITBUS; @@ -288,14 +310,28 @@ imx_sdhci_read_4(device_t dev, struct sd return (val32); } - val32 = RD4(sc, off); + /* +* The hardware moves bits around in the present state register to make +* room for all 8 data line state bits. To translate, mask out all the +* bits which are not in the same position in both registers (this also +* masks out some freescale-specific bits in locations defined as +* reserved by sdhci), then shift the data line and retune request bits +* down to their standard locations. +*/ + if (off == SDHCI_PRESENT_STATE) { + wrk32 = val32; + val32 &= 0x000F0F07; + val32 |= (wrk32 >> 4) & SDHCI_STATE_DAT_MASK; + val32 |= (wrk32 >> 9) & SDHCI_RETUNE_REQUEST; + return (val32); + } /* * imx_sdhci_intr() can synthesize a DATA_END interrupt following a * command with an R1B response, mix it into the hardware status. */ if (off == SDHCI_INT_STATUS) { - val32 |= sc->r1bfix_intmask; + return (val32 | sc->r1bfix_intmask); } return val32; @@ -522,7 +558,7 @@ imx_sdhci_intr(void *arg) count = 0; /* XXX use a callout or something instead of busy-waiting. */ while (count < 25 && - (RD4(sc, SDHCI_PRESENT_STATE) & SDHCI_DAT_ACTIVE)) { + (RD4(sc, SDHC_PRES_STATE) & SDHC_PRES_DLA)) { ++count; DELAY(1); } ___ svn-src-head@freeb
svn commit: r261816 - head/sys/boot/fdt/dts
Author: ian Date: Thu Feb 13 03:41:00 2014 New Revision: 261816 URL: http://svnweb.freebsd.org/changeset/base/261816 Log: Add standard non-removable and cd-gpios properties to the usdhc devices. That generates references to gpio devices, so uncomment them even though there isn't a gpio driver to do anything with them yet. Modified: head/sys/boot/fdt/dts/imx6.dtsi Modified: head/sys/boot/fdt/dts/imx6.dtsi == --- head/sys/boot/fdt/dts/imx6.dtsi Thu Feb 13 02:38:16 2014 (r261815) +++ head/sys/boot/fdt/dts/imx6.dtsi Thu Feb 13 03:41:00 2014 (r261816) @@ -112,58 +112,75 @@ // status = "disabled"; // }; -// /* -// * GPIO modules moved up - to have it attached for -// * drivers which rely on GPIO -// */ -// gpio1: gpio@0209C000 { -// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; -// reg = <0x0209C000 0x4000>; -// interrupt-parent = <&gic>; -// interrupts = <50 51 42 43 44 45 46 47 48 49>; -// /* TODO: use <> also */ -// gpio-controller; -// #gpio-cells = <2>; -// interrupt-controller; -// #interrupt-cells = <1>; -// status = "disabled"; -// }; -// -// gpio2: gpio@020A { -// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; -// reg = <0x020A 0x4000>; -// interrupt-parent = <&gic>; -// interrupts = <52 53>; -// gpio-controller; -// #gpio-cells = <2>; -// interrupt-controller; -// #interrupt-cells = <1>; -// status = "disabled"; -// }; -// -// gpio3: gpio@020A4000 { -// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; -// reg = <0x020A4000 0x4000>; -// interrupt-parent = <&gic>; -// interrupts = <54 55>; -// gpio-controller; -// #gpio-cells = <2>; -// interrupt-controller; -// #interrupt-cells = <1>; -// status = "disabled"; -// }; -// -// gpio4: gpio@020A8000 { -// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; -// reg = <0x020A8000 0x4000>; -// interrupt-parent = <&gic>; -// interrupts = <56 57>; -// gpio-controller; -// #gpio-cells = <2>; -// interrupt-controller; -// #interrupt-cells = <1>; -// status = "disabled"; -// }; + gpio1: gpio@0209c000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x0209c000 0x4000>; + interrupts = <0 66 0x04 0 67 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio@020a { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x020a 0x4000>; + interrupts = <0 68 0x04 0 69 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio@020a4000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x020a4000 0x4000>; + interrupts = <0 70 0x04 0 71 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio4: gpio@020a8000
svn commit: r261817 - head/sys/arm/freescale/imx
Author: ian Date: Thu Feb 13 03:45:33 2014 New Revision: 261817 URL: http://svnweb.freebsd.org/changeset/base/261817 Log: Add handling of standard "non-removable" property, and also some workaround code so that if card detect is wired to a gpio pin, for now we just treat it the same as non-removable (because there isn't a gpio driver yet). Modified: head/sys/arm/freescale/imx/imx_sdhci.c Modified: head/sys/arm/freescale/imx/imx_sdhci.c == --- head/sys/arm/freescale/imx/imx_sdhci.c Thu Feb 13 03:41:00 2014 (r261816) +++ head/sys/arm/freescale/imx/imx_sdhci.c Thu Feb 13 03:45:33 2014 (r261817) @@ -71,6 +71,7 @@ struct imx_sdhci_softc { uint32_tr1bfix_intmask; uint8_t r1bfix_type; uint8_t hwtype; + boolean_t force_card_present; }; #defineR1BFIX_NONE 0 /* No fix needed at next interrupt. */ @@ -323,6 +324,8 @@ imx_sdhci_read_4(device_t dev, struct sd val32 &= 0x000F0F07; val32 |= (wrk32 >> 4) & SDHCI_STATE_DAT_MASK; val32 |= (wrk32 >> 9) & SDHCI_RETUNE_REQUEST; + if (sc->force_card_present) + val32 |= SDHCI_CARD_PRESENT; return (val32); } @@ -591,6 +594,7 @@ imx_sdhci_attach(device_t dev) { struct imx_sdhci_softc *sc = device_get_softc(dev); int rid, err; + phandle_t node; sc->dev = dev; @@ -657,6 +661,25 @@ imx_sdhci_attach(device_t dev) sdhci_init_slot(dev, &sc->slot, 0); + /* +* If the slot is flagged with the non-removable property, set our flag +* to always force the SDHCI_CARD_PRESENT bit on. +* +* XXX Workaround for gpio-based card detect... +* +* We don't have gpio support yet. If there's a cd-gpios property just +* force the SDHCI_CARD_PRESENT bit on for now. If there isn't really a +* card there it will fail to probe at the mmc layer and nothing bad +* happens except instantiating a /dev/mmcN device for an empty slot. +*/ + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "non-removable")) + sc->force_card_present = true; + else if (OF_hasprop(node, "cd-gpios")) { + /* XXX put real gpio hookup here. */ + sc->force_card_present = true; + } + bus_generic_probe(dev); bus_generic_attach(dev); ___ 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: r261818 - head/sys/boot/fdt/dts
Author: ian Date: Thu Feb 13 04:10:27 2014 New Revision: 261818 URL: http://svnweb.freebsd.org/changeset/base/261818 Log: Enable both sdcard slots, but not the sdio-based wifi that we don't yet have a driver for. Modified: head/sys/boot/fdt/dts/wandboard-dual.dts head/sys/boot/fdt/dts/wandboard-quad.dts head/sys/boot/fdt/dts/wandboard-solo.dts Modified: head/sys/boot/fdt/dts/wandboard-dual.dts == --- head/sys/boot/fdt/dts/wandboard-dual.dtsThu Feb 13 03:45:33 2014 (r261817) +++ head/sys/boot/fdt/dts/wandboard-dual.dtsThu Feb 13 04:10:27 2014 (r261818) @@ -67,8 +67,8 @@ usb@02184200{ status = "okay"; }; usb@02184400{ status = "disabled"; }; usb@02184600{ status = "disabled"; }; - usdhc@0219 { status = "disabled"; }; - usdhc@02194000 { status = "okay"; }; + usdhc@0219 { status = "okay"; }; + usdhc@02194000 { status = "disabled"; }; usdhc@02198000 { status = "okay"; }; usdhc@0219c000 { status = "disabled"; }; }; Modified: head/sys/boot/fdt/dts/wandboard-quad.dts == --- head/sys/boot/fdt/dts/wandboard-quad.dtsThu Feb 13 03:45:33 2014 (r261817) +++ head/sys/boot/fdt/dts/wandboard-quad.dtsThu Feb 13 04:10:27 2014 (r261818) @@ -67,8 +67,8 @@ usb@02184200{ status = "okay"; }; usb@02184400{ status = "disabled"; }; usb@02184600{ status = "disabled"; }; - usdhc@0219 { status = "disabled"; }; - usdhc@02194000 { status = "okay"; }; + usdhc@0219 { status = "okay"; }; + usdhc@02194000 { status = "disabled"; }; usdhc@02198000 { status = "okay"; }; usdhc@0219c000 { status = "disabled"; }; }; Modified: head/sys/boot/fdt/dts/wandboard-solo.dts == --- head/sys/boot/fdt/dts/wandboard-solo.dtsThu Feb 13 03:45:33 2014 (r261817) +++ head/sys/boot/fdt/dts/wandboard-solo.dtsThu Feb 13 04:10:27 2014 (r261818) @@ -67,8 +67,8 @@ usb@02184200{ status = "okay"; }; usb@02184400{ status = "disabled"; }; usb@02184600{ status = "disabled"; }; - usdhc@0219 { status = "disabled"; }; - usdhc@02194000 { status = "okay"; }; + usdhc@0219 { status = "okay"; }; + usdhc@02194000 { status = "disabled"; }; usdhc@02198000 { status = "okay"; }; usdhc@0219c000 { status = "disabled"; }; }; ___ 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: r261819 - head/sys/boot/fdt
Author: ian Date: Thu Feb 13 04:13:50 2014 New Revision: 261819 URL: http://svnweb.freebsd.org/changeset/base/261819 Log: Validate the header of a new dtb before using it. Remove the comment that says that should be done. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Thu Feb 13 04:10:27 2014 (r261818) +++ head/sys/boot/fdt/fdt_loader_cmd.c Thu Feb 13 04:13:50 2014 (r261819) @@ -227,10 +227,15 @@ fdt_load_dtb(vm_offset_t va) static int fdt_load_dtb_addr(struct fdt_header *header) { + int err; - // TODO: Verify that there really is an FDT at - // the specified location. fdtp_size = fdt_totalsize(header); + err = fdt_check_header(&header); + if (err < 0) { + sprintf(command_errbuf, "error validating blob: %s", + fdt_strerror(err)); + return (err); + } free(fdtp); if ((fdtp = malloc(fdtp_size)) == NULL) { command_errmsg = "can't allocate memory for device tree copy"; ___ 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: r261823 - head/sys/net
Author: glebius Date: Thu Feb 13 04:59:18 2014 New Revision: 261823 URL: http://svnweb.freebsd.org/changeset/base/261823 Log: o Axe non-pcpu flowtable implementation. It wasn't enabled or used, and probably is a leftover from first prototyping by Kip. The non-pcpu implementation used mutexes, so it doubtfully worked better than simple routing lookup. o Use UMA_ZONE_PCPU zone for pointers instead of [MAXCPU] arrays, use zpcpu_get() to access data in there. o Substitute own single list implementation with SLIST(). This has two functional side effects: - new flows go into head of a list, before they went to tail. - a bug when incorrect flow was deleted in flow cleaner is fixed. o Due to cache line alignment, there is no reason to keep different zones for IPv4 and IPv6 flows. Both consume one cache line, real size of allocation is equal. o Rely on that f_hash, f_rt, f_lle are stable during fle lifetime, remove useless volatile quilifiers. o More INET/INET6 splitting. Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/flowtable.c head/sys/net/flowtable.h Modified: head/sys/net/flowtable.c == --- head/sys/net/flowtable.cThu Feb 13 04:55:46 2014(r261822) +++ head/sys/net/flowtable.cThu Feb 13 04:59:18 2014(r261823) @@ -47,13 +47,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include #include #include +#include #include #include @@ -76,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INET struct ipv4_tuple { uint16_tip_sport; /* source port */ uint16_tip_dport; /* destination port */ @@ -87,7 +91,9 @@ union ipv4_flow { struct ipv4_tuple ipf_ipt; uint32_tipf_key[3]; }; +#endif +#ifdef INET6 struct ipv6_tuple { uint16_tip_sport; /* source port */ uint16_tip_dport; /* destination port */ @@ -99,28 +105,44 @@ union ipv6_flow { struct ipv6_tuple ipf_ipt; uint32_tipf_key[9]; }; +#endif struct flentry { - volatile uint32_t f_fhash;/* hash flowing forward */ + uint32_tf_fhash;/* hash flowing forward */ uint16_tf_flags;/* flow flags */ uint8_t f_pad; uint8_t f_proto;/* protocol */ uint32_tf_fibnum; /* fib index */ uint32_tf_uptime; /* uptime at last access */ - struct flentry *f_next;/* pointer to collision entry */ - volatile struct rtentry *f_rt; /* rtentry for flow */ - volatile struct llentry *f_lle; /* llentry for flow */ + SLIST_ENTRY(flentry)f_next; /* pointer to collision entry */ + struct rtentry *f_rt; /* rtentry for flow */ + struct llentry *f_lle; /* llentry for flow */ + union { +#ifdef INET + union ipv4_flow v4; +#endif +#ifdef INET6 + union ipv6_flow v6; +#endif + } f_flow; +#definef_flow4 f_flow.v4 +#definef_flow6 f_flow.v6 }; +#defineKEYLEN(flags) flags) & FL_IPV6) ? 9 : 3) * 4) -struct flentry_v4 { - struct flentry fl_entry; - union ipv4_flow fl_flow; -}; +/* Make sure f_flow begins with key. */ +#ifdef INET +CTASSERT(offsetof(struct flentry, f_flow) == +offsetof(struct flentry, f_flow4.ipf_key)); +#endif +#ifdef INET6 +CTASSERT(offsetof(struct flentry, f_flow) == +offsetof(struct flentry, f_flow6.ipf_key)); +#endif -struct flentry_v6 { - struct flentry fl_entry; - union ipv6_flow fl_flow; -}; +SLIST_HEAD(flist, flentry); +/* Make sure we can use pcpu_zone_ptr for struct flist. */ +CTASSERT(sizeof(struct flist) == sizeof(void *)); #defineSECS_PER_HOUR 3600 #defineSECS_PER_DAY(24*SECS_PER_HOUR) @@ -130,37 +152,28 @@ struct flentry_v6 { #defineFIN_WAIT_IDLE 600 #defineTCP_IDLESECS_PER_DAY - -typedefvoid fl_lock_t(struct flowtable *, uint32_t); - -union flentryp { - struct flentry **global; - struct flentry **pcpu[MAXCPU]; -}; - struct flowtable { counter_u64_t *ft_stat; - uma_zone_t ft_zone; int ft_size; - int ft_lock_count; uint32_tft_flags; uint32_tft_max_depth; - fl_lock_t *ft_lock; - fl_lock_t *ft_unlock; + /* -* XXX need to pad out +* ft_table is a malloc(9)ed array of pointers. Pointers point to +* memory from UMA_ZONE_PCPU zone. +* ft_masks is per-cpu p
svn commit: r261824 - head/lib/libutil
Author: eadler Date: Thu Feb 13 05:13:22 2014 New Revision: 261824 URL: http://svnweb.freebsd.org/changeset/base/261824 Log: libutil/pw_util.3: Fix two prototypes. Reported by: marino Obtained from:DragonFlyBSD (e82b5d3dfa969bfcda5ffadceccc682b6bdcd077) MFC After:3 days Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 == --- head/lib/libutil/pw_util.3 Thu Feb 13 04:59:18 2014(r261823) +++ head/lib/libutil/pw_util.3 Thu Feb 13 05:13:22 2014(r261824) @@ -48,13 +48,13 @@ .In pwd.h .In libutil.h .Ft int -.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "const struct passwd *oldpw" +.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "struct passwd *oldpw" .Ft "struct passwd *" .Fn pw_dup "const struct passwd *pw" .Ft int .Fn pw_edit "int nosetuid" .Ft int -.Fn pw_equal "const struct passwd *pw1" "const struct passwd pw2" +.Fn pw_equal "const struct passwd *pw1" "const struct passwd *pw2" .Ft void .Fn pw_fini "void" .Ft int ___ 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: r261825 - head/sys/net
Author: glebius Date: Thu Feb 13 05:19:09 2014 New Revision: 261825 URL: http://svnweb.freebsd.org/changeset/base/261825 Log: Remove unused FL_NOAUTO. Modified: head/sys/net/flowtable.c head/sys/net/flowtable.h Modified: head/sys/net/flowtable.c == --- head/sys/net/flowtable.cThu Feb 13 05:13:22 2014(r261824) +++ head/sys/net/flowtable.cThu Feb 13 05:19:09 2014(r261825) @@ -899,7 +899,7 @@ flowtable_lookup_common(struct flowtable } critical_exit(); - if (flags & FL_NOAUTO || flow_full(ft)) + if (flow_full(ft)) return (NULL); FLOWSTAT_INC(ft, ft_misses); Modified: head/sys/net/flowtable.h == --- head/sys/net/flowtable.hThu Feb 13 05:13:22 2014(r261824) +++ head/sys/net/flowtable.hThu Feb 13 05:19:09 2014(r261825) @@ -44,7 +44,6 @@ struct flowtable_stat { #ifdef _KERNEL #defineFL_HASH_ALL (1<<0) /* hash 4-tuple + protocol */ -#defineFL_NOAUTO (1<<2) /* don't automatically add flentry on miss */ #define FL_IPV6(1<<9) #defineFL_TCP (1<<11) ___ 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: r261826 - head/sys/arm/freescale/vybrid
Author: br Date: Thu Feb 13 06:38:01 2014 New Revision: 261826 URL: http://svnweb.freebsd.org/changeset/base/261826 Log: Add function for configuring PLL4 (Audio) clock frequency output. Modified: head/sys/arm/freescale/vybrid/vf_anadig.c head/sys/arm/freescale/vybrid/vf_common.h Modified: head/sys/arm/freescale/vybrid/vf_anadig.c == --- head/sys/arm/freescale/vybrid/vf_anadig.c Thu Feb 13 05:19:09 2014 (r261825) +++ head/sys/arm/freescale/vybrid/vf_anadig.c Thu Feb 13 06:38:01 2014 (r261826) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,14 +99,19 @@ __FBSDID("$FreeBSD$"); #defineCTRL_PLL_EN (1 << 13) #defineEN_USB_CLKS (1 << 6) +#definePLL4_CTRL_DIV_SEL_S 0 +#definePLL4_CTRL_DIV_SEL_M 0x7f + struct anadig_softc { struct resource *res[1]; bus_space_tag_t bst; bus_space_handle_t bsh; }; +struct anadig_softc *anadig_sc; + static struct resource_spec anadig_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 0, RF_ACTIVE }, { -1, 0 } }; @@ -148,6 +153,28 @@ enable_pll(struct anadig_softc *sc, int return (0); } +uint32_t +pll4_configure_output(uint32_t mfi, uint32_t mfn, uint32_t mfd) +{ + struct anadig_softc *sc; + int reg; + + sc = anadig_sc; + + /* +* PLLout = Fsys * (MFI+(MFN/MFD)) +*/ + + reg = READ4(sc, ANADIG_PLL4_CTRL); + reg &= ~(PLL4_CTRL_DIV_SEL_M << PLL4_CTRL_DIV_SEL_S); + reg |= (mfi << PLL4_CTRL_DIV_SEL_S); + WRITE4(sc, ANADIG_PLL4_CTRL, reg); + WRITE4(sc, ANADIG_PLL4_NUM, mfn); + WRITE4(sc, ANADIG_PLL4_DENOM, mfd); + + return (0); +} + static int anadig_attach(device_t dev) { @@ -165,11 +192,13 @@ anadig_attach(device_t dev) sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); + anadig_sc = sc; + /* Enable USB PLLs */ enable_pll(sc, ANADIG_PLL3_CTRL); enable_pll(sc, ANADIG_PLL7_CTRL); - /* Enable other */ + /* Enable other PLLs */ enable_pll(sc, ANADIG_PLL1_CTRL); enable_pll(sc, ANADIG_PLL2_CTRL); enable_pll(sc, ANADIG_PLL4_CTRL); Modified: head/sys/arm/freescale/vybrid/vf_common.h == --- head/sys/arm/freescale/vybrid/vf_common.h Thu Feb 13 05:19:09 2014 (r261825) +++ head/sys/arm/freescale/vybrid/vf_common.h Thu Feb 13 06:38:01 2014 (r261826) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,4 +39,5 @@ #defineWRITE1(_sc, _reg, _val) \ bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) +uint32_t pll4_configure_output(uint32_t mfi, uint32_t mfn, uint32_t mfd); uint32_t tcon_bypass(void); ___ 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"