Commit Graph

8 Commits

Author SHA1 Message Date
Warner Losh
dc935c4f19 Use aligned buffer for the firmware data. Otherwise, when loading a
MAXPHYS bytes of data, the I/O would require MAXPHYS + PAGE_SIZE worth
of pages to do the I/O and we'd hit an assertion in
vm_fault_quick_hold_pages unless MAXPHYS was larger than 1M +
PAGE_SIZE.
2017-02-02 23:04:00 +00:00
Jim Harris
4a14f9dadc Check for special status code from FIRMWARE_ACTIVATE command
signifying that a reboot is required to complete activation
of the requested firmware image.

Reported by:	Joe Golio <joseph.golio@emc.com>
Sponsored by:	Intel
MFC after:	3 days
2013-11-12 21:14:19 +00:00
Jim Harris
181c4ec270 Do not throw an error if the user requests to activate the image from
an empty firmware slot, as long as the user has specified a firmware
image to download into the empty firmware slot.

Sponsored by:	Intel
Reported by:	Joe Golio <joseph.golio@emc.com>
MFC after:	3 days
2013-07-16 15:45:37 +00:00
Jim Harris
008ac71e0a %d should be used for printing int32_t instead of %zd.
clang does not complain about this - only gcc.

MFC after:	3 days
2013-07-12 18:13:41 +00:00
Jim Harris
fdfa4d2d35 Try to read firmware image before prompting the user to confirm
firmware download.  This correctly prints an error and exits for
an incorrect firmware image name before prompting the user to
confirm the download.

Sponsored by:	Intel
MFC after:	3 days
2013-07-09 21:20:08 +00:00
Jim Harris
821ef73ca6 Incorporate feedback from bde@ based on r252672 changes:
* Use 0/1 instead of sysexits.  Man pages are confusing on this topic,
  but 0/1 is sufficient for nvmecontrol.
* Use err function family where possible instead of fprintf/exit.
* Fix some typing errors.
* Clean up some error message inconsistencies.

Sponsored by:	Intel
Submitted by:	bde (parts of firmware.c changes)
MFC after:	3 days
2013-07-09 21:14:15 +00:00
Jim Harris
960116ec24 Fix printf argument mismatch reported by gcc on i386.
Reported by: kargl
2013-07-04 00:26:24 +00:00
Jim Harris
49fac6101d Add firmware replacement and activation support to nvmecontrol(8) through
a new firmware command.

NVMe controllers may support up to 7 firmware slots for storing of
different firmware revisions.  This new firmware command supports
firmware replacement (i.e. firmware download) with or without immediate
activation, or activation of a previously stored firmware image.  It
also supports selection of the firmware slot during replacement
operations, using IDENTIFY information from the controller to
check that the specified slot is valid.

Newly activated firmware does not take effect until the new controller
reset, either via a reboot or separate 'nvmecontrol reset' command to the
same controller.

Submitted by:	Joe Golio <joseph.golio@emc.com>
Obtained from:	EMC / Isilon Storage Division
MFC after:	3 days
2013-06-27 00:08:25 +00:00