svn commit: r189611 - head/sys/dev/pci
Author: marcel Date: Tue Mar 10 06:21:52 2009 New Revision: 189611 URL: http://svn.freebsd.org/changeset/base/189611 Log: Fix a buglet in revision 189401: when restoring a 64-bit BAR, write the upper 32-bits in the adjacent bar. The consequences of the buglet were severe enough though: a machine check. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c == --- head/sys/dev/pci/pci.c Tue Mar 10 02:12:03 2009(r189610) +++ head/sys/dev/pci/pci.c Tue Mar 10 06:21:52 2009(r189611) @@ -3464,7 +3464,7 @@ pci_alloc_map(device_t dev, device_t chi */ pci_write_config(child, *rid, map, 4); if (maprange == 64) - pci_write_config(child, *rid + 4, map, 4); + pci_write_config(child, *rid + 4, map 32, 4); pci_write_config(child, PCIR_COMMAND, cmd, 2); /* Ignore a BAR with a base of 0. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189539 - head/sys/kern
On Sun, 8 Mar 2009 19:05:54 + (UTC), Joe Marcus Clarke mar...@freebsd.org wrote: Author: marcus (doc,ports committer) Date: Sun Mar 8 19:05:53 2009 New Revision: 189539 URL: http://svn.freebsd.org/changeset/base/189539 Log: Add a default implementation for VOP_VPTOCNP(9) which scans the parent directory of a vnode to find a dirent with a matching file number. The name from that dirent is then used to provide the component name. Note: if the initial vnode argument is not a directory itself, then the default VOP_VPTOCNP(9) implementation still returns ENOENT. Reviewed by:kib Approved by:kib Tested by: pho I think this panics nullfs mounts. I have a kernel build from subversion changeset /h...@189540 that panics instantly with: panic: vrele: negative ref cnt inside nullfs, every time I do something like: # mount -t nullfs /home/build/obj /usr/obj # mount -t nullfs /home/build/src /usr/src # cd /usr/src/usr.sbin/fwcontrol # make clean # make all The `make all' command never returns, and the resulting kgdb backtrace is something like: (kgdb) bt #0 doadump () at pcpu.h:246 #1 0xc063d4be in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:420 #2 0xc063d792 in panic (fmt=Variable fmt is not available. ) at /usr/src/sys/kern/kern_shutdown.c:576 #3 0xc06c8fb1 in vrele (vp=0xc8896648) at /usr/src/sys/kern/vfs_subr.c:2191 #4 0xc6761610 in null_nodeget (mp=0xc674f000, lowervp=0xc8896648, vpp=0xe9081bf0) at /usr/src/sys/modules/nullfs/../../fs/nullfs/null_subr.c:204 #5 0xc6762601 in null_bypass (ap=0xe9081bdc) at /usr/src/sys/modules/nullfs/../../fs/nullfs/null_vnops.c:325 #6 0xc08d7173 in VOP_VPTOCNP_APV (vop=0xc6763240, a=0xe9081bdc) at vnode_if.c:2871 #7 0xc06b4e89 in vn_vptocnp (vp=0xe9081c24, bp=0xe9081c28, buf=0xc63ce000 ήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐήήΐή..., buflen=0xe9081c48) at vnode_if.h:1541 #8 0xc06b520a in vn_fullpath1 (td=Variable td is not available. ) at /usr/src/sys/kern/vfs_cache.c:1001 #9 0xc06b55a0 in kern___getcwd (td=0xc6de56c0, buf=0xbfbfddf6 Address 0xbfbfddf6 out of bounds, bufseg=UIO_USERSPACE, buflen=1024) at /usr/src/sys/kern/vfs_cache.c:795 #10 0xc06b5749 in __getcwd (td=0xc6de56c0, uap=0xe9081cf8) at /usr/src/sys/kern/vfs_cache.c:769 #11 0xc08cc973 in syscall (frame=0xe9081d38) at /usr/src/sys/i386/i386/trap.c:1076 ---Type return to continue, or q return to quit--- #12 0xc08b0eb0 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:261 #13 0x0033 in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) q r...@kobe:/var/crash# exit exit ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189613 - head/tools/regression/usr.bin/pkill
Author: rwatson Date: Tue Mar 10 09:33:22 2009 New Revision: 189613 URL: http://svn.freebsd.org/changeset/base/189613 Log: Rename files that collide on case-insensitive file systems by encoding colliding upper case letters as the lower case letter with a '_' in front. MFC after:3 days Discussed with: ed Spotted by: Michael David Crawford mdc at prgmr.com Added: head/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) - copied unchanged from r189289, head/tools/regression/usr.bin/pkill/pgrep-G.t head/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) - copied unchanged from r189289, head/tools/regression/usr.bin/pkill/pgrep-S.t head/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) - copied unchanged from r189289, head/tools/regression/usr.bin/pkill/pkill-G.t Deleted: head/tools/regression/usr.bin/pkill/pgrep-G.t head/tools/regression/usr.bin/pkill/pgrep-S.t head/tools/regression/usr.bin/pkill/pkill-G.t Copied: head/tools/regression/usr.bin/pkill/pgrep-_g.t (from r189289, head/tools/regression/usr.bin/pkill/pgrep-G.t) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/pkill/pgrep-_g.t Tue Mar 10 09:33:22 2009(r189613, copy of r189289, head/tools/regression/usr.bin/pkill/pgrep-G.t) @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo 1..2 + +name=pgrep -G gid +rgid=`id -gr` +sleep=`mktemp /tmp/$base.XX` || exit 1 +ln -sf /bin/sleep $sleep +$sleep 5 +sleep 0.3 +chpid=$! +pid=`pgrep -f -G $rgid $sleep` +if [ $pid = $chpid ]; then + echo ok 1 - $name +else + echo not ok 1 - $name +fi +kill $chpid +rm -f $sleep + +name=pgrep -G group +rgid=`id -grn` +sleep=`mktemp /tmp/$base.XX` || exit 1 +ln -sf /bin/sleep $sleep +$sleep 5 +sleep 0.3 +chpid=$! +pid=`pgrep -f -G $rgid $sleep` +if [ $pid = $chpid ]; then + echo ok 2 - $name +else + echo not ok 2 - $name +fi +kill $chpid +rm -f $sleep Copied: head/tools/regression/usr.bin/pkill/pgrep-_s.t (from r189289, head/tools/regression/usr.bin/pkill/pgrep-S.t) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/pkill/pgrep-_s.t Tue Mar 10 09:33:22 2009(r189613, copy of r189289, head/tools/regression/usr.bin/pkill/pgrep-S.t) @@ -0,0 +1,20 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo 1..2 + +name=pgrep -S +pid=`pgrep -Sx g_event` +if [ $pid = 2 ]; then + echo ok 1 - $name +else + echo not ok 1 - $name +fi +pid=`pgrep -x g_event` +if [ $pid != 2 ]; then + echo ok 2 - $name +else + echo not ok 2 - $name +fi Copied: head/tools/regression/usr.bin/pkill/pkill-_g.t (from r189289, head/tools/regression/usr.bin/pkill/pkill-G.t) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/pkill/pkill-_g.t Tue Mar 10 09:33:22 2009(r189613, copy of r189289, head/tools/regression/usr.bin/pkill/pkill-G.t) @@ -0,0 +1,42 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo 1..2 + +name=pkill -G gid +rgid=`id -gr` +sleep=`mktemp /tmp/$base.XX` || exit 1 +ln -sf /bin/sleep $sleep +$sleep 5 +sleep 0.3 +pkill -f -G $rgid $sleep +ec=$? +case $ec in +0) + echo ok 1 - $name + ;; +*) + echo not ok 1 - $name + ;; +esac +rm -f $sleep + +name=pkill -G group +rgid=`id -grn` +sleep=`mktemp /tmp/$base.XX` || exit 1 +ln -sf /bin/sleep $sleep +$sleep 5 +sleep 0.3 +pkill -f -G $rgid $sleep +ec=$? +case $ec in +0) + echo ok 2 - $name + ;; +*) + echo not ok 2 - $name + ;; +esac +rm -f $sleep ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189615 - head/sys/netinet
Author: rwatson Date: Tue Mar 10 11:04:19 2009 New Revision: 189615 URL: http://svn.freebsd.org/changeset/base/189615 Log: Remove now-unused INP_UNMAPPABLEOPTS. MFC after:3 days Discussed with: bz Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h == --- head/sys/netinet/in_pcb.h Tue Mar 10 10:59:30 2009(r189614) +++ head/sys/netinet/in_pcb.h Tue Mar 10 11:04:19 2009(r189615) @@ -433,8 +433,6 @@ voidinp_4tuple_get(struct inpcb *inp, IN6P_DSTOPTS|IN6P_RTHDR|IN6P_RTHDRDSTOPTS|\ IN6P_TCLASS|IN6P_AUTOFLOWLABEL|IN6P_RFC2292|\ IN6P_MTU) -#defineINP_UNMAPPABLEOPTS (IN6P_HOPOPTS|IN6P_DSTOPTS|IN6P_RTHDR|\ -IN6P_TCLASS|IN6P_AUTOFLOWLABEL) /* for KAME src sync over BSD*'s */ #defineIN6P_HIGHPORT INP_HIGHPORT ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189616 - head/sys/geom/part
Author: nyan Date: Tue Mar 10 11:14:03 2009 New Revision: 189616 URL: http://svn.freebsd.org/changeset/base/189616 Log: Restore the return statement. It was accidentally removed by rev 188429. Modified: head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part_pc98.c == --- head/sys/geom/part/g_part_pc98.cTue Mar 10 11:04:19 2009 (r189615) +++ head/sys/geom/part/g_part_pc98.cTue Mar 10 11:14:03 2009 (r189616) @@ -268,6 +268,7 @@ g_part_pc98_dumpconf(struct g_part_table entry = (struct g_part_pc98_entry *)baseentry; if (entry == NULL) { /* confxml: scheme information */ + return; } type = entry-ent.dp_mid + (entry-ent.dp_sid 8); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189617 - in head/sys: dev/syscons dev/syscons/teken pc98/cbus
Author: ed Date: Tue Mar 10 11:28:54 2009 New Revision: 189617 URL: http://svn.freebsd.org/changeset/base/189617 Log: Make a 1:1 mapping between syscons stats and terminal emulators. After I imported libteken into the source tree, I noticed syscons didn't store the cursor position inside the terminal emulator, but inside the virtual terminal stat. This is not very useful, because when you implement more complex forms of line wrapping, you need to keep track of more state than just the cursor position. Because the kernel messages didn't share the same terminal emulator as ttyv0, this caused a lot of strange things, like kernel messages being misplaced and a missing notification to resize the terminal emulator for kernel messages never to be resized when using vidcontrol. This patch just removes kernel_console_ts and adds a special parameter to te_puts to determine whether messages should be printed using regular colors or the ones for kernel messages. Reported by: ache Tested by:nyan, garga (older version) Modified: head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h head/sys/dev/syscons/teken/teken.c head/sys/dev/syscons/teken/teken.h head/sys/pc98/cbus/scterm-sck.c Modified: head/sys/dev/syscons/scterm-teken.c == --- head/sys/dev/syscons/scterm-teken.c Tue Mar 10 11:14:03 2009 (r189616) +++ head/sys/dev/syscons/scterm-teken.c Tue Mar 10 11:28:54 2009 (r189617) @@ -153,12 +153,23 @@ scteken_term(scr_stat *scp, void **softc } static void -scteken_puts(scr_stat *scp, u_char *buf, int len) +scteken_puts(scr_stat *scp, u_char *buf, int len, int kernel) { teken_stat *ts = scp-ts; + teken_attr_t backup, kattr; scp-sc-write_in_progress++; - teken_input(ts-ts_teken, buf, len); + if (kernel) { + /* Use special colors for kernel messages. */ + backup = *teken_get_curattr(ts-ts_teken); + scteken_revattr(SC_KERNEL_CONS_ATTR, kattr); + teken_set_curattr(ts-ts_teken, kattr); + teken_input(ts-ts_teken, buf, len); + teken_set_curattr(ts-ts_teken, backup); + } else { + /* Print user messages with regular colors. */ + teken_input(ts-ts_teken, buf, len); + } scp-sc-write_in_progress--; } Modified: head/sys/dev/syscons/syscons.c == --- head/sys/dev/syscons/syscons.c Tue Mar 10 11:14:03 2009 (r189616) +++ head/sys/dev/syscons/syscons.c Tue Mar 10 11:28:54 2009 (r189617) @@ -95,16 +95,10 @@ static default_attr user_default = { SC_NORM_REV_ATTR, }; -static default_attr kernel_default = { -SC_KERNEL_CONS_ATTR, -SC_KERNEL_CONS_REV_ATTR, -}; - static int sc_console_unit = -1; static int sc_saver_keyb_only = 1; static scr_stat *sc_console; static struct consdev *sc_consptr; -static void*kernel_console_ts; static scr_statmain_console; static struct tty *main_devs[MAXCONS]; @@ -323,7 +317,7 @@ sctty_outwakeup(struct tty *tp) len = ttydisc_getc(tp, buf, sizeof buf); if (len == 0) break; - sc_puts(scp, buf, len); + sc_puts(scp, buf, len, 0); } } @@ -373,22 +367,8 @@ sc_attach_unit(int unit, int flags) /* assert(sc_console != NULL) */ flags |= SC_KERNEL_CONSOLE; scmeminit(NULL); - - scinit(unit, flags); - - if (sc_console-tsw-te_size 0) { - /* assert(sc_console-ts != NULL); */ - kernel_console_ts = sc_console-ts; - sc_console-ts = malloc(sc_console-tsw-te_size, - M_DEVBUF, M_WAITOK); - bcopy(kernel_console_ts, sc_console-ts, sc_console-tsw-te_size); - (*sc_console-tsw-te_default_attr)(sc_console, - user_default.std_color, - user_default.rev_color); - } -} else { - scinit(unit, flags); } +scinit(unit, flags); sc = sc_get_softc(unit, flags SC_KERNEL_CONSOLE); sc-config = flags; @@ -1507,7 +1487,6 @@ sc_cnputc(struct consdev *cd, int c) { u_char buf[1]; scr_stat *scp = sc_console; -void *save; #ifndef SC_NO_HISTORY #if 0 struct tty *tp; @@ -1543,12 +1522,8 @@ sc_cnputc(struct consdev *cd, int c) } #endif /* !SC_NO_HISTORY */ -save = scp-ts; -if (kernel_console_ts != NULL) - scp-ts = kernel_console_ts; buf[0] = c; -sc_puts(scp, buf, 1); -scp-ts = save; +sc_puts(scp, buf, 1, 1); s = spltty(); /* block sckbdevent and scrn_timer */ sccnupdate(scp); @@ -2492,7 +2467,7 @@ exchange_scr(sc_softc_t *sc) } void
svn commit: r189618 - head/contrib/top
Author: rwatson Date: Tue Mar 10 11:46:41 2009 New Revision: 189618 URL: http://svn.freebsd.org/changeset/base/189618 Log: Merge r183430 from vendor/top/dist to head/contrib/top, although with record-only mergeinfo because an automated merge is confused by the flattening that took place: Move install to install-sh to prevent name-clashes. MFC after:3 days Added: head/contrib/top/install-sh (props changed) - copied unchanged from r189617, head/contrib/top/install Deleted: head/contrib/top/install Modified: head/contrib/top/ (props changed) Copied: head/contrib/top/install-sh (from r189617, head/contrib/top/install) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/top/install-sh Tue Mar 10 11:46:41 2009(r189618, copy of r189617, head/contrib/top/install) @@ -0,0 +1,69 @@ +#!/bin/sh +# +# this shell script is amazingly similar to the old and lamented +# BSD install command. It recognized the following options: +# +# -o target file owner +# -m target file mode +# -g target file group owner +# +# +# scan the options +# +while [ $# -gt 0 ]; do +case $1 in + -o) + owner=$2 + shift ; shift + ;; + + -m) + mode=$2 + shift; shift + ;; + + -g) + group=$2 + shift ; shift + ;; + + -*) + echo install: unknown option $1 + exit + ;; + + *) + break + ;; +esac +done +# +# we need two more: filename and destination +# +if [ $# -ne 2 ]; then +echo Usage: install [ -o owner ] [ -m mode ] [ -g group ] file destination +exit +fi +# +# first, copy +# +cp $1 $2 +# +# normalize the name +# +dest=$2 +if [ -d $2 ]; then +dest=$2/`basename $1` +fi +# +# do optional things +# +if [ $owner ]; then +chown $owner $dest +fi +if [ $group ]; then +chgrp $group $dest +fi +if [ $mode ]; then +chmod $mode $dest +fi ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189619 - head/sys/dev/cardbus
Author: imp Date: Tue Mar 10 12:10:50 2009 New Revision: 189619 URL: http://svn.freebsd.org/changeset/base/189619 Log: When freeing all the resources of the card, it is better to turn off the PORTEN and MEMEN bits in the command register than to zero the bars. Use pci_write_ivar directly instead of a one-line wrapper that adds no value. Track verbosity changes in pci. Remove a stray blank line. Modified: head/sys/dev/cardbus/cardbus.c Modified: head/sys/dev/cardbus/cardbus.c == --- head/sys/dev/cardbus/cardbus.c Tue Mar 10 11:46:41 2009 (r189618) +++ head/sys/dev/cardbus/cardbus.c Tue Mar 10 12:10:50 2009 (r189619) @@ -221,7 +221,6 @@ cardbus_detach_card(device_t cbdev) if (device_get_children(cbdev, devlist, numdevs) != 0) return (ENOENT); - if (numdevs == 0) { free(devlist, M_TEMP); return (ENOENT); @@ -269,13 +268,16 @@ cardbus_driver_added(device_t cbdev, dri } if (i 0 i == numdevs) POWER_ENABLE_SOCKET(device_get_parent(cbdev), cbdev); - /* XXX Should I wait for power to become good? */ for (i = 0; i numdevs; i++) { dev = devlist[i]; if (device_get_state(dev) != DS_NOTPRESENT) continue; dinfo = device_get_ivars(dev); pci_print_verbose(dinfo-pci); + if (bootverbose) + printf(pci%d:%d:%d:%d: reprobing on driver added\n, + dinfo-pci.cfg.domain, dinfo-pci.cfg.bus, + dinfo-pci.cfg.slot, dinfo-pci.cfg.func); pci_cfg_restore(dinfo-pci.cfg.dev, dinfo-pci); if (device_probe_and_attach(dev) != 0) pci_cfg_save(dev, dinfo-pci, 1); @@ -287,6 +289,7 @@ static void cardbus_release_all_resources(device_t cbdev, struct cardbus_devinfo *dinfo) { struct resource_list_entry *rle; + device_t dev; /* Free all allocated resources */ STAILQ_FOREACH(rle, dinfo-pci.resources, link) { @@ -294,15 +297,14 @@ cardbus_release_all_resources(device_t c BUS_RELEASE_RESOURCE(device_get_parent(cbdev), cbdev, rle-type, rle-rid, rle-res); rle-res = NULL; - /* -* zero out config so the card won't acknowledge -* access to the space anymore. XXX doesn't handle -* 64-bit bars. -*/ - pci_write_config(dinfo-pci.cfg.dev, rle-rid, 0, 4); } } resource_list_free(dinfo-pci.resources); + /* turn off the card's decoding now that the resources are done */ + dev = dinfo-pci.cfg.dev; + pci_write_config(dev, PCIR_COMMAND, + pci_read_config(dev, PCIR_COMMAND, 2) + ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN), 2); } // @@ -336,12 +338,6 @@ cardbus_read_ivar(device_t cbdev, device return 0; } -static int -cardbus_write_ivar(device_t cbdev, device_t child, int which, uintptr_t value) -{ - return(pci_write_ivar(cbdev, child, which, value)); -} - static device_method_t cardbus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, cardbus_probe), @@ -352,7 +348,7 @@ static device_method_t cardbus_methods[] /* Bus interface */ DEVMETHOD(bus_read_ivar,cardbus_read_ivar), - DEVMETHOD(bus_write_ivar, cardbus_write_ivar), + DEVMETHOD(bus_write_ivar, pci_write_ivar), DEVMETHOD(bus_driver_added, cardbus_driver_added), /* Card Interface */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189619 - head/sys/dev/cardbus
On Tuesday 10 March 2009 8:10:50 am Warner Losh wrote: Author: imp Date: Tue Mar 10 12:10:50 2009 New Revision: 189619 URL: http://svn.freebsd.org/changeset/base/189619 Log: When freeing all the resources of the card, it is better to turn off the PORTEN and MEMEN bits in the command register than to zero the bars. Modified: head/sys/dev/cardbus/cardbus.c Modified: head/sys/dev/cardbus/cardbus.c == --- head/sys/dev/cardbus/cardbus.cTue Mar 10 11:46:41 2009 (r189618) +++ head/sys/dev/cardbus/cardbus.cTue Mar 10 12:10:50 2009 (r189619) @@ -287,6 +289,7 @@ static void cardbus_release_all_resources(device_t cbdev, struct cardbus_devinfo *dinfo) { struct resource_list_entry *rle; + device_t dev; /* Free all allocated resources */ STAILQ_FOREACH(rle, dinfo-pci.resources, link) { @@ -294,15 +297,14 @@ cardbus_release_all_resources(device_t c BUS_RELEASE_RESOURCE(device_get_parent(cbdev), cbdev, rle-type, rle-rid, rle-res); rle-res = NULL; - /* - * zero out config so the card won't acknowledge - * access to the space anymore. XXX doesn't handle - * 64-bit bars. - */ - pci_write_config(dinfo-pci.cfg.dev, rle-rid, 0, 4); } } resource_list_free(dinfo-pci.resources); + /* turn off the card's decoding now that the resources are done */ + dev = dinfo-pci.cfg.dev; + pci_write_config(dev, PCIR_COMMAND, + pci_read_config(dev, PCIR_COMMAND, 2) + ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN), 2); } It might be best to do this before releasing the resources rather than afterwards. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189620 - head/sys/net
Author: csjp Date: Tue Mar 10 14:28:19 2009 New Revision: 189620 URL: http://svn.freebsd.org/changeset/base/189620 Log: Disable zerocopy by default for now. It's causing some problems in pcap consumers which fork after the shared pages have been setup. pflogd(8) is an example. The problem is understood and there is a fix coming in shortly. Folks who want to continue using it can do so by setting net.bpf.zerocopy_enable to 1. Discussed with: rwatson Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c == --- head/sys/net/bpf.c Tue Mar 10 12:10:50 2009(r189619) +++ head/sys/net/bpf.c Tue Mar 10 14:28:19 2009(r189620) @@ -124,7 +124,7 @@ SYSCTL_NODE(_net, OID_AUTO, bpf, CTLFLAG int bpf_maxinsns = BPF_MAXINSNS; SYSCTL_INT(_net_bpf, OID_AUTO, maxinsns, CTLFLAG_RW, bpf_maxinsns, 0, Maximum bpf program instructions); -static int bpf_zerocopy_enable = 1; +static int bpf_zerocopy_enable = 0; SYSCTL_INT(_net_bpf, OID_AUTO, zerocopy_enable, CTLFLAG_RW, bpf_zerocopy_enable, 0, Enable new zero-copy BPF buffer sessions); SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_MPSAFE | CTLFLAG_RW, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189621 - head/lib/libusb
Author: thompsa Date: Tue Mar 10 14:29:34 2009 New Revision: 189621 URL: http://svn.freebsd.org/changeset/base/189621 Log: Be compatible with LibUSB from sourceforge and close the handle after reset Submitted by: Hans Petter Selasky Modified: head/lib/libusb/libusb20_compat01.c Modified: head/lib/libusb/libusb20_compat01.c == --- head/lib/libusb/libusb20_compat01.c Tue Mar 10 14:28:19 2009 (r189620) +++ head/lib/libusb/libusb20_compat01.c Tue Mar 10 14:29:34 2009 (r189621) @@ -816,7 +816,11 @@ usb_reset(usb_dev_handle * dev) if (err) return (-1); - return (0); + /* +* Be compatible with LibUSB from sourceforge and close the +* handle after reset! +*/ + return (usb_close(dev)); } const char * ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189622 - head/sys/fs/nullfs
Author: kib Date: Tue Mar 10 14:35:21 2009 New Revision: 189622 URL: http://svn.freebsd.org/changeset/base/189622 Log: Do not use bypass for vop_vptocnp() from nullfs, call standard implementation instead. The bypass does not assume that returned vnode is only held. Reported by: Paul B. Mahol onemda gmail com, pluknet pluknet gmail com Reviewed by: jhb Tested by:pho, pluknet pluknet gmail com Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c == --- head/sys/fs/nullfs/null_vnops.c Tue Mar 10 14:29:34 2009 (r189621) +++ head/sys/fs/nullfs/null_vnops.c Tue Mar 10 14:35:21 2009 (r189622) @@ -742,5 +742,6 @@ struct vop_vector null_vnodeops = { .vop_setattr = null_setattr, .vop_strategy = VOP_EOPNOTSUPP, .vop_unlock = null_unlock, + .vop_vptocnp = vop_stdvptocnp, .vop_vptofh = null_vptofh, }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189623 - head/tools/tools/netrate/tcpp
Author: rwatson Date: Tue Mar 10 14:52:17 2009 New Revision: 189623 URL: http://svn.freebsd.org/changeset/base/189623 Log: Add tcpp -- TCP parallelism microbenchmark. This tool creates large numbers of TCP connections, each of which will transmit a fixed amount of data, between client and server hosts. tcpp can use multiple workers (typically up to the number of hardware cores), and can use multiple source IPs in order to use an expanded port/IP 4-tuple space to avoid problems from reusing 4-tuples too quickly. Aggregate bandwidth use will be reported after a client run. While by no means a perfect tool, it has proven quite useful in generating and optimizing TCP stack lock contention by easily generating high-intensity workloads. It also proves surprisingly good at finding device driver bugs. Added: head/tools/tools/netrate/tcpp/ head/tools/tools/netrate/tcpp/Makefile (contents, props changed) head/tools/tools/netrate/tcpp/README (contents, props changed) head/tools/tools/netrate/tcpp/tcpp.c (contents, props changed) head/tools/tools/netrate/tcpp/tcpp.h (contents, props changed) head/tools/tools/netrate/tcpp/tcpp_client.c (contents, props changed) head/tools/tools/netrate/tcpp/tcpp_server.c (contents, props changed) head/tools/tools/netrate/tcpp/tcpp_util.c (contents, props changed) Added: head/tools/tools/netrate/tcpp/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netrate/tcpp/Makefile Tue Mar 10 14:52:17 2009 (r189623) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= tcpp +INCS= tcpp.h +NO_MAN= +SRCS= tcpp.c tcpp_client.c tcpp_server.c tcpp_util.c +WARNS= 3 + +.include bsd.prog.mk Added: head/tools/tools/netrate/tcpp/README == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netrate/tcpp/READMETue Mar 10 14:52:17 2009 (r189623) @@ -0,0 +1,99 @@ +tcpp -- Parallel TCP Exercise Tool + +This is a new tool, and is rife with bugs. However, it appears to create +even more problems for device drivers and the kernel, so that's OK. + +This tool generates large numbers of TCP connections and stuffs lots of data +into them. One binary encapsulates both a client and a server. Each of the +client and the server generates a certain number of worker processes, each of +which in turn uses its own TCP port. The number of server processes must be += the number of client processes, or some of the ports required by the +client won't have a listener. The client then proceeds to make connections +and send data to the server. Each worker multiplexes many connections at +once, up to a maximum parallelism limit. The client can use one or many IP +addresses, in order to make more 4-tuples available for testing, and will +automatically spread the load of new connections across available source +addresses. + +You will need to retune your TCP stack for high volume, see Configuration +Notes below. + +The server has very little to configure, use the following command line +flags: + + -s Select server mode + -p numprocsNumber of workers, should be = client -p arg + -r baseportNon-default base TCP port, should match client + -T Print CPU usage every ten seconds + -m maxconnectionsperproc Maximum simultaneous connections/proc, should + be = client setting. + +Typical use: + + ./tcpp -s -p 4 -m 100 + +This selects server mode, four workers, and at most 1 million TCP connections +per worker at a time. + +The client has more to configure, with the following flags: + + -c remoteIPSelect client mode, and specific dest IP + -C Print connections/second instead of GBps + -M localIPcountNumber of sequential local IPs to use; req. -l + -T Include CPU use summary in stats at end of run + -b bytespertcp Data bytes per connection + -l localIPbase Starting local IP address to bind + -m maxtcpsatonce Max simultaneous conn/worker (see server -m) + -p numprocsNumber of workers, should be = server -p + -r baseportNon-default base TCP port, should match server + -t tcpsperproc How many connections to use per worker + +Typical use: + + ./tcpp -c 192.168.100.201 -p 4 -t 10 -m 1 -b 10 \ +-l 192.168.100.101 -M 4 + +This creates four workers, each of which will (over its lifetime) set up and +use 100,000 TCP connections carrying 100K of data, up to 10,000 simultaneous +connection at any given moment. tcpp will use four source IP addresses, +starting with 192.168.100.101, and all connections will be to the
svn commit: r189624 - head/etc/rc.d
Author: guido Date: Tue Mar 10 15:19:49 2009 New Revision: 189624 URL: http://svn.freebsd.org/changeset/base/189624 Log: When swap resides on a mirror and it is not stopped, the mirror is degraded upon the next reboot and will have to be rebuild. Thus call swapoff when rebooting (read: when stopping swap1) Modified: head/etc/rc.d/swap1 Modified: head/etc/rc.d/swap1 == --- head/etc/rc.d/swap1 Tue Mar 10 14:52:17 2009(r189623) +++ head/etc/rc.d/swap1 Tue Mar 10 15:19:49 2009(r189624) @@ -11,7 +11,7 @@ name=swap1 start_cmd='swapon -aq' -stop_cmd=':' +stop_cmd='swapoff -aq' load_rc_config swap run_rc_command $1 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189625 - head/sys/geom/eli
Author: guido Date: Tue Mar 10 15:23:43 2009 New Revision: 189625 URL: http://svn.freebsd.org/changeset/base/189625 Log: When attaching a geli on boot make sure that it is detached upon last close. (needed for a gmirror to properly shutdown upon reboot when a geli is on top the gmirror) Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c == --- head/sys/geom/eli/g_eli.c Tue Mar 10 15:19:49 2009(r189624) +++ head/sys/geom/eli/g_eli.c Tue Mar 10 15:23:43 2009(r189625) @@ -996,6 +996,7 @@ g_eli_taste(struct g_class *mp, struct g /* * We have correct key, let's attach provider. */ + md.md_flags |= G_ELI_FLAG_WO_DETACH; gp = g_eli_create(NULL, mp, pp, md, mkey, nkey); bzero(mkey, sizeof(mkey)); bzero(md, sizeof(md)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189628 - head/lib/libusb
Author: thompsa Date: Tue Mar 10 15:49:43 2009 New Revision: 189628 URL: http://svn.freebsd.org/changeset/base/189628 Log: Update libusb.3 name and add mlinks for usb.3 and libusb20.3 Added: head/lib/libusb/libusb.3 (contents, props changed) - copied, changed from r189619, head/lib/libusb/libusb20.3 Deleted: head/lib/libusb/libusb20.3 Modified: head/lib/libusb/Makefile Modified: head/lib/libusb/Makefile == --- head/lib/libusb/MakefileTue Mar 10 15:26:50 2009(r189627) +++ head/lib/libusb/MakefileTue Mar 10 15:49:43 2009(r189628) @@ -14,10 +14,13 @@ SRCS+= libusb20_compat01.c SRCS+= libusb20_compat10.c INCS+= libusb20.h INCS+= libusb20_desc.h -MAN= libusb20.3 +MAN= libusb.3 MKLINT=no NOGCCERROR= +MLINKS+= libusb.3 usb.3 \ + libusb.3 libusb20.3 + # libusb 0.1 compat INCS+= usb.h Copied and modified: head/lib/libusb/libusb.3 (from r189619, head/lib/libusb/libusb20.3) == --- head/lib/libusb/libusb20.3 Tue Mar 10 12:10:50 2009(r189619, copy source) +++ head/lib/libusb/libusb.3Tue Mar 10 15:49:43 2009(r189628) @@ -27,10 +27,10 @@ .\ $FreeBSD$ .\ .Dd Feb 14, 2009 -.Dt LIBUSB20 3 +.Dt LIBUSB 3 .Os .Sh NAME -.Nm libusb20 +.Nm libusb . .Nd USB access library . @@ -38,7 +38,7 @@ .Sh LIBRARY . . -USB access library (libusb20 -lusb20) +USB access library (libusb -lusb) . . . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189624 - head/etc/rc.d
On Tue, 2009-03-10 at 15:19 +, Guido van Rooij wrote: Author: guido Date: Tue Mar 10 15:19:49 2009 New Revision: 189624 URL: http://svn.freebsd.org/changeset/base/189624 Log: When swap resides on a mirror and it is not stopped, the mirror is degraded upon the next reboot and will have to be rebuild. Thus call swapoff when rebooting (read: when stopping swap1) Is this due to a bug/feature of gmirror? A long time ago, swapoff used to be run on shutdown, but it was removed by pjd@ in src/etc/rc.d/swap1 version 1.9 with the following commit message: | Stop method for swap1 script was introduced, because gmirror needed | it. Now gmirror use shutdown hooks to mark mirrors as clean on | shutdown, so this is not needed anymore. I'm not saying it's not needed, just intrigued why it is now needed again when it never used to be? FWIW, I seem to remember that one of the reasons it was removed was that turning swap off created the possibility that lots of things would be paged back into RAM, which a) could take a long time, and b) fail if there was insufficient RAM. Gavin -- Gavin Atkinson Systems Administrator Programmer Computing Service, The University of York, York. YO10 5DD Tel: +44 (0)1904 433738 Fax: +44 (0)1904 433740 I have a proof of Fermat's theorem but this .sig is too nar ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189629 - head/share/man/man4
Author: thompsa Date: Tue Mar 10 15:54:37 2009 New Revision: 189629 URL: http://svn.freebsd.org/changeset/base/189629 Log: Remove these files, they refer to module bundles that do not exist anymore. Deleted: head/share/man/man4/usb2_bluetooth.4 head/share/man/man4/usb2_controller.4 head/share/man/man4/usb2_ethernet.4 head/share/man/man4/usb2_image.4 head/share/man/man4/usb2_input.4 head/share/man/man4/usb2_misc.4 head/share/man/man4/usb2_ndis.4 head/share/man/man4/usb2_quirk.4 head/share/man/man4/usb2_serial.4 head/share/man/man4/usb2_sound.4 head/share/man/man4/usb2_storage.4 head/share/man/man4/usb2_wlan.4 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189625 - head/sys/geom/eli
Guido van Rooij gu...@freebsd.org wrote: Author: guido Date: Tue Mar 10 15:23:43 2009 New Revision: 189625 URL: http://svn.freebsd.org/changeset/base/189625 Log: When attaching a geli on boot make sure that it is detached upon last close. (needed for a gmirror to properly shutdown upon reboot when a geli is on top the gmirror) Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c == --- head/sys/geom/eli/g_eli.c Tue Mar 10 15:19:49 2009 (r189624) +++ head/sys/geom/eli/g_eli.c Tue Mar 10 15:23:43 2009 (r189625) @@ -996,6 +996,7 @@ g_eli_taste(struct g_class *mp, struct g /* * We have correct key, let's attach provider. */ + md.md_flags |= G_ELI_FLAG_WO_DETACH; gp = g_eli_create(NULL, mp, pp, md, mkey, nkey); bzero(mkey, sizeof(mkey)); bzero(md, sizeof(md)); Detach-on-last-close is known to cause panics when scrubbing at least some ZFS pools: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/117158 Quoting the PR: |Quoting Pawel Jakub Dawidek's response to my initial report: ||GELI's detach-on-last-close mechanism is a general purpose mechanism, it ||may not work correctly with ZFS, because ZFS sometimes closes and reopen ||providers, which will make GELI to detach. In other words you shouldn't ||configure detach-on-last-close for ZFS components. Fabian signature.asc Description: PGP signature
svn commit: r189630 - head/sys/arm/xscale/ixp425
Author: sam Date: Tue Mar 10 16:42:49 2009 New Revision: 189630 URL: http://svn.freebsd.org/changeset/base/189630 Log: catch up with r189306; handle delayed activation of resources Submitted by: jhb Modified: head/sys/arm/xscale/ixp425/ixp425.c head/sys/arm/xscale/ixp425/ixp425_pci.c Modified: head/sys/arm/xscale/ixp425/ixp425.c == --- head/sys/arm/xscale/ixp425/ixp425.c Tue Mar 10 15:54:37 2009 (r189629) +++ head/sys/arm/xscale/ixp425/ixp425.c Tue Mar 10 16:42:49 2009 (r189630) @@ -362,8 +362,10 @@ ixp425_alloc_resource(device_t dev, devi struct rman *rmanp; struct resource *rv; uint32_t vbase, addr; + int needactivate = flags RF_ACTIVE; int irq; + flags = ~RF_ACTIVE; switch (type) { case SYS_RES_IRQ: rmanp = sc-sc_irq_rman; @@ -382,6 +384,7 @@ ixp425_alloc_resource(device_t dev, devi if (BUS_READ_IVAR(dev, child, IXP425_IVAR_ADDR, addr) == 0) { start = addr; end = start + 0x1000; /* XXX */ + count = end - start; } if (getvbase(start, end - start, vbase) != 0) { /* likely means above table needs to be updated */ @@ -391,20 +394,41 @@ ixp425_alloc_resource(device_t dev, devi } rv = rman_reserve_resource(rmanp, start, end, count, flags, child); - if (rv != NULL) { + if (rv != NULL) rman_set_rid(rv, *rid); - if (strcmp(device_get_name(child), uart) == 0) - rman_set_bustag(rv, ixp425_a4x_bs_tag); - else - rman_set_bustag(rv, sc-sc_iot); - rman_set_bushandle(rv, vbase); - } break; default: rv = NULL; break; } - return rv; + if (rv != NULL needactivate) { + if (bus_activate_resource(child, type, *rid, rv)) { + rman_release_resource(rv); + return (NULL); + } + } + return (rv); +} + +static int +ixp425_activate_resource(device_t dev, device_t child, int type, int rid, +struct resource *r) +{ + struct ixp425_softc *sc = device_get_softc(dev); + int error; + uint32_t vbase; + + if (type == SYS_RES_MEMORY) { + error = getvbase(rman_get_start(r), rman_get_size(r), vbase); + if (error) + return (error); + if (strcmp(device_get_name(child), uart) == 0) + rman_set_bustag(r, ixp425_a4x_bs_tag); + else + rman_set_bustag(r, sc-sc_iot); + rman_set_bushandle(r, vbase); + } + return (rman_activate_resource(r)); } static __inline void @@ -472,6 +496,7 @@ static device_method_t ixp425_methods[] DEVMETHOD(bus_read_ivar, ixp425_read_ivar), DEVMETHOD(bus_alloc_resource, ixp425_alloc_resource), + DEVMETHOD(bus_activate_resource, ixp425_activate_resource), DEVMETHOD(bus_setup_intr, ixp425_setup_intr), DEVMETHOD(bus_teardown_intr, ixp425_teardown_intr), Modified: head/sys/arm/xscale/ixp425/ixp425_pci.c == --- head/sys/arm/xscale/ixp425/ixp425_pci.c Tue Mar 10 15:54:37 2009 (r189629) +++ head/sys/arm/xscale/ixp425/ixp425_pci.c Tue Mar 10 16:42:49 2009 (r189630) @@ -276,12 +276,10 @@ static struct resource * ixppcib_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - bus_space_tag_t tag; struct ixppcib_softc *sc = device_get_softc(bus); struct rman *rmanp; struct resource *rv; - tag = NULL; /* shut up stupid gcc */ rv = NULL; switch (type) { case SYS_RES_IRQ: @@ -290,28 +288,25 @@ ixppcib_alloc_resource(device_t bus, dev case SYS_RES_IOPORT: rmanp = sc-sc_io_rman; - tag = sc-sc_pci_iot; break; case SYS_RES_MEMORY: rmanp = sc-sc_mem_rman; - tag = sc-sc_pci_memt; break; default: return (rv); } - rv = rman_reserve_resource(rmanp, start, end, count, flags, child); - if (rv != NULL) { - rman_set_rid(rv, *rid); - if (type == SYS_RES_IOPORT) { - rman_set_bustag(rv, tag); - rman_set_bushandle(rv, rman_get_start(rv)); - } else if (type == SYS_RES_MEMORY) { - rman_set_bustag(rv, tag); -
svn commit: r189632 - head/sys/arm/xscale/ixp425
Author: sam Date: Tue Mar 10 17:16:16 2009 New Revision: 189632 URL: http://svn.freebsd.org/changeset/base/189632 Log: Small cleanup of memory resource allocation from Cambria branch: o encode need for A4 bus space tag hackery according to the memory address; checking for uart breaks down with the GPS chip support which is also a uart but does not require the same hackery o encode the correct memory window instead of carving up all of i/o space, potentially with a larger window than a device should have; this likely should be handled in the drivers by using a proper bus alloc call but since some drivers depend on the bus support to figure this out we cannot simply mod them o add optional GPS and RS485 support (conditionally as the support isn't ready yet) Modified: head/sys/arm/xscale/ixp425/ixp425.c Modified: head/sys/arm/xscale/ixp425/ixp425.c == --- head/sys/arm/xscale/ixp425/ixp425.c Tue Mar 10 17:00:28 2009 (r189631) +++ head/sys/arm/xscale/ixp425/ixp425.c Tue Mar 10 17:16:16 2009 (r189632) @@ -315,43 +315,82 @@ ixp425_read_ivar(device_t bus, device_t } /* - * NB: This table handles P-V translations for regions mapped - * through bus_alloc_resource. Anything done with bus_space_map - * is handled elsewhere and does not require an entry here. + * NB: This table handles P-V translations for regions setup with + * static mappings in initarm. This is used solely for calls to + * bus_alloc_resource_any; anything done with bus_space_map is + * handled elsewhere and does not require an entry here. * - * XXX getvbase is also used by uart_cpu_getdev (hence public) + * XXX this table is also used by uart_cpu_getdev via getvbase + *(hence the public api) */ -static const struct { +struct hwvtrans { uint32_thwbase; uint32_tsize; uint32_tvbase; -} hwvtrans[] = { - { IXP425_IO_HWBASE, IXP425_IO_SIZE, IXP425_IO_VBASE }, - { IXP425_PCI_HWBASE,IXP425_PCI_SIZE,IXP425_PCI_VBASE }, - { IXP425_PCI_MEM_HWBASE,IXP425_PCI_MEM_SIZE,IXP425_PCI_MEM_VBASE }, - { IXP425_EXP_BUS_CS0_HWBASE, IXP425_EXP_BUS_CS0_SIZE, - IXP425_EXP_BUS_CS0_VBASE }, - /* NB: needed only for uart_cpu_getdev */ - { IXP425_UART0_HWBASE, IXP425_REG_SIZE,IXP425_UART0_VBASE }, - { IXP425_UART1_HWBASE, IXP425_REG_SIZE,IXP425_UART1_VBASE }, - /* NB: need for ixp435 ehci controllers */ - { IXP435_USB1_HWBASE, IXP435_USB1_SIZE, IXP435_USB1_VBASE }, - { IXP435_USB2_HWBASE, IXP435_USB2_SIZE, IXP435_USB2_VBASE }, + int isa4x; /* XXX needs special bus space tag */ }; -int -getvbase(uint32_t hwbase, uint32_t size, uint32_t *vbase) +static const struct hwvtrans * +gethwvtrans(uint32_t hwbase, uint32_t size) { + static const struct hwvtrans hwvtrans[] = { + /* NB: needed only for uart_cpu_getdev */ + { .hwbase = IXP425_UART0_HWBASE, + .size = IXP425_REG_SIZE, + .vbase= IXP425_UART0_VBASE, + .isa4x= 1 }, + { .hwbase = IXP425_UART1_HWBASE, + .size = IXP425_REG_SIZE, + .vbase= IXP425_UART1_VBASE, + .isa4x= 1 }, + { .hwbase = IXP425_PCI_HWBASE, + .size = IXP425_PCI_SIZE, + .vbase= IXP425_PCI_VBASE }, + { .hwbase = IXP425_PCI_MEM_HWBASE, + .size = IXP425_PCI_MEM_SIZE, + .vbase= IXP425_PCI_MEM_VBASE }, + { .hwbase = IXP425_EXP_BUS_CS0_HWBASE, + .size = IXP425_EXP_BUS_CS0_SIZE, + .vbase= IXP425_EXP_BUS_CS0_VBASE }, + /* NB: needed for ixp435 ehci controllers */ + { .hwbase = IXP435_USB1_HWBASE, + .size = IXP435_USB1_SIZE, + .vbase= IXP435_USB1_VBASE }, + { .hwbase = IXP435_USB2_HWBASE, + .size = IXP435_USB2_SIZE, + .vbase= IXP435_USB2_VBASE }, +#ifdef CAMBRIA_GPS_VBASE + { .hwbase = CAMBRIA_GPS_HWBASE, + .size = CAMBRIA_GPS_SIZE, + .vbase= CAMBRIA_GPS_VBASE }, +#endif +#ifdef CAMBRIA_RS485_VBASE + { .hwbase = CAMBRIA_RS485_HWBASE, + .size = CAMBRIA_RS485_SIZE, + .vbase= CAMBRIA_RS485_VBASE }, +#endif + }; int i; for (i = 0; i sizeof hwvtrans / sizeof *hwvtrans; i++) { if (hwbase = hwvtrans[i].hwbase - hwbase + size = hwvtrans[i].hwbase + hwvtrans[i].size) { - *vbase = hwbase - hwvtrans[i].hwbase + hwvtrans[i].vbase; - return (0); - } + hwbase + size = hwvtrans[i].hwbase + hwvtrans[i].size) + return hwvtrans[i]; } -
svn commit: r189633 - head/sys/arm/xscale/ixp425
Author: sam Date: Tue Mar 10 17:19:45 2009 New Revision: 189633 URL: http://svn.freebsd.org/changeset/base/189633 Log: bring in ddb show gpio support from Cambria branch Modified: head/sys/arm/xscale/ixp425/ixp425.c Modified: head/sys/arm/xscale/ixp425/ixp425.c == --- head/sys/arm/xscale/ixp425/ixp425.c Tue Mar 10 17:16:16 2009 (r189632) +++ head/sys/arm/xscale/ixp425/ixp425.c Tue Mar 10 17:19:45 2009 (r189633) @@ -36,6 +36,8 @@ #include sys/cdefs.h __FBSDID($FreeBSD$); +#include opt_ddb.h + #define _ARM32_BUS_DMA_PRIVATE #include sys/param.h #include sys/systm.h @@ -95,22 +97,61 @@ bus_dma_get_range_nb(void) return (0); } +static const uint8_t int2gpio[32] __attribute__ ((aligned(32))) = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* INT#0 - INT#5 */ + 0x00, 0x01, /* GPIO#0 - GPIO#1 */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* INT#8 - INT#13 */ + 0xff, 0xff, 0xff, 0xff, 0xff, /* INT#14 - INT#18 */ + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* GPIO#2 - GPIO#7 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, /* GPIO#8 - GPIO#12 */ + 0xff, 0xff /* INT#30 - INT#31 */ +}; + static __inline u_int32_t ixp425_irq2gpio_bit(int irq) { + return (1U int2gpio[irq]); +} - static const uint8_t int2gpio[32] __attribute__ ((aligned(32))) = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* INT#0 - INT#5 */ - 0x00, 0x01, /* GPIO#0 - GPIO#1 */ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* INT#8 - INT#13 */ - 0xff, 0xff, 0xff, 0xff, 0xff, /* INT#14 - INT#18 */ - 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* GPIO#2 - GPIO#7 */ - 0x08, 0x09, 0x0a, 0x0b, 0x0c, /* GPIO#8 - GPIO#12 */ - 0xff, 0xff /* INT#30 - INT#31 */ - }; +#ifdef DDB +#include ddb/ddb.h - return (1U int2gpio[irq]); +DB_SHOW_COMMAND(gpio, db_show_gpio) +{ + static const char *itype[8] = { + [GPIO_TYPE_ACT_HIGH]= act-high, + [GPIO_TYPE_ACT_LOW] = act-low, + [GPIO_TYPE_EDG_RISING] = edge-rising, + [GPIO_TYPE_EDG_FALLING] = edge-falling, + [GPIO_TYPE_TRANSITIONAL]= transitional, + [5] = type-5, [6] = type-6, [7] = type-7 + }; + uint32_t gpoutr = GPIO_CONF_READ_4(ixp425_softc, IXP425_GPIO_GPOUTR); + uint32_t gpoer = GPIO_CONF_READ_4(ixp425_softc, IXP425_GPIO_GPOER); + uint32_t gpinr = GPIO_CONF_READ_4(ixp425_softc, IXP425_GPIO_GPINR); + uint32_t gpit1r = GPIO_CONF_READ_4(ixp425_softc, IXP425_GPIO_GPIT1R); + uint32_t gpit2r = GPIO_CONF_READ_4(ixp425_softc, IXP425_GPIO_GPIT2R); + int i, j; + + db_printf(GPOUTR %08x GPOER %08x GPINR %08x GPISR %08x\n, + gpoutr, gpoer, gpinr, + GPIO_CONF_READ_4(ixp425_softc, IXP425_GPIO_GPISR)); + db_printf(GPIT1R %08x GPIT2R %08x GPCLKR %08x\n, + gpit1r, gpit2r, GPIO_CONF_READ_4(ixp425_softc, IXP425_GPIO_GPCLKR)); + for (i = 0; i 16; i++) { + db_printf([%2d] out %u in %u %-3s, i, + (gpoutri)1, (gpinri)1, (gpoeri)1 ? in : out); + for (j = 0; j 32; j++) + if (int2gpio[j] == i) { + db_printf( irq %2u %s, j, itype[ + (((i 8) ? gpit2r : gpit1r) (3*(i7))) +7]); + break; + } + db_printf(\n); + } } +#endif void arm_mask_irq(uintptr_t nb) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189539 - head/sys/kern
On Tue, 2009-03-10 at 11:03 +0200, Giorgos Keramidas wrote: On Sun, 8 Mar 2009 19:05:54 + (UTC), Joe Marcus Clarke mar...@freebsd.org wrote: Author: marcus (doc,ports committer) Date: Sun Mar 8 19:05:53 2009 New Revision: 189539 URL: http://svn.freebsd.org/changeset/base/189539 Log: Add a default implementation for VOP_VPTOCNP(9) which scans the parent directory of a vnode to find a dirent with a matching file number. The name from that dirent is then used to provide the component name. Note: if the initial vnode argument is not a directory itself, then the default VOP_VPTOCNP(9) implementation still returns ENOENT. Reviewed by: kib Approved by: kib Tested by:pho I think this panics nullfs mounts. I have a kernel build from subversion changeset /h...@189540 that panics instantly with: Yep, kib committed a patch for this today. Joe -- Joe Marcus Clarke FreeBSD GNOME Team :: gn...@freebsd.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome signature.asc Description: This is a digitally signed message part
svn commit: r189634 - in stable/7/sys: . compat/freebsd32 contrib/pf dev/cxgb i386/ibcs2 kern
Author: jhb Date: Tue Mar 10 17:28:23 2009 New Revision: 189634 URL: http://svn.freebsd.org/changeset/base/189634 Log: MFC: Push down Giant inside sysctl. Modified: stable/7/sys/ (props changed) stable/7/sys/compat/freebsd32/freebsd32_misc.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/ibcs2/ibcs2_sysi86.c stable/7/sys/kern/kern_sysctl.c stable/7/sys/kern/kern_xxx.c Modified: stable/7/sys/compat/freebsd32/freebsd32_misc.c == --- stable/7/sys/compat/freebsd32/freebsd32_misc.c Tue Mar 10 17:19:45 2009(r189633) +++ stable/7/sys/compat/freebsd32/freebsd32_misc.c Tue Mar 10 17:28:23 2009(r189634) @@ -1966,7 +1966,6 @@ freebsd32_sysctl(struct thread *td, stru error = copyin(uap-name, name, uap-namelen * sizeof(int)); if (error) return (error); - mtx_lock(Giant); if (uap-oldlenp) oldlen = fuword32(uap-oldlenp); else @@ -1975,12 +1974,10 @@ freebsd32_sysctl(struct thread *td, stru uap-old, oldlen, 1, uap-new, uap-newlen, j, SCTL_MASK32); if (error error != ENOMEM) - goto done2; + return (error); if (uap-oldlenp) suword32(uap-oldlenp, j); -done2: - mtx_unlock(Giant); - return (error); + return (0); } int Modified: stable/7/sys/i386/ibcs2/ibcs2_sysi86.c == --- stable/7/sys/i386/ibcs2/ibcs2_sysi86.c Tue Mar 10 17:19:45 2009 (r189633) +++ stable/7/sys/i386/ibcs2/ibcs2_sysi86.c Tue Mar 10 17:28:23 2009 (r189634) @@ -74,15 +74,11 @@ ibcs2_sysi86(struct thread *td, struct i case SETNAME: { /* set hostname given string w/ len = 7 chars */ int name[2]; - int error; name[0] = CTL_KERN; name[1] = KERN_HOSTNAME; - mtx_lock(Giant); - error = userland_sysctl(td, name, 2, 0, 0, 0, - args-arg, 7, 0, 0); - mtx_unlock(Giant); - return (error); + return (userland_sysctl(td, name, 2, 0, 0, 0, + args-arg, 7, 0, 0)); } case SI86_MEM: /* size of physical memory */ Modified: stable/7/sys/kern/kern_sysctl.c == --- stable/7/sys/kern/kern_sysctl.c Tue Mar 10 17:19:45 2009 (r189633) +++ stable/7/sys/kern/kern_sysctl.c Tue Mar 10 17:28:23 2009 (r189634) @@ -70,6 +70,7 @@ static struct sx sysctllock; #defineSYSCTL_LOCK() sx_xlock(sysctllock) #defineSYSCTL_UNLOCK() sx_xunlock(sysctllock) +#defineSYSCTL_LOCK_ASSERT()sx_assert(sysctllock, SX_XLOCKED) #defineSYSCTL_INIT() sx_init(sysctllock, sysctl lock) static int sysctl_root(SYSCTL_HANDLER_ARGS); @@ -666,6 +667,8 @@ name2oid (char *name, int *oid, int *len struct sysctl_oid_list *lsp = sysctl__children; char *p; + SYSCTL_LOCK_ASSERT(); + if (!*name) return (ENOENT); @@ -722,6 +725,8 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR int error, oid[CTL_MAXNAME], len; struct sysctl_oid *op = 0; + SYSCTL_LOCK_ASSERT(); + if (!req-newlen) return (ENOENT); if (req-newlen = MAXPATHLEN) /* XXX arbitrary, undocumented */ @@ -1066,14 +1071,12 @@ kernel_sysctl(struct thread *td, int *na req.lock = REQ_LOCKED; SYSCTL_LOCK(); - error = sysctl_root(0, name, namelen, req); + SYSCTL_UNLOCK(); if (req.lock == REQ_WIRED req.validlen 0) vsunlock(req.oldptr, req.validlen); - SYSCTL_UNLOCK(); - if (error error != ENOMEM) return (error); @@ -1098,6 +1101,11 @@ kernel_sysctlbyname(struct thread *td, c oid[1] = 3; /* name2oid */ oidlen = sizeof(oid); + /* +* XXX: Prone to a possible race condition between lookup and +* execution? Maybe put locking around it? +*/ + error = kernel_sysctl(td, oid, 2, oid, oidlen, (void *)name, strlen(name), plen, flags); if (error) @@ -1250,6 +1258,8 @@ sysctl_root(SYSCTL_HANDLER_ARGS) struct sysctl_oid *oid; int error, indx, lvl; + SYSCTL_LOCK_ASSERT(); + error = sysctl_find_oid(arg1, arg2, oid, indx, req); if (error) return (error); @@ -1304,7 +1314,11 @@ sysctl_root(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); #endif + + /* XXX: Handlers are not guaranteed to be Giant safe! */ + mtx_lock(Giant); error = oid-oid_handler(oid, arg1, arg2, req); + mtx_unlock(Giant);
svn commit: r189635 - head/sys/netinet
Author: bms Date: Tue Mar 10 17:48:49 2009 New Revision: 189635 URL: http://svn.freebsd.org/changeset/base/189635 Log: Don't print inm_print() chatter when KTR_IGMPV3 is not enabled in the KTR_COMPILE mask. Found by: gnn Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c == --- head/sys/netinet/in_mcast.c Tue Mar 10 17:28:23 2009(r189634) +++ head/sys/netinet/in_mcast.c Tue Mar 10 17:48:49 2009(r189635) @@ -2851,6 +2851,9 @@ inm_print(const struct in_multi *inm) { int t; + if ((KTR_COMPILE KTR_IGMPV3) == 0) + return; + printf(%s: --- begin inm %p ---\n, __func__, inm); printf(addr %s ifp %p(%s) ifma %p\n, inet_ntoa(inm-inm_addr), ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189636 - head/sys/dev/cardbus
Author: gnn Date: Tue Mar 10 17:54:04 2009 New Revision: 189636 URL: http://svn.freebsd.org/changeset/base/189636 Log: Complete removal of cardbus_write_ivar which was left hanging. Modified: head/sys/dev/cardbus/cardbus.c Modified: head/sys/dev/cardbus/cardbus.c == --- head/sys/dev/cardbus/cardbus.c Tue Mar 10 17:48:49 2009 (r189635) +++ head/sys/dev/cardbus/cardbus.c Tue Mar 10 17:54:04 2009 (r189636) @@ -82,9 +82,6 @@ static intcardbus_read_ivar(device_t cb uintptr_t *result); static voidcardbus_release_all_resources(device_t cbdev, struct cardbus_devinfo *dinfo); -static int cardbus_write_ivar(device_t cbdev, device_t child, int which, - uintptr_t value); - // /* Probe/Attach */ // ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189637 - in head: sys/netinet usr.bin/sockstat
Author: rwatson Date: Tue Mar 10 17:57:41 2009 New Revision: 189637 URL: http://svn.freebsd.org/changeset/base/189637 Log: Remove unused v6 macro aliases for inpcb fields: in6p_ip6_nxt in6p_vflag in6p_flags in6p_socket in6p_lport in6p_fport in6p_ppcb Remove unused v6 macro aliases for inpcb flags: IN6P_HIGHPORT IN6P_LOWPORT IN6P_ANONPORT IN6P_RECVIF IN6P_MTUDISC IN6P_FAITH IN6P_CONTROLOPTS References to in6p_lport and in6_fport in sockstat are also replaced with normal inp_lport and inp_fport references. MFC after:3 days Reviewed by: bz Modified: head/sys/netinet/in_pcb.h head/usr.bin/sockstat/sockstat.c Modified: head/sys/netinet/in_pcb.h == --- head/sys/netinet/in_pcb.h Tue Mar 10 17:54:04 2009(r189636) +++ head/sys/netinet/in_pcb.h Tue Mar 10 17:57:41 2009(r189637) @@ -214,19 +214,12 @@ struct inpcb { #definein6p_faddr inp_inc.inc6_faddr #definein6p_laddr inp_inc.inc6_laddr #definein6p_hops inp_depend6.inp6_hops /* default hop limit */ -#definein6p_ip6_nxtinp_ip_p #definein6p_flowinfo inp_flow -#definein6p_vflag inp_vflag #definein6p_optionsinp_depend6.inp6_options #definein6p_outputopts inp_depend6.inp6_outputopts #definein6p_moptions inp_depend6.inp6_moptions #definein6p_icmp6filt inp_depend6.inp6_icmp6filt #definein6p_cksum inp_depend6.inp6_cksum -#definein6p_flags inp_flags /* for KAME src sync over BSD*'s */ -#definein6p_socket inp_socket /* for KAME src sync over BSD*'s */ -#definein6p_lport inp_lport /* for KAME src sync over BSD*'s */ -#definein6p_fport inp_fport /* for KAME src sync over BSD*'s */ -#definein6p_ppcb inp_ppcb /* for KAME src sync over BSD*'s */ /* * The range of the generation count, as used in this implementation, is 9e19. @@ -434,19 +427,6 @@ void inp_4tuple_get(struct inpcb *inp, IN6P_TCLASS|IN6P_AUTOFLOWLABEL|IN6P_RFC2292|\ IN6P_MTU) - /* for KAME src sync over BSD*'s */ -#defineIN6P_HIGHPORT INP_HIGHPORT -#defineIN6P_LOWPORTINP_LOWPORT -#defineIN6P_ANONPORT INP_ANONPORT -#defineIN6P_RECVIF INP_RECVIF -#defineIN6P_MTUDISCINP_MTUDISC -#defineIN6P_FAITH INP_FAITH -#defineIN6P_CONTROLOPTSINP_CONTROLOPTS - /* -* socket AF version is {newer than,or include} -* actual datagram AF version -*/ - #defineINPLOOKUP_WILDCARD 1 #definesotoinpcb(so) ((struct inpcb *)(so)-so_pcb) #definesotoin6pcb(so) sotoinpcb(so) /* for KAME src sync over BSD*'s */ Modified: head/usr.bin/sockstat/sockstat.c == --- head/usr.bin/sockstat/sockstat.cTue Mar 10 17:54:04 2009 (r189636) +++ head/usr.bin/sockstat/sockstat.cTue Mar 10 17:57:41 2009 (r189637) @@ -351,8 +351,8 @@ gather_inet(int proto) continue; #undef __IN_IS_ADDR_LOOPBACK } else if (inp-inp_vflag INP_IPV6) { - if ((inp-in6p_fport == 0 !opt_l) || - (inp-in6p_fport != 0 !opt_c)) + if ((inp-inp_fport == 0 !opt_l) || + (inp-inp_fport != 0 !opt_c)) continue; if (opt_L (IN6_IS_ADDR_LOOPBACK(inp-in6p_faddr) || @@ -376,9 +376,9 @@ gather_inet(int proto) } else if (inp-inp_vflag INP_IPV6) { sock-family = AF_INET6; sockaddr(sock-laddr, sock-family, - inp-in6p_laddr, inp-in6p_lport); + inp-in6p_laddr, inp-inp_lport); sockaddr(sock-faddr, sock-family, - inp-in6p_faddr, inp-in6p_fport); + inp-in6p_faddr, inp-inp_fport); } sock-vflag = inp-inp_vflag; sock-protoname = protoname; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189638 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern sys
Author: jhb Date: Tue Mar 10 18:16:03 2009 New Revision: 189638 URL: http://svn.freebsd.org/changeset/base/189638 Log: MFC: Add sysctl_rename_oid() and use it in device_set_unit(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_sysctl.c stable/7/sys/kern/subr_bus.c stable/7/sys/sys/sysctl.h Modified: stable/7/sys/kern/kern_sysctl.c == --- stable/7/sys/kern/kern_sysctl.c Tue Mar 10 17:57:41 2009 (r189637) +++ stable/7/sys/kern/kern_sysctl.c Tue Mar 10 18:16:03 2009 (r189638) @@ -417,6 +417,25 @@ sysctl_add_oid(struct sysctl_ctx_list *c } /* + * Rename an existing oid. + */ +void +sysctl_rename_oid(struct sysctl_oid *oidp, const char *name) +{ + ssize_t len; + char *newname; + void *oldname; + + oldname = (void *)(uintptr_t)(const void *)oidp-oid_name; + len = strlen(name); + newname = malloc(len + 1, M_SYSCTLOID, M_WAITOK); + bcopy(name, newname, len + 1); + newname[len] = '\0'; + oidp-oid_name = newname; + free(oldname, M_SYSCTLOID); +} + +/* * Reparent an existing oid. */ int Modified: stable/7/sys/kern/subr_bus.c == --- stable/7/sys/kern/subr_bus.cTue Mar 10 17:57:41 2009 (r189637) +++ stable/7/sys/kern/subr_bus.cTue Mar 10 18:16:03 2009 (r189638) @@ -307,6 +307,16 @@ device_sysctl_init(device_t dev) } static void +device_sysctl_update(device_t dev) +{ + devclass_t dc = dev-devclass; + + if (dev-sysctl_tree == NULL) + return; + sysctl_rename_oid(dev-sysctl_tree, dev-nameunit + strlen(dc-name)); +} + +static void device_sysctl_fini(device_t dev) { if (dev-sysctl_tree == NULL) @@ -2396,6 +2406,7 @@ device_attach(device_t dev) dev-state = DS_NOTPRESENT; return (error); } + device_sysctl_update(dev); dev-state = DS_ATTACHED; devadded(dev); return (0); Modified: stable/7/sys/sys/sysctl.h == --- stable/7/sys/sys/sysctl.h Tue Mar 10 17:57:41 2009(r189637) +++ stable/7/sys/sys/sysctl.h Tue Mar 10 18:16:03 2009(r189638) @@ -661,6 +661,7 @@ struct sysctl_oid *sysctl_add_oid(struct int kind, void *arg1, int arg2, int (*handler) (SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr); +void sysctl_rename_oid(struct sysctl_oid *oidp, const char *name); intsysctl_move_oid(struct sysctl_oid *oidp, struct sysctl_oid_list *parent); intsysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189625 - head/sys/geom/eli
On Tue, Mar 10, 2009 at 05:19:48PM +0100, Fabian Keil wrote: Log: When attaching a geli on boot make sure that it is detached upon last close. (needed for a gmirror to properly shutdown upon reboot when a geli is on top the gmirror) Detach-on-last-close is known to cause panics when scrubbing at least some ZFS pools: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/117158 Quoting the PR: |Quoting Pawel Jakub Dawidek's response to my initial report: ||GELI's detach-on-last-close mechanism is a general purpose mechanism, it ||may not work correctly with ZFS, because ZFS sometimes closes and reopen ||providers, which will make GELI to detach. In other words you shouldn't ||configure detach-on-last-close for ZFS components. Grr. So we should make it tuneable. How about being able to set this flag with the geli command, like the G_ELI_FLAG_BOOT flag. -Guido ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189640 - in stable/7/sys: . cam/scsi contrib/pf dev/ath/ath_hal dev/cxgb ia64/ia64 ia64/include kern sys
Author: jhb Date: Tue Mar 10 18:57:10 2009 New Revision: 189640 URL: http://svn.freebsd.org/changeset/base/189640 Log: MFC: Expand the scope of the sysctllock sx lock to protect the sysctl tree itself. This also includes changes to the ia64 machine check code to defer adding machine check records to the sysctl tree, removing Giant from the CAM code that created dynamic sysctls, and tweaking the teardown of da(4) and cd(4) peripheral devices to not hold locks when freeing the sysctl tree. Modified: stable/7/sys/ (props changed) stable/7/sys/cam/scsi/scsi_cd.c stable/7/sys/cam/scsi/scsi_da.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/ia64/ia64/mca.c stable/7/sys/ia64/include/mca.h stable/7/sys/kern/kern_linker.c stable/7/sys/kern/kern_sysctl.c stable/7/sys/kern/vfs_init.c stable/7/sys/sys/sysctl.h Modified: stable/7/sys/cam/scsi/scsi_cd.c == --- stable/7/sys/cam/scsi/scsi_cd.c Tue Mar 10 18:41:06 2009 (r189639) +++ stable/7/sys/cam/scsi/scsi_cd.c Tue Mar 10 18:57:10 2009 (r189640) @@ -401,11 +401,6 @@ cdcleanup(struct cam_periph *periph) xpt_print(periph-path, removing device entry\n); - if ((softc-flags CD_FLAG_SCTX_INIT) != 0 -sysctl_ctx_free(softc-sysctl_ctx) != 0) { - xpt_print(periph-path, can't remove sysctl context\n); - } - /* * In the queued, non-active case, the device in question * has already been removed from the changer run queue. Since this @@ -474,9 +469,14 @@ cdcleanup(struct cam_periph *periph) free(softc-changer, M_DEVBUF); } cam_periph_unlock(periph); + if ((softc-flags CD_FLAG_SCTX_INIT) != 0 +sysctl_ctx_free(softc-sysctl_ctx) != 0) { + xpt_print(periph-path, can't remove sysctl context\n); + } + disk_destroy(softc-disk); - cam_periph_lock(periph); free(softc, M_DEVBUF); + cam_periph_lock(periph); } static void @@ -555,8 +555,6 @@ cdsysctlinit(void *context, int pending) snprintf(tmpstr, sizeof(tmpstr), CAM CD unit %d, periph-unit_number); snprintf(tmpstr2, sizeof(tmpstr2), %d, periph-unit_number); - mtx_lock(Giant); - sysctl_ctx_init(softc-sysctl_ctx); softc-flags |= CD_FLAG_SCTX_INIT; softc-sysctl_tree = SYSCTL_ADD_NODE(softc-sysctl_ctx, @@ -565,7 +563,6 @@ cdsysctlinit(void *context, int pending) if (softc-sysctl_tree == NULL) { printf(cdsysctlinit: unable to allocate sysctl tree\n); - mtx_unlock(Giant); cam_periph_release(periph); return; } @@ -579,7 +576,6 @@ cdsysctlinit(void *context, int pending) softc-minimum_command_size, 0, cdcmdsizesysctl, I, Minimum CDB size); - mtx_unlock(Giant); cam_periph_release(periph); } Modified: stable/7/sys/cam/scsi/scsi_da.c == --- stable/7/sys/cam/scsi/scsi_da.c Tue Mar 10 18:41:06 2009 (r189639) +++ stable/7/sys/cam/scsi/scsi_da.c Tue Mar 10 18:57:10 2009 (r189640) @@ -987,6 +987,8 @@ dacleanup(struct cam_periph *periph) softc = (struct da_softc *)periph-softc; xpt_print(periph-path, removing device entry\n); + cam_periph_unlock(periph); + /* * If we can't free the sysctl tree, oh well... */ @@ -995,11 +997,10 @@ dacleanup(struct cam_periph *periph) xpt_print(periph-path, can't remove sysctl context\n); } - cam_periph_unlock(periph); disk_destroy(softc-disk); callout_drain(softc-sendordered_c); - cam_periph_lock(periph); free(softc, M_DEVBUF); + cam_periph_lock(periph); } static void @@ -1078,7 +1079,6 @@ dasysctlinit(void *context, int pending) snprintf(tmpstr, sizeof(tmpstr), CAM DA unit %d, periph-unit_number); snprintf(tmpstr2, sizeof(tmpstr2), %d, periph-unit_number); - mtx_lock(Giant); sysctl_ctx_init(softc-sysctl_ctx); softc-flags |= DA_FLAG_SCTX_INIT; softc-sysctl_tree = SYSCTL_ADD_NODE(softc-sysctl_ctx, @@ -1086,7 +1086,6 @@ dasysctlinit(void *context, int pending) CTLFLAG_RD, 0, tmpstr); if (softc-sysctl_tree == NULL) { printf(dasysctlinit: unable to allocate sysctl tree\n); - mtx_unlock(Giant); cam_periph_release(periph); return; } @@ -1100,7 +1099,6 @@ dasysctlinit(void *context, int pending) softc-minimum_cmd_size, 0, dacmdsizesysctl, I, Minimum CDB size); - mtx_unlock(Giant); cam_periph_release(periph); } Modified:
svn commit: r189641 - head/sys/arm/xscale/ixp425
Author: sam Date: Tue Mar 10 19:15:35 2009 New Revision: 189641 URL: http://svn.freebsd.org/changeset/base/189641 Log: o add missing bus_release_resource and bus_deactivate_resource that just operate on the resource (we have no local resources to manage); this fixes drivers that alloc/release resources in their probe method and then do it again in attach o while here add some prints to catch failures and massage style a bit Modified: head/sys/arm/xscale/ixp425/ixp425.c Modified: head/sys/arm/xscale/ixp425/ixp425.c == --- head/sys/arm/xscale/ixp425/ixp425.c Tue Mar 10 18:57:10 2009 (r189640) +++ head/sys/arm/xscale/ixp425/ixp425.c Tue Mar 10 19:15:35 2009 (r189641) @@ -440,7 +440,6 @@ ixp425_alloc_resource(device_t dev, devi { struct ixp425_softc *sc = device_get_softc(dev); const struct hwvtrans *vtrans; - struct rman *rmanp; struct resource *rv; uint32_t addr; int needactivate = flags RF_ACTIVE; @@ -449,18 +448,16 @@ ixp425_alloc_resource(device_t dev, devi flags = ~RF_ACTIVE; switch (type) { case SYS_RES_IRQ: - rmanp = sc-sc_irq_rman; /* override per hints */ if (BUS_READ_IVAR(dev, child, IXP425_IVAR_IRQ, irq) == 0) start = end = irq; - rv = rman_reserve_resource(rmanp, start, end, count, - flags, child); + rv = rman_reserve_resource(sc-sc_irq_rman, start, end, count, + flags, child); if (rv != NULL) rman_set_rid(rv, *rid); break; case SYS_RES_MEMORY: - rmanp = sc-sc_mem_rman; /* override per hints */ if (BUS_READ_IVAR(dev, child, IXP425_IVAR_ADDR, addr) == 0) { start = addr; @@ -485,13 +482,17 @@ ixp425_alloc_resource(device_t dev, devi if (vtrans == NULL) { /* likely means above table needs to be updated */ device_printf(child, %s: no mapping for 0x%lx:0x%lx\n, - __func__, start, end-start); + __func__, start, end - start); return NULL; } - rv = rman_reserve_resource(rmanp, start, end, end - start, - flags, child); - if (rv != NULL) - rman_set_rid(rv, *rid); + rv = rman_reserve_resource(sc-sc_mem_rman, start, end, + end - start, flags, child); + if (rv == NULL) { + device_printf(child, %s: cannot reserve 0x%lx:0x%lx\n, + __func__, start, end - start); + return NULL; + } + rman_set_rid(rv, *rid); break; default: rv = NULL; @@ -507,6 +508,14 @@ ixp425_alloc_resource(device_t dev, devi } static int +ixp425_release_resource(device_t bus, device_t child, int type, int rid, +struct resource *r) +{ + /* NB: no private resources, just release */ + return rman_release_resource(r); +} + +static int ixp425_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { @@ -515,8 +524,11 @@ ixp425_activate_resource(device_t dev, d if (type == SYS_RES_MEMORY) { vtrans = gethwvtrans(rman_get_start(r), rman_get_size(r)); - if (vtrans == NULL) /* NB: should not happen */ + if (vtrans == NULL) { /* NB: should not happen */ + device_printf(child, %s: no mapping for 0x%lx:0x%lx\n, + __func__, rman_get_start(r), rman_get_size(r)); return (ENOENT); + } if (vtrans-isa4x) rman_set_bustag(r, ixp425_a4x_bs_tag); else @@ -526,6 +538,14 @@ ixp425_activate_resource(device_t dev, d return (rman_activate_resource(r)); } +static int +ixp425_deactivate_resource(device_t bus, device_t child, int type, int rid, +struct resource *r) +{ + /* NB: no private resources, just deactive */ + return (rman_deactivate_resource(r)); +} + static __inline void get_masks(struct resource *res, uint32_t *mask, uint32_t *mask2) { @@ -581,19 +601,21 @@ ixp425_teardown_intr(device_t dev, devic static device_method_t ixp425_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, ixp425_probe), - DEVMETHOD(device_attach, ixp425_attach), - DEVMETHOD(device_identify, ixp425_identify), + DEVMETHOD(device_probe, ixp425_probe), + DEVMETHOD(device_attach,ixp425_attach), + DEVMETHOD(device_identify, ixp425_identify),
svn commit: r189642 - head/sys/arm/xscale/ixp425
Author: sam Date: Tue Mar 10 19:18:11 2009 New Revision: 189642 URL: http://svn.freebsd.org/changeset/base/189642 Log: turn off inclusion of FCS in rx'd frames; we don't use it anywhere and dhclient gets annoyed when it receives FCS in frames via bpf Modified: head/sys/arm/xscale/ixp425/if_npe.c Modified: head/sys/arm/xscale/ixp425/if_npe.c == --- head/sys/arm/xscale/ixp425/if_npe.c Tue Mar 10 19:15:35 2009 (r189641) +++ head/sys/arm/xscale/ixp425/if_npe.c Tue Mar 10 19:18:11 2009 (r189642) @@ -1108,7 +1108,6 @@ npe_rxdone(int qid, void *arg) mrx-m_len = be32toh(hw-ix_ne[0].len) 0x; mrx-m_pkthdr.len = mrx-m_len; mrx-m_pkthdr.rcvif = ifp; - mrx-m_flags |= M_HASFCS; ifp-if_ipackets++; ifp-if_input(ifp, mrx); @@ -1222,9 +1221,8 @@ if (ifp-if_drv_flags IFF_DRV_RUNNING) | NPE_TX_CNTRL1_2DEFER /* 2-part deferal */ | NPE_TX_CNTRL1_PAD_EN);/* pad runt frames */ /* XXX pad strip? */ - WR4(sc, NPE_MAC_RX_CNTRL1, - NPE_RX_CNTRL1_CRC_EN /* include CRC/FCS */ - | NPE_RX_CNTRL1_PAUSE_EN); /* ena pause frame handling */ + /* ena pause frame handling */ + WR4(sc, NPE_MAC_RX_CNTRL1, NPE_RX_CNTRL1_PAUSE_EN); WR4(sc, NPE_MAC_RX_CNTRL2, 0); npe_setmac(sc, IF_LLADDR(ifp)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189643 - in head: sys/dev/cxgb sys/dev/cxgb/common usr.sbin/cxgbtool
Author: gnn Date: Tue Mar 10 19:22:45 2009 New Revision: 189643 URL: http://svn.freebsd.org/changeset/base/189643 Log: Update the Chelsio driver to the latest bits from Chelsio Firmware upgraded to 7.1.0 (from 5.0.0). T3C EEPROM and SRAM added; Code to update eeprom/sram fixed. fl_empty and rx_fifo_ovfl counters can be observed via sysctl. Two new cxgbtool commands to get uP logic analyzer info and uP IOQs Synced up with Chelsio's common code (as of 03/03/09) Submitted by: Navdeep Parhar at Chelsio Reviewed by: gnn MFC after:2 weeks Added: head/sys/dev/cxgb/t3c_protocol_sram.h (contents, props changed) head/sys/dev/cxgb/t3c_tp_eeprom.h (contents, props changed) Modified: head/sys/dev/cxgb/bin2h.pl head/sys/dev/cxgb/common/cxgb_ael1002.c head/sys/dev/cxgb/common/cxgb_common.h head/sys/dev/cxgb/common/cxgb_t3_cpl.h head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/common/cxgb_xgmac.c head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_ioctl.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgb/cxgb_t3fw.c head/sys/dev/cxgb/cxgb_t3fw.h head/usr.sbin/cxgbtool/cxgbtool.c head/usr.sbin/cxgbtool/version.h Modified: head/sys/dev/cxgb/bin2h.pl == --- head/sys/dev/cxgb/bin2h.pl Tue Mar 10 19:18:11 2009(r189642) +++ head/sys/dev/cxgb/bin2h.pl Tue Mar 10 19:22:45 2009(r189643) @@ -22,7 +22,7 @@ unless ($success) { my $license = END; /** -Copyright (c) 2007-2008, Chelsio Inc. +Copyright (c) 2007-2009, Chelsio Inc. All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c == --- head/sys/dev/cxgb/common/cxgb_ael1002.c Tue Mar 10 19:18:11 2009 (r189642) +++ head/sys/dev/cxgb/common/cxgb_ael1002.c Tue Mar 10 19:22:45 2009 (r189643) @@ -1,6 +1,6 @@ /** -Copyright (c) 2007-2008, Chelsio Inc. +Copyright (c) 2007-2009, Chelsio Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -60,7 +60,17 @@ enum { enum { edc_none, edc_sr, edc_twinax }; /* PHY module I2C device address */ -#define MODULE_DEV_ADDR 0xa0 +enum { + MODULE_DEV_ADDR = 0xa0, + SFF_DEV_ADDR= 0xa2, +}; + +/* PHY transceiver type */ +enum { + phy_transtype_unknown = 0, + phy_transtype_sfp = 3, + phy_transtype_xfp = 6, +}; #define AEL2005_MODDET_IRQ 4 @@ -71,73 +81,7 @@ struct reg_val { unsigned short set_bits; }; -static int ael2005_i2c_rd(struct cphy *phy, int dev_addr, int word_addr); - -static int get_module_type (struct cphy *phy, int hint) -{ - int v; - - v = hint ? hint : ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0); - if (v 0) - return v; - - if (v == 0x3) { - /* SFP: see SFF-8472 for below */ - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 3); - if (v 0) - return v; - - if (v == 0x1) - return phy_modtype_twinax; - if (v == 0x10) - return phy_modtype_sr; - if (v == 0x20) - return phy_modtype_lr; - if (v == 0x40) - return phy_modtype_lrm; - - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 6); - if (v 0) - return v; - if (v != 4) - return phy_modtype_unknown; - - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 10); - if (v 0) - return v; - - if (v 0x80) { - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0x12); - if (v 0) - return v; - return v 10 ? phy_modtype_twinax_long : - phy_modtype_twinax; - } - } else if (v == 0x6) { - /* XFP: See INF-8077i for details. */ - - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 127); - if (v 0) - return v; - - if (v != 1) { - /* XXX: set page select to table 1 yourself */ - return phy_modtype_unknown; - } - - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 131); - if (v 0) - return v; - if (v == 0x10) - return phy_modtype_lrm; - if (v == 0x40) - return phy_modtype_lr; - if (v == 0x80) - return
svn commit: r189644 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/devfs kern sys vm
Author: jhb Date: Tue Mar 10 19:33:50 2009 New Revision: 189644 URL: http://svn.freebsd.org/changeset/base/189644 Log: MFC: Add a flag to tag individual sysctl leaf nodes as MPSAFE. Tag the following nodes as MPSAFE: - All standalone INT/LONG sysctls. - kern.proc.* - All name-cache related sysctls. - vm.loadavg - vm.vmtotal - vm.stats.(sys|vm).* - sysctl.name2oid - kern.ident, kern.osrelease, kern.version, etc. - kern.arandom - security.jail.jailed - kern.devname Other changes: - Remove GIANT_REQUIRED from vmtotal(). - Add conditional Giant locking around the vrele() in sysctl_kern_proc_pathname(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/devfs/devfs_devs.c stable/7/sys/kern/kern_jail.c stable/7/sys/kern/kern_mib.c stable/7/sys/kern/kern_proc.c stable/7/sys/kern/kern_sysctl.c stable/7/sys/kern/vfs_cache.c stable/7/sys/sys/sysctl.h stable/7/sys/vm/vm_meter.c Modified: stable/7/sys/fs/devfs/devfs_devs.c == --- stable/7/sys/fs/devfs/devfs_devs.c Tue Mar 10 19:22:45 2009 (r189643) +++ stable/7/sys/fs/devfs/devfs_devs.c Tue Mar 10 19:33:50 2009 (r189644) @@ -103,8 +103,9 @@ sysctl_devname(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_kern, OID_AUTO, devname, CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_ANYBODY, - NULL, 0, sysctl_devname, , devname(3) handler); +SYSCTL_PROC(_kern, OID_AUTO, devname, +CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_ANYBODY|CTLFLAG_MPSAFE, +NULL, 0, sysctl_devname, , devname(3) handler); SYSCTL_INT(_debug_sizeof, OID_AUTO, cdev, CTLFLAG_RD, 0, sizeof(struct cdev), sizeof(struct cdev)); Modified: stable/7/sys/kern/kern_jail.c == --- stable/7/sys/kern/kern_jail.c Tue Mar 10 19:22:45 2009 (r189643) +++ stable/7/sys/kern/kern_jail.c Tue Mar 10 19:33:50 2009 (r189644) @@ -1791,8 +1791,9 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_OID(_security_jail, OID_AUTO, list, CTLTYPE_STRUCT | CTLFLAG_RD, -NULL, 0, sysctl_jail_list, S, List of active jails); +SYSCTL_OID(_security_jail, OID_AUTO, list, +CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, +sysctl_jail_list, S, List of active jails); static int sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) @@ -1804,8 +1805,9 @@ sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_security_jail, OID_AUTO, jailed, CTLTYPE_INT | CTLFLAG_RD, -NULL, 0, sysctl_jail_jailed, I, Process in jail?); +SYSCTL_PROC(_security_jail, OID_AUTO, jailed, +CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, +sysctl_jail_jailed, I, Process in jail?); #ifdef DDB DB_SHOW_COMMAND(jails, db_show_jails) Modified: stable/7/sys/kern/kern_mib.c == --- stable/7/sys/kern/kern_mib.cTue Mar 10 19:22:45 2009 (r189643) +++ stable/7/sys/kern/kern_mib.cTue Mar 10 19:33:50 2009 (r189644) @@ -86,19 +86,19 @@ SYSCTL_NODE(, OID_AUTO, regression, CTLF Regression test MIB); #endif -SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, +SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD|CTLFLAG_MPSAFE, kern_ident, 0, Kernel identifier); -SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD, +SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD|CTLFLAG_MPSAFE, osrelease, 0, Operating system release); SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD, 0, BSD, Operating system revision); -SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, +SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE, version, 0, Kernel version); -SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD, +SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE, ostype, 0, Operating system type); /* @@ -164,8 +164,9 @@ sysctl_kern_arnd(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, buf, len)); } -SYSCTL_PROC(_kern, KERN_ARND, arandom, CTLTYPE_OPAQUE | CTLFLAG_RD, -NULL, 0, sysctl_kern_arnd, , arc4rand); +SYSCTL_PROC(_kern, KERN_ARND, arandom, +CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, +sysctl_kern_arnd, , arc4rand); static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) @@ -247,7 +248,7 @@ sysctl_hostname(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern, KERN_HOSTNAME, hostname, - CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON, + CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON|CTLFLAG_MPSAFE, 0, 0, sysctl_hostname, A, Hostname); static int regression_securelevel_nonmonotonic = 0; Modified: stable/7/sys/kern/kern_proc.c
svn commit: r189645 - head/sys/arm/xscale/ixp425
Author: sam Date: Tue Mar 10 19:35:37 2009 New Revision: 189645 URL: http://svn.freebsd.org/changeset/base/189645 Log: mark device capable of vlan-size frames Obtained from:netbsd Modified: head/sys/arm/xscale/ixp425/if_npe.c Modified: head/sys/arm/xscale/ixp425/if_npe.c == --- head/sys/arm/xscale/ixp425/if_npe.c Tue Mar 10 19:33:50 2009 (r189644) +++ head/sys/arm/xscale/ixp425/if_npe.c Tue Mar 10 19:35:37 2009 (r189645) @@ -363,6 +363,9 @@ npe_attach(device_t dev) ifp-if_linkmib = sc-mibdata; ifp-if_linkmiblen = sizeof(sc-mibdata); sc-mibdata.dot3Compliance = DOT3COMPLIANCE_STATS; + /* device supports oversided vlan frames */ + ifp-if_capabilities |= IFCAP_VLAN_MTU; + ifp-if_capenable = ifp-if_capabilities; #ifdef DEVICE_POLLING ifp-if_capabilities |= IFCAP_POLLING; #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189647 - head/lib/libc/softfloat
Author: delphij Date: Tue Mar 10 21:13:26 2009 New Revision: 189647 URL: http://svn.freebsd.org/changeset/base/189647 Log: Reflect license change from NetBSD. Obtained from:NetBSD Modified: head/lib/libc/softfloat/fpgetmask.c head/lib/libc/softfloat/fpgetround.c head/lib/libc/softfloat/fpgetsticky.c head/lib/libc/softfloat/fpsetmask.c head/lib/libc/softfloat/fpsetround.c head/lib/libc/softfloat/fpsetsticky.c Modified: head/lib/libc/softfloat/fpgetmask.c == --- head/lib/libc/softfloat/fpgetmask.c Tue Mar 10 19:35:41 2009 (r189646) +++ head/lib/libc/softfloat/fpgetmask.c Tue Mar 10 21:13:26 2009 (r189647) @@ -1,4 +1,4 @@ -/* $NetBSD: fpgetmask.c,v 1.3 2002/05/12 13:12:45 bjh21 Exp $ */ +/* $NetBSD: fpgetmask.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - *contributors may be used to endorse or promote products derived - *from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/softfloat/fpgetround.c == --- head/lib/libc/softfloat/fpgetround.cTue Mar 10 19:35:41 2009 (r189646) +++ head/lib/libc/softfloat/fpgetround.cTue Mar 10 21:13:26 2009 (r189647) @@ -1,4 +1,4 @@ -/* $NetBSD: fpgetround.c,v 1.2 2002/01/13 21:45:53 thorpej Exp $ */ +/* $NetBSD: fpgetround.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - *contributors may be used to endorse or promote products derived - *from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/softfloat/fpgetsticky.c == --- head/lib/libc/softfloat/fpgetsticky.c Tue Mar 10 19:35:41 2009 (r189646) +++ head/lib/libc/softfloat/fpgetsticky.c Tue Mar 10 21:13:26 2009 (r189647) @@ -1,4 +1,4 @@ -/* $NetBSD: fpgetsticky.c,v 1.2 2002/01/13 21:45:53 thorpej Exp $ */ +/* $NetBSD: fpgetsticky.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - *contributors may be used to endorse or promote products derived - *from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libc/softfloat/fpsetmask.c == --- head/lib/libc/softfloat/fpsetmask.c Tue Mar 10 19:35:41 2009 (r189646) +++ head/lib/libc/softfloat/fpsetmask.c Tue Mar 10 21:13:26 2009 (r189647) @@ -1,4 +1,4 @@ -/* $NetBSD: fpsetmask.c,v 1.3 2002/05/12 13:12:45 bjh21 Exp $ */ +/* $NetBSD: fpsetmask.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */ /*- *
svn commit: r189649 - in head/sys: kern sys
Author: jhb Date: Tue Mar 10 21:28:43 2009 New Revision: 189649 URL: http://svn.freebsd.org/changeset/base/189649 Log: - Make maxpipekva a signed long rather than an unsigned long as overflow is more likely to be noticed with signed types. - Make amountpipekva a long as well to match maxpipekva. Discussed with: bde Modified: head/sys/kern/subr_param.c head/sys/kern/sys_pipe.c head/sys/sys/pipe.h Modified: head/sys/kern/subr_param.c == --- head/sys/kern/subr_param.c Tue Mar 10 21:27:15 2009(r189648) +++ head/sys/kern/subr_param.c Tue Mar 10 21:28:43 2009(r189649) @@ -91,7 +91,7 @@ int nbuf; intnswbuf; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ -u_long maxpipekva; /* Limit on pipe KVA */ +long maxpipekva; /* Limit on pipe KVA */ intvm_guest; /* Running as virtual machine guest? */ u_long maxtsiz;/* max text size */ u_long dfldsiz;/* initial data size limit */ @@ -282,7 +282,7 @@ init_param3(long kmempages) maxpipekva = (kmempages / 20) * PAGE_SIZE; if (maxpipekva 512 * 1024) maxpipekva = 512 * 1024; - TUNABLE_ULONG_FETCH(kern.ipc.maxpipekva, maxpipekva); + TUNABLE_LONG_FETCH(kern.ipc.maxpipekva, maxpipekva); } /* Modified: head/sys/kern/sys_pipe.c == --- head/sys/kern/sys_pipe.cTue Mar 10 21:27:15 2009(r189648) +++ head/sys/kern/sys_pipe.cTue Mar 10 21:28:43 2009(r189649) @@ -178,15 +178,15 @@ static struct filterops pipe_wfiltops = #define MINPIPESIZE (PIPE_SIZE/3) #define MAXPIPESIZE (2*PIPE_SIZE/3) -static int amountpipekva; +static long amountpipekva; static int pipefragretry; static int pipeallocfail; static int piperesizefail; static int piperesizeallowed = 1; -SYSCTL_ULONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN, +SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN, maxpipekva, 0, Pipe KVA limit); -SYSCTL_INT(_kern_ipc, OID_AUTO, pipekva, CTLFLAG_RD, +SYSCTL_LONG(_kern_ipc, OID_AUTO, pipekva, CTLFLAG_RD, amountpipekva, 0, Pipe KVA usage); SYSCTL_INT(_kern_ipc, OID_AUTO, pipefragretry, CTLFLAG_RD, pipefragretry, 0, Pipe allocation retries due to fragmentation); @@ -463,7 +463,7 @@ retry: cpipe-pipe_buffer.in = cnt; cpipe-pipe_buffer.out = 0; cpipe-pipe_buffer.cnt = cnt; - atomic_add_int(amountpipekva, cpipe-pipe_buffer.size); + atomic_add_long(amountpipekva, cpipe-pipe_buffer.size); return (0); } @@ -1457,7 +1457,7 @@ pipe_free_kmem(cpipe) (pipe_free_kmem: pipe mutex locked)); if (cpipe-pipe_buffer.buffer != NULL) { - atomic_subtract_int(amountpipekva, cpipe-pipe_buffer.size); + atomic_subtract_long(amountpipekva, cpipe-pipe_buffer.size); vm_map_remove(pipe_map, (vm_offset_t)cpipe-pipe_buffer.buffer, (vm_offset_t)cpipe-pipe_buffer.buffer + cpipe-pipe_buffer.size); Modified: head/sys/sys/pipe.h == --- head/sys/sys/pipe.h Tue Mar 10 21:27:15 2009(r189648) +++ head/sys/sys/pipe.h Tue Mar 10 21:28:43 2009(r189649) @@ -56,7 +56,7 @@ /* * See sys_pipe.c for info on what these limits mean. */ -extern u_long maxpipekva; +extern longmaxpipekva; /* * Pipe buffer information. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189650 - head/sys/arm/xscale/ixp425
Author: sam Date: Tue Mar 10 21:47:17 2009 New Revision: 189650 URL: http://svn.freebsd.org/changeset/base/189650 Log: map CS0 on 2358 so flash is accessible Modified: head/sys/arm/xscale/ixp425/avila_machdep.c Modified: head/sys/arm/xscale/ixp425/avila_machdep.c == --- head/sys/arm/xscale/ixp425/avila_machdep.c Tue Mar 10 21:28:43 2009 (r189649) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Tue Mar 10 21:47:17 2009 (r189650) @@ -187,6 +187,10 @@ static const struct pmap_devmap ixp435_d { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* CFI Flash on the Expansion Bus */ +{ IXP425_EXP_BUS_CS0_VBASE, IXP425_EXP_BUS_CS0_HWBASE, + IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* IXP425 PCI Configuration */ { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189651 - in head/sys: arm/xscale/ixp425 conf
Author: sam Date: Tue Mar 10 21:49:22 2009 New Revision: 189651 URL: http://svn.freebsd.org/changeset/base/189651 Log: add IXP4XX_FLASH_SIZE config knob that can be used to override the default flash size; this is necessary at the moment because we map all of flash at boot, eventually we'll do this on the fly Modified: head/sys/arm/xscale/ixp425/ixp425reg.h head/sys/conf/options.arm Modified: head/sys/arm/xscale/ixp425/ixp425reg.h == --- head/sys/arm/xscale/ixp425/ixp425reg.h Tue Mar 10 21:47:17 2009 (r189650) +++ head/sys/arm/xscale/ixp425/ixp425reg.h Tue Mar 10 21:49:22 2009 (r189651) @@ -660,7 +660,11 @@ /* NB: CS0 is special; it maps flash */ #defineIXP425_EXP_BUS_CS0_HWBASE IXP425_EXP_BUS_CSx_HWBASE(0) #define IXP425_EXP_BUS_CS0_VBASE 0xFD00UL +#ifndef IXP4XX_FLASH_SIZE #define IXP425_EXP_BUS_CS0_SIZE0x0100 /* NB: 16M */ +#else +#define IXP425_EXP_BUS_CS0_SIZEIXP4XX_FLASH_SIZE +#endif #defineIXP425_EXP_BUS_CS1_HWBASE IXP425_EXP_BUS_CSx_HWBASE(1) #define IXP425_EXP_BUS_CS1_VBASE IXP425_EXP_BUS_CSx_VBASE(1) #define IXP425_EXP_BUS_CS1_SIZEIXP425_EXP_BUS_CSx_SIZE Modified: head/sys/conf/options.arm == --- head/sys/conf/options.arm Tue Mar 10 21:47:17 2009(r189650) +++ head/sys/conf/options.arm Tue Mar 10 21:49:22 2009(r189651) @@ -18,6 +18,7 @@ CPU_XSCALE_IXP425 opt_global.h CPU_XSCALE_IXP435 opt_global.h CPU_XSCALE_PXA2X0 opt_global.h FLASHADDR opt_global.h +IXP4XX_FLASH_SIZE opt_global.h KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LOADERRAMADDR opt_global.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189652 - head/sys/arm/conf
Author: sam Date: Tue Mar 10 21:49:51 2009 New Revision: 189652 URL: http://svn.freebsd.org/changeset/base/189652 Log: configure flash support Modified: head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CAMBRIA.hints Modified: head/sys/arm/conf/CAMBRIA == --- head/sys/arm/conf/CAMBRIA Tue Mar 10 21:49:22 2009(r189651) +++ head/sys/arm/conf/CAMBRIA Tue Mar 10 21:49:51 2009(r189652) @@ -67,6 +67,8 @@ devicepci device uart device ixpwdog # watchdog timer + +optionsIXP4XX_FLASH_SIZE=0x0200# stock 2358 comes w/ 32M device cfi # flash support device cfid# flash disk support device geom_redboot# redboot fis parser Modified: head/sys/arm/conf/CAMBRIA.hints == --- head/sys/arm/conf/CAMBRIA.hints Tue Mar 10 21:49:22 2009 (r189651) +++ head/sys/arm/conf/CAMBRIA.hints Tue Mar 10 21:49:51 2009 (r189652) @@ -27,6 +27,10 @@ hint.npe.0.phy=1 #hint.npe.1.mii=C #hint.npe.1.phy=2 +# FLASH +hint.cfi.0.at=ixp0 +hint.cfi.0.addr=0x5000 + # CF IDE controller hint.ata_avila.0.at=ixp0 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189653 - head/sys/dev/cardbus
Author: imp Date: Tue Mar 10 22:04:52 2009 New Revision: 189653 URL: http://svn.freebsd.org/changeset/base/189653 Log: Restore blank line removed when fixing my earlier botch. Never do just one last change before bed... Pointy had to: imp Modified: head/sys/dev/cardbus/cardbus.c Modified: head/sys/dev/cardbus/cardbus.c == --- head/sys/dev/cardbus/cardbus.c Tue Mar 10 21:49:51 2009 (r189652) +++ head/sys/dev/cardbus/cardbus.c Tue Mar 10 22:04:52 2009 (r189653) @@ -82,6 +82,7 @@ static intcardbus_read_ivar(device_t cb uintptr_t *result); static voidcardbus_release_all_resources(device_t cbdev, struct cardbus_devinfo *dinfo); + // /* Probe/Attach */ // ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189654 - head/sys/dev/cfi
Author: sam Date: Tue Mar 10 22:29:42 2009 New Revision: 189654 URL: http://svn.freebsd.org/changeset/base/189654 Log: choose the size of the last region for d_stripsize instead of the first; this fixes geom_redboot on boards that have multiple parts/regions as it uses the value to locate the FIS directory which is in the last erase region of flash Modified: head/sys/dev/cfi/cfi_disk.c Modified: head/sys/dev/cfi/cfi_disk.c == --- head/sys/dev/cfi/cfi_disk.c Tue Mar 10 22:04:52 2009(r189653) +++ head/sys/dev/cfi/cfi_disk.c Tue Mar 10 22:29:42 2009(r189654) @@ -99,9 +99,16 @@ cfi_disk_attach(device_t dev) sc-disk-d_mediasize = sc-parent-sc_size; sc-disk-d_maxsize = CFI_DISK_MAXIOSIZE; /* NB: use stripesize to hold the erase/region size */ - if (sc-parent-sc_regions) - sc-disk-d_stripesize = sc-parent-sc_region-r_blksz; - else + if (sc-parent-sc_regions) { + /* +* Multiple regions, use the last one. This is a +* total hack as it's (presently) used only by +* geom_redboot to locate the FIS directory which +* lies at the start of the last erase region. +*/ + sc-disk-d_stripesize = + sc-parent-sc_region[sc-parent-sc_regions-1].r_blksz; + } else sc-disk-d_stripesize = sc-disk-d_mediasize; sc-disk-d_drv1 = sc; disk_create(sc-disk, DISK_VERSION); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189654 - head/sys/dev/cfi
Sam Leffler wrote: Author: sam Date: Tue Mar 10 22:29:42 2009 New Revision: 189654 URL: http://svn.freebsd.org/changeset/base/189654 Log: choose the size of the last region for d_stripsize instead of the first; this fixes geom_redboot on boards that have multiple parts/regions as it uses the value to locate the FIS directory which is in the last erase region of flash This is a total hack. Suggestions welcome on how best to pass the right information to a geom module. Sam ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189655 - head/sys/dev/cxgb
Author: rwatson Date: Tue Mar 10 22:35:45 2009 New Revision: 189655 URL: http://svn.freebsd.org/changeset/base/189655 Log: Prefer ENETDOWN to ENXIO when returning queuing errors due to a link down, interface down, etc, with if_cxgb's if_transmit routine. MFC after:3 days Reviewed by: kmacy Modified: head/sys/dev/cxgb/cxgb_multiq.c Modified: head/sys/dev/cxgb/cxgb_multiq.c == --- head/sys/dev/cxgb/cxgb_multiq.c Tue Mar 10 22:29:42 2009 (r189654) +++ head/sys/dev/cxgb/cxgb_multiq.c Tue Mar 10 22:35:45 2009 (r189655) @@ -120,7 +120,7 @@ cxgb_pcpu_enqueue_packet_(struct sge_qse KASSERT(m-m_type == MT_DATA, (bad mbuf type %d, m-m_type)); if (qs-qs_flags QS_EXITING) { m_freem(m); - return (ENXIO); + return (ENETDOWN); } txq = qs-txq[TXQ_ETH]; err = buf_ring_enqueue(txq-txq_mr, m); @@ -301,13 +301,13 @@ cxgb_pcpu_start_(struct sge_qset *qs, st retry: if (!pi-link_config.link_ok) - initerr = ENXIO; + initerr = ENETDOWN; else if (qs-qs_flags QS_EXITING) - initerr = ENXIO; + initerr = ENETDOWN; else if ((pi-ifp-if_drv_flags IFF_DRV_RUNNING) == 0) - initerr = ENXIO; + initerr = ENETDOWN; else if ((pi-ifp-if_flags IFF_UP) == 0) - initerr = ENXIO; + initerr = ENETDOWN; else if (immpkt) { if (!buf_ring_empty(txq-txq_mr) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189656 - head/sys/arm/conf
Author: sam Date: Wed Mar 11 00:12:45 2009 New Revision: 189656 URL: http://svn.freebsd.org/changeset/base/189656 Log: switch to !legacy usb stack Modified: head/sys/arm/conf/CAMBRIA Modified: head/sys/arm/conf/CAMBRIA == --- head/sys/arm/conf/CAMBRIA Tue Mar 10 22:35:45 2009(r189655) +++ head/sys/arm/conf/CAMBRIA Wed Mar 11 00:12:45 2009(r189656) @@ -142,15 +142,14 @@ deviceath_rf5413 #deviceath_ar9285 # NB: 2 USB 2.0 ports standard -makeoptionsWITH_LEGACY -device ousb +device usb optionsUSB_EHCI_BIG_ENDIAN_DESC# handle big-endian byte order #options USB_DEBUG -device oehci -device oumass +device ehci +device umass device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) -#deviceoural -#deviceozyd +#deviceural +#devicezyd #devicewlan_amrr ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189657 - head/sys/netinet
Author: rwatson Date: Wed Mar 11 00:29:22 2009 New Revision: 189657 URL: http://svn.freebsd.org/changeset/base/189657 Log: Add INP_INHASHLIST flag for inpcb-inp_flags to indicate whether or not the inpcb is currenty on various hash lookup lists, rather than using (lport != 0) to detect this. This means that the full 4-tuple of a connection can be retained after close, which should lead to more sensible netstat output in the window between TCP close and socket close. MFC after:2 weeks Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.c == --- head/sys/netinet/in_pcb.c Wed Mar 11 00:12:45 2009(r189656) +++ head/sys/netinet/in_pcb.c Wed Mar 11 00:29:22 2009(r189657) @@ -1,7 +1,7 @@ /*- * Copyright (c) 1982, 1986, 1991, 1993, 1995 * The Regents of the University of California. - * Copyright (c) 2007-2008 Robert N. M. Watson + * Copyright (c) 2007-2009 Robert N. M. Watson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1032,7 +1032,7 @@ in_pcbdrop(struct inpcb *inp) INP_WLOCK_ASSERT(inp); inp-inp_vflag |= INP_DROPPED; - if (inp-inp_lport) { + if (inp-inp_flags INP_INHASHLIST) { struct inpcbport *phd = inp-inp_phd; LIST_REMOVE(inp, inp_hash); @@ -1041,7 +1041,7 @@ in_pcbdrop(struct inpcb *inp) LIST_REMOVE(phd, phd_hash); free(phd, M_PCB); } - inp-inp_lport = 0; + inp-inp_flags = ~INP_INHASHLIST; } } @@ -1421,6 +1421,8 @@ in_pcbinshash(struct inpcb *inp) INP_INFO_WLOCK_ASSERT(pcbinfo); INP_WLOCK_ASSERT(inp); + KASSERT((inp-inp_flags INP_INHASHLIST) == 0, + (in_pcbinshash: INP_INHASHLIST)); #ifdef INET6 if (inp-inp_vflag INP_IPV6) @@ -1457,6 +1459,7 @@ in_pcbinshash(struct inpcb *inp) inp-inp_phd = phd; LIST_INSERT_HEAD(phd-phd_pcblist, inp, inp_portlist); LIST_INSERT_HEAD(pcbhash, inp, inp_hash); + inp-inp_flags |= INP_INHASHLIST; return (0); } @@ -1475,6 +1478,8 @@ in_pcbrehash(struct inpcb *inp) INP_INFO_WLOCK_ASSERT(pcbinfo); INP_WLOCK_ASSERT(inp); + KASSERT(inp-inp_flags INP_INHASHLIST, + (in_pcbrehash: !INP_INHASHLIST)); #ifdef INET6 if (inp-inp_vflag INP_IPV6) @@ -1502,7 +1507,7 @@ in_pcbremlists(struct inpcb *inp) INP_WLOCK_ASSERT(inp); inp-inp_gencnt = ++pcbinfo-ipi_gencnt; - if (inp-inp_lport) { + if (inp-inp_flags INP_INHASHLIST) { struct inpcbport *phd = inp-inp_phd; LIST_REMOVE(inp, inp_hash); @@ -1511,6 +1516,7 @@ in_pcbremlists(struct inpcb *inp) LIST_REMOVE(phd, phd_hash); free(phd, M_PCB); } + inp-inp_flags = ~INP_INHASHLIST; } LIST_REMOVE(inp, inp_list); pcbinfo-ipi_count--; Modified: head/sys/netinet/in_pcb.h == --- head/sys/netinet/in_pcb.h Wed Mar 11 00:12:45 2009(r189656) +++ head/sys/netinet/in_pcb.h Wed Mar 11 00:29:22 2009(r189657) @@ -406,6 +406,7 @@ voidinp_4tuple_get(struct inpcb *inp, #defineINP_DONTFRAG0x800 /* don't fragment packet */ #defineINP_NONLOCALOK 0x1000 /* Allow bind to spoof any address */ /* - requires options IP_NONLOCALBIND */ +#defineINP_INHASHLIST 0x2000 /* in_pcbinshash() has been called */ #define IN6P_IPV6_V6ONLY 0x008000 /* restrict AF_INET6 socket for v6 */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189646 - head/sys/dev/usb
On Tue, Mar 10, 2009 at 07:35:41PM +, Andrew Thompson wrote: Author: thompsa Date: Tue Mar 10 19:35:41 2009 New Revision: 189646 URL: http://svn.freebsd.org/changeset/base/189646 Log: Make sure HID has a default usage, this fixes recent mouse problems. My mouse still not fixed by this patch. Debugging info you requested: usbconfig ... 1 ... REQUEST = 0x06 0x00 0xff 0x09 0x01 0xa1 0x01 0x85 0x10 0x75 0x08 0x95 0x06 0x15 0x00 0x26 0xff 0x00 0x09 0x01 0x81 0x00 0x09 0x01 0x91 0x00 0xc0 0x06 0x00 0xff 0x09 0x02 0xa1 0x01 0x85 0x11 0x75 0x08 0x95 0x13 0x15 0x00 0x26 0xff 0x00 0x09 0x02 0x81 0x00 0x09 0x02 0x91 0x00 0xc0uu usbconfig ... 0 ... REQUEST = 0x05 0x01 0x09 0x02 0xa1 0x01 0x09 0x01 0xa1 0x00 0x05 0x09 0x19 0x01 0x29 0x08 0x15 0x00 0x25 0x01 0x95 0x08 0x75 0x01 0x81 0x02 0x06 0x00 0xff 0x09 0x40 0x15 0x81 0x25 0x7f 0x75 0x08 0x95 0x02 0x81 0x02 0x05 0x01 0x09 0x38 0x95 0x01 0x81 0x06 0x05 0x0c 0x0a 0x38 0x02 0x95 0x01 0x81 0x06 0x05 0x01 0x16 0x01 0x80 0x26 0xff 0x7f 0x75 0x10 0x95 0x02 0x09 0x30 0x09 0x31 0x81 0x06 0x05 0x09 0x19 0x09 0x29 0x10 0x15 0x00 0x25 0x01 0x95 0x08 0x75 0x01 0x81 0x02 0xc0 0xc0)%...@%u88u01)%u -- http://ache.pp.ru/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189617 - in head/sys: dev/syscons dev/syscons/teken pc98/cbus
On Tue, Mar 10, 2009 at 11:28:54AM +, Ed Schouten wrote: Author: ed Date: Tue Mar 10 11:28:54 2009 New Revision: 189617 URL: http://svn.freebsd.org/changeset/base/189617 Log: Make a 1:1 mapping between syscons stats and terminal emulators. Well, reboot messages are now in the proper position, thanx. But _boot_ messages still makes complete mess with rc output after the moment rc switches syscons to 80x30 -- http://ache.pp.ru/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189660 - head/sys/geom
Author: sam Date: Wed Mar 11 01:12:52 2009 New Revision: 189660 URL: http://svn.freebsd.org/changeset/base/189660 Log: o disallow write to RedBoot and FIS directory partitions; these are painful to resurrect (maybe honor foot shooting bit in kern.geom_debugflags) o fix match macro so we now recognize we want to merge FIS dir with RedBoot config parameters even if we don't actually do it Modified: head/sys/geom/geom_redboot.c Modified: head/sys/geom/geom_redboot.c == --- head/sys/geom/geom_redboot.cWed Mar 11 01:03:32 2009 (r189659) +++ head/sys/geom/geom_redboot.cWed Mar 11 01:12:52 2009 (r189660) @@ -62,6 +62,7 @@ struct fis_image_desc { #defineFISDIR_NAME FIS directory #defineREDBCFG_NAMERedBoot config +#defineREDBOOT_NAMERedBoot #defineREDBOOT_MAXSLICE64 #defineREDBOOT_MAXOFF \ @@ -70,6 +71,8 @@ struct fis_image_desc { struct g_redboot_softc { uint32_tentry[REDBOOT_MAXSLICE]; uint32_tdsize[REDBOOT_MAXSLICE]; + uint8_t readonly[REDBOOT_MAXSLICE]; + g_access_t *parent_access; }; static void @@ -90,6 +93,18 @@ g_redboot_ioctl(struct g_provider *pp, u } static int +g_redboot_access(struct g_provider *pp, int dread, int dwrite, int dexcl) +{ + struct g_geom *gp = pp-geom; + struct g_slicer *gsp = gp-softc; + struct g_redboot_softc *sc = gsp-softc; + + if (dwrite 0 sc-readonly[pp-index]) + return (EPERM); + return (sc-parent_access(pp, dread, dwrite, dexcl)); +} + +static int g_redboot_start(struct bio *bp) { struct g_provider *pp; @@ -155,8 +170,7 @@ nameok(const char name[16]) static struct fis_image_desc * parse_fis_directory(u_char *buf, size_t bufsize, off_t offset, uint32_t offmask) { -#definematch(a,b) \ - (bcmp(fd-name, FISDIR_NAME, sizeof(FISDIR_NAME)-1) == 0) +#definematch(a,b) (bcmp(a, b, sizeof(b)-1) == 0) struct fis_image_desc *fd, *efd; struct fis_image_desc *fisdir, *redbcfg; struct fis_image_desc *head, **tail; @@ -242,6 +256,10 @@ g_redboot_taste(struct g_class *mp, stru g_redboot_start); if (gp == NULL) return (NULL); + /* interpose our access method */ + sc-parent_access = gp-access; + gp-access = g_redboot_access; + sectorsize = cp-provider-sectorsize; blksize = cp-provider-stripesize; if (powerof2(cp-provider-mediasize)) @@ -287,6 +305,9 @@ again: __func__, error, fd-name); sc-entry[i] = fd-entry; sc-dsize[i] = fd-dsize; + /* disallow writing hard-to-recover entries */ + sc-readonly[i] = (strcmp(fd-name, FISDIR_NAME) == 0) || + (strcmp(fd-name, REDBOOT_NAME) == 0); i++; } g_free(buf); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189659 - in stable/7: share/man/man4 sys/dev/usb
Author: thompsa Date: Wed Mar 11 01:03:32 2009 New Revision: 189659 URL: http://svn.freebsd.org/changeset/base/189659 Log: MFC r189360 Add Mobile Action MA-620 Infrared Adapter. Manually merged due to different codebase. Modified: stable/7/share/man/man4/uplcom.4 stable/7/sys/dev/usb/uplcom.c stable/7/sys/dev/usb/usbdevs Modified: stable/7/share/man/man4/uplcom.4 == --- stable/7/share/man/man4/uplcom.4Wed Mar 11 00:58:22 2009 (r189658) +++ stable/7/share/man/man4/uplcom.4Wed Mar 11 01:03:32 2009 (r189659) @@ -96,6 +96,8 @@ I/O DATA USB-RSAQ2 .It I/O DATA USB-RSAQ3 .It +Mobile Action MA-620 Infrared Adapter +.It PLANEX USB-RS232 URS-03 .It RATOC REX-USB60 Modified: stable/7/sys/dev/usb/uplcom.c == --- stable/7/sys/dev/usb/uplcom.c Wed Mar 11 00:58:22 2009 (r189658) +++ stable/7/sys/dev/usb/uplcom.c Wed Mar 11 01:03:32 2009 (r189659) @@ -272,6 +272,9 @@ static const struct uplcom_product { { USB_VENDOR_SITECOM, USB_PRODUCT_SITECOM_SERIAL, -1, TYPE_PL2303 }, /* Tripp-Lite U209-000-R */ { USB_VENDOR_TRIPPLITE, USB_PRODUCT_TRIPPLITE_U209, -1, TYPE_PL2303X }, + /* Mobile Action MA-620 Infrared Adapter */ + { USB_VENDOR_MOBILEACTION, USB_PRODUCT_MOBILEACTION_MA620, -1, + TYPE_PL2303X }, { 0, 0 } }; Modified: stable/7/sys/dev/usb/usbdevs == --- stable/7/sys/dev/usb/usbdevsWed Mar 11 00:58:22 2009 (r189658) +++ stable/7/sys/dev/usb/usbdevsWed Mar 11 01:03:32 2009 (r189659) @@ -1716,6 +1716,9 @@ product MITSUMI CDRRW 0x CD-R/RW Dr product MITSUMI BT_DONGLE 0x641f Bluetooth USB dongle product MITSUMI FDD0x6901 USB FDD +/* Mobile Action products */ +product MOBILEACTION MA620 0x0620 MA-620 Infrared Adapter + /* Mobility products */ product MOBILITY EA0x0204 Ethernet product MOBILITY EASIDOCK 0x0304 EasiDock Ethernet ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189661 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 01:47:32 2009 New Revision: 189661 URL: http://svn.freebsd.org/changeset/base/189661 Log: Merge r189045 Remove the PZERO priority from mtx_sleep. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h Modified: stable/7/sys/dev/drm/drmP.h == --- stable/7/sys/dev/drm/drmP.h Wed Mar 11 01:12:52 2009(r189660) +++ stable/7/sys/dev/drm/drmP.h Wed Mar 11 01:47:32 2009(r189661) @@ -294,8 +294,8 @@ for ( ret = 0 ; !ret !(condition) ; ) DRM_UNLOCK(); \ mtx_lock(dev-irq_lock); \ if (!(condition)) \ - ret = -mtx_sleep((queue), dev-irq_lock, \ -PZERO | PCATCH, drmwtq, (timeout)); \ + ret = -mtx_sleep((queue), dev-irq_lock, \ + PCATCH, drmwtq, (timeout)); \ mtx_unlock(dev-irq_lock); \ DRM_LOCK(); \ } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189662 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 01:49:22 2009 New Revision: 189662 URL: http://svn.freebsd.org/changeset/base/189662 Log: Merge r189046 There is no reason to hold the lock here. When I was LOCK_PROFILING this was pretty high up and there is no reason for it. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_drv.c Modified: stable/7/sys/dev/drm/drm_drv.c == --- stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 01:47:32 2009 (r189661) +++ stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 01:49:22 2009 (r189662) @@ -658,9 +658,7 @@ int drm_ioctl(struct cdev *kdev, u_long int is_driver_ioctl = 0; struct drm_file *file_priv; - DRM_LOCK(); retcode = devfs_get_cdevpriv((void **)file_priv); - DRM_UNLOCK(); if (retcode != 0) { DRM_ERROR(can't find authenticator\n); return EINVAL; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189663 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 01:50:53 2009 New Revision: 189663 URL: http://svn.freebsd.org/changeset/base/189663 Log: Merge r189047 The vblank_swap ioctl was fundamentally race prone. Get rid of it. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_drv.h stable/7/sys/dev/drm/i915_irq.c Modified: stable/7/sys/dev/drm/i915_dma.c == --- stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 01:49:22 2009 (r189662) +++ stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 01:50:53 2009 (r189663) @@ -1087,7 +1087,6 @@ int i915_driver_load(struct drm_device * #ifdef I915_HAVE_GEM i915_gem_load(dev); #endif - DRM_SPININIT(dev_priv-swaps_lock, swap); DRM_SPININIT(dev_priv-user_irq_lock, userirq); #ifdef __linux__ @@ -1117,7 +1116,6 @@ int i915_driver_unload(struct drm_device drm_rmmap(dev, dev_priv-mmio_map); - DRM_SPINUNINIT(dev_priv-swaps_lock); DRM_SPINUNINIT(dev_priv-user_irq_lock); #ifdef __linux__ Modified: stable/7/sys/dev/drm/i915_drv.h == --- stable/7/sys/dev/drm/i915_drv.h Wed Mar 11 01:49:22 2009 (r189662) +++ stable/7/sys/dev/drm/i915_drv.h Wed Mar 11 01:50:53 2009 (r189663) @@ -178,9 +178,6 @@ typedef struct drm_i915_private { struct drm_i915_validate_buffer *val_bufs; #endif - DRM_SPINTYPE swaps_lock; - drm_i915_vbl_swap_t vbl_swaps; - unsigned int swaps_pending; #if defined(I915_HAVE_BUFFER) /* DRI2 sarea */ struct drm_buffer_object *sarea_bo; Modified: stable/7/sys/dev/drm/i915_irq.c == --- stable/7/sys/dev/drm/i915_irq.c Wed Mar 11 01:49:22 2009 (r189662) +++ stable/7/sys/dev/drm/i915_irq.c Wed Mar 11 01:50:53 2009 (r189663) @@ -121,277 +121,6 @@ i915_pipe_enabled(struct drm_device *dev return 0; } -/** - * Emit a synchronous flip. - * - * This function must be called with the drawable spinlock held. - */ -static void -i915_dispatch_vsync_flip(struct drm_device *dev, struct drm_drawable_info *drw, -int plane) -{ - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev-dev_private; - drm_i915_sarea_t *sarea_priv = dev_priv-sarea_priv; - u16 x1, y1, x2, y2; - int pf_planes = 1 plane; - - DRM_SPINLOCK_ASSERT(dev-drw_lock); - - /* If the window is visible on the other plane, we have to flip on that -* plane as well. -*/ - if (plane == 1) { - x1 = sarea_priv-planeA_x; - y1 = sarea_priv-planeA_y; - x2 = x1 + sarea_priv-planeA_w; - y2 = y1 + sarea_priv-planeA_h; - } else { - x1 = sarea_priv-planeB_x; - y1 = sarea_priv-planeB_y; - x2 = x1 + sarea_priv-planeB_w; - y2 = y1 + sarea_priv-planeB_h; - } - - if (x2 0 y2 0) { - int i, num_rects = drw-num_rects; - struct drm_clip_rect *rect = drw-rects; - - for (i = 0; i num_rects; i++) - if (!(rect[i].x1 = x2 || rect[i].y1 = y2 || - rect[i].x2 = x1 || rect[i].y2 = y1)) { - pf_planes = 0x3; - - break; - } - } - - i915_dispatch_flip(dev, pf_planes, 1); -} - -/** - * Emit blits for scheduled buffer swaps. - * - * This function will be called with the HW lock held. - */ -static void i915_vblank_tasklet(struct drm_device *dev) -{ - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev-dev_private; - struct list_head *list, *tmp, hits, *hit; - int nhits, nrects, slice[2], upper[2], lower[2], i, num_pages; - unsigned counter[2]; - struct drm_drawable_info *drw; - drm_i915_sarea_t *sarea_priv = dev_priv-sarea_priv; - u32 cpp = dev_priv-cpp, offsets[3]; - u32 cmd = (cpp == 4) ? (XY_SRC_COPY_BLT_CMD | - XY_SRC_COPY_BLT_WRITE_ALPHA | - XY_SRC_COPY_BLT_WRITE_RGB) -: XY_SRC_COPY_BLT_CMD; - u32 src_pitch = sarea_priv-pitch * cpp; - u32 dst_pitch = sarea_priv-pitch * cpp; - /* COPY rop (0xcc), map cpp to magic color depth constants */ - u32 ropcpp = (0xcc 16) | ((cpp - 1) 24); - RING_LOCALS; - - if (IS_I965G(dev) sarea_priv-front_tiled) { - cmd |= XY_SRC_COPY_BLT_DST_TILED; - dst_pitch = 2; - } - if (IS_I965G(dev) sarea_priv-back_tiled) { - cmd |=
svn commit: r189664 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 01:53:21 2009 New Revision: 189664 URL: http://svn.freebsd.org/changeset/base/189664 Log: Merge 189048 The i915 driver was the only consumer of locked task support. Now that it doesn't use it anymore, get right of the taskqueue and locked task support. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/drm_drv.c stable/7/sys/dev/drm/drm_irq.c stable/7/sys/dev/drm/drm_lock.c Modified: stable/7/sys/dev/drm/drmP.h == --- stable/7/sys/dev/drm/drmP.h Wed Mar 11 01:50:53 2009(r189663) +++ stable/7/sys/dev/drm/drmP.h Wed Mar 11 01:53:21 2009(r189664) @@ -63,7 +63,6 @@ struct drm_file; #include sys/signalvar.h #include sys/poll.h #include sys/tree.h -#include sys/taskqueue.h #include vm/vm.h #include vm/pmap.h #include vm/vm_extern.h @@ -628,7 +627,6 @@ struct drm_device { struct mtxirq_lock; /* protects irq condition checks */ struct mtxdev_lock; /* protects everything else */ DRM_SPINTYPE drw_lock; - DRM_SPINTYPE tsk_lock; /* Usage Counters */ int open_count; /* Outstanding files open */ @@ -695,9 +693,6 @@ struct drm_device { struct unrhdr *drw_unrhdr; /* RB tree of drawable infos */ RB_HEAD(drawable_tree, bsd_drm_drawable_info) drw_head; - - struct task locked_task; - void (*locked_task_call)(struct drm_device *dev); }; static __inline__ int drm_core_check_feature(struct drm_device *dev, @@ -918,8 +913,6 @@ int drm_control(struct drm_device *dev, struct drm_file *file_priv); intdrm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_priv); -void drm_locked_tasklet(struct drm_device *dev, - void (*tasklet)(struct drm_device *dev)); /* AGP/GART support (drm_agpsupport.c) */ intdrm_agp_acquire_ioctl(struct drm_device *dev, void *data, Modified: stable/7/sys/dev/drm/drm_drv.c == --- stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 01:50:53 2009 (r189663) +++ stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 01:53:21 2009 (r189664) @@ -193,7 +193,6 @@ int drm_attach(device_t nbdev, drm_pci_i mtx_init(dev-irq_lock, drmirq, NULL, MTX_DEF); mtx_init(dev-vbl_lock, drmvbl, NULL, MTX_DEF); mtx_init(dev-drw_lock, drmdrw, NULL, MTX_DEF); - mtx_init(dev-tsk_lock, drmtsk, NULL, MTX_DEF); id_entry = drm_find_description(pci_get_vendor(dev-device), pci_get_device(dev-device), idlist); @@ -440,7 +439,6 @@ error: DRM_UNLOCK(); destroy_dev(dev-devnode); - mtx_destroy(dev-tsk_lock); mtx_destroy(dev-drw_lock); mtx_destroy(dev-vbl_lock); mtx_destroy(dev-irq_lock); @@ -503,14 +501,12 @@ static void drm_unload(struct drm_device if (pci_disable_busmaster(dev-device)) DRM_ERROR(Request to disable bus-master failed.\n); - mtx_destroy(dev-tsk_lock); mtx_destroy(dev-drw_lock); mtx_destroy(dev-vbl_lock); mtx_destroy(dev-irq_lock); mtx_destroy(dev-dev_lock); } - int drm_version(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_version *version = data; Modified: stable/7/sys/dev/drm/drm_irq.c == --- stable/7/sys/dev/drm/drm_irq.c Wed Mar 11 01:50:53 2009 (r189663) +++ stable/7/sys/dev/drm/drm_irq.c Wed Mar 11 01:53:21 2009 (r189664) @@ -36,8 +36,6 @@ __FBSDID($FreeBSD$); #include dev/drm/drmP.h #include dev/drm/drm.h -static void drm_locked_task(void *context, int pending __unused); - int drm_irq_by_busid(struct drm_device *dev, void *data, struct drm_file *file_priv) { @@ -198,7 +196,6 @@ int drm_irq_install(struct drm_device *d dev-driver-irq_postinstall(dev); DRM_UNLOCK(); - TASK_INIT(dev-locked_task, 0, drm_locked_task, dev); return 0; err: DRM_LOCK(); @@ -507,46 +504,3 @@ void drm_handle_vblank(struct drm_device drm_vbl_send_signals(dev, crtc); } -static void drm_locked_task(void *context, int pending __unused) -{ - struct drm_device *dev = context; - - DRM_SPINLOCK(dev-tsk_lock); - - DRM_LOCK(); /* XXX drm_lock_take() should do it's own locking */ - if (dev-locked_task_call == NULL || - drm_lock_take(dev-lock, DRM_KERNEL_CONTEXT) == 0) { - DRM_UNLOCK(); - DRM_SPINUNLOCK(dev-tsk_lock); -
svn commit: r189665 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 01:54:41 2009 New Revision: 189665 URL: http://svn.freebsd.org/changeset/base/189665 Log: Merge r189049 This was part of a sync to the code that Intel is shipping in linux. - Remove the old TTM interface - Move register definitions to i915_reg.h - Overhaul the irq handler Added: stable/7/sys/dev/drm/i915_reg.h - copied unchanged from r189049, head/sys/dev/drm/i915_reg.h Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_drv.c stable/7/sys/dev/drm/i915_drv.h stable/7/sys/dev/drm/i915_irq.c Modified: stable/7/sys/dev/drm/drmP.h == --- stable/7/sys/dev/drm/drmP.h Wed Mar 11 01:53:21 2009(r189664) +++ stable/7/sys/dev/drm/drmP.h Wed Mar 11 01:54:41 2009(r189665) @@ -655,6 +655,7 @@ struct drm_device { /* Context support */ int irq; /* Interrupt used by board */ int irq_enabled; /* True if the irq handler is enabled */ + int msi_enabled; /* MSI enabled */ int irqrid; /* Interrupt used by board */ struct resource *irqr;/* Resource for interrupt used by board */ void *irqh;/* Handle from bus_setup_intr */ Modified: stable/7/sys/dev/drm/i915_dma.c == --- stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 01:53:21 2009 (r189664) +++ stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 01:54:41 2009 (r189665) @@ -58,6 +58,9 @@ int i915_wait_ring(struct drm_device * d if (ring-space = n) return 0; + if (dev_priv-sarea_priv) + dev_priv-sarea_priv-perf_boxes |= I915_BOX_WAIT; + if (ring-head != last_head) i = 0; @@ -72,77 +75,53 @@ int i915_wait_ring(struct drm_device * d return -EBUSY; } -int i915_init_hardware_status(struct drm_device *dev) +/** + * Sets up the hardware status page for devices that need a physical address + * in the register. + */ +static int i915_init_phys_hws(struct drm_device *dev) { drm_i915_private_t *dev_priv = dev-dev_private; - drm_dma_handle_t *dmah; /* Program Hardware Status Page */ -#ifdef __FreeBSD__ DRM_UNLOCK(); -#endif - dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0x); -#ifdef __FreeBSD__ + dev_priv-status_page_dmah = + drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0x); DRM_LOCK(); -#endif - if (!dmah) { + if (!dev_priv-status_page_dmah) { DRM_ERROR(Can not allocate hardware status page\n); return -ENOMEM; } - - dev_priv-status_page_dmah = dmah; - dev_priv-hw_status_page = dmah-vaddr; - dev_priv-dma_status_page = dmah-busaddr; + dev_priv-hw_status_page = dev_priv-status_page_dmah-vaddr; + dev_priv-dma_status_page = dev_priv-status_page_dmah-busaddr; memset(dev_priv-hw_status_page, 0, PAGE_SIZE); - I915_WRITE(0x02080, dev_priv-dma_status_page); + I915_WRITE(HWS_PGA, dev_priv-dma_status_page); DRM_DEBUG(Enabled hardware status page\n); return 0; } -void i915_free_hardware_status(struct drm_device *dev) +/** + * Frees the hardware status page, whether it's a physical address or a virtual + * address set up by the X Server. + */ +static void i915_free_hws(struct drm_device *dev) { drm_i915_private_t *dev_priv = dev-dev_private; if (dev_priv-status_page_dmah) { drm_pci_free(dev, dev_priv-status_page_dmah); dev_priv-status_page_dmah = NULL; - /* Need to rewrite hardware status page */ - I915_WRITE(0x02080, 0x1000); } if (dev_priv-status_gfx_addr) { dev_priv-status_gfx_addr = 0; drm_core_ioremapfree(dev_priv-hws_map, dev); - I915_WRITE(0x02080, 0x1000); } -} -#if I915_RING_VALIDATE -/** - * Validate the cached ring tail value - * - * If the X server writes to the ring and DRM doesn't - * reload the head and tail pointers, it will end up writing - * data to the wrong place in the ring, causing havoc. - */ -void i915_ring_validate(struct drm_device *dev, const char *func, int line) -{ - drm_i915_private_t *dev_priv = dev-dev_private; - drm_i915_ring_buffer_t *ring = (dev_priv-ring); - u32 tail = I915_READ(PRB0_TAIL) HEAD_ADDR; - u32 head = I915_READ(PRB0_HEAD) HEAD_ADDR; - - if (tail !=
svn commit: r189667 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 01:57:20 2009 New Revision: 189667 URL: http://svn.freebsd.org/changeset/base/189667 Log: Merge r189051 Prepare the radeon driver for MSI support. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/radeon_irq.c Modified: stable/7/sys/dev/drm/radeon_irq.c == --- stable/7/sys/dev/drm/radeon_irq.c Wed Mar 11 01:56:17 2009 (r189666) +++ stable/7/sys/dev/drm/radeon_irq.c Wed Mar 11 01:57:20 2009 (r189667) @@ -192,6 +192,7 @@ irqreturn_t radeon_driver_irq_handler(DR (drm_radeon_private_t *) dev-dev_private; u32 stat; u32 r500_disp_int; + u32 tmp; /* Only consider the bits we're interested in - others could be used * outside the DRM @@ -218,6 +219,33 @@ irqreturn_t radeon_driver_irq_handler(DR if (stat RADEON_CRTC2_VBLANK_STAT) drm_handle_vblank(dev, 1); } + if (dev-msi_enabled) { + switch(dev_priv-flags RADEON_FAMILY_MASK) { + case CHIP_RS400: + case CHIP_RS480: + tmp = RADEON_READ(RADEON_AIC_CNTL) + ~RS400_MSI_REARM; + RADEON_WRITE(RADEON_AIC_CNTL, tmp); + RADEON_WRITE(RADEON_AIC_CNTL, + tmp | RS400_MSI_REARM); + break; + case CHIP_RS690: + case CHIP_RS740: + tmp = RADEON_READ(RADEON_BUS_CNTL) + ~RS600_MSI_REARM; + RADEON_WRITE(RADEON_BUS_CNTL, tmp); + RADEON_WRITE(RADEON_BUS_CNTL, tmp | + RS600_MSI_REARM); + break; +default: + tmp = RADEON_READ(RADEON_MSI_REARM_EN) + ~RV370_MSI_REARM_EN; + RADEON_WRITE(RADEON_MSI_REARM_EN, tmp); + RADEON_WRITE(RADEON_MSI_REARM_EN, + tmp | RV370_MSI_REARM_EN); + break; + } + } return IRQ_HANDLED; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189668 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 01:58:37 2009 New Revision: 189668 URL: http://svn.freebsd.org/changeset/base/189668 Log: Merge r189052 Turn on MSI if the card supports it. There is a blacklist for chips which report that they are capable of MSI, but don't work correctly. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/drm_drv.c stable/7/sys/dev/drm/drm_irq.c Modified: stable/7/sys/dev/drm/drmP.h == --- stable/7/sys/dev/drm/drmP.h Wed Mar 11 01:57:20 2009(r189667) +++ stable/7/sys/dev/drm/drmP.h Wed Mar 11 01:58:37 2009(r189668) @@ -319,6 +319,12 @@ typedef struct drm_pci_id_list char *name; } drm_pci_id_list_t; +struct drm_msi_blacklist_entry +{ + int vendor; + int device; +}; + #define DRM_AUTH 0x1 #define DRM_MASTER 0x2 #define DRM_ROOT_ONLY 0x4 Modified: stable/7/sys/dev/drm/drm_drv.c == --- stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 01:57:20 2009 (r189667) +++ stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 01:58:37 2009 (r189668) @@ -134,6 +134,27 @@ static struct cdevsw drm_cdevsw = { .d_flags = D_TRACKCLOSE | D_NEEDGIANT }; +static struct drm_msi_blacklist_entry drm_msi_blacklist[] = { + {0x8086, 0x2772}, /* Intel i945G*/ \ + {0x8086, 0x27A2}, /* Intel i945GM */ \ + {0x8086, 0x27AE}, /* Intel i945GME */ \ + {0, 0} +}; + +static int drm_msi_is_blacklisted(int vendor, int device) +{ + int i = 0; + + for (i = 0; drm_msi_blacklist[i].vendor != 0; i++) { + if ((drm_msi_blacklist[i].vendor == vendor) + (drm_msi_blacklist[i].device == device)) { + return 1; + } + } + + return 0; +} + int drm_probe(device_t dev, drm_pci_id_list_t *idlist) { drm_pci_id_list_t *id_entry; @@ -169,7 +190,7 @@ int drm_attach(device_t nbdev, drm_pci_i { struct drm_device *dev; drm_pci_id_list_t *id_entry; - int unit; + int unit, msicount; unit = device_get_unit(nbdev); dev = device_get_softc(nbdev); @@ -189,21 +210,66 @@ int drm_attach(device_t nbdev, drm_pci_i DRM_DEV_MODE, dri/card%d, unit); +#if __FreeBSD_version = 700053 + dev-pci_domain = pci_get_domain(dev-device); +#else + dev-pci_domain = 0; +#endif + dev-pci_bus = pci_get_bus(dev-device); + dev-pci_slot = pci_get_slot(dev-device); + dev-pci_func = pci_get_function(dev-device); + + dev-pci_vendor = pci_get_vendor(dev-device); + dev-pci_device = pci_get_device(dev-device); + + if (!drm_msi_is_blacklisted(dev-pci_vendor, dev-pci_device)) { + msicount = pci_msi_count(dev-device); + DRM_DEBUG(MSI count = %d\n, msicount); + if (msicount 1) + msicount = 1; + + if (pci_alloc_msi(dev-device, msicount) == 0) { + DRM_INFO(MSI enabled %d message(s)\n, msicount); + dev-msi_enabled = 1; + dev-irqrid = 1; + } + } + + dev-irqr = bus_alloc_resource_any(dev-device, SYS_RES_IRQ, + dev-irqrid, RF_SHAREABLE); + if (!dev-irqr) { + return ENOENT; + } + + dev-irq = (int) rman_get_start(dev-irqr); + mtx_init(dev-dev_lock, drmdev, NULL, MTX_DEF); mtx_init(dev-irq_lock, drmirq, NULL, MTX_DEF); mtx_init(dev-vbl_lock, drmvbl, NULL, MTX_DEF); mtx_init(dev-drw_lock, drmdrw, NULL, MTX_DEF); - id_entry = drm_find_description(pci_get_vendor(dev-device), - pci_get_device(dev-device), idlist); + id_entry = drm_find_description(dev-pci_vendor, + dev-pci_device, idlist); dev-id_entry = id_entry; return drm_load(dev); } -int drm_detach(device_t dev) +int drm_detach(device_t nbdev) { - drm_unload(device_get_softc(dev)); + struct drm_device *dev; + + dev = device_get_softc(nbdev); + + drm_unload(dev); + + bus_release_resource(dev-device, SYS_RES_IRQ, dev-irqrid, dev-irqr); + + if (dev-msi_enabled) { + pci_release_msi(dev-device); + DRM_INFO(MSI released\n); + } + return 0; } @@ -352,19 +418,6 @@ static int drm_load(struct drm_device *d DRM_DEBUG(\n); - dev-irq = pci_get_irq(dev-device); -#if __FreeBSD_version = 700053 - dev-pci_domain = pci_get_domain(dev-device); -#else - dev-pci_domain = 0; -#endif - dev-pci_bus = pci_get_bus(dev-device); - dev-pci_slot =
svn commit: r189669 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 02:00:13 2009 New Revision: 189669 URL: http://svn.freebsd.org/changeset/base/189669 Log: Merge r189053 Remove D_NEEDGIANT Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_drv.c Modified: stable/7/sys/dev/drm/drm_drv.c == --- stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 01:58:37 2009 (r189668) +++ stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 02:00:13 2009 (r189669) @@ -131,7 +131,7 @@ static struct cdevsw drm_cdevsw = { .d_poll = drm_poll, .d_mmap = drm_mmap, .d_name = drm, - .d_flags = D_TRACKCLOSE | D_NEEDGIANT + .d_flags = D_TRACKCLOSE }; static struct drm_msi_blacklist_entry drm_msi_blacklist[] = { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189670 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 02:13:46 2009 New Revision: 189670 URL: http://svn.freebsd.org/changeset/base/189670 Log: Merge r189054 The GM45 handles vblank differently. Pull the changes from Intel in. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_drv.c stable/7/sys/dev/drm/i915_drv.h stable/7/sys/dev/drm/i915_irq.c stable/7/sys/dev/drm/i915_reg.h Modified: stable/7/sys/dev/drm/i915_dma.c == --- stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 02:13:46 2009 (r189670) @@ -868,6 +868,12 @@ int i915_driver_load(struct drm_device * ret = drm_addmap(dev, base, size, _DRM_REGISTERS, _DRM_KERNEL | _DRM_DRIVER, dev_priv-mmio_map); + + if (IS_GM45(dev)) + dev-driver-get_vblank_counter = gm45_get_vblank_counter; + else + dev-driver-get_vblank_counter = i915_get_vblank_counter; + #ifdef I915_HAVE_GEM i915_gem_load(dev); #endif Modified: stable/7/sys/dev/drm/i915_drv.c == --- stable/7/sys/dev/drm/i915_drv.c Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_drv.c Wed Mar 11 02:13:46 2009 (r189670) @@ -81,7 +81,6 @@ static void i915_configure(struct drm_de dev-driver-preclose = i915_driver_preclose; dev-driver-lastclose = i915_driver_lastclose; dev-driver-device_is_agp = i915_driver_device_is_agp; - dev-driver-get_vblank_counter = i915_get_vblank_counter; dev-driver-enable_vblank = i915_enable_vblank; dev-driver-disable_vblank = i915_disable_vblank; dev-driver-irq_preinstall = i915_driver_irq_preinstall; Modified: stable/7/sys/dev/drm/i915_drv.h == --- stable/7/sys/dev/drm/i915_drv.h Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_drv.h Wed Mar 11 02:13:46 2009 (r189670) @@ -449,6 +449,7 @@ extern int i915_vblank_pipe_get(struct d extern int i915_enable_vblank(struct drm_device *dev, int crtc); extern void i915_disable_vblank(struct drm_device *dev, int crtc); extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc); +extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc); extern int i915_vblank_swap(struct drm_device *dev, void *data, struct drm_file *file_priv); Modified: stable/7/sys/dev/drm/i915_irq.c == --- stable/7/sys/dev/drm/i915_irq.c Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_irq.c Wed Mar 11 02:13:46 2009 (r189670) @@ -170,6 +170,19 @@ u32 i915_get_vblank_counter(struct drm_d return count; } +u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) +{ + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev-dev_private; + int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45; + + if (!i915_pipe_enabled(dev, pipe)) { + DRM_ERROR(trying to get vblank count for disabled pipe %d\n, pipe); + return 0; + } + + return I915_READ(reg); +} + irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) { struct drm_device *dev = (struct drm_device *) arg; Modified: stable/7/sys/dev/drm/i915_reg.h == --- stable/7/sys/dev/drm/i915_reg.h Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_reg.h Wed Mar 11 02:13:46 2009 (r189670) @@ -1329,6 +1329,9 @@ __FBSDID($FreeBSD$); #define PIPE_FRAME_LOW_SHIFT24 #define PIPE_PIXEL_MASK 0x00ff #define PIPE_PIXEL_SHIFT0 +/* GM45+ just has to be different */ +#define PIPEA_FRMCOUNT_GM450x70040 +#define PIPEA_FLIPCOUNT_GM45 0x70044 /* Cursor A B regs */ #define CURACNTR 0x70080 @@ -1397,6 +1400,8 @@ __FBSDID($FreeBSD$); #define PIPEBSTAT 0x71024 #define PIPEBFRAMEHIGH 0x71040 #define PIPEBFRAMEPIXEL0x71044 +#define PIPEB_FRMCOUNT_GM450x71040 +#define PIPEB_FLIPCOUNT_GM45 0x71044 /* Display B control */ #define DSPBCNTR 0x71180 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189617 - in head/sys: dev/syscons dev/syscons/teken pc98/cbus
On Wed, Mar 11, 2009 at 04:27:05AM +0300, Andrey Chernov wrote: On Tue, Mar 10, 2009 at 11:28:54AM +, Ed Schouten wrote: Author: ed Date: Tue Mar 10 11:28:54 2009 New Revision: 189617 URL: http://svn.freebsd.org/changeset/base/189617 Log: Make a 1:1 mapping between syscons stats and terminal emulators. Well, reboot messages are now in the proper position, thanx. But _boot_ messages still makes complete mess with rc output after the moment rc switches syscons to 80x30 Hmm. Perhaps not after but before, because screen is cleared on mode change... It looks like rc messages appearse in the middle of the screen over boot messages. -- http://ache.pp.ru/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189671 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 02:36:20 2009 New Revision: 189671 URL: http://svn.freebsd.org/changeset/base/189671 Log: Merge r189099 Fix up some ioctl permissions issues long overlooked. Submitted by: jkim@ Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/drm_bufs.c stable/7/sys/dev/drm/drm_drv.c Modified: stable/7/sys/dev/drm/drmP.h == --- stable/7/sys/dev/drm/drmP.h Wed Mar 11 02:13:46 2009(r189670) +++ stable/7/sys/dev/drm/drmP.h Wed Mar 11 02:36:20 2009(r189671) @@ -901,8 +901,8 @@ int drm_addmap_ioctl(struct drm_device * struct drm_file *file_priv); intdrm_rmmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); -intdrm_addbufs_ioctl(struct drm_device *dev, void *data, - struct drm_file *file_priv); +intdrm_addbufs(struct drm_device *dev, void *data, + struct drm_file *file_priv); intdrm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv); intdrm_markbufs(struct drm_device *dev, void *data, Modified: stable/7/sys/dev/drm/drm_bufs.c == --- stable/7/sys/dev/drm/drm_bufs.c Wed Mar 11 02:13:46 2009 (r189670) +++ stable/7/sys/dev/drm/drm_bufs.c Wed Mar 11 02:36:20 2009 (r189671) @@ -880,8 +880,7 @@ int drm_addbufs_pci(struct drm_device *d return ret; } -int drm_addbufs_ioctl(struct drm_device *dev, void *data, - struct drm_file *file_priv) +int drm_addbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_buf_desc *request = data; int err; Modified: stable/7/sys/dev/drm/drm_drv.c == --- stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 02:13:46 2009 (r189670) +++ stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 02:36:20 2009 (r189671) @@ -82,7 +82,7 @@ static drm_ioctl_desc_t drm_ioctls[25 DRM_IOCTL_DEF(DRM_IOCTL_SET_SAREA_CTX, drm_setsareactx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_GET_SAREA_CTX, drm_getsareactx, DRM_AUTH), - DRM_IOCTL_DEF(DRM_IOCTL_ADD_CTX, drm_addctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_ADD_CTX, drm_addctx, DRM_AUTH|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_RM_CTX, drm_rmctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_MOD_CTX, drm_modctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_GET_CTX, drm_getctx, DRM_AUTH), @@ -95,10 +95,11 @@ static drm_ioctl_desc_t drm_ioctls[25 DRM_IOCTL_DEF(DRM_IOCTL_LOCK, drm_lock, DRM_AUTH), DRM_IOCTL_DEF(DRM_IOCTL_UNLOCK, drm_unlock, DRM_AUTH), + DRM_IOCTL_DEF(DRM_IOCTL_FINISH, drm_noop, DRM_AUTH), - DRM_IOCTL_DEF(DRM_IOCTL_ADD_BUFS, drm_addbufs_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), - DRM_IOCTL_DEF(DRM_IOCTL_MARK_BUFS, drm_markbufs, DRM_AUTH|DRM_MASTER), + DRM_IOCTL_DEF(DRM_IOCTL_ADD_BUFS, drm_addbufs, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_MARK_BUFS, drm_markbufs, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_INFO_BUFS, drm_infobufs, DRM_AUTH), DRM_IOCTL_DEF(DRM_IOCTL_MAP_BUFS, drm_mapbufs, DRM_AUTH), DRM_IOCTL_DEF(DRM_IOCTL_FREE_BUFS, drm_freebufs, DRM_AUTH), @@ -117,7 +118,6 @@ static drm_ioctl_desc_t drm_ioctls[25 DRM_IOCTL_DEF(DRM_IOCTL_SG_ALLOC, drm_sg_alloc_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_SG_FREE, drm_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), - DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank, 0), DRM_IOCTL_DEF(DRM_IOCTL_MODESET_CTL, drm_modeset_ctl, 0), DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_update_draw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189672 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 02:37:52 2009 New Revision: 189672 URL: http://svn.freebsd.org/changeset/base/189672 Log: Merge r189128 Add a tuneable to allow disabling msi on drm at runtime. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_drv.c Modified: stable/7/sys/dev/drm/drm_drv.c == --- stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 02:36:20 2009 (r189671) +++ stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 02:37:52 2009 (r189672) @@ -134,6 +134,9 @@ static struct cdevsw drm_cdevsw = { .d_flags = D_TRACKCLOSE }; +int drm_msi = 1; /* Enable by default. */ +TUNABLE_INT(hw.drm.msi, drm_msi); + static struct drm_msi_blacklist_entry drm_msi_blacklist[] = { {0x8086, 0x2772}, /* Intel i945G*/ \ {0x8086, 0x27A2}, /* Intel i945GM */ \ @@ -222,7 +225,8 @@ int drm_attach(device_t nbdev, drm_pci_i dev-pci_vendor = pci_get_vendor(dev-device); dev-pci_device = pci_get_device(dev-device); - if (!drm_msi_is_blacklisted(dev-pci_vendor, dev-pci_device)) { + if (drm_msi + !drm_msi_is_blacklisted(dev-pci_vendor, dev-pci_device)) { msicount = pci_msi_count(dev-device); DRM_DEBUG(MSI count = %d\n, msicount); if (msicount 1) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189673 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm
Author: rnoland Date: Wed Mar 11 02:39:02 2009 New Revision: 189673 URL: http://svn.freebsd.org/changeset/base/189673 Log: Merge 189130 Initialize the vblank structures at load time. Previously we did this at irq install/uninstall time, but when we vt switch, we uninstall the irq handler. When the irq handler is reinstalled, the modeset ioctl happens first. The modeset ioctl is supposed to tell us that we can disable vblank interrupts if there are no active consumers. This will fail after a vt switch until another modeset ioctl is called via dpms or xrandr. Leading to cases where either interrupts are on and can't be disabled, or worse, no interrupts at all. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/drm_drv.c stable/7/sys/dev/drm/drm_irq.c stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_drv.h stable/7/sys/dev/drm/i915_irq.c stable/7/sys/dev/drm/mach64_drv.c stable/7/sys/dev/drm/mach64_drv.h stable/7/sys/dev/drm/mach64_irq.c stable/7/sys/dev/drm/mga_dma.c stable/7/sys/dev/drm/mga_irq.c stable/7/sys/dev/drm/r128_drv.c stable/7/sys/dev/drm/r128_drv.h stable/7/sys/dev/drm/r128_irq.c stable/7/sys/dev/drm/radeon_cp.c stable/7/sys/dev/drm/radeon_irq.c Modified: stable/7/sys/dev/drm/drmP.h == --- stable/7/sys/dev/drm/drmP.h Wed Mar 11 02:37:52 2009(r189672) +++ stable/7/sys/dev/drm/drmP.h Wed Mar 11 02:39:02 2009(r189673) @@ -794,6 +794,7 @@ voiddrm_handle_vblank(struct drm_device u32drm_vblank_count(struct drm_device *dev, int crtc); intdrm_vblank_get(struct drm_device *dev, int crtc); void drm_vblank_put(struct drm_device *dev, int crtc); +void drm_vblank_cleanup(struct drm_device *dev); intdrm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq); intdrm_vblank_init(struct drm_device *dev, int num_crtcs); void drm_vbl_send_signals(struct drm_device *dev, int crtc); Modified: stable/7/sys/dev/drm/drm_drv.c == --- stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 02:37:52 2009 (r189672) +++ stable/7/sys/dev/drm/drm_drv.c Wed Mar 11 02:39:02 2009 (r189673) @@ -523,6 +523,8 @@ static void drm_unload(struct drm_device DRM_DEBUG(mtrr_del = %d, retcode); } + drm_vblank_cleanup(dev); + DRM_LOCK(); drm_lastclose(dev); DRM_UNLOCK(); Modified: stable/7/sys/dev/drm/drm_irq.c == --- stable/7/sys/dev/drm/drm_irq.c Wed Mar 11 02:37:52 2009 (r189672) +++ stable/7/sys/dev/drm/drm_irq.c Wed Mar 11 02:39:02 2009 (r189673) @@ -96,7 +96,7 @@ static void vblank_disable_fn(void *arg) } } -static void drm_vblank_cleanup(struct drm_device *dev) +void drm_vblank_cleanup(struct drm_device *dev) { unsigned long irqflags; @@ -213,8 +213,6 @@ int drm_irq_uninstall(struct drm_device bus_teardown_intr(dev-device, dev-irqr, dev-irqh); DRM_LOCK(); - drm_vblank_cleanup(dev); - return 0; } Modified: stable/7/sys/dev/drm/i915_dma.c == --- stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 02:37:52 2009 (r189672) +++ stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 02:39:02 2009 (r189673) @@ -902,6 +902,13 @@ int i915_driver_load(struct drm_device * #endif DRM_SPININIT(dev_priv-user_irq_lock, userirq); + ret = drm_vblank_init(dev, I915_NUM_PIPE); + + if (ret) { + (void) i915_driver_unload(dev); + return ret; + } + return ret; } Modified: stable/7/sys/dev/drm/i915_drv.h == --- stable/7/sys/dev/drm/i915_drv.h Wed Mar 11 02:37:52 2009 (r189672) +++ stable/7/sys/dev/drm/i915_drv.h Wed Mar 11 02:39:02 2009 (r189673) @@ -49,6 +49,8 @@ enum pipe { PIPE_B, }; +#define I915_NUM_PIPE 2 + /* Interface history: * * 1.1: Original. Modified: stable/7/sys/dev/drm/i915_irq.c == --- stable/7/sys/dev/drm/i915_irq.c Wed Mar 11 02:37:52 2009 (r189672) +++ stable/7/sys/dev/drm/i915_irq.c Wed Mar 11 02:39:02 2009 (r189673) @@ -484,11 +484,6 @@ void i915_driver_irq_preinstall(struct d int i915_driver_irq_postinstall(struct drm_device *dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev-dev_private; - int ret, num_pipes = 2; - - ret = drm_vblank_init(dev, num_pipes); - if
svn commit: r189675 - head/sys/powerpc/aim
Author: nwhitehorn Date: Wed Mar 11 03:19:19 2009 New Revision: 189675 URL: http://svn.freebsd.org/changeset/base/189675 Log: Change the PVO zone for fictitious pages to the unmanaged PVO zone, to match the unmanaged flag set in the PVO attributes. Without doing this, pmap_remove() could try to remove fictitious pages (like those created by mmap of physical memory) from the wrong UMA zone, causing a panic. Reported by: Justin Hibbits MFC after:1 week Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c == --- head/sys/powerpc/aim/mmu_oea.c Wed Mar 11 03:00:40 2009 (r189674) +++ head/sys/powerpc/aim/mmu_oea.c Wed Mar 11 03:19:19 2009 (r189675) @@ -1081,8 +1081,11 @@ moea_enter_locked(pmap_t pmap, vm_offset PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* XXX change the pvo head for fake pages */ - if ((m-flags PG_FICTITIOUS) == PG_FICTITIOUS) + if ((m-flags PG_FICTITIOUS) == PG_FICTITIOUS) { + pvo_flags = ~PVO_MANAGED; pvo_head = moea_pvo_kunmanaged; + zone = moea_upvo_zone; + } /* * If this is a managed page, and it's the first reference to the page, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r189625 - head/sys/geom/eli
On Tue, 10 Mar 2009 19:01:57 +0100 Guido van Rooij gu...@gvr.org wrote: On Tue, Mar 10, 2009 at 05:19:48PM +0100, Fabian Keil wrote: Log: When attaching a geli on boot make sure that it is detached upon last close. (needed for a gmirror to properly shutdown upon reboot when a geli is on top the gmirror) Detach-on-last-close is known to cause panics when scrubbing at least some ZFS pools: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/117158 Quoting the PR: |Quoting Pawel Jakub Dawidek's response to my initial report: ||GELI's detach-on-last-close mechanism is a general purpose mechanism, it ||may not work correctly with ZFS, because ZFS sometimes closes and reopen ||providers, which will make GELI to detach. In other words you shouldn't ||configure detach-on-last-close for ZFS components. Grr. So we should make it tuneable. How about being able to set this flag with the geli command, like the G_ELI_FLAG_BOOT flag. -Guido Can we move its implementation into the GEOM framwork such that all of GEOM classes can have detach-on-last-close? It will need some kind of custom hook such that each class can do something extra, i.e. gjournal sync. I often need to stop providers to securely detach USB disks. Hiro ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189676 - head/sys/dev/usb/controller
Author: thompsa Date: Wed Mar 11 04:56:30 2009 New Revision: 189676 URL: http://svn.freebsd.org/changeset/base/189676 Log: Fix a possible NULL pointer access at controller attach. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c == --- head/sys/dev/usb/controller/usb_controller.cWed Mar 11 03:19:19 2009(r189675) +++ head/sys/dev/usb/controller/usb_controller.cWed Mar 11 04:56:30 2009(r189676) @@ -346,7 +346,8 @@ usb2_bus_attach(struct usb2_proc_msg *pm err = usb2_probe_and_attach(child, USB_IFACE_INDEX_ANY); if (!err) { - if (!bus-devices[USB_ROOT_HUB_ADDR]-hub) { + if ((bus-devices[USB_ROOT_HUB_ADDR] == NULL) || + (bus-devices[USB_ROOT_HUB_ADDR]-hub == NULL)) { err = USB_ERR_NO_ROOT_HUB; } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r189677 - head/sys/dev/usb/controller
Author: thompsa Date: Wed Mar 11 04:58:21 2009 New Revision: 189677 URL: http://svn.freebsd.org/changeset/base/189677 Log: MFp4 //depot/projects/usb 158981,159016,159024 Sync support for ATMEGA DCI parts. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/atmegadci.h head/sys/dev/usb/controller/atmegadci_atmelarm.c Modified: head/sys/dev/usb/controller/atmegadci.c == --- head/sys/dev/usb/controller/atmegadci.c Wed Mar 11 04:56:30 2009 (r189676) +++ head/sys/dev/usb/controller/atmegadci.c Wed Mar 11 04:58:21 2009 (r189677) @@ -27,8 +27,9 @@ __FBSDID($FreeBSD$); */ /* - * This file contains the driver for the ATMEGA series USB Device - * Controller + * This file contains the driver for the ATMEGA series USB OTG + * Controller. This driver currently only supports the DCI mode of the + * USB hardware. */ /* @@ -225,8 +226,6 @@ atmegadci_set_address(struct atmegadci_s { DPRINTFN(5, addr=%d\n, addr); - ATMEGA_WRITE_1(sc, ATMEGA_UDADDR, addr); - addr |= ATMEGA_UDADDR_ADDEN; ATMEGA_WRITE_1(sc, ATMEGA_UDADDR, addr); @@ -295,6 +294,8 @@ atmegadci_setup_rx(struct atmegadci_td * if ((req.bmRequestType == UT_WRITE_DEVICE) (req.bRequest == UR_SET_ADDRESS)) { sc-sc_dv_addr = req.wValue[0] 0x7F; + /* must write address before ZLP */ + ATMEGA_WRITE_1(sc, ATMEGA_UDADDR, sc-sc_dv_addr); } else { sc-sc_dv_addr = 0xFF; } @@ -651,6 +652,8 @@ atmegadci_interrupt(struct atmegadci_sof /* clear all set interrupts */ ATMEGA_WRITE_1(sc, ATMEGA_UDINT, ~status); + DPRINTFN(14, UDINT=0x%02x\n, status); + /* check for any bus state change interrupts */ if (status ATMEGA_UDINT_EORSTI) { @@ -722,6 +725,8 @@ atmegadci_interrupt(struct atmegadci_sof if (status ATMEGA_USBINT_VBUSTI) { uint8_t temp; + DPRINTFN(5, USBINT=0x%02x\n, status); + temp = ATMEGA_READ_1(sc, ATMEGA_USBSTA); atmegadci_vbus_interrupt(sc, temp ATMEGA_USBSTA_VBUS); } @@ -733,7 +738,7 @@ atmegadci_interrupt(struct atmegadci_sof if (status) { - DPRINTFN(5, real endpoint interrupt 0x%02x\n, status); + DPRINTFN(5, real endpoint interrupt UEINT=0x%02x\n, status); atmegadci_interrupt_poll(sc); } @@ -1085,7 +1090,7 @@ atmegadci_device_done(struct usb2_xfer * USB_BUS_LOCK_ASSERT(sc-sc_bus, MA_OWNED); - DPRINTFN(2, xfer=%p, pipe=%p, error=%d\n, + DPRINTFN(9, xfer=%p, pipe=%p, error=%d\n, xfer, xfer-pipe, error); if (xfer-flags_int.usb2_mode == USB_MODE_DEVICE) { @@ -1163,15 +1168,7 @@ atmegadci_clear_stall_sub(struct atmegad ATMEGA_UECONX_EPEN | ATMEGA_UECONX_STALLRQC); - if (ep_type == UE_CONTROL) { - /* one bank, 64-bytes wMaxPacket */ - ATMEGA_WRITE_1(sc, ATMEGA_UECFG0X, - ATMEGA_UECFG0X_EPTYPE0); - ATMEGA_WRITE_1(sc, ATMEGA_UECFG1X, - ATMEGA_UECFG1X_ALLOC | - ATMEGA_UECFG1X_EPBK0 | - ATMEGA_UECFG1X_EPSIZE(7)); - } else { + do { temp = 0; if (ep_type == UE_BULK) { temp |= ATMEGA_UECFG0X_EPTYPE2; @@ -1188,13 +1185,13 @@ atmegadci_clear_stall_sub(struct atmegad ATMEGA_WRITE_1(sc, ATMEGA_UECFG1X, ATMEGA_UECFG1X_ALLOC | ATMEGA_UECFG1X_EPBK1 | - ATMEGA_UECFG1X_EPSIZE(7)); + ATMEGA_UECFG1X_EPSIZE(3)); temp = ATMEGA_READ_1(sc, ATMEGA_UESTA0X); if (!(temp ATMEGA_UESTA0X_CFGOK)) { DPRINTFN(0, Chip rejected configuration\n); } - } + } while (0); } static void @@ -1237,16 +1234,21 @@ atmegadci_init(struct atmegadci_softc *s sc-sc_bus.methods = atmegadci_bus_methods; USB_BUS_LOCK(sc-sc_bus); +#if 0 + /* XXX TODO - currently done by boot strap */ /* enable USB PAD regulator */ ATMEGA_WRITE_1(sc, ATMEGA_UHWCON, - ATMEGA_UHWCON_UVREGE); - + ATMEGA_UHWCON_UVREGE | ATMEGA_UHWCON_UIMOD); +#endif /* turn on clocks */ (sc-sc_clocks_on) (sc-sc_bus); + /* make sure device is re-enumerated */ + ATMEGA_WRITE_1(sc, ATMEGA_UDCON, ATMEGA_UDCON_DETACH); + /* wait a little for things to stabilise */ - usb2_pause_mtx(sc-sc_bus.bus_mtx, hz / 1000); + usb2_pause_mtx(sc-sc_bus.bus_mtx, hz / 20); /* enable interrupts */ ATMEGA_WRITE_1(sc, ATMEGA_UDIEN, @@ -1261,7 +1263,7 @@ atmegadci_init(struct atmegadci_softc *s ATMEGA_WRITE_1(sc,
svn commit: r189678 - head/lib/libarchive
Author: kientzle Date: Wed Mar 11 05:11:57 2009 New Revision: 189678 URL: http://svn.freebsd.org/changeset/base/189678 Log: Hack: *Temporarily* disable reading extended attributes from disk, as it seems to be badly broken on ZFS. Modified: head/lib/libarchive/config_freebsd.h Modified: head/lib/libarchive/config_freebsd.h == --- head/lib/libarchive/config_freebsd.hWed Mar 11 04:58:21 2009 (r189677) +++ head/lib/libarchive/config_freebsd.hWed Mar 11 05:11:57 2009 (r189678) @@ -34,8 +34,12 @@ #defineHAVE_ACL_SET_FD_NP 1 #defineHAVE_ACL_SET_FILE 1 #defineHAVE_ACL_USER 1 +#if 0 +/* XXX Temporarily disable support for reading extended attributes from + * disk, as it seems to be badly broken on ZFS. XXX */ #defineHAVE_EXTATTR_GET_FILE 1 #defineHAVE_EXTATTR_LIST_FILE 1 +#endif #defineHAVE_EXTATTR_SET_FD 1 #defineHAVE_EXTATTR_SET_FILE 1 #defineHAVE_SYS_ACL_H 1 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org