Commit Graph

149766 Commits

Author SHA1 Message Date
Alexander Motin
c263e77659 MFC r199278:
Check SNCQ HBA capability bit when reporting NCQ support to CAM.
2009-11-17 21:27:21 +00:00
Alexander Motin
dbf0a1cd3e MFC r199263:
Do not enable tagged queueing if controller reports 0 tags support.
2009-11-17 21:26:05 +00:00
Alexander Motin
99695a07ce 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.
2009-11-17 21:23:05 +00:00
Alexander Motin
4799e6b756 MFC r199176:
Add set of chip IDs, known to support AHCI.
2009-11-17 21:21:27 +00:00
Alexander Motin
f629df5749 MFC r199132:
Organize device IDs and add some more of them.
2009-11-17 21:20:19 +00:00
Alexander Motin
0b0242c67c MFC r199079, r199101:
Add support for ATA Power Management.
2009-11-17 21:17:22 +00:00
Alexander Motin
6bb752977c MFC r198947:
Implement device stats accounting for ATA commands.
2009-11-17 21:14:58 +00:00
Alexander Motin
f6e8afbf7a MFC r198904, r198905:
PMP commands use short format. PMP write doesn't return result.
2009-11-17 21:14:02 +00:00
Alexander Motin
2c588f5344 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.
2009-11-17 21:09:47 +00:00
Alexander Motin
a60c326522 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.
2009-11-17 21:08:12 +00:00
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