Jack F Vogel [Wed, 11 Nov 2009 19:13:40 +0000 (19:13 +0000)]
With an i386 kernel the igb driver can cause a
page fault panic on initialization due to a large
number of bounce pages being allocated. This is due
to the dma tag requiring page alignment on mbuf mapping.
This was removed some time back from the ixgbe driver
and is not needed here either.
Jaakko Heinonen [Wed, 11 Nov 2009 15:43:07 +0000 (15:43 +0000)]
Create verifier used by FreeBSD NFS client is suboptimal because the
first part of a verifier is set to the first IP address from
V_in_ifaddrhead list. This address is typically the loopback address
making the first part of the verifier practically non-unique. The second
part of the verifier is initialized to zero making its initial value
non-unique too.
This commit changes the strategy for create verifier initialization:
just initialize it to a random value. Also move verifier handling into
its own function and use a mutex to protect the variable.
This change is a candidate for porting to sys/nfsclient.
Peter Pentchev [Wed, 11 Nov 2009 11:37:43 +0000 (11:37 +0000)]
Correct the information about the doceng@ team members - Murray Stokely
stepped down some time ago, about the same time as Giorgos Keramidas
joined the team.
Alexander Motin [Wed, 11 Nov 2009 11:10:36 +0000 (11:10 +0000)]
MFp4:
- Move tagged queueing control from ADA to ATA XPT. It allows to control
device command queue length correctly. First step to support < 32 tags.
- Limit queue for non-tagged devices by 2 slots for ahci(4) and siis(4).
- Implement quirk matching for ATA devices.
- Move xpt_schedule_dev_sendq() from header to source file.
- Move delayed queue shrinking to the more expected place - element freeing.
- Remove some SCSIsms in ATA.
Ed Schouten [Wed, 11 Nov 2009 09:43:26 +0000 (09:43 +0000)]
Place home and end before insert and delete.
These keys have different sequences when using cursorkeys, while insert
and delete stay the same. If they are placed like this, libteken will
return NULL instead of a proper sequence for these characters.
Ed Schouten [Wed, 11 Nov 2009 08:39:57 +0000 (08:39 +0000)]
Add a new flag to vidcontrol, -T, that allows terminal mode switching.
This will make it more easy for people to experiment with TERM=xterm.
Instead of echoing these strange escape sequences, I can just instruct
them to run `vidcontrol -T xterm'.
Ed Schouten [Wed, 11 Nov 2009 08:20:19 +0000 (08:20 +0000)]
Allow Syscons terminal emulators to provide function key strings.
xterm and cons25 have some incompatibilities when it comes to escape
sequences for special keys, such as F1 to F12, home, end, etc. Add a new
te_fkeystr() that can be used to override the strings.
scterm-sck won't do anything with this, but scterm-teken will use
teken_get_sequences() to obtain the proper sequence.
Ed Schouten [Wed, 11 Nov 2009 08:11:21 +0000 (08:11 +0000)]
Always home the cursor when changing the scrolling region.
I thought this only had to be done when in origin mode, to ensure that
the cursor is not placed outside the origin, but it seems this is also
done when not in origin mode.
This fixes some artifacts when pressing ^L while running irssi in tmux.
(Almost) nobody noticed this, because cons25 doesn't have scrolling
regions.
Nathan Whitehorn [Wed, 11 Nov 2009 03:17:51 +0000 (03:17 +0000)]
Reduce probe priority of USB input devices to BUS_PROBE_GENERIC from
BUS_PROBE_SPECIFIC. This allows device-specific drivers like atp to
attach reliably.
Be careful which vattr fields are set during setattr replay.
Without this fix strange things can appear after unclean shutdown like
files with mode set to 07777.
John Baldwin [Tue, 10 Nov 2009 22:04:19 +0000 (22:04 +0000)]
- Locking fixes to not do silly things like drop the lock only to call a
function that immediately reacquires the lock. Also removes recursive
locking.
- Use the statistics timer to drive the transmit watchdog instead of using
if_watchdog and if_timer.
Pyun YongHyeon [Tue, 10 Nov 2009 20:29:20 +0000 (20:29 +0000)]
Controller does not update Tx descriptors(send BDs) after sending
frames so remove unnecessary BUS_DMASYNC_PREREAD and
BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9).
When rename("a", "b/.") is performed, target namei() call returns
dvp == vp. Rename syscall does not check for the case, and at least
ufs_rename() cannot deal with it. POSIX explicitely requires that both
rename(2) and rmdir(2) return EINVAL when any of the pathes end in "/.".
Detect the slashdot lookup for RENAME or REMOVE in lookup(), and return
EINVAL.
In r198506, kern_sigsuspend() started doing cursig/postsig loop to make
sure that a signal was delivered to the thread before returning from
syscall. Signal delivery puts new return frame on the user stack, and
modifies trap frame to enter signal handler. As a consequence, syscall
return code sets EINTR as error return for signal frame, instead of the
syscall return.
Also, for ia64, due to different registers layout for those two kind of
frames, usermode sigsegfaulted when returned from signal handler.
Use newly-introduced cpu_set_syscall_retval(9) to set syscall result,
and return EJUSTRETURN from kern_sigsuspend() to prevent syscall return
code from modifying this frame [1].
Another issue is that pending SIGCONT might be cancelled by SIGSTOP,
causing postsig() not to deliver any catched signal [2]. Modify
postsig() to return 1 if signal was posted, and 0 otherwise, and use
this in the kern_sigsuspend loop.
Remove a bunch of code used to detect SMP on ((i386 && !pc98) || amd64) and
offer to install an SMP kernel. The way this worked was: on supported
platforms, code to read ACPI tables and BIOS MP tables was compiled into
sysinstall, and if an SMP kernel config was present in the source tree when
sysinstall was built, code that called it was also compiled. Since we
haven't had SMP kernel configs in years, the latter was never compiled and
the former never ran.
This only removes dead and unreachable code; it does *not* remove the NCpus
variable, nor the code that sets it to 1, nor the code that asks the user to
select a kernel from a list.
Unbreak booting of FreeBSD/mips by merging r195429 from projects/mips:
- Move dpcpu initialization to mips_proc0_init. It's
more appropriate place for it. Besides dpcpu_init
requires pmap module to be initialized and calling it
int pmap.c hangs the system
Edwin Groothuis [Mon, 9 Nov 2009 20:49:12 +0000 (20:49 +0000)]
MFV of r199105, tzdata2009r:
- Three Australian stations in Antarctica have changed their time zone:
Casey moved from UTC+8 to UTC+11
Davis moved from UTC+7 to UTC+5
Mawson moved from UTC+6 to UTC+5
The changes occurred on 2009-10-18 at 02:00 (local times).
Edwin Groothuis [Mon, 9 Nov 2009 20:44:37 +0000 (20:44 +0000)]
Vendor import of tzdata2009r:
- Three Australian stations in Antarctica have changed their time zone:
Casey moved from UTC+8 to UTC+11
Davis moved from UTC+7 to UTC+5
Mawson moved from UTC+6 to UTC+5
The changes occurred on 2009-10-18 at 02:00 (local times).
Roman Divacky [Mon, 9 Nov 2009 20:29:10 +0000 (20:29 +0000)]
Make isa_dma functions MPSAFE by introducing its own private lock. These
functions are selfcontained (ie. they touch only isa_dma.c static variables
and hardware) so a private lock is sufficient to prevent races. This changes
only i386/amd64 while there are also isa_dma functions for ia64/sparc64.
Sparc64 are ones empty stubs and ia64 ones are unused as ia64 does not
have isa (says marcel).
This patch removes explicit locking of Giant from a few drivers (there
are some that requires this but lack ones - this patch fixes this) and
also removes the need for implicit locking of Giant from attach routines
where it's provided by newbus.
Remove ifdefed out part of code, which seems to have originated a decade ago
in OpenBSD. As it is now, there is no way for this to be useful, since IPsec
is free to forward packets via whatever interface it wants, so checking
capabilities of the interface passed from ip_output (fetched from the routing
table) serves no purpose.
Increase the size of the OFW translations buffer to handle G5 systems
that use many translation regions in firmware, and add bounds checking
to prevent buffer overflows in case even the new value is exceeded.
Rui Paulo [Mon, 9 Nov 2009 11:23:37 +0000 (11:23 +0000)]
The isr_intval in ieee80211req_scan_result structure should be 16 bit.
This makes ifconfig list scan display the correct beacon interval
(previously it would int overflow). As a side effect, this makes the
ieee80211req_scan_result word aligned.
Jun Kuriyama [Mon, 9 Nov 2009 02:54:16 +0000 (02:54 +0000)]
- Add hw.clflush_disable loader tunable to avoid panic (trap 9) at
map_invalidate_cache_range() even if CPU is not Intel.
- This tunable can be set to -1 (default), 0 and 1. -1 is same as
current behavior, which automatically disable CLFLUSH on Intel CPUs
without CPUID_SS (should be occured on Xen only). You can specify 1
when this panic happened on non-Intel CPUs (such as AMD's). Because
disabling CLFLUSH may reduce performance, you can try with setting 0
on Intel CPUs without SS to use CLFLUSH feature.
Reviewed by: kib
Reported by: karl, kuriyama
Related to: kern/138863
Andrew Thompson [Sun, 8 Nov 2009 21:00:50 +0000 (21:00 +0000)]
Improve support for High-speed USB audio devices.
- fix issues regarding the mixer, where the interface number was not set in
time.
- fix wrong use of resolution parameter.
Andrew Thompson [Sun, 8 Nov 2009 20:51:15 +0000 (20:51 +0000)]
Integrate lost interrupts patch from the old USB stack.
Some EHCI chips from VIA / ATI seem to trigger interrupts before writing back
the qTD status, or miss signalling occasionally under heavy load. If the host
machine is too fast, we can miss transaction completion - when we scan the
active list the transaction still seems to be active. This generally exhibits
itself as a umass stall that never recovers.
We work around this behaviour by setting up this callback after any softintr
that completes with transactions still pending, giving us another chance to
check for completion after the writeback has taken place
Submitted by: Alexander Nedotsuko
MFC after: 3 days
Andrew Thompson [Sun, 8 Nov 2009 20:03:52 +0000 (20:03 +0000)]
- fix refcounting error during data transfer
- fix a memory leak on the USB backend
- fix invalid pointer computations (in one case memory outside the allocated
area was written in LibUSB v1.0)
- make sure memory is always initialised, also in failing cases
- add missing functions from v1.0.4
PR: usb/140325
Reported by: Robert Jenssen
Submitted by: Hans Petter Selasky
MFC After: 3 days
Pyun YongHyeon [Sun, 8 Nov 2009 19:59:54 +0000 (19:59 +0000)]
Partially revert r199035.
Revision 1.158 says only lower ten bits of
BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it
seems the controller maintains 16bits value for the register.
However 16bits are still too small to count all dropped packets
happened in a second. To get a correct counter we have to read the
register in bge_rxeof() which would be too expensive.
Rick Macklem [Sun, 8 Nov 2009 19:02:13 +0000 (19:02 +0000)]
Add a check for the connection being shut down to the krpc
client just before queuing a request for the connection. The
code already had a check for the connection being shut down
while the request was queued, but not one for the shut down
having been initiated by the server before the request was
in the queue. This appears to fix the problem of slow reconnects
against an NFS server that drops inactive connections reported
by Olaf Seibert, but does not fix the case
where the FreeBSD client generates RST segments at about the
same time as ACKs. This is still a problem that is being
investigated. This patch does not cause a regression for this
case.
Tested by: Olaf Seibert, Daniel Braniss
Reviewed by: dfr
MFC after: 5 days
Alexander Motin [Sun, 8 Nov 2009 11:33:51 +0000 (11:33 +0000)]
Introduce hw.hptrr.attach_generic loader tunable to deny hptrr driver
attach chips with generic Marvell (non-HighPoint) PCI identification.
These chips are also supported by ata(4). Some vendors, like Supermicro,
are using same chips without providing HPT RAID BIOS.
Pyun YongHyeon [Sun, 8 Nov 2009 01:13:38 +0000 (01:13 +0000)]
Don't count input errors twice, we always read input errors from
MAC in bge_tick. Previously it used to show more number of input
errors. I noticed actual input errors were less than 8% even for
64 bytes UDP frames generated by netperf.
Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in
bge_tick, remove useless code protected by #ifdef notyet.
Attilio Rao [Sat, 7 Nov 2009 21:46:34 +0000 (21:46 +0000)]
Use a safety belt for cases where corrupted narg can be passed to the
ktrsyscall(). print_number() does decrement the number of arguments,
leading to infinite loops for negative values.
Reported by: Patrick Lamaiziere <patpr at davenulle dot org>,
Jonathan Pascal <jkpyvxmzsa at mailinator dot com>
Submitted by: jh
PR: bin/120055, kern/119564
MFC: 1 week
Pyun YongHyeon [Sat, 7 Nov 2009 20:37:38 +0000 (20:37 +0000)]
Tell upper layer we support long frames. ether_ifattach()
initializes it to ETHER_HDR_LEN so we have to override it after
calling ether_ifattch().
While I'm here remove setting if_mtu value, it's initialized in
ether_ifattach().
Robert Noland [Sat, 7 Nov 2009 17:29:03 +0000 (17:29 +0000)]
Fix handling of GPT headers when size is > 92 bytes.
It is valid for an on-disk GPT header to report a header size which is
greater than 92 bytes. Previously, we would read in the sector and copy
only the 92 bytes that we know how to deal with before calculating the
checksum for comparison. This meant that when we did the checksum, we
overshot the buffer and took in random memory, so the checksum would fail.
We now determine the size of the header and allocate enough space to
preserve the entire on-disk contents. This allows us to be correctly
calculate the checksum and be able to modify and write the header back
to the disk, while preserving data that we might not understand.
Andriy Gapon [Sat, 7 Nov 2009 11:46:38 +0000 (11:46 +0000)]
acpi: remove 'magic' ivar
o acpi_hpet: auto-added 'wildcard' devices can be identified by
non-NULL handle attribute.
o acpi_ec: auto-add 'wildcard' devices can be identified by
unset (NULL) private attribute.
o acpi_cpu: use private instead of magic to store cpu id.
Reviewed by: jhb
Silence from: acpi@
MFC after: 2 weeks
X-MFC-Note: perhaps the ivar should stay for ABI stability
Pyun YongHyeon [Sat, 7 Nov 2009 02:10:59 +0000 (02:10 +0000)]
Fix I mssied in r199011. Rx ring index also should be updated.
If we fill Rx ring full instead of half we can simplify this logic
but this requires more experimentation.
Pyun YongHyeon [Sat, 7 Nov 2009 01:01:33 +0000 (01:01 +0000)]
Reimplement Rx buffer allocation to handle dma map load failure.
Introduce two spare dma maps for standard buffer and jumbo buffer
respectively. If loading a dma map failed reuse previously loaded
dma map. This should fix unloaded dma map is used in case of dma
map load failure. Also don't blindly unload dma map and defer
dma map sync and unloading operation until we know dma map for new
buffer is successfully loaded. This change saves unnecessary dma
load/unload operation. Previously bge(4) tried to reuse mbuf
with unloaded dma map which is really bad thing in bus_dma(9)
perspective.
While I'm here update if_iqdrops if we can't allocate Rx buffers.