Matthew Dillon [Tue, 16 Jun 2009 01:38:33 +0000 (18:38 -0700)]
AHCI - augment ahci_pm_check_good() to handle targets larger then pmcount.
Matthew Dillon [Tue, 16 Jun 2009 01:36:16 +0000 (18:36 -0700)]
AHCI - go back to reading the EINFO register, check for unexpected EINFO bits
* Go back to reading the EINFO register. We still have some issues with
the PM not generating an interrupt for target port change events, this
may clear it up.
* Report unexpected EINFO bits set beyond the number of supported targets.
Matthew Dillon [Mon, 15 Jun 2009 23:04:23 +0000 (16:04 -0700)]
AHCI - add new kenv "hint.ahci.nofeatures"
set hint.ahci.nofeatures in /boot/loader.conf or at the boot loader command
line to tell the AHCI driver not to attempt to set the security freeze on
a device. Some devices will stop operating.
Matthew Dillon [Mon, 15 Jun 2009 22:04:16 +0000 (15:04 -0700)]
AHCI - Add additional information in the CMD TIMEOUT message.
* Also dump the STS state when printing the CMD TIMEOUT messeage.
Matthew Dillon [Mon, 15 Jun 2009 21:50:06 +0000 (14:50 -0700)]
Set tty ownership on pty open (temporary until devfs is integrated)
Fix a very long standing issue when opening new pty's as non-root. The
related tty could not be chowned/chmoded in that case, giving any user
in the system access to the pty.
This would not effect programs like sshd which set up the pty as root, but
it did effect programs like xterm which do not run suid-root.
This is strictly a temporary fix until devfs can be integrated into the
system. Basically we allow the uid stored in the cdev_t structure to
override the uid returned by VOP_GETATTR for VCHR devices, and the chmod
helper function checks the uid stored in the cdev_t structure for
compatibility.
Reported-by: Hasso Tepper <hasso@estpak.ee>, Numerous others
Matthew Dillon [Mon, 15 Jun 2009 16:31:15 +0000 (09:31 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 15 Jun 2009 16:13:42 +0000 (09:13 -0700)]
AHCI - Add hint.ahci.force150. Force negotiation at 1.5GBits.
* Add a feature which forces the AHCI controller to negotiate at 1.5 GBits
instead of 3 GBits.
Sascha Wildner [Mon, 15 Jun 2009 00:11:34 +0000 (02:11 +0200)]
ahci.4: Fix typo.
Sascha Wildner [Sun, 14 Jun 2009 23:51:01 +0000 (01:51 +0200)]
Add an ahci(4) manual page from OpenBSD (with some adaptation).
Sascha Wildner [Sun, 14 Jun 2009 22:45:34 +0000 (00:45 +0200)]
Adjust the LiveDVD's beastie.4th too for the AHCI option.
Matthew Dillon [Sun, 14 Jun 2009 22:33:47 +0000 (15:33 -0700)]
GENERIC kernel build - build-in the AHCI driver.
* The ahci driver is now part of the GENERIC kernel build.
Matthew Dillon [Sun, 14 Jun 2009 22:32:21 +0000 (15:32 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 14 Jun 2009 22:30:53 +0000 (15:30 -0700)]
AHCI - Add kenv "boot.hint.ahci_disabled", and add a boot menu option for it
* Setting the variable "boot.hint.ahci_disabled" in the boot loader will
disable the AHCI driver's probe, causing AHCI devices to fall back to
the NATA driver.
* The boot menu now has an option to boot with the AHCI driver disabled.
Sascha Wildner [Sun, 14 Jun 2009 18:18:14 +0000 (20:18 +0200)]
sbin/hammer/cmd_mirror.c: Stick with style(9) bracing style.
Matthew Dillon [Sun, 14 Jun 2009 17:40:38 +0000 (10:40 -0700)]
AHCI - Minor console output spew cleanup
Michael Neumann [Sun, 14 Jun 2009 16:52:03 +0000 (18:52 +0200)]
Simplify logical expression
Michael Neumann [Sun, 14 Jun 2009 16:43:16 +0000 (18:43 +0200)]
Implement -y "force yes" option for hammer utility.
This fixes a problem with terminals when operating remotely via ssh while
using the auto-PFS creation feature of hammer mirror-stream or
hammer mirror-copy.
For more information see the following thread (off-box mirror-stream and
friends):
http://leaf.dragonflybsd.org/mailarchive/users/2009-02/msg00017.html
Michael Neumann [Sun, 14 Jun 2009 16:18:09 +0000 (18:18 +0200)]
test
Sepherosa Ziehau [Sun, 14 Jun 2009 11:39:44 +0000 (19:39 +0800)]
MADT MP probe: Rework cpuid mapping, and cpuid to apicid mapping
- Don't use the ACPI ProcessorID as our cpuid, some BIOSes count ProcessorID
from 1, and ACPI standards actually allow that. Instead, except for BSP,
we set the processor's cpuid in the order that we found the MADT LAPIC
entry.
- Since MADT does not provide a way to identify the BSP, we will have to do
it ourselves:
Split the madt_parse() into three parts:
o madt_check(), preliminary length and revision check.
o madt_pass1(), locate the LAPIC address.
o madt_pass2(), set mp_naps and map cpuid to apicid.
After madt_pass1(), the lapic is mapped, so we could get the current CPU's
apic id. Since the current CPU is BSP, we have the BSP's apic id.
In madt_pass2(), we match the MADT LAPIC entry's apic_id field against the
the value read from the current CPU's lapic id field. Any matching means
that entry contains information concerning BSP.
Reported-by: tuxillo on EFnet #dragonflybsd
Matthew Dillon [Sun, 14 Jun 2009 06:07:00 +0000 (23:07 -0700)]
AHCI - Bug fixes - primary port probe and TFD flushing.
* The primary port probe was skipping the software reset step.
* ahci_flush_tfd() was looping on the SERR.DIAG.X bit with a 10ms delay,
but on some parts this bit gets re-set very quickly if the port is
in a COMRESET state. Remove the loop, just use an if() instead.
Reported-by: Sepherosa Ziehau
Matthew Dillon [Sun, 14 Jun 2009 03:27:59 +0000 (20:27 -0700)]
AHCI - Implement better timeout semantics, fix bug in error handling, softreset
* Stopping a port with ahci_port_stop() is problematic if the port has not
already been stopped by the command processor (CR is inactive), because
command completions can race our saved CI register, leading to
double-issues. This creates issues with both NCQ and FBSS support.
Change the timeout code to idle the port by allowing commands to
complete normally until the only commands remaining are expired.
Then the port can be safely stopped.
The timeout code also no longer performs a softreset. It used to under
certain conditions.
* With the changes to the timeout code softreset is no longer being called
from the timeout code, remove hacks from the softreset code that attempted
to restore the command processing state on failure.
* The CAM code was not properly generating dummy SENSE data for command
timeouts, leading the kernel to believe that the command succeeded
when it in fact failed.
Matthew Dillon [Sat, 13 Jun 2009 21:07:57 +0000 (14:07 -0700)]
AHCI - Port Multiplier bug fixes
* The error ccb must be used in ahci_pm_softreset() to collect a reliable
signature from the device.
* Release the error ccb before performing any ahci_pm_*() functions (which
have to issue their own commands).
* Probe the CAM bus asynchronously.
* Proactively assert that the error ccb is not used in a reentrant fashion.
Matthew Dillon [Sat, 13 Jun 2009 18:10:06 +0000 (11:10 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 13 Jun 2009 18:09:50 +0000 (11:09 -0700)]
AHCI - fix minor bug in last commit.
* Fix a broken KKASSERT()
Matthew Dillon [Sat, 13 Jun 2009 17:40:46 +0000 (10:40 -0700)]
AHCI - Fix PM probing issues, wait 10 seconds on physical port insertion
* The spec is not completely clear on the point but CCB[1] *MUST* be used
as the second CCB in a softreset sequence. If it isn't, the wrong
signature may be loaded into the signature register.
* Wait 10 seconds on insertion of a physical port (we already wait 10 seconds
on the insertion of a target behind a PM).
* Do not cycle the PHY when doing a hard reset, it seems to create
detection problems.
Sepherosa Ziehau [Sat, 13 Jun 2009 12:17:43 +0000 (20:17 +0800)]
Fallback to ACPI MADT CPU enumeration, if BIOS does not provide MP table.
APIC_IO does not work with ACPI MADT CPU enumeration yet.
Sepherosa Ziehau [Sat, 13 Jun 2009 11:45:43 +0000 (19:45 +0800)]
Add mp_set_cpuids(), which links CPU's logical id to its apic id
Sascha Wildner [Sat, 13 Jun 2009 12:05:11 +0000 (14:05 +0200)]
sed(1): Remove the old regression tests.
FreeBSD's tests in tools/regression/usr.bin/sed are more comprehensive.
Sascha Wildner [Sat, 13 Jun 2009 11:39:15 +0000 (13:39 +0200)]
sed(1): Sync with FreeBSD.
* Add workaround for a back reference when no corresponding parenthesized
subexpression is defined. For example, the following command line caused
unexpected behavior like segmentation fault:
% echo test | sed -e 's/test/\1/'
* Fix the code to conform to the "or more" part of the following POSIX
specification.
"A function can be preceded by one or more '!' characters, in which
case the function shall be applied if the addresses do not select
the pattern space."
* Implement "addr1,+N" ranges - not dissimilar to grep's -A switch.
Sascha Wildner [Sat, 13 Jun 2009 10:54:17 +0000 (12:54 +0200)]
Fix several 'cound' typos.
Sepherosa Ziehau [Sat, 13 Jun 2009 10:41:54 +0000 (18:41 +0800)]
Implement ACPI MADT parsing
This will be used to enumerate CPUs if BIOS does not provide MP table
Matthew Dillon [Sat, 13 Jun 2009 07:30:59 +0000 (00:30 -0700)]
AHCI - fixes to ahci_port_init()
* ahci_port_init() had some coding errors related to physical ports verses
targets behind a port multiplier. Correct the errors.
* Increase the post-boot insertion delay to 10 seconds.
Matthew Dillon [Sat, 13 Jun 2009 07:08:36 +0000 (00:08 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 13 Jun 2009 07:02:39 +0000 (00:02 -0700)]
AHCI - Port multiplier plug/unplug work, tuning, cleanup, bug fixes.
* Clean up the command dispatch and polling code, including fixing a
deadlock between the timeout code and the polling code. The polling
code now checks for timed-out CCBs.
* Test some of the delay intervals in the hard and softreset code to
reduce protocol problems.
* Add an exclusive-access abstraction for dealing with device insertions
and removals. This isn't working perfectly yet, there are still some
communications issues due to the newly inserted device interfering with
devices already in the enclosure.
* Greatly reduce probe times.
Sepherosa Ziehau [Sat, 13 Jun 2009 03:52:37 +0000 (11:52 +0800)]
ACPI P-State probing: Put _PCT evaluation error logging under bootverbose.
Sepherosa Ziehau [Sat, 13 Jun 2009 03:42:38 +0000 (11:42 +0800)]
MP table related static function renaming
Sepherosa Ziehau [Sat, 13 Jun 2009 03:16:53 +0000 (11:16 +0800)]
Get rid of global variable 'boot_cpu_id'
Sepherosa Ziehau [Sat, 13 Jun 2009 02:56:21 +0000 (10:56 +0800)]
Correct mptable_pass[12]() function comment
Matthew Dillon [Fri, 12 Jun 2009 23:19:35 +0000 (16:19 -0700)]
AHCI - Fix a bug in ahci_port_intr() when blockable == 0.
* The IS register was not being properly masked for the fall-through.
Matthew Dillon [Fri, 12 Jun 2009 21:45:35 +0000 (14:45 -0700)]
AHCI - Implement parallel port scan and thread each port interrupt.
* Implement a thread helper for each port. The master interrupt will perform
all actions which can be done without blocking and will delegate any
remaining actions (typically error and timeout handling) to the
port's thread helper.
* The thread helper is responsible for the initial probe. Thus ALL AHCI
SATA PORTS WILL NOW PROBE IN PARALLEL! Instead of 6 ports each taking
2 seconds to probe we now have 6 ports probing in a total of 2 seconds.
* Multiple port multipliers will probe in parallel, but targets on each
one have to be iterated.
* The attach code waits for all ports to fully probe and then runs CAM
attachments serially. This step goes very quickly since the ports
have already probed.
* Stalls on one physical port will no longer stall the rest of the ports.
So, for example, stalls on the port connected to your port multiplier
will not effect operations on, say, your internal SATA ports.
Matthew Dillon [Fri, 12 Jun 2009 16:31:43 +0000 (09:31 -0700)]
CAM - Add missing protocol for xpt_action_async()
Matthew Dillon [Fri, 12 Jun 2009 15:45:04 +0000 (08:45 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 12 Jun 2009 15:44:38 +0000 (08:44 -0700)]
AHCI - follow fixes to CAM
* Forgot to commit the CAM changes to use xpt_action_async().
Sascha Wildner [Fri, 12 Jun 2009 12:01:41 +0000 (14:01 +0200)]
Add missing ahci_pm.c to sys/conf/files.
This should fix the LINT build.
Reported-by: sephe
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1400>
Sepherosa Ziehau [Fri, 12 Jun 2009 10:31:40 +0000 (18:31 +0800)]
mp_probe() -> mptable_probe()
Sepherosa Ziehau [Fri, 12 Jun 2009 10:15:38 +0000 (18:15 +0800)]
Change mptable mapping mechanism during mptable parsing.
- Don't setup PTD for P=V, instead, pmap_mapdev() is used to mapping
MP float pointer struct and MP base configuration table.
- Get rid of 'mpfps' global variable
Sepherosa Ziehau [Fri, 12 Jun 2009 09:37:36 +0000 (17:37 +0800)]
mp_probe(): Return physical address of the MP float pointer struct
Sepherosa Ziehau [Fri, 12 Jun 2009 08:56:20 +0000 (16:56 +0800)]
Reorder MP probing
- Defer mp_probe() from getmemsize() to mp_enable()
- Use pmap_mapdev when searching MP float pointer struct
Sepherosa Ziehau [Fri, 12 Jun 2009 08:36:45 +0000 (16:36 +0800)]
Defer mptable_pass1() from mp_probe() to mp_enable()
Sepherosa Ziehau [Fri, 12 Jun 2009 08:06:13 +0000 (16:06 +0800)]
Save EBDA address before mp_probe()
Sepherosa Ziehau [Fri, 12 Jun 2009 04:33:05 +0000 (12:33 +0800)]
mptable_pass1: Don't set ncpus to 1; it has already been setup.
Matthew Dillon [Fri, 12 Jun 2009 08:45:28 +0000 (01:45 -0700)]
AHCI - Fix CAM reentrancy problem, work-around HW async notification issue.
* Our XPT_ENG_EXEC was not running asynchronously like we thought, nor
was CAM_SCAN_BUS. Use the not xpt_action_async() CAM call to ensure
these run asynchrnously.
* The SDBS interrupt bit does not always get set when an async notification
is receives. It is unclear whether this is because the port multipler (PM)
is sending a device set bits with 'N' but not 'I' flagged, or whether it
is a bug in the host controller. It only occurs while the AHCI port is
under load.
Matthew Dillon [Fri, 12 Jun 2009 08:07:11 +0000 (01:07 -0700)]
CAM - add xpt_action_async()
* The xpt_action_async() function works like xpt_action() but it guarantees
the ccb will be run from an independant thread.
This feature can be used by drivers to issue actions which they would like
to occur in a different context.
Matthew Dillon [Fri, 12 Jun 2009 06:14:51 +0000 (23:14 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 12 Jun 2009 06:10:06 +0000 (23:10 -0700)]
AHCI - Add Port Multiplier HOTPLUG support
* Add a ton of infrastructure to the port multiplier module. We now probe
the PM capabilities and turn on asynchronous notification if it supports
it.
Upon reception of an async notification event we access the PM to
determine which targets may have changed state, then rescan those
targets.
* Add code to handle transient IFS failures when issuing a PM softreset
command.
* Significantly rework the CAM infrastructure such that most of the hard
work now occurs from a main context instead of from an interrupt context.
* Replace all DELAY()'s with ahci_os_sleep(), and use tsleep().
* Use milliseconds as a universal time-base.
* Do not initiate a timeout until a CCB is actually sent to the
chip.
* Improve the device probe and state machine (it still needs work though).
Matthew Dillon [Fri, 12 Jun 2009 06:07:20 +0000 (23:07 -0700)]
CAM - Silence console spew on bus-rescan
Silence the console spew that occurs when rescanning a SCSI bus. This
is primarily so the AHCI driver can just have CAM re-test all the targets
when new targets are added or deleted.
Simon Schubert [Thu, 11 Jun 2009 23:51:33 +0000 (01:51 +0200)]
nrelease: don't mkdir bootstrap workdir
The newer pkgsrc bootstraps don't seem to like it when their
workdir already exist, so simply don't create it.
Matthew Dillon [Thu, 11 Jun 2009 08:30:38 +0000 (01:30 -0700)]
AHCI - Try to salvage port on PM target failure.
* If a PM target times out disable it, but try to salvage the rest of
the port so other PM targets continue to operate. We do this by
stopping the port, issuing a CLO, and then restarting it to clear
the BSY condition, then re-issue whatever commands might have been
active (probably none if this is a PM since we are restricted to
one command at a time).
Matthew Dillon [Thu, 11 Jun 2009 07:49:48 +0000 (00:49 -0700)]
AHCI - DHRS interrupt does not stop command processing.
Not only does the DHRS interrupt not stop command processing (which means
that ahci_pm_read() needs to be single-threaded by the way, which we only do
by happenstance atm), but we were stopping and starting the port without
reloading commands in-progress.
Matthew Dillon [Thu, 11 Jun 2009 06:41:04 +0000 (23:41 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 11 Jun 2009 06:24:06 +0000 (23:24 -0700)]
AHCI - Initial Port Multiplier support + misc fixes, and major reorg.
* Add nearly all of the core port multiplier support code. Add a
new module, ahci_pm.c, which has most of the PM support. Note
that the PM probe code (ahci_port_pmprobe()) was placed in ahci.c.
Note that we have to reduce the number of commands in the queue to 1
even though we are in command switched mode, which is contrary to the
AHCI spec which says we can queue more then 1 (the HBA still serializes
it). However, when I try to queue more then one to different devices
the SATA port gets fatal PHY errors.
* Significantly reorganize the hard and soft reset code and create
additional procedures in ahci_pm.c for hard and soft resets of
targets through the PM.
The softreset code now does the reset sequence twice to try to work
around an issue where a previous signature prevents the new signature
from being properly latched.
The hard and soft reset code and the CAM code now has a simple probe
sequencer using ap->ap_probe (and at->at_probe for the PM ata_port
structures).
* The hardreset code now interfaces with the PM probe code, which itself
is a bit complex. Ports with port multipliers on them can either busy
out on the initial probe or return information related to the device
at target 0 instead of information related to the PM itself, so we
have to probe the PM by putting the port into PMA mode and doing a
softreset of target 15 even if a PM does not appear to be attached.
* The hard and soft reset code for a target behind a PM (in ahci_pm.c)
tries to be careful not to break the entire port (and thus all the
targets) when one target misbehaves.
* Get a large chunk of the error handling code working with the PM,
including hopefully partial cancelation on target failure to fail
just that target instead of the entire SATA port.
* Modify the probe code to check for the presence of a PHY with a short
polling interval and skip the port if nothing appears to be connected
to it.
* Fix re-initialization recursions which can occur from the port interrupt
handler when called during a software or hardware reset.
* ATA_PORT vs AHCI_PORT
AHCI_PORT represents a physical port on the AHCI device. ATA_PORT
reprewents a logical port of which (if a PM is present) there can be
up to 16 per physical port. In most cases in the code we only pass
ATA_PORT (variable name 'atx') for targets behind a port multiplier
and we pass NULL for atx for directly connected targets. The variable
'at' is similar to 'atx' except it is always non-NULL and is a
pointer to target 0 on non-PM SATA ports (and the same as atx on
PM SATA ports).
* Reorganize tracking of ap->ap_active_cnt, tying it more directly to
the manipulation of ap->ap_active. This also fixed a few bugs in
the tracking of ap->ap_active_cnt.
* Implement the DHRS (Device-to-Host FIS) interrupt and properly
copy the rfis to the ccb. It is unclear whether command processing
stops when we receive DHRS but if it does we restart it. Without
this the PM register read and write functions do not work.
* Add interrupt code to track notification (SSNTF capability) via
the SDBS interrupt and AHCI_PREG_SNTF. Not tied into anything yet.
* Put all the bits for the AHCI_PREG_SERR register on the same plane,
combining the DIAG and ERR bits. Get rid of the shift-by-16 macros.
* Pray.
Hasso Tepper [Wed, 10 Jun 2009 06:13:53 +0000 (09:13 +0300)]
Make openssl define OPENSSL_NO_IDEA if compiled without IDEA support.
Sascha Wildner [Wed, 10 Jun 2009 17:09:29 +0000 (19:09 +0200)]
mount(8): Add an 'ignore' option.
The actual infrustructure was already in place (MNT_IGNORE) but it
couldn't be set, i.e. df(1) already had code to ignore MNT_IGNORE
mounts and an option to also show ignored mounts (-a), but the user
couldn't set the ignored option.
This is useful for procfs, amd, nullfs, filebacked fs, etc.
To test it with procfs you also need to recompile mount_std(8).
Some systems call the option 'hidden', but it doesn't seem any better
(both aren't very good), but at least 'ignore' corresponds to
MNT_IGNORE.
Submitted-by: Andreas Hauser <andy@splashground.de>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue200>
Sascha Wildner [Wed, 10 Jun 2009 16:37:28 +0000 (18:37 +0200)]
nrelease: Tar the src tarballs for the CD/DVD from the root of the src tree.
...and not from the root's parent directory.
This fixes the corner case of building an ISO in a source tree which
resides in a directory that is not named "src".
Reported-by: Antonio Huete Jimenez <ahuete.devel@gmail.com>
Submitted-by: corecode
Sascha Wildner [Wed, 10 Jun 2009 13:24:38 +0000 (15:24 +0200)]
posix_spawn.3: Sort by section number, then alphabetically.
Matthew Dillon [Tue, 9 Jun 2009 18:54:40 +0000 (11:54 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 9 Jun 2009 18:47:54 +0000 (11:47 -0700)]
AHCI - Better reset sequencing, bug fixes
* Change the reset sequence. If the first hardreset fails do a second
hardreset. If that fails then try doing a softreset. This seems to
catch all the cases. It is unclear why the reset sequence fails at
random points but it seems to be a combination of the port command
processor state and the device state. COMRESET does not actually reset
everything like its supposed to.
* Temporarily set ap_state to AP_S_NORMAL when starting a reset
sequence so commands do not just fail due to a previously failed
condition on the port.
* Restoration of command register state now depends on whether the
reset succeeded or failed.
* Note that only SERR_DIAG_X needs to be cleared to allow for the
next TFD update. These updates are serialized by the controller
and there may be more then one. Add a function ahci_flush_tfd() which
flushes all of them.
* Add ahci_port_hardstop() for dealing with failed ports and device
removals, instead of using ahci_port_hardreset(). This function
tries to do multiple transitions via section 10.10.1. These
transitions are not well documented by the standard.
* Fix ahci_poll() to not queue a command if the port is in a failed
state, as this really messes up our port processing state machine.
Sepherosa Ziehau [Tue, 9 Jun 2009 13:48:14 +0000 (21:48 +0800)]
Remove mp_capable; mp_enable() uses cpu_apic_address.
Sepherosa Ziehau [Tue, 9 Jun 2009 11:47:58 +0000 (19:47 +0800)]
Defer LAPIC mapping from pmap_bootstrap() to mp_enable()
Discussed-with: dillon@
Matthew Dillon [Tue, 9 Jun 2009 09:42:49 +0000 (02:42 -0700)]
AHCI - Add some small delays in the reset sequence.
* Add a small delay after sending the RESET FIS in softreset before
sending the second FIS.
* Add a small delay after the device succesfully unbusies before starting
normal commands.
Matthew Dillon [Tue, 9 Jun 2009 09:30:21 +0000 (02:30 -0700)]
AHCI - Improve hot-plug sequencing.
* Properly either fail or restart outstanding commands when we get a PCS
interrupt, based on the event we determined to have occurred.
NOTE: A PCS event stops command processing, so at the very least command
processing must be restarted by cycling the port.
* Reset the port's ap->ap_state when a hotplug-insertion is detected, so
the port has a chance to get out of its failed state.
Matthew Dillon [Tue, 9 Jun 2009 08:50:36 +0000 (01:50 -0700)]
AHCI bug fixes & enhancements. port_init, port_stop, port_start, etc.
* When initializing the AHCI device do an unconditional reset instead of
a conditional reset. The previous conditional reset did not cover
all the bases and could result in an unusable device.
* Remove the second (unused) argument from ahci_port_start().
* ahci_port_init() - init/reinit common code. If the hard reset
fails try a second time before giving up. Devices can get into
weird states and two attempts seems to clear it up.
* ahci_port_start() - FRE must be turned on before ST. Wait for FR
to come up before turning on ST. The spec does not require this but
it saves us from a race in ahci_port_stop() so do it anyway.
* ahci_port_stop() - When turning off ST we must wait for CR to go
inactive before we can turn off FRE.
* ahci_port_free() - Properly sequence stopping of the port by calling
ahci_port_stop().
* Create a consolidated ahci_port_reset() call to clean up some of the
code paths.
Matthew Dillon [Mon, 8 Jun 2009 23:10:51 +0000 (16:10 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 8 Jun 2009 23:09:04 +0000 (16:09 -0700)]
vmstat enhancements - Fall-back to kilobytes and megabytes if field too wide
If a numeric field is too wide divide and output in kilobytes or megabytes
(megabytes or gigabytes for VM page statistics).
Aggelos Economopoulos [Mon, 8 Jun 2009 22:48:46 +0000 (01:48 +0300)]
Properly protect kernel structures in varsym.h
Noticed-by: Antonio Huete Himenez, dillon@, aggelos@
Tested-by: dillon@
Matthew Dillon [Mon, 8 Jun 2009 22:24:44 +0000 (15:24 -0700)]
Correct missing 'STD' clause in entries for syscalls.master 450-452
Matthew Dillon [Mon, 8 Jun 2009 19:36:03 +0000 (12:36 -0700)]
USB - Properly handle the 'wait' flag when getting a char from the keyboard
This fixes numerous issues with DDB and panic dumps when a USB keyboard
is attached.
Matthew Dillon [Mon, 8 Jun 2009 19:35:44 +0000 (12:35 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 8 Jun 2009 19:31:44 +0000 (12:31 -0700)]
DDB - Do not generate endless stream of CRs if console not attached
If we get a console EOF do not just generate an endless stream of
CR's. Just hang in the loop for now.
Matthew Dillon [Mon, 8 Jun 2009 18:49:05 +0000 (11:49 -0700)]
USB - Add support for xfer-restart-before-callback
Interrupt pipes restart their xfers. When used for a USB
keyboard the xfer must be restarted before the callback,
even though there may be state data races, otherwise
the CTL-ALT-ESC sequence into the debugger will leave
the xfer unqueued and the keyboard will stop working.
Matthew Dillon [Mon, 8 Jun 2009 18:46:43 +0000 (11:46 -0700)]
USB - Fix polling code
The polling code now calls the intr function instead of trying
to optimize/shortcut the pending-interrupt test. There are
additional conditions which need action which the test was
not covering.
The polling code now calls the softintr function as well,
as it may be non-operational when the polling code
is being used.
Aggelos Economopoulos [Mon, 8 Jun 2009 14:54:38 +0000 (17:54 +0300)]
Merge branch 'master' of /home/aggelos/devel/dfly/dfly.git/
Aggelos Economopoulos [Mon, 8 Jun 2009 14:42:46 +0000 (17:42 +0300)]
lock around accesses to uidinfo and varsymset
- add ->vx_lock to protect the varsymset fields
- add ->ui_lock to protect the rest of the fields in uidinfo
- protect the uidinfo hash
- the varsym*() syscalls are now mpsafe
This is obviously performance-irrelevant, but it allows
access to uidinfo without the BGL.
Sascha Wildner [Mon, 8 Jun 2009 13:43:03 +0000 (15:43 +0200)]
Sync zoneinfo database with tzdata2009i from elsie.
asia: 8.32 -> 8.34
Bangladesh will introduce DST starting June 20.
Sascha Wildner [Sun, 7 Jun 2009 04:06:05 +0000 (06:06 +0200)]
rc.sendmail(8): Fix typo.
Sascha Wildner [Sat, 6 Jun 2009 13:08:38 +0000 (15:08 +0200)]
localtime(3): Silence the last i386 warning in libc.
Taken-from: FreeBSD
Sascha Wildner [Sat, 6 Jun 2009 12:56:12 +0000 (14:56 +0200)]
rpc.rquotad(8): Remove bogus #include <varargs.h>.
Matthew Dillon [Sun, 7 Jun 2009 19:42:30 +0000 (12:42 -0700)]
AHCI - Fix a polled command issue.
* If ATA_F_POLL is set, the timeout code may be called without
ATA_F_TIMEOUT_RUNNING having been set.
* NOTE on previous commit: The ahci_poll() code also had to be made
more robust to handle ATA_F_POLL general requests (such as when dealing
with a crash dump). Such requests can wind up in a more diverse set
of states then polled requests made from the softreset code.
Matthew Dillon [Sun, 7 Jun 2009 19:39:13 +0000 (12:39 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 7 Jun 2009 19:36:35 +0000 (12:36 -0700)]
AHCI - properly initialize ccb_xa.flags in softreset, make poll code robust
* The softreset code did not properly initialize ccb_xa.flags, causing
the softreset FIS's to sometimes get queued as an NCQ command instead of
as a non-NCQ command.
* Make ahci_poll() a bit more robust. Properly set ccb_xa.state on
timeout, check for unexpected completions, and check to see if the
ccb was put on a queue (though the latter should never happen since
active/sactive is cleared by ahci_get_err_ccb()).
Justin C. Sherrill [Sun, 7 Jun 2009 17:51:04 +0000 (10:51 -0700)]
s/pkgbox/avalon/g for nrelease, pkg_radd, pkg_search. Plus pkg_radd fixes.
pkg_radd had a BINPKG_SITES default that wouldn't have worked.
Sepherosa Ziehau [Sun, 7 Jun 2009 06:25:54 +0000 (14:25 +0800)]
ACPI P-State: Using priority messages
Sepherosa Ziehau [Sun, 7 Jun 2009 06:04:03 +0000 (14:04 +0800)]
icmp: Bring in reply_src and reply_from_interface sysctl nodes.
They act as fallback mechanism if proper inet address could not
be found on the packet incoming interface.
reply_from_interface:
icmp reply from incoming interface for non-local packets
reply_src:
icmp reply source for non-local packets
Obtained-from: FreeBSD
Sepherosa Ziehau [Sun, 7 Jun 2009 01:21:09 +0000 (09:21 +0800)]
route_output: Fix RTM_DELETE rtentry leakage
This actually incorporates two dependent changes.
- Change to routing code:
Keep the rtinfo in the netmsg unchanged, so all CPU on the ntemsg
forwarding path will see the same rtinfo setup by rtrequest1_global()
or rtsearch_global()'s caller, instead of the rtinfo baked by the
previous CPU.
This is critical step before we could free the rtentry in route_output()
RTM_DELETE callback, since in this callback, fillrtmsg() will change
the rtinfo to point the current rtentry's memory. As long as we feed
it a rtinfo local copy, we are safe to free the rtentry later, no
dangling memory reference anymore.
- Change to the rtsock code:
Since the rtinfo setup in the route_output() points to the memory in
the preallocated rtm, so we could not allow the callback of
rtrequset1_global()/ rtsearch_global() to free the rtm if reallocation
is required due to the rtm size changes. We keep two different pointer
fields in the callback argument now. One is the save the preallocated
rtm, which is pointed to by the rtinfo. It could be freed only after
a new rtm is allocated and rtrequset1_global()/ rtsearch_global() are
done, so rtinfo will not reference invalid memory. The other pointer
saves the new rtm if there is any.
Comments are added to the related places.
Reported-by: ruse39 on EFnet
Sepherosa Ziehau [Sat, 6 Jun 2009 11:03:18 +0000 (19:03 +0800)]
route_output: Correctly set family according to the rtinfo.rti_dst
Mainly to
- Avoid referencing rtinfo after rtrequest1_global/rtsearch_global;
this will ease upcoming fixes.
- Eliminate bunch of rtinfo.rti_dst NULL assignments.
Matthew Dillon [Sun, 7 Jun 2009 00:55:16 +0000 (17:55 -0700)]
USB - umass - fix reentrancy issues when rescanning the bus.
Use an asynchronous rescan instead of a synchronous rescan to avoid
reentrancy issues.
Matthew Dillon [Sun, 7 Jun 2009 00:32:45 +0000 (17:32 -0700)]
AHCI - Implement ahci_xpt_poll() - fix livelock during shutdown/reboot/panic
The ahci_xpt_poll() function is called when interrupts might be
non-operational, typically during a shutdown/reboot, or panic.
Poll the appropriate AHCI port.
Matthew Dillon [Sat, 6 Jun 2009 22:45:14 +0000 (15:45 -0700)]
AHCI - Hotplug. Increase timeout for BSY check, FIS adjusts for softreset, CAM
* Wait up to 3 seconds for BSY to clear. 1 second was not enough when
powering up an external 2.5" drive already connected to the port.
* It is unclear how other fields in the FIS should be initialized when
performing a soft reset. Zero the fields instead of inheriting whatever
junk was in the FIS from prior commands. This seems to fix random
errors from unplugging and plugging in a "My Book".
* Adjust the CAM devq to ensure that one ata_xfer remains available for error
processing. Do not clean out the devq when reducing the number of tags to
1 as we will not use NCQ in this case anyway and need the extra CCB for
error processing.
Matthew Dillon [Sat, 6 Jun 2009 21:22:30 +0000 (14:22 -0700)]
systat - fix bug in vmmeter when switching to it via ':pv'.
If systat is started with something and then switched to vmmeter via ':pv'
vmmeter failed to display. Fixing the return value for the init function
solves the problem.
Matthew Dillon [Sat, 6 Jun 2009 21:01:53 +0000 (14:01 -0700)]
vmstat - Add another byte of width for Csw, Trp, Sys, Int, and Flt.
Reorganize the Proc: and csw/trp/sys/int/sof/flt line a bit to make them
a bit wider so they are less likely to squeeze together without any
separation on heavily loaded systems.