summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
Commit message (Collapse)AuthorAgeFilesLines
* MFC r311305 (by asomers):mav2017-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name) 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
* MFC r313949: Remove dead mentions of CAM target mode APIs from drivers.mav2017-02-281-4/+0
| | | | This makes grepping kernel for target mode implementation much easier.
* sys/dev: minor spelling fixes.pfg2016-05-033-3/+3
| | | | Most affect comments, very few have user-visible effects.
* Implement Auxiliary register. Add PIM_ATA_EXT flag to flag that a SIMimp2016-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
* Cleanup unnecessary semicolons from the kernel.pfg2016-04-101-1/+1
| | | | Found with devel/coccinelle.
* Small typo.pfg2016-03-291-1/+1
|
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().jhibbits2016-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
* Ternary operator has lower priority than OR.glebius2016-02-171-3/+2
| | | | Found by: PVS-Studio
* Convert a few more long -> rman_res_t.jhibbits2016-02-161-1/+1
|
* Add defines for WRITE_UNCORRECTABLE ATA command, and improve command loggingrpokala2016-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
* Convert rman to use rman_res_t instead of u_longjhibbits2016-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
* Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingimp2015-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
* Increase reset assertion time from 10 to 100us.mav2015-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
* Pass proper device to pci_read_config().mav2015-10-211-2/+3
| | | | For some reason JMicron driver was different from others at this point.
* Small addition to r286814.mav2015-08-151-2/+0
| | | | | Submitted by: bz MFC after: 2 weeks
* Remove UMA allocation of ATA requests.mav2015-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
* Disable 32-bit PIO for 6Gbit/s Intel SATA controllers.mav2015-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
* Add unmapped I/O support to ata(4) driver.mav2015-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.
* Remove from legacy ata(4) driver support for hardware, supported by newermav2015-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.
* Reduce priority of ATA/SATA drivers.mav2015-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
* Fix SATA Gen3 speed constants.mav2015-03-131-1/+2
| | | | MFC after: 1 week
* Add bunch of PCI IDs of Intel Wildcat Point (9 Series) chipsets.mav2014-11-262-0/+25
| | | | MFC after: 1 week
* Add another PCI ID for JMB368 PATA controller.mav2014-10-202-0/+2
| | | | MFC after: 1 week
* err set but not used. Eliminate it.imp2014-08-081-2/+2
|
* Actually pro AMD chipsets.marius2014-07-011-1/+1
| | | | | MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-281-2/+1
|
* Revert r267961, r267973:gjb2014-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
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-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
* Don't bother clearing maps for static DMA allocations to NULL. Instead,jhb2014-06-171-1/+0
| | | | leave them as purely opaque values that are only set by bus_dmamem_alloc().
* Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,jhb2014-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
* Fix the style of ata_interrupt_locked().rpaulo2014-04-121-13/+11
|
* Add fsl,imx53.rpaulo2014-04-051-1/+2
|
* Follow r261352 by updating all drivers which are children of simplebusian2014-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.
* Add some more IDs for Intel ATA, AHCI and USB controllers.mav2013-11-152-0/+27
|
* Merge CAM locking changes from the projects/camlock branch to radicallymav2013-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
* Allow the legacy CDROM device to be accessed in a FreeBSD guest, whilegrehan2013-10-102-2/+2
| | | | | | | still using enlightened drivers for other block devices. Submitted by: Microsoft hyperv dev team, mav@ Approved by: re@
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIscottl2013-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
* Add missing NULL check after malloc(M_NOWAIT).mav2013-07-251-0/+4
| | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
* Add new Coleto Creek device support: SATA, SMBus, and Watchdog devices.jfv2013-07-192-0/+7
| | | | MFC after: 1 week
* Add test for SATA registers writability and skip using them if it failed.mav2013-06-251-5/+30
| | | | | | | | | | There are some systems reported, where PCI BAR(5), used for SATA registers access, is present, but not functional. Attempt to use it brakes devices detection logic. Try to detect those cases on attach by setting and testing some bits in SControl register. If bits are unsettable, fallback to legacy ATA without hot-plug detection, speed control/reporting, etc. MFC after: 2 weeks
* Pass proper memory type to free() in ata_ali_chipinit().mav2013-06-181-1/+1
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week
* Fix several typoseadler2013-05-121-1/+1
| | | | | | PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days
* Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCIkib2013-04-141-0/+8
| | | | | | | | | | | device which makes the request for dma tag, instead of some descendant of the PCI device, by creating a pass-through trampoline for vga_pci and ata_pci buses. Sponsored by: The FreeBSD Foundation Suggested by: jhb Discussed with: jhb, mav MFC after: 1 week
* - With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) relatedmarius2013-04-0631-35/+3
| | | | | | | | | option left but actually consumed by ada(4), so move it to opt_ada.h and get rid of opt_ata.h. - Fix stand-alone build of atacore(4) by adding opt_cam.h. - Use __FBSDID. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers.
* - Make ata_str2mode() static, it's not used outside of ata-all.c.marius2013-04-064-195/+153
| | | | | | | | | | - 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
* Remove some more remnants of !ATA_CAM.marius2013-04-061-11/+0
|
* Unbreak ATA_NO_48BIT_DMA with ATA_CAM by treating 48-bit DMA as anmarius2013-04-061-7/+23
| | | | | | | optional property with PATA transport. Reviewed by: mav MFC after: 3 days
* Remove all legacy ATA code parts, not used since options ATA_CAM enabled inmav2013-04-0428-13814/+2
| | | | | | | | | 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
* Since ATA_CAM mode has no implemented support for serializing access to themav2013-04-032-6/+22
| | | | | | | | | different ATA channels, required for acard and pc98 ATA controllers, block access to second channels of both, hoping that one working channel is better then none. I have an idea how that support could be implemented, but I have no hardware to work on that. MFC after: 1 week
* Add some more ATA_CAM ifdefs.mav2013-04-032-7/+15
| | | | | Submitted by: marius (partially) MFC after: 1 week
OpenPOWER on IntegriCloud