aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ata
Commit message (Collapse)AuthorAgeFilesLines
* MFC: 364430:Warner Losh2020-09-091-0/+1
| | | | | | | | | | | | | r364430 | imp | 2020-08-20 11:19:40 -0600 (Thu, 20 Aug 2020) | 6 lines Tag pccard drivers with gone in 13. MFC After: 3 days Reviewed by: emaste, brooks, adrian (on twitter) Differential Revision: https://reviews.freebsd.org/D26095 Notes: svn path=/stable/12/; revision=365539
* MFC r355830:Brooks Davis2019-12-201-1/+1
| | | | | | | | | | | | | | | Avoid a tautological bitwise compare. This looks like a bit of debugging code that sliped into the initial import of the sos@ ATA framework. This changes the behavior to omit a line of output that appears to have been intended for omission. Reviewed by: mav Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22845 Notes: svn path=/stable/12/; revision=355964
* MFC r344198:Andriy Voskoboinyk2019-02-211-4/+0
| | | | | | | | | | | GC ATA_REQUEST_TIMEOUT option remnants It was removed from code in r249083 and from sys/conf/options in r249213. PR: 193935, 222170 Notes: svn path=/stable/12/; revision=344430
* Reset indentiation of ata_suspend() such that its clear we fall throughSean Bruno2018-07-031-7/+7
| | | | | | | | | | this function and that we aren't supposed to be controlled by the first if() conditional. Found with gcc. No functional change is intended with this commit. Notes: svn path=/head/; revision=335896
* Reset indentation of this flag. No functional change intended.Sean Bruno2018-07-031-1/+1
| | | | | | | | | | | | | | | | Found with gcc. sys/dev/ata/chipsets/ata-siliconimage.c: In function 'ata_cmd_ch_attach': sys/dev/ata/chipsets/ata-siliconimage.c:187:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (ctlr->chip->cfg2 & SII_INTR) ^~ sys/dev/ata/chipsets/ata-siliconimage.c:190:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' ch->flags |= ATA_NO_ATAPI_DMA; Notes: svn path=/head/; revision=335894
* Add ready polling after PHY reset on VIA SATA controllers.Alexander Motin2018-05-231-2/+19
| | | | | | | | | | | | | | | | According to PR there are cases of controller hang if soft reset is sent before device report ready status after the hard reset. I don't think this patch is perfect, but it was reported as working by the submitter, and I have neither the old hardware nor interest to test some improved version, so just done some style cleaning. PR: 183294 Submitted by: alexandre.martins@netasq.com MFC after: 1 month Notes: svn path=/head/; revision=334099
* Add ISA PNP tables to ISA drivers. Fix a few incidental comments.Warner Losh2018-01-291-0/+1
| | | | | | | ACPI ISA PBP tables not tagged, there's bigger issues with them. Notes: svn path=/head/; revision=328524
* Fix typoEitan Adler2017-11-301-1/+1
| | | | | | | Reported by: mjg, zrj@dragonflybsd.org Notes: svn path=/head/; revision=326387
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2731-0/+62
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Use "Ibex Peak" codename for "5 Series/3400 Series" chipsets.Alexander Motin2017-08-092-12/+12
| | | | | | | | | This is shorter and unifies naming with later chipsets. MFC after: 1 week Notes: svn path=/head/; revision=322309
* Remove dead mentions of CAM target mode APIs from drivers.Alexander Motin2017-02-191-4/+0
| | | | | | | This makes grepping kernel for target mode implementation much easier. Notes: svn path=/head/; revision=313949
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-282-355/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v". This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field. PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-033-3/+3
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Implement Auxiliary register. Add PIM_ATA_EXT flag to flag that a SIMWarner Losh2016-04-171-0/+6
| | | | | | | | | | | | can handle it, and add the code to add it to the FIS that's sent to the drive. The mvs driver is the only other ATA driver in the system, and its hardware doesn't appear to support setting the Auxiliary register. Differential Revision: https://reviews.freebsd.org/D5598 Notes: svn path=/head/; revision=298143
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-101-1/+1
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* Small typo.Pedro F. Giffuni2016-03-291-1/+1
| | | | Notes: svn path=/head/; revision=297402
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits2016-02-273-16/+16
| | | | | | | | | | | Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
* Ternary operator has lower priority than OR.Gleb Smirnoff2016-02-171-3/+2
| | | | | | | Found by: PVS-Studio Notes: svn path=/head/; revision=295719
* Convert a few more long -> rman_res_t.Justin Hibbits2016-02-161-1/+1
| | | | Notes: svn path=/head/; revision=295664
* Add defines for WRITE_UNCORRECTABLE ATA command, and improve command loggingRavi Pokala2016-02-041-8/+92
| | | | | | | | | | | | | | | Add #defines for ATA_WRITE_UNCORRECTABLE48 and its features. Update the decoding in ATACAM to recognize the new values. Also improve command decoding for a few other commands (SMART, NOP, SET_FEATURES). Bring the decoding in ata(4) up to parity with ATACAM. Reviewed by: mav, imp MFC after: 1 month Sponsored by: Panasas, Inc. Differential Revision: https://reviews.freebsd.org/D5181 Notes: svn path=/head/; revision=295276
* Convert rman to use rman_res_t instead of u_longJustin Hibbits2016-01-274-6/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075 Notes: svn path=/head/; revision=294883
* Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingWarner Losh2015-12-111-0/+1
| | | | | | | | | | | | block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number. Differential Review: https://reviews.freebsd.org/D3461 Notes: svn path=/head/; revision=292079
* Increase reset assertion time from 10 to 100us.Alexander Motin2015-11-151-1/+1
| | | | | | | | | | | | | On my own tests I see no effect from this change, but I also can't reproduce the reported problem in general. PR: 127391 PR: 204554 Submitted by: satz@iranger.com MFC after: 2 weeks Notes: svn path=/head/; revision=290855
* Pass proper device to pci_read_config().Alexander Motin2015-10-211-2/+3
| | | | | | | For some reason JMicron driver was different from others at this point. Notes: svn path=/head/; revision=289707
* Small addition to r286814.Alexander Motin2015-08-151-2/+0
| | | | | | | | Submitted by: bz MFC after: 2 weeks Notes: svn path=/head/; revision=286816
* Remove UMA allocation of ATA requests.Alexander Motin2015-08-152-34/+3
| | | | | | | | | | | After CAM replaced old ATA stack, this driver processes no more then one request at a time per channel. Using UMA after that is overkill, so replace it with simple preallocation of one request per channel. MFC after: 2 weeks Notes: svn path=/head/; revision=286814
* Disable 32-bit PIO for 6Gbit/s Intel SATA controllers.Alexander Motin2015-08-082-21/+24
| | | | | | | | | | | | | | | | For some reason 32-bit PIO writes are not working on 6Gbit/s Intel SATA ports, while 16/32-bit PIO reads and 16-bit PIO writes are working fine. 3Gbit/s ports on the same controllers have no this problem. Workaround this by disabling 32-bit PIO for all Intel controllers that may have 6Gbit/s ports. It halves PIO performance from 6MB/s to 3MB/s, but who bother about speed of such rare and slow mode, which is also highly discouraged by SATA specifications? MFC after: 2 weeks Notes: svn path=/head/; revision=286448
* Add unmapped I/O support to ata(4) driver.Alexander Motin2015-08-072-71/+168
| | | | | | | | | Main problem there was PIO mode support, that required KVA mapping. Handle that case using recently added pmap_quick_enter_page(9) KPI, mapping data pages to KVA one at a time. Notes: svn path=/head/; revision=286415
* Remove from legacy ata(4) driver support for hardware, supported by newerAlexander Motin2015-03-2412-2485/+16
| | | | | | | | | and more functional drivers ahci(4), siis(4) and mvs(4). This removes about 3400 lines of code, unused since FreeBSD 9.0 release. Notes: svn path=/head/; revision=280451
* Reduce priority of ATA/SATA drivers.Alexander Motin2015-03-2324-24/+24
| | | | | | | | | | Legacy ata(4) -> BUS_PROBE_LOW_PRIORITY; more functional ahci(4), siis(4), mvs(4) -> BUS_PROBE_DEFAULT; BUS_PROBE_VENDOR leave for vendor drivers. MFC after: 2 weeks Notes: svn path=/head/; revision=280393
* Fix SATA Gen3 speed constants.Alexander Motin2015-03-131-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=279963
* Add bunch of PCI IDs of Intel Wildcat Point (9 Series) chipsets.Alexander Motin2014-11-262-0/+25
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=275101
* Add another PCI ID for JMB368 PATA controller.Alexander Motin2014-10-202-0/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=273328
* err set but not used. Eliminate it.Warner Losh2014-08-081-2/+2
| | | | Notes: svn path=/head/; revision=269713
* Actually pro AMD chipsets.Marius Strobl2014-07-011-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH Notes: svn path=/head/; revision=268095
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-2/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-1/+2
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Don't bother clearing maps for static DMA allocations to NULL. Instead,John Baldwin2014-06-171-1/+0
| | | | | | | leave them as purely opaque values that are only set by bus_dmamem_alloc(). Notes: svn path=/head/; revision=267589
* Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,John Baldwin2014-06-101-3/+1
| | | | | | | | | | | | don't create a map before calling bus_dmamem_alloc() (such maps were leaked). It is believed that the extra destroy of the map was generally harmless since bus_dmamem_alloc() often uses special maps for which bus_dmamap_destroy() is a no-op (e.g. on x86). Reviewed by: scottl Notes: svn path=/head/; revision=267340
* Fix the style of ata_interrupt_locked().Rui Paulo2014-04-121-13/+11
| | | | Notes: svn path=/head/; revision=264389
* Add fsl,imx53.Rui Paulo2014-04-051-1/+2
| | | | Notes: svn path=/head/; revision=264181
* Follow r261352 by updating all drivers which are children of simplebusIan Lepore2014-02-021-0/+3
| | | | | | | | | | | | | | | | to check the status property in their probe routines. Simplebus used to only instantiate its children whose status="okay" but that was improper behavior, fixed in r261352. Now that it doesn't check anymore and probes all its children; the children all have to do the check because really only the children know how to properly interpret their status property strings. Right now all existing drivers only understand "okay" versus something- that's-not-okay, so they all use the new ofw_bus_status_okay() helper. Notes: svn path=/head/; revision=261410
* Add some more IDs for Intel ATA, AHCI and USB controllers.Alexander Motin2013-11-152-0/+27
| | | | Notes: svn path=/head/; revision=258162
* Merge CAM locking changes from the projects/camlock branch to radicallyAlexander Motin2013-10-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reduce lock congestion and improve SMP scalability of the SCSI/ATA stack, preparing the ground for the coming next GEOM direct dispatch support. Replace big per-SIM locks with bunch of smaller ones: - per-LUN locks to protect device and peripheral drivers state; - per-target locks to protect list of LUNs on target; - per-bus locks to protect reference counting; - per-send queue locks to protect queue of CCBs to be sent; - per-done queue locks to protect queue of completed CCBs; - remaining per-SIM locks now protect only HBA driver internals. While holding LUN lock it is allowed (while not recommended for performance reasons) to take SIM lock. The opposite acquisition order is forbidden. All the other locks are leaf locks, that can be taken anywhere, but should not be cascaded. Many functions, such as: xpt_action(), xpt_done(), xpt_async(), xpt_create_path(), etc. are no longer require (but allow) SIM lock to be held. To keep compatibility and solve cases where SIM lock can't be dropped, all xpt_async() calls in addition to xpt_done() calls are queued to completion threads for async processing in clean environment without SIM lock held. Instead of single CAM SWI thread, used for commands completion processing before, use multiple (depending on number of CPUs) threads. Load balanced between them using "hash" of the device B:T:L address. HBA drivers that can drop SIM lock during completion processing and have sufficient number of completion threads to efficiently scale to multiple CPUs can use new function xpt_done_direct() to avoid extra context switch. Make ahci(4) driver to use this mechanism depending on hardware setup. Sponsored by: iXsystems, Inc. MFC after: 2 months Notes: svn path=/head/; revision=256843
* Allow the legacy CDROM device to be accessed in a FreeBSD guest, whilePeter Grehan2013-10-102-2/+2
| | | | | | | | | | still using enlightened drivers for other block devices. Submitted by: Microsoft hyperv dev team, mav@ Approved by: re@ Notes: svn path=/head/; revision=256304
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long2013-08-121-4/+1
| | | | | | | | | | | | | | | | | | | | command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day Notes: svn path=/head/; revision=254263
* Add missing NULL check after malloc(M_NOWAIT).Alexander Motin2013-07-251-0/+4
| | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Notes: svn path=/head/; revision=253644
* Add new Coleto Creek device support: SATA, SMBus, and Watchdog devices.Jack F Vogel2013-07-192-0/+7
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=253475