summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-lowlevel.c
Commit message (Collapse)AuthorAgeFilesLines
* Small typo.pfg2016-03-291-1/+1
|
* Add unmapped I/O support to ata(4) driver.mav2015-08-071-70/+167
| | | | | | Main problem there was PIO mode support, that required KVA mapping. Handle that case using recently added pmap_quick_enter_page(9) KPI, mapping data pages to KVA one at a time.
* Fix several typoseadler2013-05-121-1/+1
| | | | | | PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days
* - With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) relatedmarius2013-04-061-1/+0
| | | | | | | | | option left but actually consumed by ada(4), so move it to opt_ada.h and get rid of opt_ata.h. - Fix stand-alone build of atacore(4) by adding opt_cam.h. - Use __FBSDID. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers.
* - Make ata_str2mode() static, it's not used outside of ata-all.c.marius2013-04-061-1/+1
| | | | | | | | | | - Move ata_timeout() to ata-all.c so we don't need to expose both this function and ata_cam_end_transaction() but only the former. - Move ata_cmd2str() from ata-queue.c to ata-all.c so we can get rid of the former. - Add some missing prototypes. MFC after: 3 days
* Remove all legacy ATA code parts, not used since options ATA_CAM enabled inmav2013-04-041-30/+0
| | | | | | | | | most kernels before FreeBSD 9.0. Remove such modules and respective kernel options: atadisk, ataraid, atapicd, atapifd, atapist, atapicam. Remove the atacontrol utility and some man pages. Remove useless now options ATA_CAM. No objections: current@, stable@ MFC after: never
* Improve r238673 to additionally allow for odd-aligned buffers asmarius2013-02-021-10/+39
| | | | | | | | | passed in by smartd of smartmontools. While at it, hint the compiler that 32-bit PIO is the most likely case (idea from Linux) and use bus_{read,write}_stream_2(9) instead of bus_{read,write}_multi_stream_2(9) for single count reads/writes. MFC after: 1 week
* Implement CAM_ATAIO_NEEDRESULT (fetching full set of result registers) formav2012-10-261-2/+10
| | | | | | | ata(4) driver in ATA_CAM mode. That slighty improves error reporting and also should fix `smartctl -l scterc /dev/adaX` operation. MFC after: 3 weeks
* Remove bogus break statements.kevlo2012-09-181-1/+0
| | | | Obtained from: DragonFly
* Use 16bit PIO instead of 32bit in case of misaligned buffer.mav2012-07-211-18/+14
| | | | It fixes kernel panic during CD write with cdrecord on sparc64.
* Convert files to UTF-8uqs2012-01-151-1/+1
|
* Make PATA-like soft-reset in ata(4) more strict in checking disk signature.mav2011-04-211-2/+2
| | | | | | | It allows to avoid false positive device detection under Xen, that caused long probe delays due to subsequent IDENTIFY command timeouts. MFC after: 1 month
* Mark command submission timeouts as timeouts. This should trigger devicemav2010-11-061-8/+13
| | | | resets and increase chances of getting device back again.
* Add support for odd-sized PIO transfers, sometimes used by ATAPI.mav2010-11-061-6/+18
|
* Fix a problem where device detection would work unreliably on Serverworksnwhitehorn2010-09-091-2/+8
| | | | | | | | | | | | 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. Reported by: many Reviewed by: mav MFC after: 3 weeks
* SATA1.x SiliconImage controllers on power-on reset TFD Status register intomav2010-09-021-17/+13
| | | | | | | 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.
* Some revisions of the Serverworks K2 SATA controller have a datanwhitehorn2010-06-061-1/+10
| | | | | | | | | | | | | | 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. Observer on: Xserve G5 Reviewed by: mav MFC after: 1 week
* MFp4:mav2009-12-061-0/+9
| | | | | | | | | | | | | | | | | | Introduce ATA_CAM kernel option, turning ata(4) controller drivers into cam(4) interface modules. When enabled, this options deprecates all ata(4) peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers (ada, cd, ...) and interfaces to be natively used instead. As side effect of this, ata(4) mode setting code was completely rewritten to make controller API more strict and permit above change. While doing this, SATA revision was separated from PATA mode. It allows DMA-incapable SATA devices to operate and makes hw.ata.atapi_dma tunable work again. Also allow ata(4) controller drivers (except some specific or broken ones) to handle larger data transfers. Previous constraint of 64K was artificial and is not really required by PCI ATA BM specification or hardware. Submitted by: nwitehorn (powerpc part)
* MFp4:mav2009-10-311-46/+45
| | | | | | | | - Remove most of direct relations between ATA(4) peripherial and controller levels. It makes logic more transparent and is a mandatory step to wrap ATA(4) controller level into ATA-native CAM SIM. - Tune AHCI and SATA2 SiI drivers memory allocation a bit to allow bigger I/O transaction sizes without additional cost.
* Fix panic and breakage for non-DMA ATA devices e.g. powermac macio cells.grehan2008-05-081-1/+3
| | | | | | | | | | Handle cases where dma function pointers may be NULL, and where the max_iosize can't be derived from a DMA data structure. For the latter, revert to the prior behaviour of using DFLTPHYS for the max i/o size when there is no other data. Reviewed by: marcel No objection by: sos
* Go back to preallocating everything possible on init.sos2008-04-171-4/+4
| | | | | This avoids calling busdma in the request processing path which caused a traumatic performance degradation. Allocation has be postponed to after we know how many devices we possible can have on portmulitpliers to save some space.
* Fix problem with slave devices.sos2008-04-141-8/+7
| | | | | Fix or rather bring ENOMEM problems back to the state it was before. Temporarily disable PortMultipliers on AHCI devices.
* Add experimental support for SATA Port Multiplierssos2008-04-101-33/+31
| | | | | | | Support is working on the Silicon Image SiI3124/3132. Support is working on some AHCI chips but far from all. Remember this is WIP, so test reports and (constructive) suggestions are welcome!
* Implement a workaround of the datacorruption problem on serverworks HT1000 ↵sos2007-12-131-67/+89
| | | | | | | | | chipsets. The HT1000 DMA engine seems to not always like 64K transfers and sometimes barfs data all over memory leading to instant chrash and burn. Also fix 48bit adressing issues, apparently newer chips needs 16bit writes and not the usual fifo thing. HW donated by: Travis Mikalson at TerraNovaNet
* Add support for 64bit addressing to AHCI and Marvell controllers.sos2007-04-061-0/+1
| | | | | | Munged into ATA shape and Marvell specifics my yours truely. Submitted by: jhb
* Update copyright headers.sos2007-02-211-1/+1
|
* Add preliminary support for the Serverworks HT1000 chip.sos2006-07-041-1/+1
| | | | HW sponsored by: Yahoo!
* Add support for using DMA on dump, greatly speeds up the dump process.sos2006-01-181-5/+19
| | | | Add dump support in ataraid.
* Get rid of the advertising clause in the copyright.sos2006-01-051-3/+1
|
* Dont use the BUS_DMA_ALLOCNOW flag. Instead use BUS_DMA_NOWAIT and returnsos2005-12-051-7/+9
| | | | | | ENOMEM to the upper layers if we run out of memory. This solves part of the trouble with running on >4GB memory systems.
* Fix two identical harmless typos in ata error messages:keramida2005-11-281-2/+2
| | | | | | | | | s/issueing/issuing/ PR: kern/89481 Submitted by: John Nielsen Approved by: sos MFC after: 1 week
* Dont wait for READY on ATAPI_IDENTIFY.sos2005-09-191-1/+5
| | | | | Fixes the losage of some ATAPI device that reported failed probing with "timeout waiting for read DRQ".
* Harden the hotplug support for SATA devices.sos2005-09-141-3/+5
| | | | | | This also fixes a few races that was present in the timeout/detach code. Sponsored by: pair.com
* Add support for working around controllers that cannot do DMA in 48bit mode.sos2005-08-171-4/+4
| | | | | The workaround use PIO mode above ~137GB to allow using the disk. Add the Acer chips with rev < 0xc4 as first candidate.
* Change the way ioctls are issue to ATA.sos2005-05-161-42/+41
| | | | | | The most prominent part is that its now possible to issue ata_requests directly to say acd0, instead of going through the cumbersome /dev/ata device.
* Fix more ATAPI breakage.sos2005-05-131-3/+9
| | | | Apparently some devices are very picky on details :)
* Fix ATAPI DMA. We need to set the proper flags for DMA modes.sos2005-05-111-1/+3
|
* Reshape the dma code to be a bit more flexible so it can cope withsos2005-05-031-155/+103
| | | | | | | new HW that has new and different demands. Fix a few nits in former commit in this cleanup crusade. Sponsored by: pair.com
* Update on the last commit, the dma* funciton needs to be called withsos2005-05-011-9/+9
| | | | | a channel device, not an ata device, or we'll be out of luck in reset/timeout where we dont have a device.
* Take newbusification one step further, ie use the device_t more consequentlysos2005-04-301-25/+31
| | | | | | | all way through the code down the layers, instead of the mix'n'match that resulted from the conversion done earlier. Sponsored by: pair.com
* Now that probing is working in the new fashion, we need to go back tosos2005-04-291-138/+0
| | | | | | having ata_getparm issue an ata_request and not fool around with the HW on its own. Needed for new HW support.
* Rearrange the way the reset code is called.sos2005-04-281-6/+1
| | | | Prepare for different looking controllers.
* Rehash the timeout code to make it more simple.sos2005-04-211-57/+59
| | | | | | This also removes the warning timeout on the taskqueues stalling as I'm tired of getting ATA error reports for problems in other parts ;) Misc cosmetic and comment cleanups now we are here.
* Read back the real taskfile register values when in 48BIT mode.sos2005-04-141-5/+22
|
* Generalise the SATA PHY handling code so it wont be duplicated forsos2005-04-081-12/+7
| | | | | each SATA chip. Promise and Silicon Image are the current candidates for this.
* Add support for controllers that doesn't have the usual taskfilesos2005-04-061-9/+9
| | | | layout. No functional changes.
* Fix a buglet that caused slaves to be nondetected.sos2005-04-031-3/+4
|
* Change the ata_* methods to use a channel device instead of asos2005-03-311-1/+1
| | | | | controller device. This helps when there is no controller parent to a channel (PPC port).
* This is the much rumoured ATA mkIII update that I've been working on.sos2005-03-301-186/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o ATA is now fully newbus'd and split into modules. This means that on a modern system you just load "atapci and ata" to get the base support, and then one or more of the device subdrivers "atadisk atapicd atapifd atapist ataraid". All can be loaded/unloaded anytime, but for obvious reasons you dont want to unload atadisk when you have mounted filesystems. o The device identify part of the probe has been rewritten to fix the problems with odd devices the old had, and to try to remove so of the long delays some HW could provoke. Also probing is done without the need for interrupts, making earlier probing possible. o SATA devices can be hot inserted/removed and devices will be created/ removed in /dev accordingly. NOTE: only supported on controllers that has this feature: Promise and Silicon Image for now. On other controllers the usual atacontrol detach/attach dance is still needed. o Support for "atomic" composite ATA requests used for RAID. o ATA RAID support has been rewritten and and now supports these metadata formats: "Adaptec HostRAID" "Highpoint V2 RocketRAID" "Highpoint V3 RocketRAID" "Intel MatrixRAID" "Integrated Technology Express" "LSILogic V2 MegaRAID" "LSILogic V3 MegaRAID" "Promise FastTrak" "Silicon Image Medley" "FreeBSD PseudoRAID" o Update the ioctl API to match new RAID levels etc. o Update atacontrol to know about the new RAID levels etc NOTE: you need to recompile atacontrol with the new sys/ata.h, make world will take care of that. NOTE2: that rebuild is done differently from the old system as the rebuild is now done piggybacked on read requests to the array, so atacontrol simply starts a background "dd" to rebuild the array. o The reinit code has been worked over to be much more robust. o The timeout code has been overhauled for races. o Support of new chipsets. o Lots of fixes for bugs found while doing the modulerization and reviewing the old code. Missing or changed features from current ATA: o atapi-cd no longer has support for ATAPI changers. Todays its much cheaper and alot faster to copy those CD images to disk and serve them from there. Besides they dont seem to be made anymore, maybe for that exact reason. o ATA RAID can only read metadata from all the above metadata formats, not write all of them (Promise and Highpoint V2 so far). This means that arrays can be picked up from the BIOS, but they cannot be created from FreeBSD. There is more to it than just the missing write metadata support, those formats are not unique to a given controller like Promise and Highpoint formats, instead they exist for several types, and even worse, some controllers can have different formats and its impossible to tell which one. The outcome is that we cannot reliably create the metadata of those formats and be sure the controller BIOS will understand it. However write support is needed to update/fail/rebuild the arrays properly so it sits fairly high on the TODO list. o So far atapicam is not supported with these changes. When/if this will change is up to the maintainer of atapi-cam so go there for questions. HW donated by: Webveveriet AS HW donated by: Frode Nordahl HW donated by: Yahoo! HW donated by: Sentex Patience by: Vife and my boys (and even the cats)
* Whitespace nit. Clarifies which body this line belongs to.njl2005-03-061-1/+1
|
OpenPOWER on IntegriCloud