summaryrefslogtreecommitdiff
path: root/sys/dev/ata/ata-raid.c
Commit message (Collapse)AuthorAgeFilesLines
* Limit the size of the rebuild requests to be within safety.Søren Schmidt2003-09-081-3/+6
| | | | Notes: svn path=/head/; revision=119882
* Adjust the max transfer size used.Søren Schmidt2003-09-021-1/+1
| | | | Notes: svn path=/head/; revision=119676
* Use __FBSDID().David E. O'Brien2003-08-241-2/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* This is a major rework of the ATA driver (ATAng)Søren Schmidt2003-08-241-28/+40
| | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=119404
* Acquire Giant at the start of the raid rebuild kthreads.John Baldwin2003-05-081-0/+1
| | | | | | | | | Reported by: Masachika ISHIZUKA <ishizuka@ish.org> Reviewed by: sos Approved by: re (bmah) Notes: svn path=/head/; revision=114843
* Change the way loadbalancing works on RAID1's.Søren Schmidt2003-05-041-6/+27
| | | | | | | Based on code partially by me and by <Tor.Egge@cvsup.no.freebsd.org>. Notes: svn path=/head/; revision=114665
* Implement dump function for ATA RAID's. Minor fixes by me...Søren Schmidt2003-05-041-0/+128
| | | | | | | Submitted by: Tor Egge <Tor.Egge@cvsup.no.freebsd.org> Notes: svn path=/head/; revision=114662
* Add ioctl to add a spare disk to a RAID array.Søren Schmidt2003-05-021-26/+81
| | | | | | | | Fix the discovery of RAID's to not grap unused disks. Change the probe printing of a RAID a bit. Notes: svn path=/head/; revision=114529
* Fix breakage on sparc64.Søren Schmidt2003-04-081-2/+2
| | | | | | | Note to self: always test even the smallest changes on all platforms. Notes: svn path=/head/; revision=113264
* Fix a long standing bug in handling the last part of a stripeSøren Schmidt2003-04-081-5/+42
| | | | | | | | | on "odd" size disks. Add printout of the RAID structure on verbose boot. Notes: svn path=/head/; revision=113245
* Minor cleanup of the ATA RAID code.Søren Schmidt2003-04-071-2/+6
| | | | Notes: svn path=/head/; revision=113223
* Use bioq_flush() to drain a bio queue with a specific error code.Poul-Henning Kamp2003-04-011-0/+1
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=112946
* Remove the enclose_print() call, it is already called from ata-disk.cSøren Schmidt2003-03-101-1/+0
| | | | Notes: svn path=/head/; revision=112055
* Centralize the devstat handling for all GEOM disk device driversPoul-Henning Kamp2003-03-081-1/+0
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=111979
* Convert to new disk API.Søren Schmidt2003-02-251-47/+21
| | | | | | | Prodded by: phk Notes: svn path=/head/; revision=111489
* NO_GEOM cleanup:Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=111216
* First round off updates/fixes to the ATA driver.Søren Schmidt2003-02-201-13/+17
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=111188
* NO_GEOM cleanup: retire disk_invalidate()Poul-Henning Kamp2003-01-301-1/+0
| | | | Notes: svn path=/head/; revision=110116
* Update the code that deals with disk enclosures:Søren Schmidt2003-01-271-4/+6
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=109931
* Some kernel threads try to do significant work, and the default KSTACK_PAGESScott Long2002-10-021-1/+1
| | | | | | | | | | | | | | | | doesn't give them enough stack to do much before blowing away the pcb. This adds MI and MD code to allow the allocation of an alternate kstack who's size can be speficied when calling kthread_create. Passing the value 0 prevents the alternate kstack from being created. Note that the ia64 MD code is missing for now, and PowerPC was only partially written due to the pmap.c being incomplete there. Though this patch does not modify anything to make use of the alternate kstack, acpi and usb are good candidates. Reviewed by: jake, peter, jhb Notes: svn path=/head/; revision=104354
* Add yet another Promise PCI id.Søren Schmidt2002-10-011-0/+1
| | | | Notes: svn path=/head/; revision=104298
* (This commit touches about 15 disk device drivers in a very consistentPoul-Henning Kamp2002-09-201-9/+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. Notes: svn path=/head/; revision=103714
* Add a couble more Promise chip ID's.Søren Schmidt2002-04-121-1/+2
| | | | Notes: svn path=/head/; revision=94508
* Add yet another chip ID for a Promise TX2 chip.Søren Schmidt2002-04-111-0/+1
| | | | Notes: svn path=/head/; revision=94426
* Fix the FreeBSD native ATA RAID code a bit.Søren Schmidt2002-04-101-30/+33
| | | | Notes: svn path=/head/; revision=94356
* Add get-status to the ATA RAID subsystem.Søren Schmidt2002-04-021-1/+44
| | | | Notes: svn path=/head/; revision=93662
* Use the raid lun not the magic when writing Promise config.Søren Schmidt2002-03-301-2/+1
| | | | Notes: svn path=/head/; revision=93415
* Fix a braino, only update LED's when a device is present.Søren Schmidt2002-03-281-2/+2
| | | | Notes: svn path=/head/; revision=93332
* OK, the old HighPoint BIOS's are braindead, they haveSøren Schmidt2002-03-271-2/+5
| | | | | | | | | | a really warped way of things. Anyway deal with it, and luckily the newer HighPoint BIOS's doesn't mind.. No brownies to HighPoint for that... Notes: svn path=/head/; revision=93297
* Add support for creating/deleting ATA RAID's.Søren Schmidt2002-03-271-99/+315
| | | | | | | | | | | | | | | | | This completes the ATA RAID support, since all functions to manipulate the RAID are accessible from FreeBSD, the BIOS on the ATA RAID cards are only nessesary for booting. I decided to allow for creation of ATA RAID's on any ATA controller, but please keep in mind the restrictions on that. Due to the BIOS not knowing what to do you can only boot from a RAID1 or the first disk in a SPAN, if its not located on a "real" ATA RAID controller like the Promise or Highpoint controllers. Sponsored by: Advanis Notes: svn path=/head/; revision=93276
* Add some break's after default: in the end of switch statements toPeter Wemm2002-03-191-0/+2
| | | | | | | | | | | keep gcc-3.1+ happy: ata-all.c:410: warning: deprecated use of label at end of compound statement ata-all.c:587: warning: deprecated use of label at end of compound statement ata-raid.c:99: warning: deprecated use of label at end of compound statement ata-raid.c:151: warning: deprecated use of label at end of compound statement Notes: svn path=/head/; revision=92695
* Fix 64bit arch problems.Søren Schmidt2002-03-161-2/+3
| | | | Notes: svn path=/head/; revision=92419
* Update to the RAID1 rebuild code.Søren Schmidt2002-03-151-19/+35
| | | | | | | | | Run rebuild as a background process. Sponsored by: Advanis Notes: svn path=/head/; revision=92343
* Add new support for locking an ATA channel and use that throughoutSøren Schmidt2002-03-111-4/+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. Notes: svn path=/head/; revision=92107
* Even more Highpoint RAID support.Søren Schmidt2002-03-081-61/+44
| | | | | | | Fix the 80pin cable detection system. Notes: svn path=/head/; revision=91914
* Support newer Highpoint BIOS's extended config.Søren Schmidt2002-03-081-21/+16
| | | | Notes: svn path=/head/; revision=91861
* Oops I mixed up the patch for -current & -stable, sorry ....Søren Schmidt2002-03-071-4/+4
| | | | Notes: svn path=/head/; revision=91829
* Fix a couble of bugs in the rebuild code, return errors properly.Søren Schmidt2002-03-071-37/+38
| | | | Notes: svn path=/head/; revision=91816
* Fixed a printf format error again. Rev.127 was clobbered in rev.1.128Bruce Evans2002-03-061-1/+1
| | | | | | | | | | | | | | | | by removing parentheses. The main bug is in gcc: on machines with 64-bit longs and 64-bit long longs, (unsigned long long)rdp->total_sectors / ((1024L * 1024L) / DEV_BSIZE)) has type plain unsigned long instead of the correctly promoted type unsigned long long, so it can not be printfed using %llu format. Even 1ULL / 1L is mispromoted. Anyway, casting the correct operand automatically avoids the problem. We do not want to to pessimize the division; we just want to convert to a common maximal type for printing. Notes: svn path=/head/; revision=91729
* Misc little cleanups:Søren Schmidt2002-03-051-9/+9
| | | | | | | | | | 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... Notes: svn path=/head/; revision=91672
* Forgot this litte patch, scale the individual disk size from theSøren Schmidt2002-03-031-3/+3
| | | | | | | arrays total size depending on width of the array. Notes: svn path=/head/; revision=91596
* Major update of the ATA RAID code, part 3:Søren Schmidt2002-03-031-224/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=91593
* Fixed a printf format error.Bruce Evans2002-03-021-1/+3
| | | | Notes: svn path=/head/; revision=91563
* Add support for the Highpoint HPT372 based cards (rocketraid 133).Søren Schmidt2002-02-181-0/+1
| | | | | | | HW Sponsored by: Mike Tancsa Notes: svn path=/head/; revision=90844
* Dont try to attach ATA RAID's if none found.Søren Schmidt2002-02-161-0/+3
| | | | Notes: svn path=/head/; revision=90719
* Major update of the ATA RAID code, part 2:Søren Schmidt2002-02-121-127/+398
| | | | | | | | | | | More cleanups of the RAID1 failure mode code. Add functionality that writes the changed RAID config setup back to the disks (in controller BIOS specific format), so that a reboot will make the BIOS pick up the changed config. Notes: svn path=/head/; revision=90566
* Make LINT compile after fruitless attempts to get the authorsJulian Elischer2002-02-061-1/+1
| | | | | | | | | | | | to fix their code. ata stuff: Change name of ar_attach to not colide with existing ar_attach in if_ar.c. usb stuff: Create a dummy function to satisfy a call to it when in DEBUG mode. Notes: svn path=/head/; revision=90318
* Major update of the ATA RAID code, part 1:Søren Schmidt2002-02-041-268/+476
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overhaul of the attach/detach code and structures, there were some nasty bugs in the old implementation. This made it possible to collapse the ATA/ATAPI device control structures into one generic structure. A note here, the kernel is NOT ready for detach of active devices, it fails all over in random places, but for inactive devices it works. However for ATA RAID this works, since the RAID abstration layer insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the physical disks. Proberly detect the RAID's from the BIOS, and mark critical RAID1 arrays as such, but continue if there is enough of the mirror left to do so. Properly fail arrays on a live system. For RAID0 that means return EIO, and for RAID1 it means continue on the still working part of the mirror if possible, else return EIO. If the state changes, log this to the console. Allow for Promise & Highpoint controllers/arrays to coexist on the same machine. It is not possible to distribute arrays over different makes of controllers though. If Promise SuperSwap enclosures are used, signal disk state on the status LED on the front. Misc fixes that I had lying around for various minor bugs. Sponsored by: Advanis Inc. Notes: svn path=/head/; revision=90215
* Update with latest ATA/ATAPI ver 6 rev 2 items.Søren Schmidt2001-10-061-3/+2
| | | | Notes: svn path=/head/; revision=84584
* Update the promise raid structure with some of the info I've gatheredSøren Schmidt2001-10-041-2/+7
| | | | | | | before I'm accused of "lending" it from somebody else. Notes: svn path=/head/; revision=84485