MFC r251945:
Pass proper memory type to free() in ata_ali_chipinit().


git-svn-id: svn://svn.freebsd.org/base/stable/9@252197 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251743:
Improve firmware download status check.  Previous check was insufficient for
ATA since it ignored transport errors like command timeouts, while for SCSI
it was just wrong.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252199 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251792:
Restore use of polling mode for disk cache flush in case of kernel panic.
While I am not sure that any extra hardware access is a good idea after
panic, that is an existing behaviour that should better work correctly.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r249980:
Give periph validity flag own periph reference.  That slightly simplifies
the release logic and covers hypothetical case if lock is dropped inside
the periph_oninval() method.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252202 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250377:
	Allow the use of lowercase 'yes'

PR:		bin/178422


git-svn-id: svn://svn.freebsd.org/base/stable/9@252210 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: 249658, 249701

Update chio(1) and ch(4) to support reporting element designators.

This allows mapping a tape drive in a changer (as reported by
'chio status') to a sa(4) driver instance by comparing the
serial numbers.

The designators can be ASCII (which is printed out directly), binary
(which is printed in hex format) or UTF-8, which is printed in either
native UTF-8 format if the terminal can support it, or in %XX notation
for non-ASCII characters.  Thanks to Hiroki Sato <hrs@> for the
explanation and example UTF-8 printing code.

chio.h:		Modify the changer_element_status structure to add new
		fields and definitions from the SMC3r16 spec.

		Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
		define a new CHIOGSTATUS ioctl.

		Clean up some tab/space issues.

chio.c: 	For the 'status' subcommand, print the designator field
		if it is supplied by a device.

scsi_ch.h:	Add new flags for DVCID and CURDATA to the READ
		ELEMENT STATUS command structure.

		Add a read_element_status_device_id structure
		for the data fields in the new standard. Add new
		unions, dt_or_obsolete and voltage_devid, to hold
		and address data from either SCSI-2 or newer devices.

scsi_ch.c:	Implement support for fetching device IDs with READ
		ELEMENT STATUS data.

		Add new arguments to scsi_read_element_status() to
		allow the user to request the DVCID and CURDATA bits.
		This isn't compiled into libcam (it's only an internal
		kernel interface), so we don't need any special
		handling for the API change.

		If the user issues the new CHIOGSTATUS ioctl, copy all of
		the available element status data out.  If he issues the
		OCHIOGSTATUS ioctl, we don't copy the new fields in the
		structure.

		Fix a bug in chopen() that would result in the peripheral
		never getting unheld if chgetparams() failed.

Sponsored by:	Spectra Logic
Submitted by:	Po-Li Soong


git-svn-id: svn://svn.freebsd.org/base/stable/9@252214 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251560

Fix a bad calloc(3) call


git-svn-id: svn://svn.freebsd.org/base/stable/9@252216 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r240616, r240619, r240620:

Merge initial NVM Express (NVMe) commits to stable/9.

This only pulls the nvme(4), nvd(4) and nvmecontrol(8) code into stable/9.
A follow-up commit will link it into the build and merge all of the
additional commits made for NVMe over the last few months.

Sponsored by:	Intel


git-svn-id: svn://svn.freebsd.org/base/stable/9@252221 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
240618, 240621, 240633, 240671, 240672, 240697, 240700, 241433,
241434, 241657, 241658, 241659, 241660, 241661, 241662, 241663,
241664, 241665, 241689, 242420, 243951, 244410, 244411, 244413,
244549, 245136, 247963, 248729, 248730, 248731, 248732, 248733,
248734, 248735, 248736, 248737, 248738, 248739, 248740, 248741,
248746, 248747, 248748, 248749, 248754, 248755, 248756, 248757,
248758, 248759, 248760, 248761, 248762, 248763, 248764, 248765,
248766, 248767, 248768, 248769, 248770, 248771, 248772, 248773,
248780, 248834, 248835, 248913, 248977, 249067, 249416, 249417,
249418, 249419, 249420, 249421, 249422, 249432


git-svn-id: svn://svn.freebsd.org/base/stable/9@252222 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Forced commit due to bad commit message in r252222.

MFC:
r240618, r240621, r240633, r240671, r240672, r240697, r240700, r241433,
r241434, r241657, r241658, r241659, r241660, r241661, r241662, r241663,
r241664, r241665, r241689, r242420, r243951, r244410, r244411, r244413,
r244549, r245136, r247963, r248729, r248730, r248731, r248732, r248733,
r248734, r248735, r248736, r248737, r248738, r248739, r248740, r248741,
r248746, r248747, r248748, r248749, r248754, r248755, r248756, r248757,
r248758, r248759, r248760, r248761, r248762, r248763, r248764, r248765,
r248766, r248767, r248768, r248769, r248770, r248771, r248772, r248773,
r248780, r248834, r248835, r248913, r248977, r249067, r249416, r249417,
r249418, r249419, r249420, r249421, r249422, r249432

Merge all NVMe-related changes since the original code was added to HEAD,
including linking it into the build.

Sponsored by:	Intel


git-svn-id: svn://svn.freebsd.org/base/stable/9@252223 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251652, r251811, r252101:

r251652:
  Add new script to run release builds.  The script is heavily based upon
  the release/generate-release.sh script by nwhitehorn.

  This script can use optional configuration file to override defaults,
  making running multiple serialzied builds with different specific
  configurations or architecture-specific tunings quite easy.

  Sample overrideable options are included in the release.conf.sample
  file.

r251811:
  Fix OSVERSION variable within PBUILD_FLAGS.

r252101:
  If MAKE_CONF and/or SRC_CONF are set and not character devices,
  copy to chroot to use with release build.

Approved by:	kib (mentor, implicit)


git-svn-id: svn://svn.freebsd.org/base/stable/9@252224 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Set SRCBRANCH to stable/9 in release.conf.sample.

This is a direct commit to stable/9.

Approved by:	kib (mentor, implicit)


git-svn-id: svn://svn.freebsd.org/base/stable/9@252225 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC	r252103:

Define and use e2fs_lbn_t in ext2fs.

In line to what is done in UFS, define an internal type
e2fs_lbn_t for the logical block numbers.

This change is basically a no-op as the new type is unchanged
(int32_t) but it may be useful as bumping this may be required
for ext4fs.

Also, as pointed out by Bruce Evans:

-Use daddr_t for daddr in ext2_bmaparray(). This seems to
improve reliability with the reallocblks option.
- Add a cast to the fsbtodb() macro as in UFS.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252234 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/svn_stable_9' into svn_stable_9