axp81x: Serialize the register accesses
The registers were accessed with iicbus_transfer(), which does not own
the bus. The interrupt driven transfers of the Allwinner twsi
controller drop their mutex while they sleep waiting for the interrupt,
so two accesses can overlap, and the PMU shares its bus with other
devices, an RTC for instance. Use iicbus_transfer_excl() so that the
accesses are arbitrated.
The regulators share the enable registers and the regulator framework
only serializes the accesses to a single regulator. Protect the
read-modify-write of these registers with a lock, so that regulators
enabled at the same time cannot lose each other's update.
No failure was seen without this, it is there for correctness.
Tested on: A64, H6
axp81x: Add support for the AXP805 and AXP806
The AXP805 and AXP806 are regulator only PMUs, with different registers
than the AXP803 and AXP813, and without a battery, ADC sensors or GPIO.
Add the regulators (voltage ranges from the datasheet and the Linux
driver) and the interrupts: the power key short press powers the system
off and the die temperature is sent to devd. The battery, sensors,
thresholds, shutdown handler and GPIO bus are not set up for them.
Tested on a Pine H64 (AXP805 on the R_I2C).
axp81x: Do not change the voltage of a regulator in range
axp8xx_regnode_init() set every regulator described in the FDT to its
minimum voltage, even if the firmware had already set a voltage in the
range. For a regulator that is in use, like the one of the CPU, this can
make the system crash. Only set the voltage when the current one is out
of the range.
Tested on: A64, H6
axp81x: Skip the regulators that have no name in the FDT
A regulator that is not used is described in the FDT by a node without
regulator-name, and regulator_parse_ofw_stdparam() fails for it, which
printed two errors at every boot. Skip these nodes, and only tell about
it when booting verbose.
axp81x: Get the voltage of the regulators with a single range
axp8xx_regnode_get_voltage() failed when the regulator has no second
step, which is the case of the ones with a single range. Only the first
step is mandatory, as in axp8xx_regnode_set_voltage().
Tested on: A64, H6
axp81x: Check the errors of the register accesses
axp8xx_regnode_enable() wrote back a value computed from a register it
failed to read, which clears the enable bits of all the other
regulators of that register. Return an error instead, and do the same
in the other regnode methods, which used an uninitialised value when an
access failed.
Also initialise udelay in axp8xx_regnode_init(), as
axp8xx_regnode_set_voltage() can now fail before setting it.
Tested on: A64, H6
axp81x: Fix the register accesses
The register pointer was written without IIC_M_NOSTOP, so the controller
sends a STOP before the read message. On the Allwinner H6 (twsi) this
makes the reads return garbage without any error.
Set IIC_M_NOSTOP on it, and send the register and its value in a single
write message, like the other PMIC drivers do.
Tested on: A64, H6
axp81x: Add a function to get the regulator definition
Move the lookup of the regulator definitions out of axp8xx_attach().
This also fixes an off-by-one: the test was i <= nitems(common), so the
first regulator of the per-chip table (dc1sw or dcdc7) was never
registered and one entry past the end of the common table was read.
Tested on: A64
twsi: Do not clear the interrupt flag when changing the control bits
twsi_control_set() and twsi_control_clear() read the control register,
change some bits and write it back. On the controllers where the
interrupt flag is cleared by writing a 1 to it (iflag_w1c), this clears
it as the flag is read as set.
In the polled mode this breaks the repeated start: START is set with
the flag cleared by the write, the hardware sends the repeated start at
once, and the flag is then cleared a second time, which loses the event
and leaves the controller with the status of the previous transfer.
Transfers with a repeated start fail with IIC_ESTATUS on an Allwinner
H6 until the controller works with interrupts.
Mask the flag out of the value that is written back, unless the caller
asks for it.
Tested on: H6
aw_rsb: Accept a write in a single message
The driver only took a write as two messages, the offset and then the
data. A write on an I2C bus is a single message that starts with the
register, which is how a driver that can be on I2C or on RSB, like
axp81x, does it. Split such a message into the two the controller
needs.
Tested on: A64
axp81x: Move the sensors, sysctls and thresholds out of attach
Add one function for each of them: axp8xx_add_sensors(),
axp8xx_add_sysctls() and axp8xx_get_thresholds().
No functional change. This is a preparation to support PMUs without a
battery, like the AXP805, with this driver.
netipsec: Release the SA inside the vnet context in AH and IPComp callbacks
The error paths of ah_input_cb(), ah_output_cb(), ipcomp_input_cb() and
ipcomp_output_cb() called CURVNET_RESTORE() before key_freesav() and
key_freesp(). When the callback runs on a crypto return thread, no
vnet is set after the restore, and key_freesav() panics with "vnet is
not set" on INVARIANTS kernels. Without INVARIANTS, the last reference
would be released without a vnet.
Restore the vnet last, as the ESP callbacks do.
Reviewed by: mjg
Fixes: 8a9269edd71a ("ipsec: sprinkle CURVNET_ASSERT_SET")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D61386
math/R-cran-matrixcalc: New port: Collection of functions for matrix calculations
A collection of functions to support matrix calculations
for probability, econometric and numerical analysis. There are
additional functions that are comparable to APL functions which
are useful for actuarial models such as pension mathematics.
PR: 296813
Approved by: jrm (mentor)
Differential Revision: https://reviews.freebsd.org/D61240
devel/R-cran-furrr: New port: Apply mapping functions in parallel using futures
Implementations of the family of map() functions from 'purrr'
that can be resolved using any 'future'-supported backend, e.g.
parallel on the local machine or distributed on a compute cluster.
PR: 296815
Approved by: jrm (mentor)
Differential Revision: https://reviews.freebsd.org/D61239
kobj: Make the containers of pointers to base classes constant
The containers (arrays) will not be modified during runtime.
Reviewed by: kib, imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61297
java/openjdk25: set wxneeded on bootstrap jdk
The upstream fix to Bug 296945 set the wxneeded flag for executables;
however, it did not do so for the bootstrap jdk.
This patch fixes that.
PR: 300566
Reported by: mondo.debater_0q at icloud.com
Reviewed by: haraldei
Approved by: haraldei
ixgbe: Attach the MDIO bus after iflib drops the context lock
ixgbe_mdio_attach() ran from ixgbe_if_attach_post(), which iflib calls
with the context lock held. Attaching the MDIO bus there also probes
and attaches the devices on it, and their register accesses go through
ixgbe_mdio_readreg_c22() and ixgbe_mdio_writereg_c22(), which take the
same lock. A driver on the bus that was in the kernel or loaded by
loader(8) therefore recursed on the non-recursive iflib sx lock as soon
as it touched a register: INVARIANTS kernels panic in _sx_xlock_hard(),
others recurse silently.
Wrap iflib_device_attach() and attach the MDIO bus once it has
returned, so the children take the context lock like any later MDIO
access does.
Reviewed by: kbowling
Fixes: cfec995c87f3 ("ixgbe: add MDIO bus support")
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D61199
emulators/open-vm-{kmod,tools}: machine/stdarg.h -> sys/stdarg.h
machine/stdarg.h is deprecated and will be removed in due course.
Use a different method of patching each port to work around
WKRSRC_SUBDIR in emulators/open-vm-kmod.
PR: 300600
Approved by: garga (maintainer)
Sponsored by: DARPA, AFRL
math/blacs: use MPI compiler wrappers
Use the compiler wrappers and installation path provided by mpi.mk.
Use MPI-2 communicator conversion for MPICH and OpenMPI.
Merge their identical build configuration patches.
Approved by: thierry (mentor, implicit)