aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ata/ata-queue.c
Commit message (Collapse)AuthorAgeFilesLines
* - Make ata_str2mode() static, it's not used outside of ata-all.c.Marius Strobl2013-04-061-186/+0
| | | | | | | | | | | | | - Move ata_timeout() to ata-all.c so we don't need to expose both this function and ata_cam_end_transaction() but only the former. - Move ata_cmd2str() from ata-queue.c to ata-all.c so we can get rid of the former. - Add some missing prototypes. MFC after: 3 days Notes: svn path=/head/; revision=249203
* Remove all legacy ATA code parts, not used since options ATA_CAM enabled inAlexander Motin2013-04-041-639/+0
| | | | | | | | | | | | most kernels before FreeBSD 9.0. Remove such modules and respective kernel options: atadisk, ataraid, atapicd, atapifd, atapist, atapicam. Remove the atacontrol utility and some man pages. Remove useless now options ATA_CAM. No objections: current@, stable@ MFC after: never Notes: svn path=/head/; revision=249083
* - First pass at const'ifying ata(4) as appropriate.Marius Strobl2012-03-211-1/+1
| | | | | | | | | | - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers MFC after: 1 week Notes: svn path=/head/; revision=233282
* Remove remnants of ATA_LOCKING uses in the ATA_CAM case and wrap itMarius Strobl2012-03-211-3/+27
| | | | | | | | | | | | | | | | | | along with functions, SYSCTLs and tunables that are not used with ATA_CAM in #ifndef ATA_CAM, similar to the existing #ifdef'ed ATA_CAM code for the other way around. This makes it easier to understand which parts of ata(4) actually are used in the new world order and to later on remove the !ATA_CAM bits. It also makes it obvious that there is something fishy with the C-bus front-end as well as in the ATP850 support, as these used ATA_LOCKING which is defunct in the ATA_CAM case. When fixing the former, ATA_LOCKING probably needs to be brought back in some form or other. Reviewed by: mav MFC after: 1 week Notes: svn path=/head/; revision=233274
* Fix panic after "WARNING - ATA_IDENTIFY taskqueue timeout"Ed Maste2012-02-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | When performing a firmware upgrade via atacontrol[1] the subsequent command may time out producing the error message above. When this happens the callout could still be active, and the system would then panic due to a destroyed semaphore. Instead, ensure that the callout is done first, via callout_drain. Note that this fix applies to the "old" ata(4) and so isn't applicable to the default configuration in HEAD. It is still applicable to stable/8. [1] http://lists.freebsd.org/pipermail/freebsd-current/2012-January/031122.html Submitted by: Nima Misaghian Reviewed by: rstone, attilio, mav Obtained from: SVOS MFC after: 3 days Notes: svn path=/head/; revision=231573
* Convert files to UTF-8Ulrich Spörlein2012-01-151-1/+1
| | | | Notes: svn path=/head/; revision=230132
* Mark ATA channel as idle on timeout in non-ATA_CAM mode.Alexander Motin2010-04-261-1/+1
| | | | | | | | | This should fix possible duplicate request completion. Submitted by: mjacob Notes: svn path=/head/; revision=207221
* MFp4:Alexander Motin2009-12-061-2/+9
| | | | | | | | | | | | | | | | | | | | | Introduce ATA_CAM kernel option, turning ata(4) controller drivers into cam(4) interface modules. When enabled, this options deprecates all ata(4) peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers (ada, cd, ...) and interfaces to be natively used instead. As side effect of this, ata(4) mode setting code was completely rewritten to make controller API more strict and permit above change. While doing this, SATA revision was separated from PATA mode. It allows DMA-incapable SATA devices to operate and makes hw.ata.atapi_dma tunable work again. Also allow ata(4) controller drivers (except some specific or broken ones) to handle larger data transfers. Previous constraint of 64K was artificial and is not really required by PCI ATA BM specification or hardware. Submitted by: nwitehorn (powerpc part) Notes: svn path=/head/; revision=200171
* Introduce define and kernel option ATA_REQUEST_TIMEOUT to control ATA(4)Alexander Motin2009-11-081-3/+3
| | | | | | | | | command timeout. Submitted by: keramida Notes: svn path=/head/; revision=199050
* MFp4:Alexander Motin2009-10-311-1/+9
| | | | | | | | | | | - Remove most of direct relations between ATA(4) peripherial and controller levels. It makes logic more transparent and is a mandatory step to wrap ATA(4) controller level into ATA-native CAM SIM. - Tune AHCI and SATA2 SiI drivers memory allocation a bit to allow bigger I/O transaction sizes without additional cost. Notes: svn path=/head/; revision=198717
* Increase ATA command timeouts. Some drives need more then 5s to spin-up.Alexander Motin2009-10-261-2/+2
| | | | | | | PR: kern/111023 Notes: svn path=/head/; revision=198486
* MFp4:Alexander Motin2009-10-231-5/+1
| | | | | | | Do not differentiate 12/16 bytes ATAPI CCB formats when it is not needed. Notes: svn path=/head/; revision=198407
* Improve kernel dumping reliability for busy ATA channels:Alexander Motin2009-05-011-9/+24
| | | | | | | | | | | | - Generate fake channel interrupts even if channel busy with previous request to let it finish. Without this, dumping requests were just queued and never processed. - Drop pre-dump requests queue on dumping. ATA code, working in dumping (interruptless) mode, unable to handle long request queue. Actually, to get coherent dump we anyway should do as few unrelated actions as possible. Notes: svn path=/head/; revision=191717
* Improve clarity: if (a && (b ? b : c)) -> if (a && (b || c))Ed Schouten2009-04-071-2/+1
| | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Notes: svn path=/head/; revision=190820
* Revert my ata_identify()/ata_reinit() related changes: r189166, r189091Alexander Motin2009-02-281-1/+7
| | | | | | | | | | | | | | | | | and partially r188903. Revert breaks new drives detection on reinit to the state as it was before me, but fixes series of new bugs reported by some people. Unconditional queueing of ata_completed() calls can lead to deadlock if due to timeout ata_reinit() was called at the same thread by previous ata_completed(). Calling of ata_identify() on ata_reinit() in current implementation opens numerous races and deadlocks. Problems I was touching here are still exist and should be addresed, but probably in different way. Notes: svn path=/head/; revision=189195
* Rollback rev. 189093.Alexander Motin2009-02-261-1/+0
| | | | | | | | | | mtx_lock() is not needed there as callout initialized with callout_init_mtx(). Sorry. Submitted by: Ian Dowse Notes: svn path=/head/; revision=189095
* Restore mtx_lock() call on ata_timeout(), dropped (I think accidentally)Alexander Motin2009-02-261-0/+1
| | | | | | | during commit 3 years ago. Notes: svn path=/head/; revision=189093
* Remove direct ata_completed() call options from ata_finish(), except for theAlexander Motin2009-02-261-7/+1
| | | | | | | | | | | | | kernel dumping case. ata_completed() may initiate ata_reinit() on error, that may lead to drives attach or detach. Attach and detach are sending requests to drives and sleep waiting for results. But ata_finish() can be called directly from interrupt handler where sleeping is prohibited, so we must break this chain somewhere. This place seems to fit best. Notes: svn path=/head/; revision=189091
* Adaptively increase control command timeout when drive is spun down.Alexander Motin2009-02-171-1/+8
| | | | | | | | | | This should fix, for example, cache flush timeout error on shutdown, if some drives are not mounted. PR: kern/111023 Notes: svn path=/head/; revision=188740
* ata_interrupt() does not need to return anything. It is not it's businessAlexander Motin2009-02-171-1/+3
| | | | | | | to report request completion, expecially when it is not reliable. Notes: svn path=/head/; revision=188731
* Make core dumping to ad not to freeze even if interrupts, not disabledAlexander Motin2009-02-161-1/+1
| | | | | | | for some reason, stealing our events. Notes: svn path=/head/; revision=188700
* Fix issue where ata_atapicmd() can never really return EBUSY which isDavid E. O'Brien2009-01-121-1/+2
| | | | | | | | | | | | | | expected in acd_fixate(). This should fix various problems folks are having with 'burncd' reporting "burncd: ioctl(CDRIOCFIXATE): Input/output error" during the fixate phase when "fixate" is issued together with the "data" command. PR: 95979 Submitted by: Jaakko Heinonen <jh@saunalahti.fi> Notes: svn path=/head/; revision=187105
* Don't let ata_completed() dereference a null request->dma pointer toPeter Wemm2008-11-271-1/+1
| | | | | | | print dma status after a media error. Notes: svn path=/head/; revision=185357
* Only call dma.unload() if initialized.Søren Schmidt2008-10-271-1/+2
| | | | | | | Reported by: Stanislav Sedov Notes: svn path=/head/; revision=184328
* Unload DMA slot on device timeouts.Søren Schmidt2008-04-211-0/+1
| | | | Notes: svn path=/head/; revision=178374
* Go back to preallocating everything possible on init.Søren Schmidt2008-04-171-4/+6
| | | | | | | | This avoids calling busdma in the request processing path which caused a traumatic performance degradation. Allocation has be postponed to after we know how many devices we possible can have on portmulitpliers to save some space. Notes: svn path=/head/; revision=178278
* Fix the brokenness in the former commit, sorry for the mess.Søren Schmidt2008-04-111-5/+3
| | | | | | | | | | | The problem is that the PM support is part of a much larger WIP here, but due to popular demand I decided to get some of it imported. Also I forgot the mention: HW sponsored by: Vitsch Electronics / VEHosting Notes: svn path=/head/; revision=178114
* Add experimental support for SATA Port MultipliersSøren Schmidt2008-04-101-3/+8
| | | | | | | | | | Support is working on the Silicon Image SiI3124/3132. Support is working on some AHCI chips but far from all. Remember this is WIP, so test reports and (constructive) suggestions are welcome! Notes: svn path=/head/; revision=178067
* (ata_completed): When REQUEST SENSE is automatically issued after a failedThomas Quinot2007-03-131-1/+1
| | | | | | | | | | | | ATAPI request, do not clear the ATA_R_DEBUG flag. This allows a request marked as requiring debug traces to produce these traces also during the completion of the autosense processing. Reviewed by: sos MFC after: 2 weeks Notes: svn path=/head/; revision=167506
* Update copyright headers.Søren Schmidt2007-02-211-1/+1
| | | | Notes: svn path=/head/; revision=166878
* Add the SMART command to the ATA instruction set.Remko Lodder2007-01-271-0/+1
| | | | | | | | | | | | When the disk has an error, it will now print SMART instead of 'Unknown CMD'. PR: kern/93368 Submitted by: Garry Belka <garry at NetworkPhysics dot COM> Approved by: sos Notes: svn path=/head/; revision=166287
* Fix a typo in ata-queue.cRemko Lodder2006-12-231-2/+2
| | | | | | | | | PR: kern/107100 Submitted by: Stephen J. Roznowski <sjr at comcast dot net> Approved by: sos Notes: svn path=/head/; revision=165487
* If we get an error w/o atapi sense information, just print a newlineWarner Losh2006-07-211-0/+2
| | | | | | | | to terminate the message we started. I get non-terminated messages when reading audio tracks w/o this patch. Notes: svn path=/head/; revision=160554
* Add missing ";"Søren Schmidt2006-04-171-1/+1
| | | | | | | found by: jmg Notes: svn path=/head/; revision=157807
* Make the ATAPI sense data accessible when using the ioctl interfaceSøren Schmidt2006-03-311-30/+33
| | | | | | | MFC candidate. Notes: svn path=/head/; revision=157329
* Only use the channel in the request given to ata_completed if itsSøren Schmidt2006-03-091-3/+7
| | | | | | | still present. Notes: svn path=/head/; revision=156487
* Get rid of all the "long long"/"maxint" casting around in printf's.Søren Schmidt2006-03-091-6/+5
| | | | | | | | On all our platforms intmax == int64_t so simply using %j to print int64_t's is safe all over, and doesn't pullute the code. Notes: svn path=/head/; revision=156473
* Only look for ICRC and CORR errors on ATA devices not ATAPI.Søren Schmidt2006-03-071-1/+1
| | | | Notes: svn path=/head/; revision=156392
* Update atapi-fd to support direct devices such as disks.Søren Schmidt2006-03-051-0/+1
| | | | Notes: svn path=/head/; revision=156320
* Work around the deadlock that occours when ATA waits for the taskqueueSøren Schmidt2006-03-011-5/+18
| | | | | | | | | | | | | | | | | | to call back for completition and something else is holding the taskqueue waiting for ATA to return data. This should clear up the "semaphore timeout !! DANGER Will Robinson !!" in most situations, and log "taskqueue timeout - completing request directly" instead, with a delayed "WARNING - freeing taskqueue zombie request" when the taskqueue finally calls us back with the now stale request. (It would have been nice if there was a way to remove a scheduled item from a taskqueue, but that is not currently implemented in the kernel). A real fix for this is in the works but wont make it to 6.1RELEASE definite MFC candidate. Notes: svn path=/head/; revision=156140
* Fix ata_reinit so it does things in the right order to prevent panic's.Søren Schmidt2006-02-251-5/+1
| | | | | | | Lock the channel so master/slave setups wont trash during reinit. Notes: svn path=/head/; revision=156003
* Keep the parent device (in this case the channel) around in ata_request,Søren Schmidt2006-02-231-17/+26
| | | | | | | | so we dont panic device removal or failure. Clean up ata_fail_requests to prevent the queue munging to fail. Notes: svn path=/head/; revision=155959
* Whitespace cleanup.Søren Schmidt2006-01-181-3/+3
| | | | Notes: svn path=/head/; revision=154515
* Add support for using DMA on dump, greatly speeds up the dump process.Søren Schmidt2006-01-181-2/+11
| | | | | | | Add dump support in ataraid. Notes: svn path=/head/; revision=154507
* Get rid of the advertising clause in the copyright.Søren Schmidt2006-01-051-3/+1
| | | | Notes: svn path=/head/; revision=154063
* Fix rebuilds of arrays that got stuck.Søren Schmidt2005-12-271-5/+17
| | | | | | | | | Misc minor fixes. Bughunting and initial fixes by Pav@ and Anton. Notes: svn path=/head/; revision=153752
* Harden the hotplug support for SATA devices.Søren Schmidt2005-09-141-36/+29
| | | | | | | | | This also fixes a few races that was present in the timeout/detach code. Sponsored by: pair.com Notes: svn path=/head/; revision=150129
* Zero donecount on auto request sense.Søren Schmidt2005-06-281-0/+1
| | | | | | | | PR: 81450 Approved by: re@ (scottl) Notes: svn path=/head/; revision=147644
* Add back one line that got deleted in the last commit.Søren Schmidt2005-05-111-2/+4
| | | | | | | | | Change the comment there so it better describes whats going on. This should fix the boot problems of late. Notes: svn path=/head/; revision=146100
* Reshape the dma code to be a bit more flexible so it can cope withSøren Schmidt2005-05-031-2/+1
| | | | | | | | | | new HW that has new and different demands. Fix a few nits in former commit in this cleanup crusade. Sponsored by: pair.com Notes: svn path=/head/; revision=145818