aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mvs
Commit message (Collapse)AuthorAgeFilesLines
* MFC r366922, r367915, r367916:Alexander Motin2020-11-241-1/+2
| | | | | | | | | | Pass lower 3 bits of sector_count for FPDMA commands. When this code was written those bits were N/A, but now the lowest bit is Rebuild Assist Recovery Control (RARC). Notes: svn path=/stable/12/; revision=367974
* Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,Warner Losh2018-09-261-0/+2
| | | | | | | | | | | | | mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existing pci device tables, and has no probe / attach code changes. Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com> Sponsored by: Google, Inc. (GSoC 2018) Approved by: re (glen) Notes: svn path=/head/; revision=338949
* kernel: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327231
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-274-0/+8
| | | | | | | | | | | | | | | 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
* 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
* 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-032-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
* Replace 0 with NULL for pointers in misc. device drivers.Pedro F. Giffuni2016-04-122-2/+2
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297862
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-101-1/+1
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* Fix some more long -> rman_res_tJustin Hibbits2016-03-212-2/+2
| | | | | | | Reported by: Michael Butler (siis breakage) Notes: svn path=/head/; revision=297170
* Convert rman to use rman_res_t instead of u_longJustin Hibbits2016-01-272-2/+3
| | | | | | | | | | | | | | | | | | | | | | | 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
* Reduce priority of ATA/SATA drivers.Alexander Motin2015-03-233-3/+3
| | | | | | | | | | 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-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=279963
* Prevent overflow issues in timeout processingSteven Hartland2014-11-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Previously, any timeout value for which (timeout * hz) will overflow the signed integer, will give weird results, since callout(9) routines will convert negative values of ticks to '1'. For unsigned integer overflow we will get sufficiently smaller timeout values than expected. Switch from callout_reset, which requires conversion to int based ticks to callout_reset_sbt to avoid this. Also correct isci to correctly resolve ccb timeout. This was based on the original work done by Eygene Ryabinkin <rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid the overlow. Differential Revision: https://reviews.freebsd.org/D1157 Reviewed by: mav, davide MFC after: 1 month Sponsored by: Multiplay Notes: svn path=/head/; revision=274819
* Initialize variables before resource_int_value().Alexander Motin2014-09-123-0/+3
| | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Notes: svn path=/head/; revision=271461
* Don't bother clearing maps for static DMA allocations to NULL. Instead,John Baldwin2014-06-171-2/+0
| | | | | | | leave them as purely opaque values that are only set by bus_dmamem_alloc(). Notes: svn path=/head/; revision=267589
* 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
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler2013-11-301-1/+1
| | | | | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva Notes: svn path=/head/; revision=258780
* Run mvs SATA driver on Armada XP instead of old mv_sataZbigniew Bodek2013-10-281-0/+2
| | | | | | | | The mvs driver seems to be more functional than mv_sata and is not causing random interrupt storms during boot. Notes: svn path=/head/; revision=257240
* 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
* Replicate r242422 from ata(4) to mvs(4):Alexander Motin2013-06-121-3/+9
| | | | | | | | | | | Only four specific ATA PIO commands transfer several sectors per DRQ block (interrupt). All other ATA PIO commands transfer one sector or 512 bytes at one time. Hardcode these exceptions in mvs(4) with ATA_CAM option. This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`. Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`. Notes: svn path=/head/; revision=251661
* Make siis(4) and mvs(4) send bus_get_dma_tag() requests to parent busesAlexander Motin2013-04-182-1/+17
| | | | | | | | | passing real bus' child pointers instead of grandchilds. Requested by: kib Notes: svn path=/head/; revision=249622
* Reform the busdma API so that new types may be added without modifyingKonstantin Belousov2013-02-121-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. The cam changes unify the bus_dmamap_load* handling in cam drivers. The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map. Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>) Notes: svn path=/head/; revision=246713
* Add support for Marvell 88F6282.Hiroki Sato2012-07-281-0/+1
| | | | | | | Sponsored by: Plat'Home, Co.,Ltd. Notes: svn path=/head/; revision=238873
* - Limit r214102 workaround to only x86. On arm it causes more problemsAlexander Motin2012-06-123-1/+47
| | | | | | | | | | | | then solves because of cache coherency issues. This fixes periodic error messages on console and command timeouts. - Patch SATA PHY configuration for 65nm SoCs to improve SNR same as Linux does. MFC after: 2 weeks Notes: svn path=/head/; revision=236952
* Partially revert r236666:Alexander Motin2012-06-101-1/+1
| | | | | | | | | | | | | | Return PROTO_ATA protocol in response to XPT_PATH_INQ. smartmontools uses it to identify ATA devices and I don't know any other place now where it is important. It could probably use XPT_GDEV_TYPE instead for more accurate protocol information, but let it live for now. Reported by: matthew MFC after: 3 days Notes: svn path=/head/; revision=236847
* ATA/SATA controllers have no idea about protocol of the connected deviceAlexander Motin2012-06-061-2/+2
| | | | | | | | | | until transport will do some probe actions (at least soft reset). Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol. Make ATA/SATA transport to fill that gap by reporting protocol to SIM with XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed. Notes: svn path=/head/; revision=236666
* Add two functions xpt_batch_start() and xpt_batch_done() to the CAM SIM KPIAlexander Motin2012-05-121-0/+2
| | | | | | | | | | | | to allow drivers to handle request completion directly without passing them to the CAM SWI thread removing extra context switch. Modify all ATA/SATA drivers to use them. Reviewed by: gibbs, ken MFC after: 2 weeks Notes: svn path=/head/; revision=235333
* Adjust mvs(4) to handle interrupt cause reg depending on the actual number ofRafal Jaworowski2012-02-012-10/+16
| | | | | | | | | | | | | | | | | | | channels available - current code treats bits 4:7 in 'SATAHC interrupt mask' and 'SATAHC interrupt cause' as flags for SATA channels 2 and 3 - for embedded SATA controllers (SoC) these bits have been marked as reserved in datasheets so far, but for some new and upcoming chips they are used for purposes other than SATA Submitted by: Lukasz Plachno Reviewed by: mav Obtained from: Semihalf MFC after: 2 weeks Notes: svn path=/head/; revision=230865
* Rename device_delete_all_children() into device_delete_children().Hans Petter Selasky2011-11-222-2/+2
| | | | | | | | Suggested by: jhb @ and marius @ MFC after: 1 week Notes: svn path=/head/; revision=227849
* Move the device_delete_all_children() function from usb_util.cHans Petter Selasky2011-11-192-14/+4
| | | | | | | | | | | to kern/subr_bus.c. Simplify this function so that it no longer depends on malloc() to execute. Identify a few other places where it makes sense to use device_delete_all_children(). MFC after: 1 week Notes: svn path=/head/; revision=227701
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-1/+1
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* According to SATA specification, when Serial ATA Enclosure Management BridgeAlexander Motin2011-05-251-10/+34
| | | | | | | | | | | | | | | | | | | | | | | (SEMB) is unable to communicate to Storage Enclosure Processor (SEP), in response to hard and soft resets it should among other things return value 0x7F in Status register. The weird side is that it means DRQ bit set, which tells that reset request is not completed. It would be fine if SEMB was the only device on port. But if SEMB connected to PMP or built into it, it may block access to other devices sharing same SATA port. Make some tunings/fixes to soft-reset handling to workaround the issue: - ahci(4): request CLO on the port after soft reset to ignore DRQ bit; - siis(4): gracefully reinitialize port after soft reset timeout (hardware doesn't detect reset request completion in this case); - mvs(4): if PMP is used, send dummy soft-reset to the PMP port to make it clear DRQ bit for us. For now this makes quirks in ata_pmp.c, hiding SEMB ports of SiI3726/SiI4726 PMPs, less important. Further, if hardware permit, I hope to implement real SEMB support. Notes: svn path=/head/; revision=222285
* Fix some English grammar.Alexander Motin2011-04-192-6/+6
| | | | Notes: svn path=/head/; revision=220830
* According to specification. device should respond to COMRESET with COMINITAlexander Motin2011-04-191-10/+14
| | | | | | | | in no more then 10ms. If we detected no device presence within that time, there is no reason to wait longer. Notes: svn path=/head/; revision=220829
* Properly handle memory allocation errors during error recovery.Alexander Motin2011-04-191-6/+19
| | | | Notes: svn path=/head/; revision=220822
* Refactor hard-reset implementation in mvs(4).Alexander Motin2011-04-142-17/+86
| | | | | | | | | | | | Instead of spinning in a tight loop for up to 15 seconds, polling for device readiness while it spins up, return reset completion just after PHY reports "connect well" or 100ms connection timeout. If device was found, use callout for checking device readiness with 100ms period up to full 31 second timeout. This fixes system freeze for 5-10 seconds on drives hot plug-in. Notes: svn path=/head/; revision=220615
* Improve SATA Asynchronous Notification feature support in CAM:Alexander Motin2011-04-131-0/+15
| | | | | | | | | | | | | | | | - make SATA SIMs announce capabilities to handle SDB with Notification bit; - make PMP driver honor this SIMs capability; - make SATA XPT to negotiate and enable this feature for ATAPI devices. This feature allows supporting SATA ATAPI devices to inform system about some events happened, that may require attention. In my case this allows LG GH22LS50 SATA DVR-RW drive to report tray open/close events. Events reported to CAM in form of AC_SCSI_AEN async. Further they could be used as a hints for checking device status and reporting media change to upper layers, for example, via spoiling mechanism of GEOM. Notes: svn path=/head/; revision=220602
* Implement automatic SCSI sense fetching for mvs(4).Alexander Motin2011-04-122-38/+111
| | | | | | | | Make few improvements/changes to ATAPI PIO support to pass most of scgcheck (cdrtools) tests. Notes: svn path=/head/; revision=220569
* Update mvs(4) driver to work over FDT's simplebus(4) bus.Alexander Motin2011-03-281-4/+9
| | | | Notes: svn path=/head/; revision=220097
* Workaround strange situation when EDMA_RESQIP register returns zero insteadAlexander Motin2010-10-201-15/+31
| | | | | | | | | | | of proper value. It caused bunch of "EMPTY CRPB" messages and potentially may cause premature requests completion, which could cause data corruption. For most cases it seems enough to just reread register to get proper value. To protect against worse cases - erase processed queue entries with impossible values and ignore them if problem still happen. Notes: svn path=/head/; revision=214102
* Some style cleanup:Alexander Motin2010-10-203-44/+37
| | | | | | | | - remove commented debugging code; - wrap long lines. Notes: svn path=/head/; revision=214099
* Fix panic, when due to some kind of congestion on FIS-based switchingAlexander Motin2010-09-161-5/+8
| | | | | | | | | | port multiplier some command triggers false positive timeout, but then completes normally. MFC after: 2 weeks Notes: svn path=/head/; revision=212732
* Export PCI IDs of ATA/SATA controllers through CAM and ata(4) layers toAlexander Motin2010-07-251-1/+9
| | | | | | | | GEOM. This information needed for proper soft-RAID's on-disk metadata reading and writing. Notes: svn path=/head/; revision=210471
* Plug memory leak to silent Coverity. Error is still not really handled.Alexander Motin2010-06-051-0/+1
| | | | | | | | Found with: Coverity Prevent(tm) CID: 4137 Notes: svn path=/head/; revision=208818
* Fill rman range start/end values. It makes devinfo output more readable.Alexander Motin2010-05-222-0/+4
| | | | Notes: svn path=/head/; revision=208414
* Report ATA/SATA channel number to NewBus at location string.Alexander Motin2010-05-222-0/+22
| | | | Notes: svn path=/head/; revision=208410
* Improve suspend/resume support. Make sure controller is idle on suspendAlexander Motin2010-05-211-15/+44
| | | | | | | and reset it on resume. Notes: svn path=/head/; revision=208393
* Fix polled operation. Now it is possible to dump kernel via mvs(4).Alexander Motin2010-05-061-1/+1
| | | | Notes: svn path=/head/; revision=207696