mav [Tue, 17 Nov 2009 21:45:28 +0000 (21:45 +0000)]
MFC r196964:
Do not check proper request alignment here in geom_dev in production.
It will be checked any way later by g_io_check() in g_io_schedule_down().
It is only needed here to not trigger panic from additional check, when
INVARIANTS enabled. So cover it with #ifdef INVARIANTS. It saves two
64bit divisions per request.
mav [Tue, 17 Nov 2009 21:43:42 +0000 (21:43 +0000)]
MFC r196904:
Remove msleep() timeout from g_io_schedule_up/down(). It works fine
without it, saving few percents of CPU on high request rates without
need to rearm callout twice per request.
mav [Tue, 17 Nov 2009 21:42:11 +0000 (21:42 +0000)]
MFC r196837:
Remove artificial MAX_IO_SIZE constant, equal to DFLTPHYS * 2. Use MAXPHYS
instead. It is NULL change for GENERIC kernel, but allows 'fast' mode to
work on systems with increased MAXPHYS.
mav [Tue, 17 Nov 2009 21:23:05 +0000 (21:23 +0000)]
MFC r199178:
- 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.
mav [Tue, 17 Nov 2009 21:09:47 +0000 (21:09 +0000)]
MFC r198899:
- Remove CAM_PERIPH_POLLED flag. It is broken by design. Polling can't be
periph flag. May be SIM, may be CCB, but now it works fine just without it.
- Remove check unused for at least five years. If we will ever have non-BIO
devices in CAM, this check is smallest of what we will need.
- If several controllers complete requests same time, call swi_sched()
only once.
mav [Tue, 17 Nov 2009 21:08:12 +0000 (21:08 +0000)]
MFC r198897:
- Add support for sector size > 512 bytes and physical sector of several
logical sectors, introduced by ATA-7 specification.
- Remove some obsoleted code.
mav [Tue, 17 Nov 2009 21:00:02 +0000 (21:00 +0000)]
MFC r198896:
Do not unarm callout on request completion and change slot selection
algorithm as done in ahci(4). This saves some CPU time on high request
rates.
mav [Tue, 17 Nov 2009 20:59:00 +0000 (20:59 +0000)]
MFC r198852:
- Rework timeout handling, to make it more graceful for devices sharing
controller port (with PMP). Wait for other commands completion/timeout
before initiating recovery.
- Handle timeouts and fatal errors with port hard-reset. The rest of
recovery will be done by XPT on receiving async event. More gracefull
per-device soft-reset recovery can be implemented later.
mav [Tue, 17 Nov 2009 20:57:35 +0000 (20:57 +0000)]
MFC r198851:
- Handle timeouts and fatal errors with port hard-reset. The rest of
recovery will be done by XPT on receiving async event. More gracefull
per-device soft-reset recovery can be implemented later.
- Add workaround for ATI SB600/SB700 PMP probe related bug, to speedup boot.
mav [Tue, 17 Nov 2009 20:54:52 +0000 (20:54 +0000)]
MFC r198832:
Provide the same sanity check on the sector size in dagetcapacity as when the
disk is first probed. dagetcapacity is called whenever the disk is opened from
geom via d_open(), a zero sector size will cause geom to panic later on.
mav [Tue, 17 Nov 2009 20:49:26 +0000 (20:49 +0000)]
MFC r198748, r198782:
Fix reference counting bug, when device unreferenced before
invalidated. To do it, do not handle validity flag as another
reference, but explicitly modify reference count each time flag is
modified.
The async callback could free the device. If it is a broadcast async,
it doesn't hold device reference, so take our own reference.
mav [Tue, 17 Nov 2009 20:43:04 +0000 (20:43 +0000)]
MFC r198708:
- Reduce code duplication in ATA XPT and PMP driver.
- Move PIO size setting from ada driver to ATA XPT. It is XPT business
to negotiate transfer details. ada driver is now stateless.
- Report PIO size to SIM. It is required for correct PATA SIM operation.
- Tune PMP scan timings. It workarounds some problems with SiI.
- If reset hapens during PMP initialization - restart it.
- Introduce early-initialized periph drivers, which are used during initial
scan process. Use it for xpt, probe, aprobe and pmp. It gives pmp chance
to finish scan before mountroot and numerate devices in right order.
mav [Tue, 17 Nov 2009 20:41:15 +0000 (20:41 +0000)]
MFC r198705:
Ensure target/lun passed from user-level supported on this bus.
Scanning unsupported IDs causes different issues from duplicate
devices to system crash.
mav [Tue, 17 Nov 2009 20:17:48 +0000 (20:17 +0000)]
MFC r198389:
Move Port Multiplier support code out of ATA XPT into pmp periph driver.
This is convinient, as PMP itself is a bus target and has own state.
mav [Tue, 17 Nov 2009 19:40:39 +0000 (19:40 +0000)]
MFC r198319:
On error, freeze device queue, to allow periph driver to do proper recovery.
Freeze SIM queue only in some cases, when it is needed to protect SIM.
Implement better command timeout detection logic for non-queued commands.
This fixes false positives when command with short timeout waiting for the
long one. For example, when hald tastes CD during burning process.
kib [Tue, 17 Nov 2009 18:38:00 +0000 (18:38 +0000)]
MFC r198505:
When protection of wired read-only mapping is changed to read-write,
install new shadow object behind the map entry and copy the pages
from the underlying objects to it. This makes the mprotect(2) call to
actually perform the requested operation instead of silently do nothing
and return success, that causes SIGSEGV on later write access to the
mapping.
Reuse vm_fault_copy_entry() to do the copying, modifying it to behave
correctly when src_entry == dst_entry.
jhb [Tue, 17 Nov 2009 16:17:11 +0000 (16:17 +0000)]
MFC 198990:
Several years ago a feature was added to TCP that casued soreceive() to
send an ACK right away if data was drained from a TCP socket that had
previously advertised a zero-sized window. The current code requires the
receive window to be exactly zero for this to kick in. If window scaling is
enabled and the window is smaller than the scale, then the effective window
that is advertised is zero. However, in that case the zero-sized window
handling is not enabled because the window is not exactly zero. The fix
changes the code to check the raw window value against zero.
jhb [Tue, 17 Nov 2009 15:28:14 +0000 (15:28 +0000)]
MFC 198820:
Ensure 'kvm' is always initialized. If "-M" was not specified and the
garbage value on the stack was not zero, then 'ddb capture' would try to
use the garbage value as a kvm_t pointer.
mav [Tue, 17 Nov 2009 15:04:58 +0000 (15:04 +0000)]
MFC r198331:
Separate CAM_DEV_IDENTIFY_DATA_VALID flag from CAM_DEV_INQUIRY_DATA_VALID.
Add workaround for very old devices without support for mode setting.
Add some PATA bus scanning support.
Remove some SCSIsms.
mav [Tue, 17 Nov 2009 14:56:00 +0000 (14:56 +0000)]
MFC r198328:
Add support for PIO-only devices.
Fix maxio values and 256 sectors transactions for 28bits commands.
Implement periodic ordered commands insertion, sames as da driver does.
Remove some SCSIsms.
bz [Tue, 17 Nov 2009 14:30:09 +0000 (14:30 +0000)]
MFC r198049:
Immediately after clearing a pending callout that didn't make it due
to the lock we hold, disable interrupts, and announce to the firmware
that we are shutting down. Especially do this before disabling blocks.
This makes some types of machines with asf enabled no longer hang upon
boot, when we start configuring the interface.
mav [Tue, 17 Nov 2009 12:23:14 +0000 (12:23 +0000)]
MFC r198582:
Turn off use of ATA_A_4BIT on modern hardware. This flag was already
obsoleted in 1996 by ATA-2, and crashes some modern hardware like some
revisions of the Serverworks K2 SATA controller. Even very ancient
hardware seems not to require it. In the unlikely event this causes
problems, the previous behavior can be re-enabled by defining
ATA_LEGACY_SUPPORT at the top of this file.
kib [Tue, 17 Nov 2009 11:43:53 +0000 (11:43 +0000)]
MFC r198853:
If socket buffer space appears to be lower then sum of count of
already prepared bytes and next portion of transfer, inner loop of
kern_sendfile() aborts, not preparing next mbuf for socket buffer, and
not modifying any outer loop invariants. The thread loops in the outer
loop forever.
Instead of breaking from inner loop, prepare only bytes that fit into
the socket buffer space.
bms [Tue, 17 Nov 2009 10:59:51 +0000 (10:59 +0000)]
MFC r199287:
Fix a functional regression in multicast.
Userland daemons need to see IGMP traffic regardless of the group;
omit the imo filter check if the proto is IGMP. The kernel part
of IGMP will have already filtered appropriately at this point.
Submitted by: Franz Struwig
Reported by: Ivor Prebeg, Franz Struwig
jfv [Mon, 16 Nov 2009 18:58:45 +0000 (18:58 +0000)]
On a 32 bit kernel the igb driver may cause a page
fault panic due to a failed bounce page allocation
during RX mbuf setup. The large demand on bounce pages
is due to the alignment requirement in the tag. This
restriction was removed in the ixgbe driver with no
ill effects and so is being removed here also.
rmacklem [Sun, 15 Nov 2009 19:26:06 +0000 (19:26 +0000)]
MFC: r199053
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 fixes some cases of problems w.r.t. reconnecting
to a NFS server that drops inactive TCP connections.
Tested by: Olaf Seibert, Daniel Braniss
Reviewed by: dfr
jh [Sun, 15 Nov 2009 14:11:26 +0000 (14:11 +0000)]
MFC r197956:
- Catch SIGHUP to perform cleanup before exiting.
- Exit if getch() returns with an error other than EINTR. Otherwise
systat(1) may get stuck in an infinite loop if it doesn't receive
SIGHUP when terminal closes.
- Remove attempt to clear stdio error indicators. getch() doesn't use
stdio, making it useless.
- Remove unneeded masking of getch() return value.
stas [Sun, 15 Nov 2009 11:30:59 +0000 (11:30 +0000)]
- MFC r198320:
Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header
in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not
into if_bce.c anyway. It is disabled by default.
rnoland [Sat, 14 Nov 2009 16:14:51 +0000 (16:14 +0000)]
MFC r199241
This patch addresses an overflow in the the zfs boot code and allows
users to boot from zfs raidz volumes. This has been tested by a number
of users and does not impact those which are not booting from zfs raidz
volumes.
pjd [Sat, 14 Nov 2009 11:59:59 +0000 (11:59 +0000)]
MFC r198703,r199156,r199157:
r198703:
- zfs_zaccess() can handle VAPPEND too, so map V_APPEND to VAPPEND and call
zfs_access() instead of vaccess() in this case as well.
- If VADMIN is specified with another V* flag (unlikely) call both
zfs_access() and vaccess() after spliting V* flags.
This fixes "dirtying snapshot!" panic.
PR: kern/139806
Reported by: Carl Chave <carl@chave.us>
In co-operation with: jh
r199156:
Avoid passing invalid mountpoint to getnewvnode().
Reported by: rwatson
Tested by: rwatson
r199157:
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.
edwin [Thu, 12 Nov 2009 10:44:29 +0000 (10:44 +0000)]
MFC of r199107, 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).
thompsa [Wed, 11 Nov 2009 01:33:06 +0000 (01:33 +0000)]
MFC r199058
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
thompsa [Wed, 11 Nov 2009 01:27:58 +0000 (01:27 +0000)]
MFC r199055
- 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
kensmith [Mon, 9 Nov 2009 21:39:42 +0000 (21:39 +0000)]
Comment out the sbp(4) entry for GENERIC config files that contain it.
There are known issues with this driver that are beyond what can be
fixed for 8.0-RELEASE and the bugs can cause boot failure on some systems.
It's not clear if it impacts all systems and there is interest in getting
the problem fixed so for now just comment it out instead of remove it.
Commit straight to stable/8, this is an 8.0-RELEASE issue. Head was left
alone so work on it can continue there.
nwhitehorn [Mon, 9 Nov 2009 21:30:45 +0000 (21:30 +0000)]
Insta-MFC of r199084,199108:
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.
Short MFC requested by re since the problem this fixes breaks CD boot on
most G5 systems, making them uninstallable.
Reported by: Jacob Lambert
Approved by: re (kensmith,kib)
Requested by: re
jhb [Mon, 9 Nov 2009 18:56:47 +0000 (18:56 +0000)]
Cleanup mergeinfo for libc. Part of the damage was caused by a merge from
a partial checkout of libc in a user branch up to head. Don't do merges
from sparse trees!
kensmith [Mon, 9 Nov 2009 18:09:10 +0000 (18:09 +0000)]
MFC r198719:
> While certain supported Symbios/LSI SCSI chips (532c896, 53c1000, 53c1010)
> do support 64bit addresses, the current SCRIPTS code supports only 32bit
> addresses causing data corruption for buffer addresses >4GB. This problem
> affects 64bit machines with more than 4GB RAM or amd64 with 4GB and
> memory hole remapping.
> Work-around this problem with a bus_dma tag that requests bounce-buffers
> for addresses >4GB. This causes some overhead, but given the maximum SCSI
> bus speed of 160MB/s compared, the effect should hardly be noticeable.
> The problem was reported by Mike Watters (mike at mwatters net) who also
> verified that this fix cures the problem.
>
> Since this change is a NOOP on systems with less than 4GB RAM and fixes
> data corruption (in RAM and on disk) on systems with more than 4GB, I hope
> that this change is accepted for 8.0.
Requested by: Stefan Esser (se at freebsd dot org)[1]
Reviewed by: jhb, scottl
[1] Stefan requested this be part of 8.0 but has been unavailable to do
the MFC since submitting the request. We want to get 8.0-RC3 started
so I'm doing the merges with re@ hat on.