Ian Lepore [Sat, 15 Nov 2014 03:39:58 +0000 (03:39 +0000)]
When doing busdma sync ops for BUSDMA_COHERENT memory, there is no need
for cache maintenance operations, but ensure that all prior writes have
reached memory when doing a PREWRITE sync.
Adrian Chadd [Sat, 15 Nov 2014 01:18:49 +0000 (01:18 +0000)]
Convert the callouts back to using mutexes.
I did this wrong - I should've included a state flag for each callout
to see if it was supposed to run or not. I didn't do that.
Instead, just use mutexes anyway.
Gleb Smirnoff [Fri, 14 Nov 2014 06:02:29 +0000 (06:02 +0000)]
There should not be zero length mbufs in socket buffers. The code comes
from r1451, and thus can't be explained. A patch with explicit panic()
here survived all tests.
John Baldwin [Thu, 13 Nov 2014 22:06:57 +0000 (22:06 +0000)]
- Use the existing driver lock in cdevsw methods and remove D_NEEDGIANT.
- Use callout(9) instead of timeout(9).
- Use bus_*() instead of bus_space_*().
- Don't check for a NULL softc in attach.
John Baldwin [Thu, 13 Nov 2014 22:00:18 +0000 (22:00 +0000)]
Lock iir(4) and mark it MPSAFE.
- Add a per-device mutex to the softc and use it for bus_dma tags,
CAM SIMs, callouts, and interrupt handler.
- Switch from timeout(9) to callout(9).
- Add a separate global mutex to protect the global event buffer ring.
- Return completed index from iir_intr_locked() and remove the global
gdt_wait_* variables.
- Remove global list of gdt softcs and replace its use with
devclass_get_device().
- Use si_drv1 to store softc pointer in the SDEV_PER_HBA case instead
of minor numbers.
- Do math on osreldate instead of dubious char math on osrelease[]
that didn't work on 10.0+.
- Use bus_*() instead of bus_space_*().
- Use device_printf() instead of printf() with a unit number.
John Baldwin [Thu, 13 Nov 2014 20:09:47 +0000 (20:09 +0000)]
Drop mention of ISA cards. Note that I have no idea what to cull from the
supported hardware list. Judging by the PCI driver attachment, dpt_pci.c
only supports a single adapter rather than the various PCI adapters listed.
The list of EISA adapters listed somewhat overlaps with the device IDs in
dpt_eisa.c. It's not clear which devices are ISA-only devices.
John Baldwin [Thu, 13 Nov 2014 20:00:54 +0000 (20:00 +0000)]
Remove dpt_isa.c and commented out references to it. It was never connected
to the build in either sys/conf/files* or sys/modules/dpt/Makefile. Also,
it was denoted as "doesn't quite work yet" when the file was initially added
(which may account for it never having been hooked up to the build).
Jung-uk Kim [Thu, 13 Nov 2014 00:46:53 +0000 (00:46 +0000)]
Increase MAXTABLE to the maxmimum possible value. The default value is too
low for complex parsers. Note it was one of those memory optimization hacks
back in the day.
Navdeep Parhar [Wed, 12 Nov 2014 23:29:22 +0000 (23:29 +0000)]
Fix some bad interaction between cxgbe(4) and lacp lagg(4) that could
leave a port permanently disabled when a copper cable is unplugged and
then plugged right back in.
lacp_linkstate goes looking for the current ifmedia on a link state
change and it could get stale information from cxgbe(4) on a module
unplug followed by replug. The fix is to process module events before
link-state events within the driver, and to always rebuild the ifmedia
list on a module change event (instead of rebuilding it lazily).
Thanks to asomers@ for the problem report and detailed analysis to go
with it.
Zbigniew Bodek [Wed, 12 Nov 2014 21:38:31 +0000 (21:38 +0000)]
Make PL011 UART to wait on putc only when TX FIFO is full
Instead of waiting for empty TX FIFO it is more reasonable to
block on full FIFO. As soon as FIFO slot is free the character
can be transmitted.
In case of TX FIFO disabled, TXFF bit indicates that transmit
register is not empty.
Obtained from: Semihalf
Reviewed by: andrew, emaste
Sponsored by: The FreeBSD Foundation
Dimitry Andric [Wed, 12 Nov 2014 20:01:10 +0000 (20:01 +0000)]
Pull in r221709 from upstream llvm trunk (by Frédéric Riss):
Totally forget deallocated SDNodes in SDDbgInfo.
What would happen before that commit is that the SDDbgValues associated with
a deallocated SDNode would be marked Invalidated, but SDDbgInfo would keep
a map entry keyed by the SDNode pointer pointing to this list of invalidated
SDDbgNodes. As the memory gets reused, the list might get wrongly associated
with another new SDNode. As the SDDbgValues are cloned when they are transfered,
this can lead to an exponential number of SDDbgValues being produced during
DAGCombine like in http://llvm.org/bugs/show_bug.cgi?id=20893
Note that the previous behavior wasn't really buggy as the invalidation made
sure that the SDDbgValues won't be used. This commit can be considered a
memory optimization and as such is really hard to validate in a unit-test.
This should fix abnormally large memory usage and resulting OOM crashes
when compiling certain ports with debug information.
Pedro F. Giffuni [Wed, 12 Nov 2014 16:23:56 +0000 (16:23 +0000)]
ifdef ext2_print_inode which is not really used.
ext2_print_inode is not really used but it was nice to
have for initial development work. #ifdef it under a
new EXT2FS_DEBUG knob so that we don't spend time
compiling it.
Ian Lepore [Wed, 12 Nov 2014 02:37:27 +0000 (02:37 +0000)]
Bugfixes for the imx5/imx6 iomux fdt_pinctrl driver.
I originally overlooked a couple flag bits defined in the fdt binding docs.
One flag suppresses the pad configuration (pullup/pulldown/etc). The other
one requires that the SION (set input on) flag be set in the mux register.
Also, it appears from the data involved that if the input register
address in the config tuple is zero, there is no input configuration. The
old code was writing to register zero, which contains a collection of misc
control bits (having nothing to do with input configuration) that probably
shouldn't get overwritten arbitrarily. The bindings doc doesn't explictly
mention this.
Marcel Moolenaar [Wed, 12 Nov 2014 00:10:27 +0000 (00:10 +0000)]
SEEK_DATA has interesting behaviour for sparse files on ZFS. A sparse file
with 128K of random data and truncated to 800K can have SEEK_DATA return -1
when given an offset of 128K. On UFS, the SEEK_DATA returns 800K (the size
of the file). SEEK_HOLE on ZFS seems to behave the same as UFS.
To handle this, map -1 to the size of the file (`end') when lseek returns
this for either SEEK_HOLE or SEEK_DATA. When sparse files are not supported
by the file system both `hole' and `data' will now be equal to `end' and we
will treat the entire file as data. This way, the -1 return for SEEK_DATA
on ZFS will end up doing the right thing.
Peter Grehan [Tue, 11 Nov 2014 22:03:11 +0000 (22:03 +0000)]
Fix incorrect reading of 32-bit modinfo by 64-bit loaders.
The various structures in the mod_metadata set of a FreeBSD kernel and
modules contain pointers. The FreeBSD loader correctly deals with a
mismatch in loader and kernel pointer size (e.g. 32-bit i386/ppc
loader, loading 64-bit amd64/ppc64 kernels), but wasn't dealing with
the inverse case where a 64-bit loader was loading a 32-bit kernel.
Reported by: ktcallbox@gmail.com with a bhyve/i386 and ZFS root install
Differential Revision: https://reviews.freebsd.org/D1129
Reviewed by: neel, jhb
MFC after: 1 week
Gleb Smirnoff [Tue, 11 Nov 2014 20:32:46 +0000 (20:32 +0000)]
Remove SF_KQUEUE code. This code was developed at Netflix, but was not
ever used. It didn't go into stable/10, neither was documented.
It might be useful, but we collectively decided to remove it, rather
leave it abandoned and unmaintained. It is removed in one single
commit, so restoring it should be easy, if anyone wants to reopen
this idea.
John Baldwin [Tue, 11 Nov 2014 19:44:59 +0000 (19:44 +0000)]
Move NFS and TFTP filesystems before the synthetic filesystems (bzip,
gzip, and split). "Real" filesystems should always be listed first so
that the "bare" filename is tried before alternate filenames. For PXE
booting in particular this can remove a lot of spurious pathname lookups.
While here, move splitfs to the bottom after the bzip and gzip filesystems
as it is the least often used.
Dimitry Andric [Tue, 11 Nov 2014 18:54:57 +0000 (18:54 +0000)]
Change kbdb's kthr::cpu field into an int, to avoid gcc warnings about
comparing it with NOCPU, which became -1 recently. While here, avoid
using it for address calculations if it is negative.
John Baldwin [Tue, 11 Nov 2014 18:15:05 +0000 (18:15 +0000)]
Use the callout(9) API instead of timeout(9). To do this more cleanly,
convert a global timer to a per-controller timer. This works much better
with locking and removes the need for several global lookup tables.
Adrian Chadd [Tue, 11 Nov 2014 17:14:11 +0000 (17:14 +0000)]
Use the correct device (child) when asking the bus layer about which power
state said device should go into.
This was a snafu introduced in the ACPI/PCI awareness separation.
When putting a device into a power state, the bus (and thus firmware,
eg ACPI) should be asked before hand to check whether the device
can indeed go into that power state.
There's a set of nodes in ACPI under each device - the _SxD nodes - which
state which ACPI power state to put the device into when the system is
going into power save state 'x'. So when going into S3, the existence
of an _S3D node would override whatever the system was trying to do.
By default the PCI code wants to put devices into D3 before suspending.
I have a laptop here (Asus Zenbook - check the PR) whose EHCI controller
really wants to be in D2 during suspend, not D3. So if we put it into
D3 and then try to enter S3, everything hangs. The device itself
can go into D3 - it just can't be there when the call to ACPI to enter
S3 occurs. The PCI patch fixes this.
jkim@ noticed that the same is needed for the ACPI child device
enumeration.
Thankyou to Matt Dillon (the programmer, not the actor) for buying me
this particular laptop so I could debug the issues with the Atheros
AR9485 that is in it. It's his fault that I ended up with this
laptop and was sufficiently annoyed by the lack of USB suspend
to go down this rabbit hole.
Tested:
* Thinkpad T400
* Thinkpad X230
* Thinkpad T42
* Thinkpad T60
* Asus Zenbook (see PR)
* Asus EEEPC 701
* Asus EEEPC 1001PX
TODO:
* Figure out what we should do about devices we unload drivers for
that want to be in a specific state when entering S3 / S4 -
the "put devices into D3 if they're not bound to a driver" option
may also mess with things.
Ed Maste [Tue, 11 Nov 2014 14:59:46 +0000 (14:59 +0000)]
Add workaround for vt efifb's early use of PHYS_TO_DMAP
In vt_efifb_init the framebuffer's physaddr is passed to PHYS_TO_DMAP
before the DMAP is setup. The result is not actually accessed until
after the mapping is setup, though. Loosen the assertion in PHYS_TO_DMAP
for now, to allow use when dmaplimit == 0.
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1142
Based on some BIOS configuration (GGC register in host bridge, bit 1),
IGP may declare subclass as either VGA-compatible, or non-VGA. The
difference is that in the later case, IGP does not claim VGA cycles.
Other than that, the device functions normally, and agp_i810 should
attach to it.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week