summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-disk.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the disk(9) API in order to make device removal more robust.phk2004-02-181-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | Previously the "struct disk" were owned by the device driver and this gave us problems when the device disappared and the users of that device were not immediately disappearing. Now the struct disk is allocate with a new call, disk_alloc() and owned by geom_disk and just abandonned by the device driver when disk_create() is called. Unfortunately, this results in a ton of "s/\./->/" changes to device drivers. Since I'm doing the sweep anyway, a couple of other API improvements have been carried out at the same time: The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to DISKFLAG_NEEDSGIANT A version number have been added to disk_create() so that we can detect, report and ignore binary drivers with old ABI in the future. Manual page update to follow shortly.
* Use the biotask functionality in GEOM to put finished requests onsos2004-01-281-3/+2
| | | | | | | 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.
* Fix breakage in PIO multisector support.sos2004-01-231-1/+0
|
* Use UMA instead of plain malloc for getting ATA request storage.sos2004-01-141-2/+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-21/+35
| | | | | | | | | | | | 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..
* Use the saved params for LBA-CHS conversion. Fixes PC98 bug.sos2004-01-081-4/+3
|
* Centralise mode setting. Instead of doing it in all subdrivers, dosos2003-11-111-6/+0
| | | | | | it in ata-all.c where it belongs. Prime controller HW by always setting PIO mode first in attach.
* Update the dump code to flush buffers at the end of the dumpsos2003-11-111-19/+25
| | | | to avoid loosing evt cached data.
* Move sysctl declarations next to the corresponding tunable declarations.des2003-11-031-7/+0
| | | | | | | Add a sysctl declaration for hw.ata.atapi_dma, which had gone MIA (though setting it in loader.conf still worked, it was not visible at runtime) Approved by: sos
* Change all SYSCTLS which are readonly and have a related TUNABLEsilby2003-10-211-2/+2
| | | | | from CTLFLAG_RD to CTLFLAG_RDTUN so that sysctl(8) can provide more useful error messages.
* Up timeout to 10s (from 5) in r/w commands.sos2003-10-121-1/+1
|
* Unify prototypes.sos2003-08-251-5/+5
| | | | Cosmetics.
* Fix ad_dump top actually produce a dump.sos2003-08-241-3/+9
| | | | Reported by: Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
* Use __FBSDID().obrien2003-08-241-2/+3
| | | | Also some minor style cleanups.
* This is a major rework of the ATA driver (ATAng)sos2003-08-241-636/+149
| | | | | | | | | | | | | | | | | | | | | | Restructure the way ATA/ATAPI commands are processed, use a common ata_request structure for both. This centralises the way requests are handled so locking is much easier to handle. The driver is now layered much more cleanly to seperate the lowlevel HW access so it can be tailored to specific controllers without touching the upper layers. This is needed to support some of the newer semi-intelligent ATA controllers showing up. The top level drivers (disk, ATAPI devices) are more or less still the same with just corrections to use the new interface. Pull ATA out from under Gaint now that locking can be done in a sane way. Add support for a the National Geode SC1100. Thanks to Soekris engineering for sponsoring a Soekris 4801 to make this support. Fixed alot of small bugs in the chipset code for various chips now we are around in that corner anyways.
* Print the right position on disk errorssos2003-05-191-3/+4
| | | | Approved by: re@
* Add flushing of devices on shutdown.sos2003-05-021-21/+1
| | | | | | Note: this might print failure messages on some systems, unfortunatly the info from the device, stating if flushing is supported, cannot be trusted so the operation is always issued on all devices, just in case...
* Add ioctl to add a spare disk to a RAID array.sos2003-05-021-7/+5
| | | | | Fix the discovery of RAID's to not grap unused disks. Change the probe printing of a RAID a bit.
* Relax the test for when to use LBA instead of CHS size.sos2003-05-011-2/+2
|
* Minor cleanup of the ATA RAID code.sos2003-04-071-7/+3
|
* Use bioq_flush() to drain a bio queue with a specific error code.phk2003-04-011-6/+3
| | | | | | | | Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate.
* Second round of updates to the ATA driver.sos2003-03-291-20/+19
| | | | | | | | | | | | Clean up the DMA interface too much unneeded stuff crept in with the busdma code back when. Modify the ATA_IN* / ATA_OUT* macros so that resource and offset are gotten from a table. That allows for new chipsets that doesn't nessesarily have things ordered the good old way. This also removes the need for the wierd PC98 resource functions. Tested on: i386, PC98, Alpha, Sparc64
* Biofinish the request if we cannot malloc in ad_start.sos2003-03-271-3/+4
|
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-12/+3
| | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
* Convert to new disk API.sos2003-02-251-35/+20
| | | | Prodded by: phk
* Temporarily disable tagged queueing while I figure out why it broke.sos2003-02-231-1/+2
|
* NO_GEOM cleanup:phk2003-02-211-3/+6
| | | | | | | | | | | | | Retire the "d_dump_t" and use the "dumper_t" type instead. Dumper_t takes a void * as first arg which is more general than the dev_t taken by d_dump_t. (Remember: we could have net-dumpers if somebody wrote us one!) Define the convention for GEOM controlled disk devices to be that the first argument to the dumper function is the struct disk pointer. Change device drivers accordingly.
* NO_GEOM cleanup:phk2003-02-211-1/+1
| | | | | | | | Change the argument to disk_destroy() to be the same struct disk * as disk_create() takes. This enables drivers to ignore the (now) bogus dev_t which disk_create() returns.
* First round off updates/fixes to the ATA driver.sos2003-02-201-32/+26
| | | | | | | | | | | | This moves all chipset specific code to a new file 'ata-chipset.c'. Extensive use of tables and pointers to avoid having the same switch on chipset type in several places, and to allow substituting various functions for different HW arch needs. Added PIO mode setup and all DMA modes. Support for all known SiS chipsets. Thanks to Christoph Kukulies for sponsoring a nice ASUS P4S8X SiS648 based board for this work! Tested on: i386, PC98, alpha and sparc64
* NO_GEOM cleanup: retire disk_invalidate()phk2003-01-301-1/+0
|
* Update the code that deals with disk enclosures:sos2003-01-271-1/+3
| | | | | | | | Properly handle the newer Promise SuperSwap 1000 enclosures. Print out what kind of enclosure was found in the probe. Misc cleanups in the enclosure handling code. Sponsored by: Advanis Inc.
* This should be the way PC98 ATA disks are seen geometry wise.sos2002-12-171-0/+5
| | | | Should go into 5_0_RELEASE as well.
* Fix linking problem when atadisk is not use in ata-all.csos2002-12-061-2/+4
| | | | | | Add dummy intr_func and lock_func to ata-card.c Dont call ad_print if the driver decided there is no disk.
* Add support for the PC98 platform to the ATA driver.sos2002-12-031-0/+8
| | | | | | | | | | | | | | | | This mostly consists of functionality to serialize accesses to the two ATA channels (which can also be used to "fix" certain PCI based controllers). Add support for Acard controllers. Enable the ATA driver in PC98 GENERIC, and add device hints. Update man page with latest support. The PC98 core team has kindly provided me with a PC98 machine that made this all possible, thanks to all that contributed to that effort, without that this would probably newer have been possible.. Approved by: re@
* (This commit touches about 15 disk device drivers in a very consistentphk2002-09-201-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and predictable way, and I apologize if I have gotten it wrong anywhere, getting prior review on a patch like this is not feasible, considering the number of people involved and hardware availability etc.) If struct disklabel is the messenger: kill the messenger. Inside struct disk we had a struct disklabel which disk drivers used to communicate certain metrics to the disklayer above (GEOM or the disk mini-layer). This commit changes this communication to use four explicit fields instead. Amongst the benefits is that the fields do not get overwritten by wrong or bogus on-disk disklabels. Once that is clear, <sys/disk.h> which is included in the drivers no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in, the few places that needs them, have gotten explicit #includes for them. The disklabel inside struct disk is now only for internal use in the disk mini-layer, so instead of embedding it, we malloc it as we need it. This concludes (modulus any mistakes) the series of disklabel related commits. I belive it all amounts to a NOP for all the rest of you :-) Sponsored by: DARPA & NAI Labs.
* Make FreeBSD "struct disklabel" agnostic, step 311 of 723:phk2002-09-201-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Rename diskerr() to disk_err() for naming consistency. Drop the by now entirely useless struct disklabel argument. Add a flag argument for new-line termination. Fix a couple of printf-format-casts to %j instead of %l. Correctly print the name of all bio commands. Move the function from subr_disklabel.c to subr_disk.c, and from <sys/disklabel.h> to <sys/disk.h>. Use the new disk_err() throughout, #include <sys/disk.h> as needed. Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs. Remove unused disklabel members of softc for aac, amr and mlx, which seem to originally have been intended for diskerr() use, but which only rotted and got Copy&Pasted at least two times to many. Sponsored by: DARPA & NAI Labs.
* Update the tags handling a bit, which makes support for thesos2002-07-221-49/+56
| | | | | older IBM DTTA series of drives possible. Update error handling a bit now we are here.
* Dont panic if only one disk on a channel can do tagged queueing.sos2002-05-231-8/+8
| | | | MFC: asap
* Fix the breakage of tagged queueing that the busdma integrationsos2002-04-181-2/+4
| | | | | introduced. Since its now only possible to have one DMA control block at a time, we move the setup to dmastart instead.
* Cleanups.sos2002-04-051-6/+6
|
* Make the ATA driver compile & work on the sparc64 platform.sos2002-04-051-43/+43
| | | | | | | Initial work & code by tmm. Lots of changes and rearrangements by yours truely to make busdma be a little less a PITA (but I still dont like it).
* Here follows the new kernel dumping infrastructure.phk2002-03-311-45/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caveats: The new savecore program is not complete in the sense that it emulates enough of the old savecores features to do the job, but implements none of the options yet. I would appreciate if a userland hacker could help me out getting savecore to do what we want it to do from a users point of view, compression, email-notification, space reservation etc etc. (send me email if you are interested). Currently, savecore will scan all devices marked as "swap" or "dump" in /etc/fstab _or_ any devices specified on the command-line. All architectures but i386 lack an implementation of dumpsys(), but looking at the i386 version it should be trivial for anybody familiar with the platform(s) to provide this function. Documentation is quite sparse at this time, more to come. Details: ATA and SCSI drivers should work as the dump formatting code has been removed. The IDA, TWE and AAC have not yet been converted. Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set the device as dumpdev. To implement the "off" argument, /dev/null is used as the device. Savecore will fail if handed any options since they are not (yet) implemented. All devices marked "dump" or "swap" in /etc/fstab will be scanned and dumps found will be saved to diskfiles named from the MD5 hash of the header record. The header record is dumped in readable format in the .info file. The kernel is not saved. Only complete dumps will be saved. All maintainer rights for this code are disclaimed: feel free to improve and extend. Sponsored by: DARPA, NAI Labs
* Remove useless splXXX set.sos2002-03-161-3/+0
|
* Add new support for locking an ATA channel and use that throughoutsos2002-03-111-8/+10
| | | | | | the ATA/ATAPI driver. This solves the concurrency problem with the new GEOM code, and also cuts a good deal of the patch size in the upcoming MFC.
* Minor cosmetic changes to minimise diffs for MFC.sos2002-03-071-3/+3
|
* Misc little cleanups:sos2002-03-051-1/+1
| | | | | | | Link if only ATAPI device in kernel config Remove unused #includes Rearrange a bit in ata-raid to make diff against -stable smaller Enable wc as default again, dunne how this happend...
* Major update of the ATA RAID code, part 3:sos2002-03-031-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to properly detach/attach disks that are part of a RAID. Mark a disk that is attached on an ATA channel belonging to a RAID as a spare disk that can be used for rebuilding failed RAID1's. Add support for rebuilding failed RAID1's. Several fixes to the detach/attach code. For replacing a disk in a failed RAID1 do the following: Find the controller channel# of the failed disk. Exec 'atacontrol detach <channel#>' to free the disk from the system. Replace the failed disk with a new one of at least the same size. If your have your disks in drawers/enclosures this can be done with the system still running. Exec 'atacontrol attach <channel#>' to add the disk to the system and mark it as a valid spare for rebuild. Exec 'atacontrol rebuild <array#>' The system will rebuild the array on the fly, the array can still be used during this, although with slower performance. Please let me know of any problems with this! Sponsored by: Advanis Inc. MFC after: 2 weeks
* Finish phk's previous removal of BIO_ORDERED, all code thatsos2002-02-241-4/+0
| | | | depended on ATA_FLUSHCACHE_ON is now useless.
* GC: BIO_ORDERED going away.phk2002-02-221-23/+0
|
* Fix the problem that some (in my book broken) disks reportssos2002-02-181-1/+2
| | | | | | | to be able to use 48bit addressing mode, but says the 48bit size of the disk is 0, which according to spec means it can address zero sectors in 48bit mode, why then say it supports 48bit mode at all..
OpenPOWER on IntegriCloud