summaryrefslogtreecommitdiff
path: root/sys/dev/ata
AgeCommit message (Collapse)Author
2013-10-30play the addref/delref game on suspend, prevents crash if the disk/CF Carddrochner
is eg. in a PCMCIA adapter and not mounted
2013-10-30-recognize CF cards by the magic value in inquiry datadrochner
-kill CFG_ATAPI_MASK, didn't see anything in the specs supporting that it exists
2013-10-12Pass the device name in, so we can debug what deferred drivers did not work.christos
2013-08-19Don't return EPASSTHROUGH when succeeding in ODIOCGDINFO or ODIOCGDEFLABELskrll
2013-08-07Make sure a channel has drives attached before resetting it otherwiseblymn
wdc_reset will panic the kernel due to a null derefrence of ch_drives.
2013-08-06TRIM showed up sometime between ATA-7 and ATA-8.soren
2013-05-29phase 1 of disk geometry cleanup:christos
- centralize the geometry -> plist code so that we don't have n useless copies of it.
2013-05-03Wait for DRDY after the PMP commands and don't wait before.jakllsch
Should fix the worst part of PR kern/47793.
2013-04-17Also print port multiplier port number when register accesses fail.jakllsch
2013-04-03Fix kernel dump on ahci controller, by making sure we won't sleepbouyer
while dumping: - introduce ata_delay() which either use delay() or kpause() depending on flags. use it in sata_reset_interface() and some ahci functions - kill ATA_NOSLEEP, it was tested but never set. use ATA_POLL instead. - reduce delay while polling in ahci, to speed up the dump Should fix PR kern/41095
2013-02-03Add argument to wdccommandext() to allow the entire contents of thejakllsch
device/head register to be specified. Needed for upcoming port multipler support in mvsata(4).
2013-01-09Initialize b_resid before biodone in wdioctlstrategy error branch.riastradh
Otherwise we may panic when physio's biodone callback kasserts something about b_resid, since nothing will have initialized it.
2013-01-09Name the ATA SECURITY commands.riastradh
2012-11-19Introduce WDC_CAPABILITY_NO_AUXCTL flag. For lame controllers that don'trkujawa
have aux control registers (driver coming soon).
2012-11-01Allow setting ATADEBUG_MASK to default value of atadebug_maskabs
2012-10-27split device_t/softc for all remaining drivers.chs
replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
2012-10-19Implement experimental support to pass notifications that a filedrochner
was deleted from the filesystem to the disk driver, commonly known as "discard" or "trim". fs/driver support is in ffs and ata wd for now. This is what was posted here: http://mail-index.netbsd.org/tech-kern/2012/02/28/msg012813.html with minor cleanup, and the global switch replaced by a mount option.
2012-08-04If ch_ndrives is > 0, then ch_drive is not supposed to be NULL.bouyer
2012-08-01Make this compile again after DRIVET renamebouyer
2012-08-01Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdcbouyer
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
2012-07-31Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdcbouyer
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
2012-07-29Remove ata_channel->ata_drives, it's redundant with the pointer injakllsch
ata_drive_datas. Originally part of a commit by bouyer@.
2012-07-26Revert, with intention of restoring in a less invasive way, the SATA Portjakllsch
Multiplier code. ok christos@
2012-07-24Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 andjakllsch
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump. First step in reverting regressions to ata(4) subsystem during the addition of port multiplier support.
2012-07-22It turns out my previous commit here was off by one.jakllsch
2012-07-22FLUSH CACHE EXT is a 48-bit command, issue as such. Both FLUSH CACHE commandsjakllsch
will return the LBA of first failure in the return task file, specifiy that we want it read, even if we don't look at the value.
2012-07-22ATA-6 and ACS-2 drafts both say the flush cache commands may take longer thanjakllsch
30 seconds to complete. For now assume 5 minutes will always be enough.
2012-07-22Port multiplier registers are 64-bits wide (although the ones we need onlyjakllsch
implement 32-bits). Implement the access routines using 64-bit values and add 32-bit wrappers thereto.
2012-07-22The vendor and product IDs are 16-bit, print out as such.jakllsch
2012-07-22Correctly issue port multiplier register access commands as LBA48 now that thejakllsch
FIS code doesn't get in the way of doing that.
2012-07-22KASSERT if we attempt to access an invalid port.jakllsch
Also, small whitespace change for internal consistency.
2012-07-22SATA uses the head portion of the device register in the command protocol forjakllsch
port multiplier register access. Thus, in the LBA48 case, pass the complete r(hd|dh)_dh byte back and forth to the upper layers. (This is irrelevant in the LBA28/CHS code path for what should be obvious reasons.)
2012-07-15Stopgap crash prevention when atadebug_mask includes DEBUG_PROBE bit.jakllsch
2012-07-15Some namespace protection (and add greppablity).dsl
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_. Don't use an enum for drive_type - you don't know how big it will be. Move driver_type to avoid implicit structure padding (esp on arm). This change is purely lexical and mechanical. Update to 6.99.9 - this wasn't done when the SATA PMP changes were made - I'm sure they warranted a bump.
2012-07-02Add sata Port MultiPlier (PMP) support to the ata bus layer,bouyer
as described in http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html PMP support in integrated to the atabus layer. struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive (renamed to ch_ndrives) closely reflects the size of the ch_drive[] array. Add helper functions atabus_alloc_drives() and atabus_free_drives() to manage ch_drive[]/ch_ndrives. Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify how much drive they really support (master/slave or single). ata_reset_drive() callback gains a uint32_t *sigp argument which, when not NULL, will contain the signature of the device being reset. While there, some cosmetic changes: - added a drive_type enum to ata_drive_datas, and stop encoding the probed drive type in drive_flags (we were out of drive flags anyway). - rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this really is - remove ata_channel->ata_drives, it's redundant with the pointer in ata_drive_datas - factor out the interpretation of SATA signatures in sata_interpet_sig() propagate these changes to the ATA HBA drivers, and add support for PMP to ahcisata(4) and siisata(4). Thanks to: - Protocase (http://www.protocase.com/) which provided a system with lots of controllers, SATA PMP and drive slots - Conservation Genomics Laboratory, Department of Biology, New Mexico State University for hosting the above system - Brook Milligan, who set up remote access and has been very responsive when SATA cable move was needed
2012-06-26In some case, when an error is reported by the disk, the ahci controllerbouyer
still reports a number of bytes transfered equal to bcount. This then triggers a KASSERT in physio_biodone: if (done == todo) KASSERT(bp->b_error == 0); Detect this case in wd(4) (so that the workaround works for other controllers too if they have the same issue, or if the issue is with the drive) and claim we didn't read/write anything.
2012-05-15If the PHY reports link up but no communication, wait 5 morebouyer
seconds for communications to be established. This seems to be needed for some configurations.
2012-04-06Fix a typo (that I found 5 years ago). Though the definition ofisaki
atabusiodetach_args is the same as atabusioscan_args (at the moment).
2012-02-02Entropy-pool implementation move and cleanup.tls
1) Move core entropy-pool code and source/sink/sample management code to sys/kern from sys/dev. 2) Remove use of NRND as test for presence of entropy-pool code throughout source tree. 3) Remove use of RND_ENABLED in device drivers as microoptimization to avoid expensive operations on disabled entropy sources; make the rnd_add calls do this directly so all callers benefit. 4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might have lead to slight entropy overestimation for some sources. 5) Add new source types for environmental sensors, power sensors, VM system events, and skew between clocks, with a sample implementation for each. ok releng to go in before the branch due to the difficulty of later pullup (widespread #ifdef removal and moved files). Tested with release builds on amd64 and evbarm and live testing on amd64.
2012-01-24Rework struct ata_command to support LBA28 and LBA48-protocol commands.jakllsch
Implement 28- and 48-bit command issuance and parameter read-back in the various ATA host drivers. Add LBA28-protocol support to ATAIOCCOMMAND ioctl.
2012-01-09Instead of assume that 'features' is 0 in wdccommandext(),jakllsch
pass it as an argument, as is done for wdccommand().
2011-11-25Replace broken memset with M_ZEROjoerg
2011-11-19First step of random number subsystem rework described intls
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes the following: An initial cleanup and minor reorganization of the entropy pool code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are fixed. Some effort is made to accumulate entropy more quickly at boot time. A generic interface, "rndsink", is added, for stream generators to request that they be re-keyed with good quality entropy from the pool as soon as it is available. The arc4random()/arc4randbytes() implementation in libkern is adjusted to use the rndsink interface for rekeying, which helps address the problem of low-quality keys at boot time. An implementation of the FIPS 140-2 statistical tests for random number generator quality is provided (libkern/rngtest.c). This is based on Greg Rose's implementation from Qualcomm. A new random stream generator, nist_ctr_drbg, is provided. It is based on an implementation of the NIST SP800-90 CTR_DRBG by Henric Jungheim. This generator users AES in a modified counter mode to generate a backtracking-resistant random stream. An abstraction layer, "cprng", is provided for in-kernel consumers of randomness. The arc4random/arc4randbytes API is deprecated for in-kernel use. It is replaced by "cprng_strong". The current cprng_fast implementation wraps the existing arc4random implementation. The current cprng_strong implementation wraps the new CTR_DRBG implementation. Both interfaces are rekeyed from the entropy pool automatically at intervals justifiable from best current cryptographic practice. In some quick tests, cprng_fast() is about the same speed as the old arc4randbytes(), and cprng_strong() is about 20% faster than rnd_extract_data(). Performance is expected to improve. The AES code in src/crypto/rijndael is no longer an optional kernel component, as it is required by cprng_strong, which is not an optional kernel component. The entropy pool output is subjected to the rngtest tests at startup time; if it fails, the system will reboot. There is approximately a 3/10000 chance of a false positive from these tests. Entropy pool _input_ from hardware random numbers is subjected to the rngtest tests at attach time, as well as the FIPS continuous-output test, to detect bad or stuck hardware RNGs; if any are detected, they are detached, but the system continues to run. A problem with rndctl(8) is fixed -- datastructures with pointers in arrays are no longer passed to userspace (this was not a security problem, but rather a major issue for compat32). A new kernel will require a new rndctl. The sysctl kern.arandom() and kern.urandom() nodes are hooked up to the new generators, but the /dev/*random pseudodevices are not, yet. Manual pages for the new kernel interfaces are forthcoming.
2011-11-02Drop trailing whitespace.jakllsch
2011-10-29Some comment improvements; spelling and grammar.jakllsch
2011-10-27Attempt to complete the WD_QUIRK_SPLIT_MOD15_WRITE list.jakllsch
Per Seagate Publication number 100221381, Rev. B, the ST360015AS is the only other drive in the Seagate Barracuda Serial ATA V family that was not already listed. Also, correct spelling of "globing".
2011-10-24SATA_SIGNAL_GEN3 definition for Serial ATA capabilities word injakllsch
IDENTIFY DEVICE structure.
2011-10-24Add defines for SET FEATURES for the SATA, PUIS and AAM feature sets.jakllsch
2011-10-05Limit wd(4) transfers to 128 (512-byte) logical sectors, as the traditionaljakllsch
MAXPHYS value has for at least the past decade. There are issues in wd(4) and possibly in host adapter drivers that need work before this should be raised.
2011-08-28make this compile.christos