Alan Somers [Mon, 12 Aug 2019 20:31:12 +0000 (20:31 +0000)]
MFC r349248, r349391, r350088
r349248:
fcntl: fix overflow when setting F_READAHEAD
VOP_READ and VOP_WRITE take the seqcount in blocks in a 16-bit field.
However, fcntl allows you to set the seqcount in bytes to any nonnegative
31-bit value. The result can be a 16-bit overflow, which will be
sign-extended in functions like ffs_read. Fix this by sanitizing the
argument in kern_fcntl. As a matter of policy, limit to IO_SEQMAX rather
than INT16_MAX.
Also, fifos have overloaded the f_seqcount field for a completely different
purpose ever since r238936. Formalize that by using a union type.
Reviewed by: cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20710
r349391:
fcntl: style changes to r349248
Reported by: bde
MFC-With: 349248
Sponsored by: The FreeBSD Foundation
r350088:
F_READAHEAD: Fix r349248's overflow protection, broken by r349391
I accidentally broke the main point of r349248 when making stylistic changes
in r349391. Restore the original behavior, and also fix an additional
overflow that was possible when uio->uio_resid was nearly SSIZE_MAX.
Reported by: cem
Reviewed by: bde
MFC-With: 349248
Sponsored by: The FreeBSD Foundation
Alan Somers [Mon, 12 Aug 2019 20:21:36 +0000 (20:21 +0000)]
MFC r349231, r349233, r349280, r349478
r349231:
Add FIOBMAP2 ioctl
This ioctl exposes VOP_BMAP information to userland. It can be used by
programs like fragmentation analyzers and optimized cp implementations. But
I'm using it to test fusefs's VOP_BMAP implementation. The "2" in the name
distinguishes it from the similar but incompatible FIBMAP ioctls in NetBSD
and Linux. FIOBMAP2 differs from FIBMAP in that it uses a 64-bit block
number instead of 32-bit, and it also returns runp and runb.
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20705
r349233:
#include <sys/types.h> from sys/filio.h
This fixes world build after r349231
Reported by: Jenkins
MFC-With: 349231
Sponsored by: The FreeBSD Foundation
r349280:
Reduce namespace pollution from r349233
Define __daddr_t in _types.h and use it in filio.h
Reported by: ian, bde
Reviewed by: ian, imp, cem
MFC-With: 349233
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20715
r349478:
FIOBMAP2: inline vn_ioc_bmap2
Reported by: kib
Reviewed by: kib
MFC-With: 349238
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20783
Alexander Motin [Mon, 12 Aug 2019 19:44:57 +0000 (19:44 +0000)]
MFC r350652 (by imp): Fix mismerge.
I merged passthru.c from the wrong branch (it was a branch that went further in
a direction I wound up not taking). Fix the mismerge and turn passthru on.
Alexander Motin [Mon, 12 Aug 2019 19:43:25 +0000 (19:43 +0000)]
MFC r350563: Add `nvmecontrol sanitize` command.
It allows to delete all user data from NVM subsystem in one of 3 methods.
It is a close equivalent of SCSI SANITIZE command of `camcontrol sanitize`,
so I tried to keep arguments as close as possible.
While there, fix supported sanitize methods reporting in `identify`.
Alexander Motin [Mon, 12 Aug 2019 19:39:31 +0000 (19:39 +0000)]
MFC r350523, r350524: Add IOCTL to translate nvdX into nvmeY and NSID.
While very useful by itself, it also makes `nvmecontrol` not depend on
hardcoded device names parsing, that in its turn makes simple to take
nvdX (and potentially any other) device names as arguments.
Also added IOCTL bypass from nvdX to respective nvmeYnsZ makes them
interchangeable for management purposes.
This adds several previously missed but important subcommands to list
namespaces and controllers. It also fixes few previously added but
just found with real testing to be broken subcommands.
Also while there, add possibility to explicitly specify nsid for
`nvmecontrol identify` subcommand. It may be useful to specify nsids
not having own devices, for example 0xffffffff, or just newly created
ones.
Alexander Motin [Mon, 12 Aug 2019 18:57:46 +0000 (18:57 +0000)]
MFC r350333 (by imp): Widen the type for to.
The timeout field in the CAPS register is defined to be 8 bits, so its type was
uint8_t. We recently started adding 1 to it to cope with rogue devices that
listed 0 timeout time (which is impossible). However, in so doing, other devices
that list 0xff (for a 2 minute timeout) were broken when adding 1
overflowed. Widen the type to be uint32_t like its source register to avoid the
issue.
Alexander Motin [Mon, 12 Aug 2019 18:56:46 +0000 (18:56 +0000)]
MFC r350311 (by imp):
Fix the fix to the logic bug. Upon further testing, the bug is that we shadoow
opt.vendor with vendor. We shouldn't. Delete the latter and use the former
everywhere and restore the prior logic which is now correct.
Alexander Motin [Mon, 12 Aug 2019 18:55:36 +0000 (18:55 +0000)]
MFC r350147 (by imp): Keep track of the number of commands that exhaust their retry limit.
While we print failure messages on the console, sometimes logs are lost or
overwhelmed. Keeping a count of how many times we've failed retriable commands
helps get a magnitude of the problem.
Alexander Motin [Mon, 12 Aug 2019 18:54:58 +0000 (18:54 +0000)]
MFC r350146 (by imp): Keep track of the number of retried commands.
Retried commands can indicate a performance degredation of an nvme drive. Keep
track of the number of retries and report it out via sysctl, just like number of
commands an interrupts.
Alexander Motin [Mon, 12 Aug 2019 18:53:53 +0000 (18:53 +0000)]
MFC r350118 (by imp): Provide new tunable hw.nvme.verbose_cmd_dump
The nvme drive dumps only the most relevant details about a command when it
fails. However, there are times this is not sufficient (such as debugging weird
issues for a new drive with a vendor). Setting hw.nvme.verbose_cmd_dump=1
in loader.conf will enable more complete debugging information about each
command that fails.
Alexander Motin [Mon, 12 Aug 2019 18:53:01 +0000 (18:53 +0000)]
MFC r350114 (by imp):
Provide macros to extract the sub-fields of the CAP_LO and CAP_HI registers.
These macros make places where we extract these easier to read. The shift and
mask stuff is also a bit tedious and error prone. Start with the CAP_LO and
CAP_HI registers since their scope is somewhat constrained. This is style
chagne only, no functional changes.
Alexander Motin [Mon, 12 Aug 2019 18:51:35 +0000 (18:51 +0000)]
MFC r350068 (by imp): Assume that the timeout value from the capacity is 1-based
Neither the 1.3 or 1.4 standards say this number is 1's based, but adding 1
costs little and copes with those NVMe drives that report '0' in this field
cheaply. This is consistent with what the Linux driver does as well.
These are mostly compatible with Linux, with three exceptions.
1. We don't do metadata segment stuff. Our passthrough interface
doesn't cope. The code is there, but generates an error.
2. Linux lets you specify a namespace ID for the command. We current
do not: we get ours from the namespace device, or pass in a generic
one. Generally, this will lead to the same command, but FreeBSD's
is safer since you can't specify the wrong id.
3. --show-command outputs to stderr instead of stdout so you can both
see your command, and capture its output with a simple redirect.
Create a set of routines and structures to hold the data for the args
for a command. Use them to generate help and to parse args. Convert
all the current commands over to the new format. "comnd" is a hat-tip
to the TOPS-20 %COMND JSYS that (very) loosely inspired much of the
subsequent command line notions in the industry, but this is far
simpler (the %COMND man page is longer than this code) and not in the
kernel... Also, it implements today's de-facto
command [verb]+ [opts]* [args]*
format rather than the old, archaic TOPS-20 command format :)
This is a snapshot of a work in progress to get the nvme passthru
stuff committed. In time it will become a private library and used
by some other programs in the tree that conform to the above pattern.
Alexander Motin [Mon, 12 Aug 2019 18:49:32 +0000 (18:49 +0000)]
MFC r348495 (by imp):
Since a fatal trap can happen at aribtrary times, don't panic when the
completions are not in a consistent state. Cope with the different
places the normal I/O completion polling thread can be interrupted and
then re-entered during a kernel panic + dump.
Alexander Motin [Mon, 12 Aug 2019 18:47:40 +0000 (18:47 +0000)]
MFC r344955 (by imp):
Don't print all the I/O we abort on a reset, unless we're out of
retries.
When resetting the controller, we abort I/O. Prior to this fix, we
printed a ton of abort messages for I/O that we're going to
retry. This imparts no useful information. Stop printing them unless
our retry count is exhausted. Clarify code for when we don't retry,
and remove useless arg to a routine that's always called with it
as 'true'. All the other debug is still printed (including multiple
reset messages if we have multiple timeouts before the taskqueue
runs the actual reset) so that we know when we reset.
Move from using a linker set to a constructor function that's
called. This simplifies the code and is slightly more obvious. We now
keep a list of page decoders rather than having an array we managed
before. Commands will move to something similar in the future.
Alexander Motin [Mon, 12 Aug 2019 17:54:28 +0000 (17:54 +0000)]
MFC r342358 (by imp): Try the first 256 units with nvmecontrol devlist.
The nvmecontrol code that did the devlist assumed that we had a
tightly-packed allocation of units. Since pci writing exists, this
isn't the case. Loop over the first 256 units, which is a reasonable
number of possible units.
o Dynamically load all the .so files found in /libexec/nvmecontrol and
/usr/local/libexec/nvmecontrol.
o Link nvmecontrol -rdynamic so that its symbols are visible to the
libraries we load.
o Create concatinated linker sets that we dynamically expand.
o Add the linked-in top and logpage linker sets to the mirrors for them
and add those sets to the mirrors when we load a new .so.
o Add some macros to help hide the names of the linker sets.
o Update the man page.
Alexander Motin [Mon, 12 Aug 2019 17:41:57 +0000 (17:41 +0000)]
MFC r341415 (by imp): Delete the undocumented alias 'wds'.
This was a typo for wdc. Eliminate it since it was in error. People
should use either 'wdc' or 'hgst' for the vendor from now on. 'hgst'
works for all versions this functionality is present for.
Alexander Motin [Mon, 12 Aug 2019 17:41:26 +0000 (17:41 +0000)]
MFC r341414 (by imp): Move Intel specific log pages to intel.c
Move the Intel specific log pages (including the one that samsung
implements) to intel.c. Add comment to the samsung vendor that it will
be going away soon.
Alexander Motin [Mon, 12 Aug 2019 17:40:52 +0000 (17:40 +0000)]
MFC r341413 (by imp): Usage cleanup pt 2
Eliminage redundant spaces and nvmecontrol at start of all the usage
strings. Update the usage printing code to add them back when
presenting to the user. Allow multi-line usage messages and print
proper leading spaces for lines starting with a space.
Alexander Motin [Mon, 12 Aug 2019 17:40:22 +0000 (17:40 +0000)]
MFC r341412 (by imp): Usage cleanup pt 1
Provide a usage() function that takes a struct nvme_function pointer
and produces a usage mssage. Eliminate all now-redundant usage
functions. Propigate the new argument through the program as needed.
Use common routine to print usage.
Alexander Motin [Mon, 12 Aug 2019 17:38:08 +0000 (17:38 +0000)]
MFC r341408 (by imp): Make logpage functions a linker set.
Move logpage function def to header. Convert all the logpage_function
elements to elements of the linker set. Leave them all in logpage.c
for the moment.
Alexander Motin [Mon, 12 Aug 2019 17:37:35 +0000 (17:37 +0000)]
MFC r341407 (by imp): Move nvmecontrol to using linker sets for commands
More commands will be added to nvmecontrol. Also, there will be a few
more vendor commands (some of which may need to remain private to
companies writing them). The first step on that journey is to move to
using linker sets to dispatch commands. The next step will be using
dlopen to bring in the .so's that have the command that might need
to remain private for seamless integration.
Similar changes to this will be needed for vendor specific log pages.
Ed Maste [Mon, 12 Aug 2019 17:25:32 +0000 (17:25 +0000)]
nandfs: avoid integer overflow in nandfs_get_dat_bdescs_ioctl
nandfs was removed in head in r349352 and in any case was not built by
default, but address the potential integer overflow in case someone does
enable it and manages to avoid a panic from other nandfs issues.
admbugs: 815
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: imp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21232
r349807:
Eliminate spurious periodic.daily error message for rotating accounting log.
In 2011, r218961 removed local code for rotating logs in favor of using the
rotate_log command in etc/rc.d/accounting. If the accounting service is
activated then subsequently de-activated in rc.conf but still remains active
in periodic.conf, then you get an error message every day in the periodic
jobs about being unable to rotate the logs.
With this change to use "onerotate_log", the log rotation will happen the
first time periodic daily runs after accounting was disabled but periodic
accounting was left enabled. After that happens once, the /var/account/acct
will no longer exist, which results in a different path through the periodic
code and no more error messages will appear (unless daily_show_badconfig is
set, in which case the admin will be told that periodic security processing
is enabled but the accounting file is not present).
This is only a partial fix for the problems reported in PR 202203.
PR: 202203
r349974:
Limit access to system accounting files.
In 2013 the security chapter of the Handbook was updated in r42501 to
suggest limiting access to the system accounting file [*1] by creating the
initial file with a mode of 0600. This was in part based on a discussion in
the forums [*2]. Unfortunately, this advice is overridden by the fact that a
new file is created as part of periodic daily processing, and the file mode
is set by the rc.d/accounting script.
These changes update the accounting script to create the directory with mode
0750 if it doesn't already exist, and to create the daily file with mode
0640. This limits write access to root only, read access to root and members
of wheel, and eliminates world access completely. For admins who want to
prevent even members of wheel from accessing the files, the mode of the
/var/account directory can be manually changed to 0700, because the script
never creates or changes that directory if it already exists.
The accounting_rotate_log() function now also handles the error cases of no
existing log file to rotate, and attempting to rotate the file multiple
times (.0 file already exists).
Another small change here eliminates the complexity of the mktemp/chmod/mv
sequence for creating a new acct file by using install(1) with the flags
needed to directly create the file with the desired ownership and
modes. That allows coalescing two separate if checkyesno accounting_enable
blocks into one.
These changes were inspired by my investigation of PR 202203.
r349976:
Add an entry mentioning the permission/mode change to daily accounting files.
r350324:
Fix indentation (spaces->tab).
r350361:
Re-wrap the text at 80 columns after fixing the indent in the prior commit.
r350445:
Create the /var/account dir with mode 0750; this is a followup to r349974.
The rc.d/account script contains code to create the /var/account dir, so
it hadn't occurred to me that it is normally created via mtree; thanks to
jilles@ for pointing it out.
Ian Lepore [Sun, 11 Aug 2019 22:46:58 +0000 (22:46 +0000)]
MFC r349891, r349972
r349891:
Reorganize the SRCS lists as one file per line, and then alphabetize them.
No functional changes.
r349972:
Add arm_sync_icache() and arm_drain_writebuf() sysarch syscall wrappers.
NetBSD and OpenBSD have libc wrapper functions for the ARM_SYNC_ICACHE and
ARM_DRAIN_WRITEBUF sysarch operations. This change adds compatible functions
to our library. This should make it easier for various upstream sources to
support *BSD operating systems with a single variation of cache maintence
code in tools like interpreters and JIT compilers.
I consider the argument types passed to arm_sync_icache() to be especially
unfortunate, but this is intended to match the other BSDs.
Ian Lepore [Sun, 11 Aug 2019 22:31:38 +0000 (22:31 +0000)]
MFC r350104, r350106, r350185, r350203
r350104:
Handle the PCF2127 RTC chip the same as PCF2129 when init'ing the chip.
This affects the detection of 24-hour vs AM/PM mode... the ampm bit is in a
different location on 2127 and 2129 chips compared to other nxp rtc chips.
I noticed the 2127 case wasn't being handled correctly when I accidentally
misconfiged my system by claiming my PCF2129 was a 2127.
r350106:
Fix a paste-o, set is212x = false for other chip types. Doh!
r350185:
Rewrite the nxprtc chip init to extend battery life by using power-saving
features offered by the chips.
For 2127 and 2129 chips, fix the detection of when chip-init is needed. The
chip config needs to be reset whenever power was lost, but the logic was
wrong for 212x chips (it only worked for 8523). Now the "oscillator
stopped" bit rather than the power manager mode is used to detect startup
after powerfail.
For all chips, disable the clock output pin.
For chips that have a timestamp/tamper-monitor feature, turn off monitoring
of the timestamp trigger pin.
The 8523, 2127, and 2129 chips have a "power manager" feature that offers
several options. We've been using the default mode which enables
everything. Now the code sets the power manager options to
- direct-switch (when Vdd < Vbat, without extra threshold check)
- no battery monitor
- no external powerfail monitor
This reduces the current draw while running on battery from 1930nA to 880nA,
which should roughly double the lifespan of the battery under load.
Because battery checking is a nice thing to have, the code now does a check
at startup, and then once a day after that, instead of checking continuously
(but only actually reporting at startup). The battery check is now done by
setting the power manager back to default mode, sleeping briefly while it
makes a voltage measurement, then switching back to power-saving mode.
r350203:
Add support for setting the aging/frequency-offset register via sysctl.
The 2127 and 2129 chips support a frequency tuning value in the range of
-7 through +8 PPM; add a sysctl handler to read and set the value.
Ian Lepore [Sun, 11 Aug 2019 22:19:54 +0000 (22:19 +0000)]
MFC r350015-r350016
r350015:
Fix nxprtc(4) on systems that support i2c repeat-start correctly.
An obscure footnote in the datasheets for the PCx2127, PCx2129, and
PCF8523 rtc chips states that the chips do not support i2c repeat-start
operations. When the driver was originally written and tested, the i2c
bus on that system also didn't support repeat-start and just quietly
turned repeat-start operations into a stop-then-start, making it appear
that the nxprtc driver was working properly.
The repeat-start situation only comes up on reads, so instead of using
the standard iicdev_readfrom(), use a local nxprtc_readfrom(), which is
just a cut-and-pasted copy of iicdev_readfrom(), modified to send two
separate start-data-stop sequences instead of using repeat-start.
r350016:
In nxprtc(4), use the countdown timer for better timekeeping resolution
on PCx2129 chips too.
The datasheet for the PCx2129 chips says that there is only a watchdog
timer, no countdown timer. It turns out the countdown timer hardware is
there and works just the same as it does on a PCx2127 chip, except that you
can't use it to trigger an interrupt or toggle an output pin. We don't need
interrupts or output pins, we only need to read the timer register to get
sub-second resolution. So start treating the 2129 chips the same as 2127.
Ian Lepore [Sun, 11 Aug 2019 22:11:59 +0000 (22:11 +0000)]
MFC r349887:
De-pollute arm's sysarch.h.
Instead of including stdint.h for uintptr_t, include sys/_types.h and use
__types for everything that isn't a native C keyword type.
Remove the #include of cdefs.h. It appears after the include of armreg.h
which has a precondition of cdefs.h being included before it, so everyone
including sysarch.h is already including cdefs.h. (When armv5 support
goes away, there will be no need include armreg.h here either.)
Unfortunately, the unprefixed struct member names "addr" and "len" cannot
be changed, because 3rd-party software is relying on them (libcompiler_rt
is one known consumer).
Ian Lepore [Sun, 11 Aug 2019 21:24:44 +0000 (21:24 +0000)]
MFC r349116:
In detach(), call bus_generic_detach() before deleting the iicbus child.
This gives the bus and its children the chance to return EBUSY to abort
the detach if they're in the middle of doing some IO.
Ian Lepore [Sun, 11 Aug 2019 21:21:32 +0000 (21:21 +0000)]
MFC r349839, r349850
r349839:
Call device_unbusy() on the error exit path, because if iicbus_request_bus()
returns an error, iicbus_release_bus() is not going to be called.
r349850:
Restore the ability for i2c slave devices to do IO from their probe method.
r348164 added code to iicbus_request_bus/iicbus_release_bus to automatically
call device_busy()/device_unbusy() as part of aquiring exclusive use of the
bus (so modules can't be unloaded while the bus is exclusively owned and/or
IO is in progress). That broke the ability to do i2c IO from a slave device
probe method, because the slave isn't attached yet, so calling device_busy()
triggers a sanity-check panic for trying to busy a non-attached device.
Now we check whether the device status is < DS_ATTACHING, and if so we busy
the iicbus rather than the slave device. I think this leaves a small window
where a module could be unloaded while probing is in progress. But I think
that's true of all devices, and probably should be fixed by introducing a
DS_PROBING state for devices, and handling that at various points in the
newbus code.
Ian Lepore [Sun, 11 Aug 2019 21:12:29 +0000 (21:12 +0000)]
MFC r349072, r349316-r349318
r349072:
Remove pcf8563reg.h, the driver it was associated with was replaced in 2017
with the nxprtc multi-chip driver.
r349316:
Remove some unused header files from the ad7418 driver.
r349317:
Add the rtc8583 driver to conf/files. Also, move sy8106a from
file.allwinner to conf/files... it's not allwinner-specific, some day
other platforms could use the same regulator chip.
r349318:
The sy8106a and syr827 drviers require FDT and the ext_resources subsystem.
Ian Lepore [Sun, 11 Aug 2019 20:50:41 +0000 (20:50 +0000)]
MFC r349325, r349327
r349325:
Allow compiling ukbdmap.h on arm, since it appears to work fine.
r349327:
Build an armv7 LINT kernel in addition to armv5 LINT. You might think this
had been done years ago. I did. All this time we've only compiled a LINT
kernel for TARGET_ARCH=arm. Now separate LINT-V5 and LINT-V7 configs are
generated and built.
There are two new files in arm/conf, NOTES.armv5 and NOTES.armv7, containing
some of what used to be in the arm NOTES file. That file now contains only
the bits that are common to v5 and v7.
The makeLINT.mk file now creates the LINT-V5 and LINT-V7 files by concatening
sys/conf/NOTES, arm/conf/NOTES, and arm/conf/NOTES.armv{5,7} in that order.
r350229:
arm: ti: Get the hwmods property from the parent node
Since the Linux 5.0 dts the ti,hwmods property is on the parent
ti.sysc node.
r350230:
arm: ti: Add a driver for ti,sysc bus
ti,sysc is a simple-bus like driver.
Add a driver for it so child nodes can attach.
r350408:
arm: ti: Get the hwmods property either from the node or the parent
r350229 changed the code to lookup the ti,hwmods property in the parent
as it's now like that in the DTS from >= Linux 5.0, allow the property
to be also in the node itself so we can boot with an older DTB.
Reported by: "Dr. Rolf Jansen" <rj@obsigna.com>
r350410:
arm: ti: cpsw: Check the new slave node address
Since DTS from >= Linux 5.0 the slave address are relative to the parent
node address and aren't the full ones.
Check both so the cpsw driver can find the phy id.
r350673:
arm: dts: am33xx: Fix the region for uart0
The region for uart0 is declared to be 0x2000 in size but the parent
node only declare 0x1000.
As the parent only declare a size of 0x1000 in the ranges for it's children
this cause the device to not be mappable.
r350674:
ofw: ofw_reg_to_paddr: Use a 256 static array for the cell
Some hardware needs more than 32, bump this value.
We cannot use the _alloc for of getencprop as this function is called
too early in the boot before pmap is initialized and we only have
2k of stack when cninit is called.
MFC r350815:
In m_pulldown(), before trying to prepend bytes to the subsequent mbuf,
ensure that the subsequent mbuf contains the remainder of the bytes
the caller sought. If this is not the case, fall through to the code
which gathers the bytes in a new mbuf.
This fixes a bug where m_pulldown() could fail to gather all the desired
bytes into consecutive memory.
Michal Meloun [Fri, 9 Aug 2019 12:15:23 +0000 (12:15 +0000)]
MFC r345299:
PSCI: Don't take missing implementation of psci get_version() as fatal.
Minimalistic PSCI implementation in U-Boot doesn't implement get_version()
method for some SoC. In this case, use PSCI version declared by 'psci' node
in DT as fallback.
Michal Meloun [Fri, 9 Aug 2019 11:21:42 +0000 (11:21 +0000)]
MFC r345297:
Improve cpufreq_dt.
- older DT can use 'cpu0-supply' property for power supply binding. - don't
expect that actual CPU frequency is contained in CPU
operational point table, but read current CPU voltage directly from
reguator. Typically, u-boot can set starting CPU frequency to any value.
Michal Meloun [Fri, 9 Aug 2019 11:20:05 +0000 (11:20 +0000)]
MFC r345296:
Use named field's initializer when constructing <foo>_platform structure. In
current code, the delay argument in FDT_PLATFORM_DEF(2) improperly initialize
refs field from kobj_class structure instead of delay_count field. This
causes not working DELAY() function (due to never initialized delay_count) in
earlier boot stages, until the first timer was attached.
Michal Meloun [Fri, 9 Aug 2019 10:28:20 +0000 (10:28 +0000)]
MFC r343962,r343965:
r343962:
Properly handle alignment requests bigger that page size.
- for now, alignments bigger that page size is allowed only for buffers
allocated by bus_dmamem_alloc(), cover this fact by KASSERT.
- never bounce buffers allocated by bus_dmamem_alloc(), these always
comply
with the required rules (alignment, boundary, address range).
r343965:
Fix bug introduced by r343962. DMAMAP_DMAMEM_ALLOC is property of dmamap,
not dmatag.
Michal Meloun [Fri, 9 Aug 2019 10:00:11 +0000 (10:00 +0000)]
MFC r343828:
Adapt FreeBSD specific DT stub for Jetson TK1 board to be consistent with
update of devicetree to 4.19 in r340337. Our build system doesn't provide
dependencies for included DTS files, so nobody noticed this issue for long
time.
Alexander Motin [Fri, 9 Aug 2019 00:49:31 +0000 (00:49 +0000)]
MFC r350378: Allow WRITE SAME handle more then 2^^32 blocks.
If not limited by write_same_max_lba option, split operation into several
2^^31 blocks chunks in a loop. For large disks it may take a while, so
setting write_same_max_lba may be useful to avoid timeouts.
Alexander Motin [Fri, 9 Aug 2019 00:47:27 +0000 (00:47 +0000)]
MFC r350343: Add reporting of SCSI Feature Sets VPD page from SPC-5.
CTL implements all defined feature sets except Drive Maintenance 2016,
which is not very applicable to such a virtual device, and implemented
only partially now. But may be it could be fixed later at least for
completeness.
Alexander Motin [Thu, 8 Aug 2019 03:01:35 +0000 (03:01 +0000)]
MFC r348376 (by rpokala):
Add bits related to SANITIZE, SED, and form-factor to (struct ata_params)
Based on ATA-ACS-4, recognize several bit-fields related to the ATA SANITIZE
feature-set, Self-Encrypting Drives, and form-factor identification.
As part of this change, the name of word 48 of (struct ata_params) is being
changed. The previous name, "usedmovsd" does not appear to be related to the
previous definition of the word ("double-word IO supported"). The word was
defined that way in ATA-1 (1994), but it was marked "Reserved" (meaning
"unused, but might be used in the future") in ATA-2 (1996). It stayed that
way until ATA-8 (2008), which re-defined it as implemented in this change.
The field is not used in-tree.