]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoAR933x CPU device improvements:
Adrian Chadd [Sat, 30 Mar 2013 04:31:29 +0000 (04:31 +0000)]
AR933x CPU device improvements:

* Add baud rate and divisor programming code. See below for more
  information.

* Flesh out ar933x_init() to disable interrupts and program the initial
  console setup.

* Remove #if 0'ed code from ar933x_term().

* Explain what these functions do.

Now, the baud rate and divisor code comes from Linux, as a submission
to the OpenWRT project and Linux kernel from
Gabor Juhos <juhosg@openwrt.org>.

The original ticket for this code is https://dev.openwrt.org/ticket/12031 .

I've contacted Gabor and asked for his permission to also licence the patch
in question (which covers this code) to BSD lience and he's agreed.
Hence why I'm including it here in FreeBSD.

Tested:

* AP121 (AR9330)

11 years agoAR933x UART updates:
Adrian Chadd [Sat, 30 Mar 2013 04:13:47 +0000 (04:13 +0000)]
AR933x UART updates:

* Default clock is 25MHz;
* Remove the UART register macro here - it's not needed as we don't need
  to "adjust" the register offset / spacing at all;
* Remove unused fields in the softc.

Tested:

* AP121

11 years agocxgbe(4): Add support for Chelsio's Terminator 5 (aka T5) ASIC. This
Navdeep Parhar [Sat, 30 Mar 2013 02:26:20 +0000 (02:26 +0000)]
cxgbe(4):  Add support for Chelsio's Terminator 5 (aka T5) ASIC.  This
includes support for the NIC and TOE features of the 40G, 10G, and
1G/100M cards based on the T5.

The ASIC is mostly backward compatible with the Terminator 4 so cxgbe(4)
has been updated instead of writing a brand new driver.  T5 cards will
show up as cxl (short for cxlgb) ports attached to the t5nex bus driver.

Sponsored by: Chelsio

11 years agoAdds the ability to enable / disable sorting of BIO requests queued within
Steven Hartland [Fri, 29 Mar 2013 22:58:15 +0000 (22:58 +0000)]
Adds the ability to enable / disable sorting of BIO requests queued within
CAM. This can significantly improve performance particularly for SSDs
which don't suffer from seek latencies.

The sysctl / tunable kern.cam.sort_io_queues provides the systems default
setting where:-
0 = queued BIOs are NOT sorted
1 = queued BIOs are sorted (default)

Each device gets its own sysctl kern.cam.<type>.<id>.sort_io_queue
Valid values are:-
-1 = use system default (default)
0 = queued BIOs are NOT sorted
1 = queued BIOs are sorted

Note: Additional patch will look to add automatic use of none sorted queues
for none rotating media e.g. SSD's

Reviewed by: scottl
Approved by: pjd (mentor)
MFC after: 2 weeks

11 years agoKeep fwd_tag around for subsequent pcb lookups
Ed Maste [Fri, 29 Mar 2013 20:51:44 +0000 (20:51 +0000)]
Keep fwd_tag around for subsequent pcb lookups

For TIMEWAIT handling tcp_input may have to jump back for an additional
pass through pcblookup.  Prior to this change the fwd_tag had been
discarded after the first lookup, so a new connection attempt delivered
locally via 'ipfw fwd' would fail to find a match.

As of r248886 the tag will be detached and freed when passed to the
socket buffer.

11 years agoAdd "type" to nvme_request, signifying if its payload is a VADDR, UIO, or
Jim Harris [Fri, 29 Mar 2013 20:34:28 +0000 (20:34 +0000)]
Add "type" to nvme_request, signifying if its payload is a VADDR, UIO, or
NULL. This simplifies decisions around if/how requests are routed through
busdma.  It also paves the way for supporting unmapped bios.

Sponsored by: Intel

11 years agoDisable this; it's a local option that I haven't yet committed to -HEAD.
Adrian Chadd [Fri, 29 Mar 2013 20:07:51 +0000 (20:07 +0000)]
Disable this; it's a local option that I haven't yet committed to -HEAD.

11 years agoAdd userland access to at91 gpio functionality via ioctl calls. Also,
Ian Lepore [Fri, 29 Mar 2013 19:52:57 +0000 (19:52 +0000)]
Add userland access to at91 gpio functionality via ioctl calls.  Also,
add the ability for userland to be notified of changes on gpio pins via
a select(2)/read(2) interface.

Change the interrupt handler from filtered to threaded.

Because of the uiomove() calls in the new interface, change locking from
standard mutex to sx.

Add / restore the at91_gpio_high_z() function.

Reviewed by: imp (long ago)

11 years agoChange the API for at91_pio_gpio_get() to return the entire masked set
Ian Lepore [Fri, 29 Mar 2013 19:04:18 +0000 (19:04 +0000)]
Change the API for at91_pio_gpio_get() to return the entire masked set
of bits, not just a 0/1 indicating whether any of the masked bits are on.
This is compatible with the single in-tree caller of this function right now
(at91_vbus_poll() in dev/usb/controller/at91dci_atemelarm.c).

11 years agoCall soc_info.soc_data->soc_clock_init() before at91_pmc_init_clock(), so
Ian Lepore [Fri, 29 Mar 2013 18:47:08 +0000 (18:47 +0000)]
Call soc_info.soc_data->soc_clock_init() before at91_pmc_init_clock(), so
that the latter correctly fills in the clock data structures based on
proper hardware-specific shift and mask values from the soc_data structure.

11 years agoChange the define in the header to eliminate unnecessary data
Jack F Vogel [Fri, 29 Mar 2013 18:46:13 +0000 (18:46 +0000)]
Change the define in the header to eliminate unnecessary data
when using LEGACY TX.

11 years agoAdd a couple forward declarations, so that board support routines don't have
Ian Lepore [Fri, 29 Mar 2013 18:43:10 +0000 (18:43 +0000)]
Add a couple forward declarations, so that board support routines don't have
to pre-include a bunch of header files they don't need just to use this one.

11 years agoChange defines in the igb driver to allow an easier selection of
Jack F Vogel [Fri, 29 Mar 2013 18:25:45 +0000 (18:25 +0000)]
Change defines in the igb driver to allow an easier selection of
the older if_start/non-multiqueue interface from the stack. This
is not the default, but can be turned on in the Makefile now regardless
of the OS level to allow either testing or use of ALTQ.

MFC after: one week

11 years agoRedo the workaround for at91rm9200 erratum #26 in a way that doesn't
Ian Lepore [Fri, 29 Mar 2013 18:17:51 +0000 (18:17 +0000)]
Redo the workaround for at91rm9200 erratum #26 in a way that doesn't
cause a lockup on some rm92 hardware.

11 years agoFix a typo: the RXD0 pin is PA18, not PA19.
Ian Lepore [Fri, 29 Mar 2013 18:06:54 +0000 (18:06 +0000)]
Fix a typo: the RXD0 pin is PA18, not PA19.

11 years agoTwo small fixes:
Jack F Vogel [Fri, 29 Mar 2013 18:03:00 +0000 (18:03 +0000)]
Two small fixes:
  Set promiscuous code was unconditionally turning off multicast when
  turning off promiscuous mode, this should only be done when there are
  less than MAX groups. Thanks to Mike Karels for this correction.

  Second, the overtmp interrupt setup/detection was wrong, correcting it.

MFC after: one week

11 years agoRemove a really noisy printf left over from debugging hardware errata.
Ian Lepore [Fri, 29 Mar 2013 17:57:24 +0000 (17:57 +0000)]
Remove a really noisy printf left over from debugging hardware errata.

11 years agoAdd bus_dmamap_load_bio for non-CAM disk drivers that wish to enable
Jim Harris [Fri, 29 Mar 2013 16:26:25 +0000 (16:26 +0000)]
Add bus_dmamap_load_bio for non-CAM disk drivers that wish to enable
unmapped I/O.

Sponsored by: Intel
Reviewed by: kib

11 years agoAdd CTR5() to bus_dmamap_load_ccb, similar to other bus_dmamap_load_*
Jim Harris [Fri, 29 Mar 2013 16:00:16 +0000 (16:00 +0000)]
Add CTR5() to bus_dmamap_load_ccb, similar to other bus_dmamap_load_*
functions.

Sponsored by: Intel

11 years agoDo not add 1 to nsegs before passing to CTR5(), since nsegs
Jim Harris [Fri, 29 Mar 2013 15:54:12 +0000 (15:54 +0000)]
Do not add 1 to nsegs before passing to CTR5(), since nsegs
has already been incremented before these calls.

Sponsored by: Intel

11 years agoPass correct parameter to CTR5() in bus_dmamap_load_uio.
Jim Harris [Fri, 29 Mar 2013 15:51:45 +0000 (15:51 +0000)]
Pass correct parameter to CTR5() in bus_dmamap_load_uio.

Sponsored by: Intel

11 years agoFix bug in m_split() in a case when split len matches len of the
Gleb Smirnoff [Fri, 29 Mar 2013 14:10:40 +0000 (14:10 +0000)]
Fix bug in m_split() in a case when split len matches len of the
first mbuf, and the first mbuf is M_PKTHDR.

PR: kern/176144
Submitted by: Jacques Fourie <jacques.fourie gmail.com>

11 years agoOnce ng_ksocket(4) is fixed, re-apply r194662. See this revision for
Gleb Smirnoff [Fri, 29 Mar 2013 14:06:04 +0000 (14:06 +0000)]
Once ng_ksocket(4) is fixed, re-apply r194662. See this revision for
longer description.

Discussed with: andre, rwatson
Sponsored by: Nginx, Inc.

11 years agoRevamp mbuf handling in ng_ksocket_incoming2():
Gleb Smirnoff [Fri, 29 Mar 2013 14:04:26 +0000 (14:04 +0000)]
Revamp mbuf handling in ng_ksocket_incoming2():

- Clear code that workarounded a bug in FreeBSD 3,
  and even predated import of netgraph(4).
- Clear workaround for m_nextpkt pointing into
  next record in buffer (fixed in r248884).
  Assert that m_nextpkt is clear.
- Do not rely on SOCK_STREAM sockets containing
  M_PKTHDR mbufs. Create a header ourselves and
  attach chain to it. This is correct fix for
  kern/154676.

PR: kern/154676
Sponsored by: Nginx, Inc

11 years agoWhen soreceive_generic() hands off an mbuf from buffer,
Gleb Smirnoff [Fri, 29 Mar 2013 13:57:55 +0000 (13:57 +0000)]
When soreceive_generic() hands off an mbuf from buffer,
clear its pointer to next record, since next record
belongs to the buffer, and shouldn't be leaked.

The ng_ksocket(4) used to clear this pointer itself,
but the correct place is here.

Sponsored by: Nginx, Inc

11 years agoWhitespace.
Gleb Smirnoff [Fri, 29 Mar 2013 13:53:14 +0000 (13:53 +0000)]
Whitespace.

11 years agoNon-functional cleanup of ng_ksocket_incoming2().
Gleb Smirnoff [Fri, 29 Mar 2013 13:51:01 +0000 (13:51 +0000)]
Non-functional cleanup of ng_ksocket_incoming2().

11 years agoUnbreak compilation after r248868.
Marius Strobl [Fri, 29 Mar 2013 11:53:20 +0000 (11:53 +0000)]
Unbreak compilation after r248868.

11 years agoMake pre-shutdown flush and spindown routines to not use xpt_polled_action(),
Alexander Motin [Fri, 29 Mar 2013 08:33:18 +0000 (08:33 +0000)]
Make pre-shutdown flush and spindown routines to not use xpt_polled_action(),
but execute the commands in regular way.  There is no any reason to cook CPU
while the system is still fully operational.  After this change polling in
CAM is used only for kernel dumping.

11 years agoRemove EOL whitespace.
Joel Dahl [Fri, 29 Mar 2013 08:32:49 +0000 (08:32 +0000)]
Remove EOL whitespace.

11 years agoMinor mdoc fix.
Joel Dahl [Fri, 29 Mar 2013 08:12:09 +0000 (08:12 +0000)]
Minor mdoc fix.

11 years agoImplement CAM_PERIPH_FOREACH() macro, safely iterating over the list of
Alexander Motin [Fri, 29 Mar 2013 07:50:47 +0000 (07:50 +0000)]
Implement CAM_PERIPH_FOREACH() macro, safely iterating over the list of
driver's periphs, acquiring and releaseing periph references while doing it.

Use it to iterate over the lists of ada and da periphs when flushing caches
and putting devices to sleep on shutdown and suspend.  Previous code could
panic in theory if some device disappear in the middle of the process.

11 years agoFor the AR933x UART, the serial clock is not the AHB clock, it's the
Adrian Chadd [Fri, 29 Mar 2013 06:32:39 +0000 (06:32 +0000)]
For the AR933x UART, the serial clock is not the AHB clock, it's the
reference clock.  So use that instead.

11 years ago* Fix clock register definitions
Adrian Chadd [Fri, 29 Mar 2013 06:32:02 +0000 (06:32 +0000)]
* Fix clock register definitions
* Add maximum clock register values

11 years agoPrint out the platform reference frequency.
Adrian Chadd [Fri, 29 Mar 2013 06:31:31 +0000 (06:31 +0000)]
Print out the platform reference frequency.

This is useful for AR933x platforms where that matters.

11 years ago - Update hardware notes to reflect that amd64 is no longer "young"[1]
Glen Barber [Thu, 28 Mar 2013 22:52:42 +0000 (22:52 +0000)]
 - Update hardware notes to reflect that amd64 is no longer "young"[1]
 - Bump copyright year

Patched by: skreuzer

11 years agoWelcome clang as the default compiler on ARM.
Andrew Turner [Thu, 28 Mar 2013 22:49:49 +0000 (22:49 +0000)]
Welcome clang as the default compiler on ARM.

Change the default compiler for little-endian ARM to clang to allow for more
testing before 10.0 is released. As LLVM and clang currnetly lack support
for big-endian ARM leave gcc as the default there.

This will also allow us to investigate moving to use the hard floating-point
version of the ARM EABI on SoCs that include the Vector Floating Point unit.
A version of this is included in all ARMv6 and ARMv7 SoCs we currently, and
are likely to support.

Both the current ABI and the new EABI are supported by clang and it will be
built correctly depending on which is selected by the user.

11 years agoAllow caller to skip 'guest linear address' validation when doing instruction
Neel Natu [Thu, 28 Mar 2013 21:26:19 +0000 (21:26 +0000)]
Allow caller to skip 'guest linear address' validation when doing instruction
decode. This is to accomodate hardware assist implementations that do not
provide the 'guest linear address' as part of nested page fault collateral.

Submitted by: Anish Gupta (akgupt3 at gmail dot com)

11 years agoReverse the order of some implicit commands (FS mounts and ifconfigs)
Jamie Gritton [Thu, 28 Mar 2013 21:02:49 +0000 (21:02 +0000)]
Reverse the order of some implicit commands (FS mounts and ifconfigs)
when stopping jails.  This matters particularly for nested filesystem
mounts.

PR: kern/177325
Submitted by: Harald Schmalzbauer
MFC after: 3 days

11 years agoInitial (unfinished!) AR933x support.
Adrian Chadd [Thu, 28 Mar 2013 20:48:58 +0000 (20:48 +0000)]
Initial (unfinished!) AR933x support.

11 years agoIgnore interface renames instead of removing the interface from the bridge
Mark Johnston [Thu, 28 Mar 2013 20:37:07 +0000 (20:37 +0000)]
Ignore interface renames instead of removing the interface from the bridge
group.

Reviewed by: rstone
Approved by: rstone (co-mentor)
Sponsored by: Sandvine Incorporated
MFC after: 1 week

11 years agoUpdate to upstream version 2.7
Tony Finch [Thu, 28 Mar 2013 20:33:07 +0000 (20:33 +0000)]
Update to upstream version 2.7

The most notable new feature is support for processing multiple
files in one invocation. There is also support for more make-friendly
exit statuses.

The most notable bug fix is #line directives now include the input
file name.

Obtained from: http://dotat.at/prog/unifdef

11 years agoCommit a patch that fixes a problem in the #pragma statement when searching
George V. Neville-Neil [Thu, 28 Mar 2013 20:31:03 +0000 (20:31 +0000)]
Commit a patch that fixes a problem in the #pragma statement when searching
for and loading dependent modules.  This addresses a bug seen with
io.d where it was being doubly included.

PR: 171678
Submitted by:  Mark Johnston
MFC after: 2 weeks

11 years agoRevert previous change in favor of a fix to the actual dtrace
George V. Neville-Neil [Thu, 28 Mar 2013 20:22:43 +0000 (20:22 +0000)]
Revert previous change in favor of a fix to the actual dtrace
libraries that addresses a #pragma issue.

11 years agoRemove dependency code that caused a double inclusion.
George V. Neville-Neil [Thu, 28 Mar 2013 20:12:46 +0000 (20:12 +0000)]
Remove dependency code that caused a double inclusion.

Pointed out by: rpaulo and others

11 years agoTie in the AR933x support into -HEAD.
Adrian Chadd [Thu, 28 Mar 2013 19:30:56 +0000 (19:30 +0000)]
Tie in the AR933x support into -HEAD.

11 years agoBring over the initial, CPU-only UART support for the AR933x SoC.
Adrian Chadd [Thu, 28 Mar 2013 19:27:06 +0000 (19:27 +0000)]
Bring over the initial, CPU-only UART support for the AR933x SoC.

This implements the kernel glue needed (getc, putc, rxready).

This isn't a 16550 UART, even if the datasheet overview claims so.

The Linux ar933x support was used as a reference, however the uart code
is a reimplementation.

Attentive viewers will note that the uart code is based off of the ns8250
code and the UART bus code is a stubbed-out version of this.  I'll be
replacing it with non-stubbed versions soon, making this a fully featured
driver.

Tested:

* AP121 reference board (AR933x), booting through the mountroot> prompt;
  then doing some basic interactive tests in ddb.

11 years agoUpdate hwpmc to support Haswell class processors.
Sean Bruno [Thu, 28 Mar 2013 19:15:54 +0000 (19:15 +0000)]
Update hwpmc to support Haswell class processors.
0x3C:      /* Per Intel document 325462-045US 01/2013. */

Add manpage to document all the goodness that is available in this
processor model.

Submitted by: hiren panchasara <hiren.panchasara@gmail.com>
Reviewed by: jimharris, sbruno
Obtained from: Yahoo! Inc.
MFC after: 2 weeks

11 years agoAdd the "-g <gdport>" option to the vmrun.sh script that enables remote
Neel Natu [Thu, 28 Mar 2013 18:03:39 +0000 (18:03 +0000)]
Add the "-g <gdport>" option to the vmrun.sh script that enables remote
debugging of the guest via kgdb.

See also: https://wiki.freebsd.org/BHyVe/gdb

Obtained from: NetApp

11 years agoKGDB: Accept KLD symbol files with the ".symbols" extension.
Will Andrews [Thu, 28 Mar 2013 17:07:02 +0000 (17:07 +0000)]
KGDB: Accept KLD symbol files with the ".symbols" extension.

Submitted by: gibbs
Approved by: ken (mentor)
Sponsored by: Spectra Logic
MFC after: 1 month

11 years agoKGDB: Allow modules to be loaded from the specified kernel's directory.
Will Andrews [Thu, 28 Mar 2013 17:04:59 +0000 (17:04 +0000)]
KGDB: Allow modules to be loaded from the specified kernel's directory.

When looking up the absolute path for a kld, call find_kld_path() first.
This enables locating the module in a different directory than the one
stored in kernel memory.

With this change, kgdb can now be run on a kernel & vmcore whose associated
modules are located in the same directory as the kernel.  This makes
independent triaging of problems much easier.

This change also does not break the normal kgdb use case where no arguments
are specified; in that case kgdb loads the running kernel and its modules.

Reviewed by: adrian
Approved by: ken (mentor)
Sponsored by: Spectra Logic
MFC after: 1 month

11 years agoRemove obsolete comment. This code has now been tested with the QEMU
Jim Harris [Thu, 28 Mar 2013 16:57:48 +0000 (16:57 +0000)]
Remove obsolete comment.  This code has now been tested with the QEMU
NVMe device emulator.

11 years agoDelete extra IO qpairs allocated based on number of MSI-X vectors, but
Jim Harris [Thu, 28 Mar 2013 16:54:19 +0000 (16:54 +0000)]
Delete extra IO qpairs allocated based on number of MSI-X vectors, but
later found to not be usable because the controller doesn't support the
same number of queues.

This is not the normal case, but does occur with the Chatham prototype
board.

Sponsored by: Intel

11 years agoSeveral fixes and improvements to sendfile()
Scott Long [Thu, 28 Mar 2013 14:14:28 +0000 (14:14 +0000)]
Several fixes and improvements to sendfile()

1.  If we wanted to send exactly as many bytes as the socket buffer is
    sized for, the inner loop of kern_sendfile() would see that the
    socket is full before seeing that it had no more bytes left to send.
    This would cause it to return EAGAIN to the caller instead of
    success.  Fix by changing the order that these conditions are tested.
2.  Simplify the calculation for the bytes to send in each iteration of
    the inner loop of kern_sendfile()
3.  Fix some calls with bogus arguments to sf_buf_ext().  These would
    only trigger on mbuf allocation failure, but would be hilariously
    bad if they did trigger.

Submitted by: gibbs(3), andre(2)
Reviewed by: emax, andre
Obtained from: Netflix
MFC after: 1 week

11 years agoAdd myself as ports committer.
Tijl Coosemans [Thu, 28 Mar 2013 12:46:04 +0000 (12:46 +0000)]
Add myself as ports committer.

Approved by: crees (mentor)

11 years agoRestore DB_COMMAND capabilities of ciss(4) for debugging and diagnostics
Sean Bruno [Thu, 28 Mar 2013 12:44:43 +0000 (12:44 +0000)]
Restore DB_COMMAND capabilities of ciss(4) for debugging and diagnostics

Obtained from: Yahoo! Inc.
MFC after: 2 weeks

11 years agoExcept one case mps(4) driver does not touch the data and works well with
Alexander Motin [Thu, 28 Mar 2013 11:24:30 +0000 (11:24 +0000)]
Except one case mps(4) driver does not touch the data and works well with
unmapped I/O.  That one exception is access to INQUIRY VPD request result.
Those requests are never unmapped now, but to be safe add respective check
there and allow unmapped I/O for the SIM by setting PIM_UNMAPPED flag.

11 years agoFix compile of ciss(4) with CISS_DEBUG defined
Sean Bruno [Thu, 28 Mar 2013 11:00:41 +0000 (11:00 +0000)]
Fix compile of ciss(4) with CISS_DEBUG defined

Obtained from: Yahoo! Inc.
MFC after: 2 weeks

11 years agorc.subr: disabling globbing while processing devfs rules
Andriy Gapon [Thu, 28 Mar 2013 08:13:52 +0000 (08:13 +0000)]
rc.subr: disabling globbing while processing devfs rules

The rules themselves typically have shell-like patterns and it is
incorrect when they get replaced with matching filesystem entries.

Shell magic by: jilles
MFC after: 2 weeks

11 years agoRelease the v_writecount reference on the vnode in case of error,
Konstantin Belousov [Thu, 28 Mar 2013 06:39:27 +0000 (06:39 +0000)]
Release the v_writecount reference on the vnode in case of error,
before the vnode is vput() in vm_mmap_vnode().  Error return means
that there is no use reference on the vnode from the vm object
reference, and failing to restore v_writecount breaks the invariant
that v_writecount is less or equal to the usecount.

The situation observed when nfs client returns ESTALE for
VOP_GETATTR() after the open.

In collaboration with: pho
MFC after: 1 week

11 years agoFix the AR933x platform device start/stop code.
Adrian Chadd [Thu, 28 Mar 2013 05:43:03 +0000 (05:43 +0000)]
Fix the AR933x platform device start/stop code.

This was ported from the AR724x code and I think that also doesn't
quite work.  I'll investigate that soon.

With this in place the system reset path works, so 'reset' from kdb
actually resets the SoC.

Tested:

* AP121 test board

11 years agoMake sure that ${SHLIB_NAME}.debug and ${SHLIB_NAME}.symbols are always
Mark Johnston [Thu, 28 Mar 2013 04:13:52 +0000 (04:13 +0000)]
Make sure that ${SHLIB_NAME}.debug and ${SHLIB_NAME}.symbols are always
deleted by a "make clean" when DEBUG_FLAGS is set.

Reported by: gleb
Approved by: emaste (co-mentor)

11 years agoUpdate wiht the times.
Warner Losh [Thu, 28 Mar 2013 02:44:15 +0000 (02:44 +0000)]
Update wiht the times.

11 years agodeferal -> deferral
Jim Harris [Wed, 27 Mar 2013 23:07:43 +0000 (23:07 +0000)]
deferal -> deferral

11 years agobtowc(3), isblank(3): Correct prototypes for _l variants.
Jilles Tjoelker [Wed, 27 Mar 2013 21:31:40 +0000 (21:31 +0000)]
btowc(3), isblank(3): Correct prototypes for _l variants.

MFC after: 1 week

11 years agoSimilar to r239870 and r239872, teach the other binutils tools about the
Dimitry Andric [Wed, 27 Mar 2013 19:21:36 +0000 (19:21 +0000)]
Similar to r239870 and r239872, teach the other binutils tools about the
DW_FORM_flag_present dwarf attribute, so they do not print errors or
warnings on files that contain it.  (This attribute can be emitted by
newer versions of clang and gcc.)

MFC after: 1 week

11 years agoOn SIM destruction free associated CCBs, preallocated inside xpt_get_ccb().
Alexander Motin [Wed, 27 Mar 2013 18:55:01 +0000 (18:55 +0000)]
On SIM destruction free associated CCBs, preallocated inside xpt_get_ccb().
Before this change they were just leaked.  Fortunately USB sticks now use
only one CCB, and so leak was only 2KB per detach, while other bigger SIMs
with much more allocated CCBs are rarely detached.

MFC after: 2 weeks

11 years agoLimit the amount of video memory we map for the driver to the maximum value.
Jung-uk Kim [Wed, 27 Mar 2013 18:06:28 +0000 (18:06 +0000)]
Limit the amount of video memory we map for the driver to the maximum value.
This basically restores the spirit of r203535, which was partially reverted
in r205557, while we still map fixed amount to work around transient issues
we experienced with r203535.

Prodded by: avg
Tested by: avg
MFC after: 1 week

11 years agoProperly spell "Class Based Queueing"
Rene Ladan [Wed, 27 Mar 2013 15:10:40 +0000 (15:10 +0000)]
Properly spell "Class Based Queueing"

PR: www/177412
Submitted by: Oliver Loch <grimeton@gmx.net>
Approved by: cognet

11 years agoFix a typo, 'xdev-build' should be spelled with a 'd' at the end.
Rene Ladan [Wed, 27 Mar 2013 15:03:18 +0000 (15:03 +0000)]
Fix a typo, 'xdev-build' should be spelled with a 'd' at the end.

Approved by: cognet

11 years agoFix a race with the vnode reclamation in the aio_qphysio(). Obtain
Konstantin Belousov [Wed, 27 Mar 2013 11:47:52 +0000 (11:47 +0000)]
Fix a race with the vnode reclamation in the aio_qphysio().  Obtain
the thread reference on the vp->v_rdev and use the returned struct
cdev *dev instead of using vp->v_rdev.  Call dev_strategy_csw()
instead of dev_strategy(), since we now own the reference.

Since the csw was already calculated, test d_flags to avoid mapping
the buffer if the driver supports unmapped requests [*].

Suggested by: kan [*]
Reviewed by: kan (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

11 years agoAdd dev_strategy_csw() function, which is similar to dev_strategy()
Konstantin Belousov [Wed, 27 Mar 2013 11:34:27 +0000 (11:34 +0000)]
Add dev_strategy_csw() function, which is similar to dev_strategy()
but assumes that a thread reference was already obtained on the passed
device.  Use the function from physio(), to avoid two extra dev_mtx
lock and unlock.  Note that physio() is always used as the cdevsw
method, or is called from a cdevsw method, and the caller already owns
the reference.

dev_strategy() is left to keep KPI intact, but now it is implemented
as a wrapper around dev_strategy_csw().

Do some style cleanup in physio().

Requested and reviewed by: kan (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

11 years agoOn i386, double the default size of the bio transient map. With the
Konstantin Belousov [Wed, 27 Mar 2013 10:56:15 +0000 (10:56 +0000)]
On i386, double the default size of the bio transient map.  With the
maxbcache size fixed, the auto-tuned transient map is too small for
real-world load on i386.

Tested by: David Wolfskill
Sponsored by: The FreeBSD Foundation

11 years agoFix the VM_BCACHE_SIZE_MAX definition on i386 to match the maximal
Konstantin Belousov [Wed, 27 Mar 2013 10:52:18 +0000 (10:52 +0000)]
Fix the VM_BCACHE_SIZE_MAX definition on i386 to match the maximal
buffer map size, auto-tuned on the 4GB machine.  Having the maxbcache
bigger than the buffer map causes the transient bio map sizing logic
to assume that there is enough KVA to use approximately 90MB (buffer
map is sized to 110MB, and maxbcache is 200MB).  The increase in the
KVA usage caused other big KVA consumers, like nvidia.ko, to fail the
initialization.

Change the definition for both PAE and non-PAE cases, since PAE is
even more KVA-starved.

Reported and tested by: David Wolfskill
Discussed with: alc
Sponsored by: The FreeBSD Foundation

11 years agoUpdate to 9.8.4-P2
Erwin Lansing [Wed, 27 Mar 2013 10:11:43 +0000 (10:11 +0000)]
Update to 9.8.4-P2

Removed the check for regex.h in configure in order
to disable regex syntax checking, as it exposes
BIND to a critical flaw in libregex on some
platforms. [RT #32688]

Security: CVE-2013-2266
Approved by: delphij (mentor)
Sponsored by: DK Hostmaster A/S

11 years agoAdd Subsystem ID field to the quirk table. Use it to identify Mac Pro 1,1,
Alexander Motin [Wed, 27 Mar 2013 07:30:08 +0000 (07:30 +0000)]
Add Subsystem ID field to the quirk table.  Use it to identify Mac Pro 1,1,
which requires OVREF to be set to get proper playback volume, but which has
all zeroes in HDA controller subdevice IDs on PCI.

MFC after: 1 month
Sponsored by:

11 years agoVendor import of Bind 9.8.4-P2
Erwin Lansing [Wed, 27 Mar 2013 07:15:01 +0000 (07:15 +0000)]
Vendor import of Bind 9.8.4-P2

Approved by: delphij (mentor)
Sponsored by: DK Hostmaster A/S

11 years agoAdd missing space
Bryan Venteicher [Wed, 27 Mar 2013 07:11:29 +0000 (07:11 +0000)]
Add missing space

MFC after: 3 days

11 years agoCommit initial (unfinished!) support for the AR933x series of embedded
Adrian Chadd [Wed, 27 Mar 2013 03:38:58 +0000 (03:38 +0000)]
Commit initial (unfinished!) support for the AR933x series of embedded
CPUs.

The AR933x is a mips24k based SoC with an AR9380 series SoC on board,
two gigabit ethernet interfaces and an internal 10/100mbit ethernet
switch.  There's also the normal interfaces (USB, ethernet, uart, GPIO.)

The downside? There's a non-ns8250 UART device.

With a very basic UART driver (not in this commit) the SoC is initialised
and boots up.  I'll commit the UART code soon and then link it into the
general setup path.

This code is a re-implementation based from the Linux kernel / openwrt
AR933x support.

TODO:

* UART (obviously)
* All of the ethernet, USB and wifi SoC glue, including ethernet PLL
  programming.

11 years agoAdd the reference clock for each supported chip.
Adrian Chadd [Wed, 27 Mar 2013 03:33:19 +0000 (03:33 +0000)]
Add the reference clock for each supported chip.

Obtained from: Linux (openwrt)

11 years agoFix printf format issue on i386.
Jim Harris [Wed, 27 Mar 2013 00:37:00 +0000 (00:37 +0000)]
Fix printf format issue on i386.

Reported by: bz

11 years ago* Stop processing after HAL_EIO; this is what the reference driver does.
Adrian Chadd [Wed, 27 Mar 2013 00:35:45 +0000 (00:35 +0000)]
* Stop processing after HAL_EIO; this is what the reference driver does.
* If we hit an empty queue condition (which I haven't yet root caused, grr.)
  .. make sure we release the lock before continuing.

11 years agoPanic should the SCI framework ever request a pointer into the ccb's
Jim Harris [Wed, 27 Mar 2013 00:15:22 +0000 (00:15 +0000)]
Panic should the SCI framework ever request a pointer into the ccb's
data buffer for a ccb that is unmapped.

This case is currently not possible, since the SCI framework only
requests these pointers for doing SCSI/ATA translation of non-
READ/WRITE commands.  The panic is more to protect against the
unlikely future scenario where additional commands could be unmapped.

Sponsored by: Intel

11 years agoLoosen restrictions for quoted strings. Now we can use more complex strings
Jung-uk Kim [Tue, 26 Mar 2013 23:58:13 +0000 (23:58 +0000)]
Loosen restrictions for quoted strings.  Now we can use more complex strings
and "escaped" quote characters.

MFC after: 1 month

11 years agoFix interval-based rotations when the -t flag is used. In this case, find
Mark Johnston [Tue, 26 Mar 2013 23:11:30 +0000 (23:11 +0000)]
Fix interval-based rotations when the -t flag is used. In this case, find
the most-recently archived logfile and use its mtime to determine whether
or not to rotate, as in the non-timestamped case.

Previously we would just try to use the mtime of <logfile>.0, which always
results in a rotation since it generally doesn't exist in the -t case.

PR: bin/166448
Approved by: emaste (co-mentor)
Tested by: Marco Steinbach <coco executive-computing.de>
MFC after: 2 weeks

11 years agoReport support for unmapped I/O by adding PIM_UNMAPPED flag.
Jim Harris [Tue, 26 Mar 2013 23:04:06 +0000 (23:04 +0000)]
Report support for unmapped I/O by adding PIM_UNMAPPED flag.

Submitted by: jhb, scottl

11 years agoaccept(2): Mention inheritance of O_ASYNC and signal destination.
Jilles Tjoelker [Tue, 26 Mar 2013 22:46:56 +0000 (22:46 +0000)]
accept(2): Mention inheritance of O_ASYNC and signal destination.

While almost nobody uses O_ASYNC, and rightly so, the inheritance of the
related properties across accept() is a portability issue like the
inheritance of O_NONBLOCK.

11 years agoClean up debug prints.
Jim Harris [Tue, 26 Mar 2013 22:17:10 +0000 (22:17 +0000)]
Clean up debug prints.

1) Consistently use device_printf.
2) Make dump_completion and dump_command into something more
    human-readable.

Sponsored by: Intel
Reviewed by: carl

11 years agoUse errno and strerror to print more descriptive messages when operations
Jim Harris [Tue, 26 Mar 2013 22:14:47 +0000 (22:14 +0000)]
Use errno and strerror to print more descriptive messages when operations
fail in nvmecontrol(8).

While here, use consistent checks of return values from stat, open and
ioctl.

Sponsored by: Intel
Suggested by: carl
Reviewed by: carl

11 years agoMove common code from the different nvme_allocate_request functions into a
Jim Harris [Tue, 26 Mar 2013 22:13:07 +0000 (22:13 +0000)]
Move common code from the different nvme_allocate_request functions into a
separate function.

Sponsored by: Intel
Suggested by: carl
Reviewed by: carl

11 years agoChange a number of malloc(9) calls to use M_WAITOK instead of
Jim Harris [Tue, 26 Mar 2013 22:11:34 +0000 (22:11 +0000)]
Change a number of malloc(9) calls to use M_WAITOK instead of
M_NOWAIT.

Sponsored by: Intel
Suggested by: carl
Reviewed by: carl

11 years agoReplace usages of mtx_pool_find used for admin commands with a polling
Jim Harris [Tue, 26 Mar 2013 22:09:51 +0000 (22:09 +0000)]
Replace usages of mtx_pool_find used for admin commands with a polling
mechanism.

Now that all requests are timed, we are guaranteed to get a completion
notification, even if it is an abort status due to a timed out admin
command.

This has the effect of simplifying the controller and namespace setup
code, so that it reads straight through rather than broken up into
a bunch of different callback functions.

Sponsored by: Intel
Reviewed by: carl

11 years agoAbort and do not retry any outstanding admin commands left over after
Jim Harris [Tue, 26 Mar 2013 22:06:05 +0000 (22:06 +0000)]
Abort and do not retry any outstanding admin commands left over after
a controller reset.

Sponsored by: Intel
Reviewed by: carl

11 years agoAdd the ability to internally mark a controller as failed, if it is unable to
Jim Harris [Tue, 26 Mar 2013 21:58:38 +0000 (21:58 +0000)]
Add the ability to internally mark a controller as failed, if it is unable to
start or reset.  Also add a notifier for NVMe consumers for controller fail
conditions and plumb this notifier for nvd(4) to destroy the associated
GEOM disks when a failure occurs.

This requires a bit of work to cover the races when a consumer is sending
I/O requests to a controller that is transitioning to the failed state.  To
help cover this condition, add a task to defer completion of I/Os submitted
to a failed controller, so that the consumer will still always receive its
completions in a different context than the submission.

Sponsored by: Intel
Reviewed by: carl

11 years agoJust disable the controller instead of deleting IO queues during detach.
Jim Harris [Tue, 26 Mar 2013 21:48:41 +0000 (21:48 +0000)]
Just disable the controller instead of deleting IO queues during detach.

This is just as effective, and removes the need for a bunch of admin commands
to a controller that's going to be disabled shortly anyways.

Sponsored by: Intel
Reviewed by: carl

11 years agoHave nvd(4) register for controller notifications.
Jim Harris [Tue, 26 Mar 2013 21:45:37 +0000 (21:45 +0000)]
Have nvd(4) register for controller notifications.

Also have nvd maintain controller/namespace relationships internally.

Sponsored by: Intel
Reviewed by: carl

11 years agoSet Pre-boot Software Load Count to 0 at the end of the controller
Jim Harris [Tue, 26 Mar 2013 21:42:53 +0000 (21:42 +0000)]
Set Pre-boot Software Load Count to 0 at the end of the controller
start process.

The spec indicates the OS driver should use Set Features (Software
Progress Marker) to set the pre-boot software load count to 0
after the OS driver has successfully been initialized.  This allows
pre-boot software to determine if there have been any issues with the
OS loading.

Sponsored by: Intel
Reviewed by: carl

11 years agoRemove the is_started flag from struct nvme_controller.
Jim Harris [Tue, 26 Mar 2013 21:19:26 +0000 (21:19 +0000)]
Remove the is_started flag from struct nvme_controller.

This flag was originally added to communicate to the sysctl code
which oids should be built, but there are easier ways to do this.  This
needs to be cleaned up prior to adding new controller states - for example,
controller failure.

Sponsored by: Intel
Reviewed by: carl

11 years agoEnsure the controller's MDTS is accounted for in max_xfer_size.
Jim Harris [Tue, 26 Mar 2013 21:16:53 +0000 (21:16 +0000)]
Ensure the controller's MDTS is accounted for in max_xfer_size.

The controller's IDENTIFY data contains MDTS (Max Data Transfer Size) to
allow the controller to specify the maximum I/O data transfer size.  nvme(4)
already provides a default maximum, but make sure it does not exceed what
MDTS reports.

Sponsored by: Intel
Reviewed by: carl

11 years agoCap the number of retry attempts to a configurable number. This ensures
Jim Harris [Tue, 26 Mar 2013 21:14:51 +0000 (21:14 +0000)]
Cap the number of retry attempts to a configurable number.  This ensures
that if a specific I/O repeatedly times out, we don't retry it indefinitely.

The default number of retries will be 4, but is adjusted using hw.nvme.retry_count.

Sponsored by: Intel
Reviewed by: carl