summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-lowlevel.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Handle PIO timeouts in ata_end_transaction() by immediately returning.mdodd2005-03-021-0/+3
| | | | | | | | | | Failure to do this will result in following ata_pio_read() calls walking off the end of the read buffer. This resolves the "memory modified after free" panics common with Thinkpads and CD/DVD drives. Submitted by: Nate Lawson <nate AT root.org>
* In ata_generic_reset() while waiting for both master & slave to becomemdodd2005-03-021-1/+4
| | | | | | | | | idle the 'mask' variable could be set to 0, resulting in the timeout loop running for the full 31 seconds. Handling this case eliminates long hangs on resume on some systems. Submitted by: Nate Lawson <nate AT root.org>
* Loosen the probe a bit.sos2004-12-241-5/+9
| | | | | Try to get out of probing as early as possible on (hopefully) vacant channels.
* Compensate for off by one bugs in disk firmware for 48BIT addressing cutover.sos2004-12-091-1/+1
|
* Return ATA register values in the request struct when ATAREQUEST returns.sos2004-11-241-1/+2
|
* Remove the old ATA_*LOCK_CH macros that used atomic ops and usesos2004-09-261-69/+26
| | | | | | | | | | | | | mutexes instead. This closes the last (known) race issues in ATA which should fix the various hangs etc seen on heavy loaded systems. Change from using timeout functions to using callout functions in the timeout code. This together with above closes the race that could happen if timeout and device interrupt occured simultaniously. Also fix the possible recursion in ata_reinit() on very dodgy devices that could take us down in the probe.
* Introduce ata_udelay() that uses tsleep instead of DELAY if possible.sos2004-09-031-3/+4
| | | | | | In places where we have long delays that doesn't depend on too accurate timing, use ata_udelay() instead of DELAY() so we dont uselessly spin the CPU if not nessesary;
* remove unused prototypesos2004-08-271-1/+0
|
* Fix the handling of "inflight" requests when doing reinit's.sos2004-08-271-1/+10
| | | | | | Add missing untimeout that would get lost in handling of some error situations, and caused what looked like random timeouts afterwards when the timeout fired.
* Improve (hopefully) on the workaround code for devices that doesn'tsos2004-08-161-9/+4
| | | | | interrupt when command is done, ie some ATAPI CD drives with no media loaded.
* Correct the last commit so it works in error situations as well.sos2004-08-071-1/+1
|
* Fix a panic in ata_generic_transaction(). The DMA pointer of the channelnjl2004-08-061-1/+1
| | | | | | | | was being unconditionally dereferenced but was NULL for PIO requests. Check the request flags for a DMA transaction before dereferencing. Reported by: ceri Tested by: Radek Kozlowski <radek -at- raadradd.com>
* Try to narrow down the race window on HW that does not have ways tosos2004-08-051-13/+13
| | | | poll for which channel actually pulled the irq line.
* Refine the wait for ATAPI_RESET.sos2004-07-241-2/+10
| | | | | | | | Properly wait for not busy and introduce a timeout for devices not setting busy (as they should). Leave a printf in there that states how long the wait was, as I'd like to get an idea of the variations here. The time needed seems also to be affected by whether a medium is present or not.
* Dont expect interrupt from ATAPI_RESET, it doesn't deliver one.sos2004-07-231-0/+11
|
* Back out the last change as that broke some SATA devices.sos2004-06-111-9/+4
| | | | Now we are cleaing up remove a few lines of unused code.
* Dont retry on devices that left the system.sos2004-06-011-2/+3
| | | | Ignore "fake" devices that has 0x7f status.
* Rip out the too verbose "spurious interrupt" printf's, they dont servesos2004-05-171-16/+1
| | | | a purpose any longer.
* Spring cleanup of macrossos2004-04-301-1/+1
|
* Reduce the time spent looking for devices on channels that returnsos2004-04-271-4/+4
| | | | what looks like garbage.
* Move a verbose printf before the first exit so we get a chancesos2004-04-191-4/+4
| | | | to see what was there.
* Add support for the Promise command sequencer present on all modern Promisesos2004-04-131-51/+55
| | | | | | | | | | | | | | | | | controllers (PDC203** PDC206**). This also adds preliminary support for the Promise SX4/SX4000 but *only* as a "normal" Promise ATA controller (ATA RAID's are supported though but only RAID0, RAID1 and RAID0+1). This cuts off yet another 5-8% of the command overhead on promise controllers, making them the fastest we have ever had support for. Work is now continuing to add support for this in ATA RAID, to accellerate ATA RAID quite a bit on these controllers, and especially the SX4/SX4000 series as they have quite a few tricks in there.. This commit also adds a few fixes to the SATA code needed for proper support.
* Add support for detaching PCI controllers.sos2004-03-151-2/+2
| | | | | | This adds support for cardbus ATA/SATA controllers. I get roughly the same transfer speeds as on true PCI controllers. Nice to be able to add a couble of "real" disks to a laptop :)
* Only register interrupt as seen if it was a real HW interrupt.sos2004-02-211-1/+3
|
* Move the enabling of interrupt back to where it was some time ago.sos2004-02-021-4/+3
| | | | This apparently was what broke the boot with some devices (liteon).
* Use the biotask functionality in GEOM to put finished requests onsos2004-01-281-9/+8
| | | | | | | instead of taskqueue_swi. This shaves from 1 to 10% of the overhead. Overhaul the locking once more, there was a few possible races that are now closed.
* Use UMA instead of plain malloc for getting ATA request storage.sos2004-01-141-0/+1
| | | | | | | This gives +10% performance on simple tests, so definitly worth it. A few percent more could be had by not using M_ZERO'd alloc's, but we then need to clear fields all over the place to be safe, and that was deemed not worth the trouble (and it makes life dangerous).
* Overhaul of the timeout/reinit framework. This should clear up mostsos2004-01-111-44/+38
| | | | | | | | | | | | of the leftovers from the old version that really doesn't work anymore. Add a reset function for host-end of the ATA channel. This is needed for the SiI3112 in order to whack it back to reality if a device locks up the SATA interface (thereby preventing that we can reset the device). The result is that ATA now recovers from the timeouts that happens with the SiI3112A and more or less all disks based on old PATA electronics with a Marvell PATA->SATA converter. This includes lots of the popular SATA dongles and the WDC Raptor disks..
* Finetune last commit, we need to take care of empty channels.sos2003-12-101-3/+7
|
* Fix for the missing slave problem.sos2003-12-031-1/+1
| | | | Approved by: re@
* On ATA control commands return the registers in the request.sos2003-11-021-36/+44
|
* Properly unload the DMA SG list on errors.sos2003-10-211-0/+2
|
* Fix the DMA problem that most severely hit on the DS3112a SATA chipsos2003-10-211-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in connection with Marvell based SATA->PATA dongles. The problem was caused by a combination of things working together to make it hard to spot... The ATA driver has always started the ATA command, then build the SG list for DMA and then finally started the DMA engine. While this is according to specs, it poses a potential problem as some controllers apparently do not allow for unlimitted time between starting the ATA command and starting the DMA engine. At about the same time as ATAng was committed there were lots of other changes applied, some of which was locking in parts that causes the busdma load functions to take significantly longer to load the SG list. This pushed the time spent between starting the ATA command and starting the DMA engine over the hill for some controllers (especially the Silicon Image DS3112a) and caused what looked like lost interrupts. The solution is to get all the SG list work or rather all busdma related stuff done before we even try to start anything. This has the nice side effect of seperating busdma out the way it should be, so the working of the ATA machinery is not cluttered up with busdma droppings, making the code easier to read and understand.
* Up delay from 10 to 100ms after reset, this helps some slow devicessos2003-10-201-1/+2
| | | | get their act together before we start probing.
OpenPOWER on IntegriCloud