summaryrefslogtreecommitdiff
path: root/sys/dev/ata
Commit message (Collapse)AuthorAgeFilesLines
* MFC r215468:Alexander Motin2010-11-232-0/+20
| | | | | | | | | Make ATA_CAM wrapper to report SATA power management capabilities to CAM to make it configure device to initiate transitions if controller configured to accept them. This makes hint.ata.X.pm_level=1 mode working. Notes: svn path=/stable/8/; revision=215777
* MFC r215453:Alexander Motin2010-11-231-1/+5
| | | | | | | | Even if we are skipping SATA hard reset - set power management bits in SControl register. This should make things more consistent. Notes: svn path=/stable/8/; revision=215776
* MFC r215428, r215431, r215462:Alexander Motin2010-11-232-1/+7
| | | | | | | Add support for VIA VX900 chipset SATA controller. Notes: svn path=/stable/8/; revision=215772
* MFC r214896:Alexander Motin2010-11-231-8/+13
| | | | | | | | Mark command submission timeouts as timeouts. This should trigger device resets and increase chances of getting device back again. Notes: svn path=/stable/8/; revision=215771
* MFC r214880:Alexander Motin2010-11-231-6/+18
| | | | | | | Add support for odd-sized PIO transfers, sometimes used by ATAPI. Notes: svn path=/stable/8/; revision=215769
* MFC r215034:Rebecca Cran2010-11-201-4/+4
| | | | | | | | | | Fix typos. PR: bin/148894 Submitted by: olgeni Notes: svn path=/stable/8/; revision=215588
* MFC r214672:Alexander Motin2010-11-191-1/+0
| | | | | | | Remove stale line, accidentally slipped into r214016. Notes: svn path=/stable/8/; revision=215512
* MFC r209683 by imp:Alexander Motin2010-11-191-3/+8
| | | | | | | | | | | Add a safety-belt. If the identified disk has 0 blocks, don't attach it. This can happen in some cases when plugging in SD/SmartCard PC Cards with empty slots. It is better to detect this bogosity, and refuse to attach rather than panic with a division by zero (in one of many places) down stream. Notes: svn path=/stable/8/; revision=215511
* MFC r209682 by imp:Alexander Motin2010-11-191-2/+2
| | | | | | | Minor formatting nits. Notes: svn path=/stable/8/; revision=215510
* MFC r214988:Alexander Motin2010-11-191-0/+9
| | | | | | | | Teach ahci(4), siis(4) and ATA_CAM ata(4) wrapper report to CAM residual I/O length on underruns, that often happens for some SCSI commands. Notes: svn path=/stable/8/; revision=215509
* MFC r214016:Alexander Motin2010-11-0211-155/+508
| | | | | | | | | | | | | | | | Set of legacy mode SATA enchancements: - Implement proper combined mode decoding for Intel controllers to properly identify SATA and PATA channels and associate ATA channels with SATA ports. This fixes wrong reporting and in some cases hard resets to wrong SATA ports. - Improve SATA registers support to handle hot-plug events and potentially interface errors. For ICH5/6300ESB chipsets these registers accessible via PCI config space. For later ones they may be accessible via PCI BAR(5). - For controllers not generating interrupts on hot-plug events, implement periodic status polling. Use it to detect hot-plug on Intel and VIA controllers. Same probably could also be used for Serverworks and SIS. Notes: svn path=/stable/8/; revision=214671
* MFC r213301:Alexander Motin2010-11-021-2/+1
| | | | | | | | | Revert r132291. Restore setting PIO/WDMA timings for VIA UDMA133 controllers. Linux disables only AST register writing there, but no all timings. Notes: svn path=/stable/8/; revision=214669
* MFC r213092:Alexander Motin2010-11-021-1/+1
| | | | | | | Add missing le32toh(), same as recently done in ata-siliconimage.c. Notes: svn path=/stable/8/; revision=214668
* MFC r213047 by jchandra:Alexander Motin2010-11-021-1/+1
| | | | | | | | Add missing byteswap, works on big endian systems now (tested on Netlogic XLS MIPS processor). Notes: svn path=/stable/8/; revision=214667
* MFC r212359:Nathan Whitehorn2010-09-303-19/+34
| | | | | | | | | | | | Fix a problem where device detection would work unreliably on Serverworks K2 SATA controllers. The chip's status register must be read first, and as a long, for other registers to be correctly updated after a command, and this includes the command sequence in device detection as well as the previously handled case after interrupts. While here, clean up some previous hacks related to this controller. Notes: svn path=/stable/8/; revision=213291
* MFC r212146:Alexander Motin2010-09-161-0/+8
| | | | | | | | | | Add workaround for SiI3114 and SiI3512 chips bug, which caused sending R_ERR in response to DMA activate FIS under certain circumstances. This is recommended fix from chip datasheet. If triggered, this bug most likely caused write command timeout. Notes: svn path=/stable/8/; revision=212720
* MFC r212145:Alexander Motin2010-09-163-17/+15
| | | | | | | | | | | SATA1.x SiliconImage controllers on power-on reset TFD Status register into value 0xff. On hot-plug this value confuses ata_generic_reset() device presence detection logic. As soon as we already know drive presence from SATA hard reset, hint ata_generic_reset() to wait for device signature until success or full timeout. Notes: svn path=/stable/8/; revision=212719
* MFC r212081:Alexander Motin2010-09-161-1/+1
| | | | | | | | Increase device reset timeout from 10 to 15 seconds, same as in ahci(4). Some devices found need about 10-12 seconds to spinup. Notes: svn path=/stable/8/; revision=212718
* MFC r211920:Alexander Motin2010-09-042-16/+43
| | | | | | | | Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers. Notes: svn path=/stable/8/; revision=212192
* MFC r210168:Alexander Motin2010-07-201-1/+2
| | | | | | | | | | | Make legacy ATA emulation detection more strict. This should fix false positive legacy detection and attach failure/panic for Marvell 88SX6141 controller and potentially some others. PR: kern/145064 Notes: svn path=/stable/8/; revision=210281
* MFC r210165:Alexander Motin2010-07-201-1/+7
| | | | | | | Improve interrupt setup errors handling. Notes: svn path=/stable/8/; revision=210280
* MFC r209883, r209944:Alexander Motin2010-07-181-4/+12
| | | | | | | | | | | Make interrupt handler check that CAM bus initialization completed before touching it. It fixes possible panic during controller attach in ATA_CAM mode. While there, slightly improve attach errors handling. Notes: svn path=/stable/8/; revision=210208
* MFC r209977:Alexander Motin2010-07-181-0/+2
| | | | | | | Disable multi-sector PIO transfers if ATA_SET_MULTI command failed. Notes: svn path=/stable/8/; revision=210206
* MFC r209884:Alexander Motin2010-07-187-1/+24
| | | | | | | | | If ata_sata_phy_reset() failed and ata_generic_reset() is not called, mark channel as having no devices connected. This improves hot-unplug operation on legacy-emulating SATA controllers. Notes: svn path=/stable/8/; revision=210205
* MFC r209872:Alexander Motin2010-07-1811-15/+22
| | | | | | | | | | Make hw.ata.ata_dma_check_80pin tunable affect not only device side, but also controller side cable checks. Make respective sysctl writable. PR: kern/143462 Notes: svn path=/stable/8/; revision=210204
* MFC r209664:Alexander Motin2010-07-162-2/+56
| | | | | | | | | | | Add ata(4) ability to limit initial ATA mode for devices via device hints. After boot this mode can be changed with atacontrol/camcontrol as usual. It works for both legacy and ATA_CAM wrapper mode. PR: kern/123980 Notes: svn path=/stable/8/; revision=210164
* MFC r208822:Alexander Motin2010-07-161-2/+2
| | | | | | | Fix possible use after free. Notes: svn path=/stable/8/; revision=210163
* MFC r208820:Alexander Motin2010-07-161-0/+1
| | | | | | | Fix use after free on error. Notes: svn path=/stable/8/; revision=210162
* MFC r208162, 208836, 208837:Nathan Whitehorn2010-06-111-2/+2
| | | | | | | | | | | | | | | | | Program the K2 SATA controller's interrupt to be level-triggered low, and respect the edge/level settings in the device tree. OpenPIC on powerpc sets interrupts to be level high by default. On Apple interrupt controllers, all level interrupts are low regardless of programming except interrupt 0, used by K2 SATA on some Apple systems, with the result that the K2 SATA IRQ is misconfigured. Pending review of changes to this default, work around this by changing the programming of the K2 SATA interrupt to level low. Approved by: re (kib) Notes: svn path=/stable/8/; revision=209044
* MFC r208870:Nathan Whitehorn2010-06-113-1/+21
| | | | | | | | | | | | | | | | | Some revisions of the Serverworks K2 SATA controller have a data corruption bug where if an ATA command is issued before DMA is started, data will become available to the controller before it knows what to do with it. This results in either data corruption or a controller crash. This patch remedies the problem by adopting the workaround employed by Linux and Darwin: starting the DMA engine prior to sending the ATA command. Reviewed by: mav Approved by: re (kib) Notes: svn path=/stable/8/; revision=209042
* MFC r208796:Alexander Motin2010-06-081-16/+16
| | | | | | | | | Fix PCH chipset IDs. They are 0x3bxx, not 0x3axx. Approved by: re (kib) Notes: svn path=/stable/8/; revision=208908
* MFC r208410:Alexander Motin2010-05-242-0/+14
| | | | | | | Report ATA/SATA channel number to NewBus at location string. Notes: svn path=/stable/8/; revision=208492
* MFC: r208349Marius Strobl2010-05-231-3/+3
| | | | | | | | | | | | | Change ad_firmware_geom_adjust() to operate on a struct disk * only and hook it up to ada(4) also. While at it, rename *ad_firmware_geom_adjust() to *ata_disk_firmware_geom_adjust() etc now that these are no longer limited to ad(4). This also allows to maintain a compatibility shim for pc98_ad_firmware_geom_adjust() for the tier-1 PC98 in stable/8. Reviewed by: mav (r208349) Notes: svn path=/stable/8/; revision=208451
* MFC r208375, r208393:Alexander Motin2010-05-231-4/+15
| | | | | | | | Improve suspend/resume support. Make sure controller is idle on suspend and reset it on resume. Notes: svn path=/stable/8/; revision=208448
* MFC r207432:Alexander Motin2010-05-081-39/+26
| | | | | | | Add Target/LUN ID checks. Notes: svn path=/stable/8/; revision=207773
* MFC r207221:Alexander Motin2010-05-021-1/+1
| | | | | | | | Mark ATA channel as idle on timeout in non-ATA_CAM mode. This should fix possible duplicate request completion. Notes: svn path=/stable/8/; revision=207503
* MFC r206604:Alexander Motin2010-05-021-1/+4
| | | | | | | | For early ALI chips do not announce I/O sizes that require unsupported 48bit DMA commands. Notes: svn path=/stable/8/; revision=207502
* MFC r205967:Alexander Motin2010-04-151-0/+2
| | | | | | | | Include opt_ata.h, as some structures here depending on ATA_CAM option. This fixes ATA_CAM with atamvsata and probably some other drivers. Notes: svn path=/stable/8/; revision=206655
* MFC r205680:Alexander Motin2010-04-151-2/+16
| | | | | | | | | | Use last 16 bytes of serial number in metadata instead of first ones, same as Intel MatrixRAID does. PR: kern/124064 Notes: svn path=/stable/8/; revision=206653
* MFC r205074:Alexander Motin2010-03-311-6/+8
| | | | | | | | | | Mask disk_idx to avoid panic because of extra bits set. PR: kern/102211 Submitted by: yoichi Notes: svn path=/stable/8/; revision=205968
* MFC r204509:Alexander Motin2010-03-032-1/+3
| | | | | | | | - Add ALI M5228 PATA ID. - Add missed DMA initialization for ALI SATA chips. Notes: svn path=/stable/8/; revision=204653
* MFC r204250:Alexander Motin2010-03-031-3/+3
| | | | | | | Fix recursive lock attempt on hot-plug event in non-ATA_CAM mode. Notes: svn path=/stable/8/; revision=204652
* MFC r204210, r204216:Alexander Motin2010-03-031-0/+16
| | | | | | | Add Intel PCH SATA controller IDs. Notes: svn path=/stable/8/; revision=204651
* MFC r204195:Alexander Motin2010-03-013-6/+18
| | | | | | | Improve output for controllers that doesn't report SATA speed. Notes: svn path=/stable/8/; revision=204528
* MFC r203449:Alexander Motin2010-02-141-2/+6
| | | | | | | | Implement poll method for atapicam. It is not perfect, but better then nothing. Notes: svn path=/stable/8/; revision=203900
* MFC r203347:Alexander Motin2010-02-141-1/+11
| | | | | | | NetCell is a PCI hardware RAID without cable and mode setting. Notes: svn path=/stable/8/; revision=203898
* MFC r203525:Alexander Motin2010-02-141-1/+2
| | | | | | | Report SATA300 chips also as SATA. Notes: svn path=/stable/8/; revision=203897
* MFC r203445:Alexander Motin2010-02-141-1/+1
| | | | | | | | Report to CAM unit number of underlying ataX bus device, instead of this atapicamX. It is more apropriate and useful together with "ata" name. Notes: svn path=/stable/8/; revision=203895
* MFC r203376, r203384:Alexander Motin2010-02-142-3/+13
| | | | | | | | | - Give ATA/SATA SIMs info about ATAPI packet size, supported by device. - Make ATA XPT to reject longer SCSI CDBs then supported by device, or any SCSI CDBs, if device doesn't support ATAPI. Notes: svn path=/stable/8/; revision=203890
* MFC r203108:Alexander Motin2010-02-142-34/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Large set of CAM improvements: - Unify bus reset/probe sequence. Whenever bus attached at boot or later, CAM will automatically reset and scan it. It allows to remove duplicate code from many drivers. - Any bus, attached before CAM completed it's boot-time initialization, will equally join to the process, delaying boot if needed. - New kern.cam.boot_delay loader tunable should help controllers that are still unable to register their buses in time (such as slow USB/ PCCard/ CardBus devices), by adding one more event to wait on boot. - To allow synchronization between different CAM levels, concept of requests priorities was extended. Priorities now split between several "run levels". Device can be freezed at specified level, allowing higher priority requests to pass. For example, no payload requests allowed, until PMP driver enable port. ATA XPT negotiate transfer parameters, periph driver configure caching and so on. - Frozen requests are no more counted by request allocation scheduler. It fixes deadlocks, when frozen low priority payload requests occupying slots, required by higher levels to manage theit execution. - Two last changes were holding proper ATA reinitialization and error recovery implementation. Now it is done: SATA controllers and Port Multipliers now implement automatic hot-plug and should correctly recover from timeouts and bus resets. - Improve SCSI error recovery for devices on buses without automatic sense reporting, such as ATAPI or USB. For example, it allows CAM to wait, while CD drive loads disk, instead of immediately return error status. - Decapitalize diagnostic messages and make them more readable and sensible. - Teach PMP driver to limit maximum speed on fan-out ports. - Make boot wait for PMP scan completes, and make rescan more reliable. - Fix pass driver, to return CCB to user level in case of error. - Increase number of retries in cd driver, as device may return several UAs. Notes: svn path=/stable/8/; revision=203889