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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
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
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.
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
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.
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.
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.
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.
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.)
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.
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.
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
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
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
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
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]
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Jim Harris [Tue, 26 Mar 2013 21:00:18 +0000 (21:00 +0000)]
Create struct nvme_status.
NVMe error log entries include status, so breaking this out into
its own data structure allows it to be included in both the
nvme_completion data structure as well as error log entry data
structures.
While here, expose nvme_completion_is_error(), and change all of
the places that were explicitly looking at sc/sct bits to use this
macro instead.
Jim Harris [Tue, 26 Mar 2013 20:32:57 +0000 (20:32 +0000)]
By default, always escalate to controller reset when an I/O times out.
While aborts are typically cleaner than a full controller reset, many times
an I/O timeout indicates other controller-level issues where aborts may not
work. NVMe drivers for other operating systems are also defaulting to
controller reset rather than aborts for timed out I/O.