Commit Graph

149756 Commits

Author SHA1 Message Date
Alexander Motin
ecc2f2f455 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.
2009-11-17 21:00:02 +00:00
Alexander Motin
d54c3c6363 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.
2009-11-17 20:59:00 +00:00
Alexander Motin
bf60b82344 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.
2009-11-17 20:57:35 +00:00
Alexander Motin
33e000ff00 MFC r198849:
Improve reporting ATA Status error details.
2009-11-17 20:56:24 +00:00
Alexander Motin
5907c56d56 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.
2009-11-17 20:54:52 +00:00
Alexander Motin
0e3aa3c51e 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.
2009-11-17 20:49:26 +00:00
Alexander Motin
0cfcf828a9 MFC r198709:
Sync connection speed reporting with kernel.
Report speed in identify command, same as done by inquiry.
2009-11-17 20:45:49 +00:00
Alexander Motin
8eea8c79fc 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.
2009-11-17 20:43:04 +00:00
Alexander Motin
a3a475dfb6 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.
2009-11-17 20:41:15 +00:00
Alexander Motin
e587ad07dc MFC r198426:
Reimplement device reset sequence in more controller-specific way.
2009-11-17 20:35:29 +00:00
Alexander Motin
844c81cb6d MFC r198394:
Make "Retrying Command" to be printed before actual retrying.
It should make debug/error log a bit more readable.
2009-11-17 20:20:56 +00:00
Alexander Motin
47a0c6b476 MFC r198390:
Revert interrupt reason check order back.
ATAPI errors may set IF bit together with TFE.
2009-11-17 20:19:20 +00:00
Alexander Motin
262d120349 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.
2009-11-17 20:17:48 +00:00
Alexander Motin
6b1f25ce56 MFC r197545:
Fethch more information from IDENTIFY result.
2009-11-17 19:52:51 +00:00
Alexander Motin
446b7f18f0 MFC r197419:
Reduce code duplication.
2009-11-17 19:51:39 +00:00
Alexander Motin
2ab5a453f6 MFC r198321
Freeze device queue on error to permit periph driver to do proper recovery.
2009-11-17 19:42:06 +00:00
Alexander Motin
8f5dee240e 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.

Read and clear SERR register on interrupt.
2009-11-17 19:40:39 +00:00
Alexander Motin
4956ef3a42 MFC r198382, r198385:
Replace most of priority numbers with defines. No logical changes.
2009-11-17 19:38:19 +00:00
Alexander Motin
01007372f2 MFC r197838:
On command timeout handle frozen command first, to not run it inside
XXX_end_transaction().
2009-11-17 19:36:06 +00:00
Konstantin Belousov
4a0dfeb299 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.
2009-11-17 18:38:00 +00:00
Konstantin Belousov
82bccc6465 MFC r198476 (by alc):
Simplify the inner loop of vm_fault_copy_entry().

Approved by:	alc
2009-11-17 18:31:09 +00:00
John Baldwin
41f114f107 MFC 198986:
Fix a copy-paste bug when reading data from the last 3 (7 for PAE) bytes of
a page mapped by a large page in the kernel.
2009-11-17 16:50:57 +00:00
John Baldwin
24b458cf34 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.
2009-11-17 16:17:11 +00:00
Hajimu UMEMOTO
0e78091638 MFC r197286, r197306:
V_irtualize the lltables list, making ARP and ND reasonably
usable again with options VIMAGE kernels.

Discussed with:	hrs
2009-11-17 16:11:53 +00:00
John Baldwin
fb5f8c0a4f MFC 198043:
Move the USB wireless drivers down into their own section next to the USB
ethernet drivers.
2009-11-17 15:56:45 +00:00
John Baldwin
9fff59ab13 MFC 198856: Fix a couple of comment typos. 2009-11-17 15:30:16 +00:00
John Baldwin
9ad2d73695 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.
2009-11-17 15:28:14 +00:00
Alexander Motin
0072eeecbe MFC r198381:
Remove some obsoleted comments.
2009-11-17 15:16:21 +00:00
Alexander Motin
9afd1b3ab3 MFC r198372, r198377:
Implement cam_ccbq_fini().
This is effectively NULL change, but makes this API a bit more consistent.
2009-11-17 15:14:13 +00:00
Alexander Motin
c6956547fc MFC r198333:
Do not search for bus when it is not needed.
2009-11-17 15:08:01 +00:00
Alexander Motin
1d686e05d5 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.
2009-11-17 15:04:58 +00:00
Alexander Motin
3c6b9b48a0 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.
2009-11-17 14:56:00 +00:00
Alexander Motin
db581aa0e3 MFC r198322:
Report real max_target = 15. SIM doesn't need to know that target 15 is PMP.
It is XPT business.
2009-11-17 14:49:35 +00:00
Alexander Motin
b06be4e00c MFC r196907:
To save small bit of CPU time, hide part of SNTF register read latency
behind other reads.
2009-11-17 14:47:40 +00:00
Alexander Motin
1987ffda92 MFC r197541:
Report SATA 3.x devices.
2009-11-17 14:38:47 +00:00
Alexander Motin
71f045ca3f MFC r197421:
If on sense request device returns no sence, give up and return,
or we may loop forever.
2009-11-17 14:37:20 +00:00
Bjoern A. Zeeb
422426a5f1 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.

PR:	i386/96382, kern/100410, kern/122252, kern/116328
2009-11-17 14:30:09 +00:00
Alexander Motin
72d128fa0b MFC r196983:
Free the correct buffer in an error case.

Submitted by:   phk
2009-11-17 14:14:07 +00:00
Alexander Motin
028a10f917 MFC r196903:
Remove duplicate qfrozen_cnt variable from struct cam_ed.
ccbq.queue.qfrozen_cnt should be used instead.
2009-11-17 13:48:27 +00:00
Christian Brueffer
e8f2b1218b MFC: r198952
Fix two memory leaks in error cases.
2009-11-17 13:37:27 +00:00
Alexander Motin
f26a262eeb MFC r196901:
Remove unneeded CAM_SIM_MPSAFE check.
2009-11-17 13:04:05 +00:00
Alexander Motin
05e4022d23 MFC r196898:
Report scbusX in xpt_announce_periph() to less confuse users by two
different bus addressing schemes.

MFC r196900:
s/bus %d/scbus%d/ in some messages to correct terminology.
2009-11-17 13:01:17 +00:00
Alexander Motin
b351967560 MFC r196897:
Avoid extra swi_sched() call, if this SIM is already queued.
It reduces overhead for coalesced command completions.
2009-11-17 12:58:07 +00:00
Alexander Motin
cfd3d58f6f MFC r197540, r198587, r198865:
Add more defines for bits from ATA and CF specifications.
2009-11-17 12:42:27 +00:00
Alexander Motin
b882e0398e MFC r199074:
Add more ICH10 chip IDs.
2009-11-17 12:30:06 +00:00
Alexander Motin
dfa1c364b8 MFC r198583:
Add some magic taken from OS X and Linux to support early revision K2
SATA controllers, like those found on the G5 Xserve.
2009-11-17 12:25:34 +00:00
Alexander Motin
3f2bdafd97 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.
2009-11-17 12:23:14 +00:00
Alexander Motin
ba0e41c3cc MFC r198519:
Don't ignore the return value of g_modevent() in acd_modevent().
2009-11-17 12:18:14 +00:00
Konstantin Belousov
5c3037910a MFC r199137:
Detect the slashdot lookup for RENAME or REMOVE in lookup(), and return
EINVAL.
2009-11-17 11:46:55 +00:00
Konstantin Belousov
c3568f6fbd 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.
2009-11-17 11:43:53 +00:00