summaryrefslogtreecommitdiff
path: root/sys/dev/ic/mfi.c
AgeCommit message (Collapse)Author
2022-05-24fix various typos in comment, documentation and log messages.andvar
2022-05-22Use PRIxBUSADDR for bus_addr_t in debug printf.hannken
Kernel i386/ALL compiles again.
2022-05-13Improve DNPRINTF. No functional change.msaitoh
2022-05-12Don't use MFI_PD_LIST_SIZE. Same as OpenBSD. No functional change.msaitoh
2022-05-10mfi(4): Set stripe size correctly for BIOCVOL.msaitoh
Before: Volume Status Size Device/Label Level Stripe ============================================================= 0 Online 5.5T mfi0 RAID 5 N/A 65535 seconds After: Volume Status Size Device/Label Level Stripe ============================================================= 0 Online 5.5T mfi0 RAID 5 64K 65535 seconds
2022-05-09Use union mbox instead of unit8_t[] to avoid unaligned access.msaitoh
- Same as other OSes. - mfii.c already use this. - Found by kUBSan.
2022-05-09KNF. Whitespace. No functional change.msaitoh
2022-05-07Clear mailbox to not to pass garbage data.msaitoh
2022-05-07Use mlp_bgi for MFI_LD_PROG_BGI. Same as OpenBSD.msaitoh
2022-05-07s/contrller/controller/ in comment.msaitoh
2022-05-05Add some code for the SKINNY variant to make Dell PERC H310 work.msaitoh
2022-04-16fix various typos in comments and log messages.andvar
2021-12-05s/decriptor/descriptor/ in comment.msaitoh
2021-11-06s/allign/align/msaitoh
2021-08-07Merge thorpej-cfargs2.thorpej
2021-04-24Merge thorpej-cfargs branch:thorpej
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
2020-01-07Set 'ld_sync' to NULL as part of 'again', to prevent use-after-free.maxv
2019-11-10in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAITchs
and remove code to handle failures that can no longer happen.
2019-07-29sys/dev/ic/mfi.c: Add missing break in switchgdt
(The entire switch is guarded by MFI_DEBUG and is known not to build.) Reported by Oskar.
2018-11-24Add some definitions from OpenBSD, needed by the upcoming mfii driver.bouyer
No functionnal change.
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended. HOWEVER! Some subsystems have #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation. To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it. I have left a handful of bootloaders that are too annoying to compile-test, and some dead code: cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4)) It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them. Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
2017-10-28Kill some more extern struct cfdriver declarations.riastradh
Down with externs in .c!
2015-04-04fix double free, found by Brainy.christos
2015-03-12Dedup the conversion of bioc_disk and bioc_vol to envsys_data_tchristos
2014-08-21over-initialize for the benefit of gccchristos
2014-08-21revert previous; code checking tool is incorrect. Variables are not beingchristos
used in the non tbolt case.
2014-07-25Add d_discard to all struct cdevsw instances I could find.dholland
All have been set to "nodiscard"; some should get a real implementation.
2014-03-16Change (mostly mechanically) every cdevsw/bdevsw I can find to usedholland
designated initializers. I have not built every extant kernel so I have probably broken at least one build; however I've also found and fixed some wrong cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-01-25More alignment spellosskrll
2013-10-17- remove unused variableschristos
- move variables inside ifdef sections - ifdef notdef unused code - use __USE for debugging variables
2013-06-28Fix the non-thunderbolt case. XXX: Is that right even?christos
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html
2012-11-09MFI_STATE_BOOT_MESSAGE_PENDING also needs to be handed for non-TBOLTbouyer
controllers, from FreeBSD. tested by Hugo Silva against a GEN2 controller.
2012-09-19Add a pass-through ioctl for mfi(4), allowing userland to send raw commandsbouyer
to the controller. This is compatible with the linux and FreeBSD implementations. Add the needed conversion for mfi ioctls in COMPAT_LINUX Allocate a character major number, and create /dev/mfi0 by default on amd64 and i386. This allows (along with a hand-created /emul/linux/proc/devices file) to run the MegaCLI linux binary provided by LSI.
2012-08-26Make MFI_DEBUG build on i386.bouyer
Report BBU state changes with aprint_normal(), it seems that sysmon_envsys() doens't report changes for ENVSYS_INDICATOR as it does for ENVSYS_DRIVE.
2012-08-26After discussion on tech-kern@, fix performance issue related tobouyer
cache flush commands from WAPBL, by skipping the cache flush if the BBU is present and considered good. Users which still want the write back cache with a non-working BBU can set vfs.wapbl.flush_disk_cache to 0. - add commands to monitor the BBU state. Add a boolean BBU sensor to monitor the BBU state via sysmon_envsys(9). - if the BBU is considered good, turn SCSI_SYNCHRONIZE_CACHE_10 and SCSI_SYNCHRONIZE_CACHE_16 commands from upper layer into NOOPs. While there, handle SCSI_SYNCHRONIZE_CACHE_16 in addition to SCSI_SYNCHRONIZE_CACHE_10. - Add a shutdown pmf(9) handler, which flushes the cache and shutdown the firmware - on detach, also flush cache and shutdown firmware. - on attach, print the firmware-provided name, and the BBU state Tested on a LSI MegaRAID SAS 9265-8i and a PERC 5/i Integrated
2012-08-23Avoid "unused variable" warning for non-DIAGNOSTIC kernels.bouyer
Pointed out by Havard Eidnes
2012-08-23Add support newer LSI RAID controllers based on the SAS2208 chip,bouyer
codenamed "ThunderBolt". Add tagged queuing support for all adapters supported by mfi(4). Tested with a MegaRAID SAS 9265-8i adapter, and an older Dell PERC 5/i.
2012-08-05Really init sc_ioptype in mfi_attach()bouyer
2012-08-05sg64.len is 32bits, so use htole32()bouyer
2012-08-05MFI_IOP_SKINNY is an enum not a single bit value, so it can't be used asbouyer
a bit flag. As sc_flags is really used to hold an enum mfi_iop value, change it to enum mfi_iop and rename to sc_ioptype. While there init it in mfi_attach() instead of mfi_pci_attach().
2012-08-05Add some support for 64bit DMA but stick to 32bit DMA for now.bouyer
From OpenBSD mfi.c rev 1.119.
2012-03-21Add support for skinny variants (e.g. IBM ServeRAID M1015). Based on OpenBSDsborrill
changes with some improvements. Tested on IBM x3550M3 with RAID0 and RAID1 volumes including bioctl(8) operation.
2012-03-21From OpenBSD. Fixes a deadlock during autoconf.sborrill
scrub more fields in the ccb when returning them to the free list after theyve been used, in particular the mfi header flags which has a bit that specifies if a command should be completed via the interrupt path. if we use a ccb during boot we set that bit, but it isnt necessarily cleared by things that use it later on. this means a ccb we expected to complete via an interrupt never actually generates an interrupt or appears in the reply queue. this obviously stalls the io.
2011-06-20Initialize current value for ENVSYS_DRIVE sensorspgoyette
2011-06-20Initializes sensors states before registering.pgoyette
2010-03-14Remove setting of edata->monitor since that member no longer exists.pgoyette
2010-02-09Add newer cars supports. Tested on MegaRAID SAS 9260-8i.msaitoh
- Add MFI gen2 support from OpenBSD. - Add entry for MegaRAID SAS 9260-8i
2010-02-08 Fix a bug that the system which has no logical volume panics in shutdownmsaitoh
hook. Without any logical volume, sysmon_envsys_register() fails. On such case, sc->sc_sme must be NULL for the detach. Reviewed by dyoung and bouyer.
2010-01-19bio(4) is MP-safe but mfi(4) is not. So get the kernel_lock atbouyer
mfi_ioctl() entry and release it on exit.
2009-09-13Delete whitespace at ends of lines. No functional change intended.dyoung