aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mvs
Commit message (Collapse)AuthorAgeFilesLines
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin8 days2-4/+4
| | | | | | | | | The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
* machine/stdarg.h -> sys/stdarg.hBrooks Davis2025-06-113-3/+3
| | | | | | | | | | | | | Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
* arm/mv: Remove pre-armv7 supportAndrew Turner2025-03-271-5/+0
| | | | | | | | | Armv4, Armv5, and Armv6 support has been removed. Remove the Marvell SoCs that used these cores. Reviewed by: cognet, imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D49497
* Use bus_generic_detach instead of device_delete_children in detachJohn Baldwin2025-01-022-2/+8
| | | | | | | While here, check for errors from bus_generic_detach and move it to the start of detach if necessary. Differential Revision: https://reviews.freebsd.org/D47969
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-062-2/+2
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-252-2/+2
| | | | Sponsored by: Netflix
* mvs: Fix to use rman_get_rid rather than non-existent rid argumentJessica Clarke2024-07-171-1/+1
| | | | | | | | This got missed as it's not built in a normal tinderbox build. This fixes building arm.armv7 ARMADAXP (marked NO_UNIVERSE). Fixes: 9dbf5b0e6876 ("new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE")
* Fix SATA NCQ error recovery after 25375b1415Alexander Motin2024-06-271-1/+1
| | | | | | | | | | Since that commit ahci(4), siis(4) and mvs(4) drivers ended up using wrong command to fetch error information for NCQ commands. Since ATA errors are not very informative to begin with, the only noticeable effect is a lack of retries on those errors by CAM. MFC after: 1 week PR: 279978
* mvs: Use device_set_desc(f)()Mark Johnston2024-06-023-7/+3
| | | | | | No functional change intended. MFC after: 1 week
* new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCEJohn Baldwin2024-03-132-7/+5
| | | | | | | | | | The public bus_release_resource() API still accepts both forms, but the internal kobj method no longer passes the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44131
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-273-3/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-163-6/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* mvs: Eliminate unused variable.Warner Losh2023-06-091-3/+1
| | | | | | | ccim is unused. Just remove it. PR: 271920 Sponsored by: Netflix
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-124-4/+4
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* mvs(4): Fix a typo in a source code commentGordon Bergling2023-01-111-1/+1
| | | | | | - s/reqests/requests/ MFC after: 3 days
* mvs: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-064-8/+4
|
* ahci/siis/mvs: Fix panics after 3394d4239b.Alexander Motin2022-03-051-1/+2
| | | | | | | | Full CCB header overwrites made frees go into wrong zones, causing kernel panics. Instead of copying full header use xpt_setup_ccb(), since the only field I see used from all the header is target_id. PR: 262263
* Fix "set but not used" in the mvs driver. Remove dead code.Scott Long2022-02-261-2/+0
|
* newbus: Move from bus_child_{pnpinfo,location}_src to ↵Warner Losh2021-06-232-9/+8
| | | | | | | | | | | | | | | | | | | | | | bus_child_{pnpinfo,location} with sbuf Now that the upper layers all go through a layer to tie into these information functions that translates an sbuf into char * and len. The current interface suffers issues of what to do in cases of truncation, etc. Instead, migrate all these functions to using struct sbuf and these issues go away. The caller is also in charge of any memory allocation and/or expansion that's needed during this process. Create a bus_generic_child_{pnpinfo,location} and make it default. It just returns success. This is for those busses that have no information for these items. Migrate the now-empty routines to using this as appropriate. Document these new interfaces with man pages, and oversight from before. Reviewed by: jhb, bcr Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29937
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-282-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* Pass lower 3 bits of sector_count for FPDMA commands.Alexander Motin2020-10-221-1/+2
| | | | | | | | | | When this code was written those bits were N/A, but now the lowest bit is Rebuild Assist Recovery Control (RARC). MFC after: 1 month Notes: svn path=/head/; revision=366922
* mvs: clean up empty lines in .c and .h filesMateusz Guzik2020-09-012-4/+0
| | | | Notes: svn path=/head/; revision=365199
* Use a void * argument to callout handlers instead of timeout_t casts.John Baldwin2019-12-051-5/+6
| | | | | | | | Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22684 Notes: svn path=/head/; revision=355426
* 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