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.
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.
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
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.
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().
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.
The sysmon subsystem is marked MPSAFE and so runs without the kernel lock.
So get the kernel lock in mfi_sensor_refresh() before calling
mfi_ioctl_vol().
This fixes command list corruption seen on heavy I/O load on the mfi
driver(4).
Detachment may fail after freeing some but not all resources, so
take care not to re-release any resource during detachment.
Tested on a Dell PowerEdge 1950.
mfi_scsi_io does. Do not tsleep in mfi_mgmt waiting for completion;
let the caller handle it. If mfi_mgmt() is called with a non-NULL scsipi_xfer
have mfi_mgmt_done() wake it up, else wake up the mfi_ccb.
mfi_poll()/mfi_post() is up to the caller.
mfi_scsipi_request(): handle SCSI_SYNCHRONIZE_CACHE_10 as we do for other
commmands: have mfi_mgmt() fill in the ccb, queue of poll the ccb and
return.
Introduce mfi_mgmt_internal() which behaves like mfi_mgmt() did (tsleep
waiting for completion). Use it for internal and ioctl management
requests.
Fix kern/39297 from Greg Oster (mfi calls tsleep() from mfi_intr()),
tested by Mark Davies.
mfi_despatch_cmd() func after merging changes in rev 1.12.
Merge rev 1.69 and 1.64 from openbsd, fixing two bugs:
Fix subtle x ? y : z bug when calling mfi_create_sgl. This worked because
during runtime the bug condition does not happen.
When determining the size of the volumes and disks we want how many
bytes each of them has, not the number of kilobytes. this solves the
"why am i dividing by 2" question. the answer is "you dont, you multiply
by 512".
The first item fixes a panic with Dell Perc 5/i reported by oster@.
Changes tested on Dell Perc 5/i by oster@.
- Change malloc + memset(blah, 0, ...) to malloc with M_ZERO.
- The adapt_ioctl assigned was returning ENOTTY, so there's no point
on having it.
- Static'ify.
I believe there are some paths on this driver where the splbio()s
are not needed, but can't test to verify...
http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html
sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).
sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.
The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).
Update all users and documentation to reflect these changes.
- There's no need to set edata->units again, it was set already before.
- Remove the last ENVSYS_SVALID assignment that overrides previous
assignments (found by mhitch@).
(Part 2: drivers)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.