summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* teach the side-effect free drivers about the partition they are dealingderaadt2013-11-061-2/+11
| | | | | | | by passing a start/length in the HIB_INIT op. Then rebase all hibernate-time block offsets to be relative to the start of that partition. This simplifies things a lot. ok mlarkin
* Use DL_SECTOBLK() instead of handrolling same calculation to getkrw2013-10-141-3/+4
| | | | wdsize() return value.
* XXsize() returns daddr_t, so calculate the return value in a daddr_tkrw2013-10-141-2/+2
| | | | | | variable and not (usually) an int. ok miod@
* Try harder to ensure wddump() doesn't decrement the countkrw2013-09-271-6/+7
| | | | | of sectors to write by one value and increment the address the next i/o will start at by a different amount.
* return after done in atascsi_disk_unmap.dlg2013-09-181-5/+14
|
* Make it clearer that sc_wdc_bio.blkno is actuall a disk hardwarekrw2013-09-151-8/+9
| | | | | | | | address by using the DL_BLKTOSEC() and DL_SECTOBLK() defines rather than handrolling the equivalent. Fixes current addition of a 512-byte block value (b_blkno) to a disk hardware address (DL_GETPOFFSET()). Tested on real wd(4) hardware by guenther@.
* final removal of daddr64_t. daddr_t has been 64 bit for a long enoughderaadt2013-06-112-8/+8
| | | | | test period; i think 3 years ago the last bugs fell out. ok otto beck others
* Add a hibernate HIB_DONE op. After the memory-side-effect driver finishesderaadt2013-01-171-1/+11
| | | | | | IO to the disk, DVACT_RESUME the controller back to normal operation. That allows us to do the full DVACT_POWERDOWN sequence afterwards. ok mlarkin
* Revamp the sequences for suspend/hibernate -> resume so that the codederaadt2012-10-081-21/+5
| | | | | | | | | | paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
* Correct the spelling of "transferred" and "transferring"guenther2012-02-241-3/+3
| | | | from Tobias Ulmer (tobiasu at tmux.org); ok jmc@, krw@
* on failure, the hibernate io function should return an errno type variable,deraadt2011-11-151-2/+2
| | | | instead of 1.
* Use a fixed io_page for all hibernate I/O, which is needed formlarkin2011-11-141-1/+5
| | | | | | | ahci_hibernate_io, a skeleton of which is also provided in this diff. This code is from deraadt@. Tested on a few wd machines to ensure it works there as well.
* Add some #defines for the various hibernate I/O modes, some of themlarkin2011-11-131-3/+9
| | | | | | groundwork for *_hibernate_io functions other than wd_hibernate_io These changes were sent to me by deraadt@
* KNF of mlarkin's code, requested by him. Some improvements to the interfacederaadt2011-09-222-5/+5
| | | | | for talking to the disk driver snuck in. ok mlarkin
* Alexander Polakov found a use of an uninitialized pointer in the scsidlg2011-08-031-1/+2
| | | | unmap handling.
* Backout a bunch of my SCSI commits from c2k11. At least one of thesematthew2011-07-171-10/+8
| | | | | | is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@
* Cope with the start-dma-before-init errata and some other register setupderaadt2011-07-151-4/+13
| | | | | errata for the Serverworks SATA chipset found on the macppc xserve G5. ok jmc
* translate the scsi UNMAP command into an equiv TRIM, and advertise UNMAPdlg2011-07-091-2/+126
| | | | | | | | | | support via the thin provisioning page. this emul is a bit unreliable since atascsi needs to allocate memory for the TRIM command to use, but we figure that the world wont end if we lose a TRIM unlink real io. ok matthew@
* Fix fallout from my previous SCSI refactoring diff (movingmatthew2011-07-091-7/+9
| | | | | | | | | adapter_buswidth to sc_targets): gdt(4) and atascsi(4) still used it in other ways. Apply appropriate fixes; tested on ahci(4). ok krw@
* First batch of converting SCSI HBAs from setting saa_targets andmatthew2011-07-081-3/+3
| | | | | | saa_luns instead of adapter_buswidth and luns in the prototype link. ok dlg@, miod@
* fill in the ata vpd page as best we can. i dont know how to fill in thedlg2011-07-081-5/+52
| | | | | | | device signature so i left it blank, and the identify is the cached copy in the port structure. i filled the SAT vendor stuff in as "OpenBSD", "atascsi", osrelease.
* provide the thin provisining vpd page if the disk does trim. only claimdlg2011-07-081-4/+40
| | | | to do WRITE SAME 16 for now (which is all we do).
* macros for TRIMdlg2011-07-081-1/+4
|
* some trim cleanups and additions.dlg2011-07-081-9/+17
| | | | | | use less magic numbers when check the block limits for trim. fill in the block limits vpd page with some conservative numbers about how much unmap we can do at a time (~32MB over 64 descriptors).
* Eliminate redundant buf validation checks in xxstrategy() methods nowmatthew2011-07-061-20/+12
| | | | | | | | | | | | that they're implemented consistently in bounds_check_with_label(). Also, per krw's request, change bounds_check_with_label() to return 0 if the checks succeed, and change the drivers to test == -1 instead of <= 0. (Man page update to follow; intentionally omitting arch/vax/mba/hp.c from this commit because it doesn't even build currently and miod@ promises to kill it soon.) ok krw@
* i forgot to set the sector_count when translating WRITE SAME 16dlg2011-07-051-2/+9
| | | | | | into DSM/TRIM commands. found by tedu
* Refactor some common open/close/detach disk driver code intomatthew2011-06-301-39/+4
| | | | | | subr_disk.c. For now just the MI disk drivers. ok deraadt@, krw@; jsing@ liked the approach too
* Print correct function name in debug statements. ata_get_params, notkrw2011-06-221-3/+3
| | | | ata_get_parms or wdc_ata_get_parms.
* Laurence Tratt reported that his "Intel 6 Series AHCI" ahci(4) nomatthew2011-06-211-4/+3
| | | | | | | | | longer detects his OCZ Vertex 3 after atascsi.c r1.104. For some reason, the first IDENTIFY command issued silently fails without any notification. In lieu of a better fix, workaround this for now by allowing IDENTIFY to be reissued a second time for non-PMP disks. Discussed with jmatthew@ and dlg@; ok dlg@
* Call bufq_drain() in wddetach() instead of reimplementing the samematthew2011-06-201-11/+3
| | | | logic.
* Use disk_lock_nointr() in the xxclose() routines so that they cannotderaadt2011-06-191-6/+4
| | | | | be interrupted. ok matthew
* Use disk_lock/disk_unlock directly and in the same way in these drivers,deraadt2011-06-191-10/+8
| | | | | | rather than using various wrappings. Convert vnd to using the sc_dk rwlock instead of using one of its own. ok matthew
* Delete the long dead LOCKED and WANTED flags from cd(4), sd(4), andmatthew2011-06-061-3/+1
| | | | | | | wd(4). They haven't been used for 10+ years, since the drivers were switched to use disk_lock() and disk_unlock() instead. No binary change.
* Drop kernel support for the useless DIOCWLABEL ioctl and prune a lotmatthew2011-06-052-18/+2
| | | | | | | | | of silly flag twiddling code in various disk drivers. ok deraadt@, miod@ N.B., users will need a -current disklabel(8) to be able to write new disklabels to disk now.
* Get rid of the wlabel argument to bounds_check_with_label(). It'smatthew2011-06-031-3/+2
| | | | | | | | | never done anything in OpenBSD and just clutters disk drivers with silly flag handling. More cleanup to follow. ok deraadt@, millert@; no objections krw@
* Small refactoring of atascsi and fix non-data ATA commands to not setmatthew2011-06-021-48/+65
| | | | | | ATA_F_PIO or ATA_F_READ. ok dlg@
* Change a few of the more common disk drivers (sd, cd, wd, rd, and vnd)matthew2011-05-311-2/+2
| | | | | | | | | | | | | | | | | | | to return EBUSY if the user tries to modify an open partition's offset or size. Only sadness can result if a user tries this, and rejecting it prevents a race between sdstart() and sdstrategy(). Curiously, there was already code in the kernel and in disklabel(8) to detect/handle this, but it was effectively disabled because the disk drivers always used something like "/* sc->sc_dk.dk_openmask */ 0", and this commented out code has existed since even r1.1 in NetBSD. I had no problems building a release and messing around with disklabel(8) for a bit with this diff. Canarying the more common MI disk drivers until we gain confidence that there aren't any regressions, then we can switch the remaining drivers. "I am surprised you got me convinced that this stuff is safe" deraadt@ ok krw@
* Move wdc_cd from ata/ata_wdc.c to ic/wdc.c so that you can compile amatthew2011-05-241-5/+1
| | | | | | | kernel without the former. Also, eliminate two dead stores in wdcattach(). ok dlg@
* Move ata_put_xfer() from ata_xfer to atascsi_methods. It's just sillymatthew2011-05-082-6/+12
| | | | | | | | to have a non-changing function pointer be part of an object rather than it's virtual method table. ok dlg@; tested on ahci(4) by Mattieu Baptiste, jasper@, and Jason Crawford; no sili(4) testers, but identical changes to ahci(4)
* Go back to only attempting one IDENTIFY command against directlymatthew2011-05-051-5/+6
| | | | | | | | | attached devices as in the pre-port-multiplier code. (Devices attached via port multipliers still get multiple attempts though.) Also don't bother sleeping after the last iteration if all attempts failed. Discussed with dlg@ and Jonathan Matthew; ok dlg@
* Fix a few off-by-1 errors in atascsi.matthew2011-04-271-5/+5
| | | | ok dlg@
* keep an eye out for wdc registers returning 0xff. if they return 0xff,deraadt2011-04-182-2/+20
| | | | | | | | this probably means the controller is dead -- as in, a hot plug eject event. in that case, mark the driver dead and try harder to return -1 in the interrupt handler. tested by many ok dlg, miod did not object
* Change wdc_reset_channel() to take a `no wait' argument. Pass in turn thismiod2011-04-152-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | argument to wdcreset(), to have it skip waiting until active channels see their BUSY bit clear in the status register. Use this feature in the resume path, during the first reset operation. The first reset is supposed to only wake up the controller, and the disks don't come back until the second reset is issued, therefore waiting for them to report themselves as ready after the first reset, but before the second, is moot - and as a matter of fact some controllers, such as the AMD 754 and clones/offspring (e.g. Geode) keep the BUSY bit asserted after the first reset. Last, but not least, make sure wd@ata invokes wd_get_params() again before returning from the resume code, as we will still be using polled transfers for a short while. This causes the Lemote Yeelong to resume within less than one second, instead of the lousy 30 seconds wait between the two resets; and the wd_get_params() voodoo prevents it from getting spurious ide interrupts afterwards. wd_get_params() magic from dlg; rest of the work by yours truly after enough prodding by dlg@ and pirofti@, among others. ok deraadt@ dlg@
* one dma_free() was mistakenly left as free()deraadt2011-04-081-2/+2
|
* wd_hibernate_io() is a standalone disk io writer which tries to notderaadt2011-04-053-38/+98
| | | | | | damage kernel memory very much while doing the job. It is not very pretty yet, but improving it will need some MI work. ok mlarkin jsg dlg
* pirofti made me look at wd(4) code, which made me sad.dlg2011-04-031-2/+2
| | | | | | increase the timeout on io from 10s to 45s. ata says we should wait 30, but i am cynical. this gives loongson disks enough time to wake up on resume.
* Safer, big mem friendly, allocation of ATAPARAMS buf that is thekrw2011-04-031-5/+6
| | | | | | target of DMA. ok deraadt@ dlg@
* Safer, big mem friendly, allocation of identify buf that is thekrw2011-04-021-5/+6
| | | | | | target of DMA. ok dlg@ deraadt@ thib@
* Initialize stack memory before use. Found with clang.matthew2011-02-031-1/+2
| | | | ok dlg@
* Add port multiplier support, has been in snaps for a while with no reporteddrahn2011-01-262-120/+358
| | | | issues. No actual OKs, but general acknowledgement and 'get it in' from several.