Uwe Kleine-König [Wed, 14 Feb 2024 09:31:37 +0000 (10:31 +0100)]
pwm: imx-tpm: Make use of devm_pwmchip_alloc() function
This prepares the pwm-tmp driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:36 +0000 (10:31 +0100)]
pwm: imx27: Make use of devm_pwmchip_alloc() function
This prepares the pwm-imx27 driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Also convert the to_pwm_imx27_chip() helper macro to a static inline to
get some type safety.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:35 +0000 (10:31 +0100)]
pwm: imx27: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:34 +0000 (10:31 +0100)]
pwm: imx1: Make use of devm_pwmchip_alloc() function
This prepares the pwm-imx1 driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Also convert the to_pwm_imx1_chip() helper macro to a static inline to
get some type safety.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:33 +0000 (10:31 +0100)]
pwm: img: Make use of devm_pwmchip_alloc() function
This prepares the pwm-img driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:32 +0000 (10:31 +0100)]
pwm: img: Prepare removing pwm_chip from driver data
This prepares the driver for further changes that will drop struct
pwm_chip chip from struct img_pwm_chip. Use the pwm_chip as driver data
instead of the img_pwm_chip to get access to the pwm_chip in
img_pwm_remove() and the PM callbacks without using imgchip->chip.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:31 +0000 (10:31 +0100)]
pwm: img: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:29 +0000 (10:31 +0100)]
pwm: hibvt: Make use of devm_pwmchip_alloc() function
This prepares the pwm-hibvt driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Most functions use "hi_pwm_chip" as name. Make use of this in the
remaining two functions (that used "pwm_chip" before, which isn't
optimal as this is a type name, too).
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:27 +0000 (10:31 +0100)]
pwm: fsl-ftm: Make use of devm_pwmchip_alloc() function
This prepares the pwm-fsl-ftm driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:26 +0000 (10:31 +0100)]
pwm: fsl-ftm: Prepare removing pwm_chip from driver data
This prepares the driver for further changes that will drop struct
pwm_chip chip from struct fsl_pwm_chip. Use the pwm_chip as driver data
instead of the fsl_pwm_chip to get access to the pwm_chip in
fsl_pwm_suspend() and fsl_pwm_resume() without using fpc->chip.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:25 +0000 (10:31 +0100)]
pwm: fsl-ftm: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:24 +0000 (10:31 +0100)]
pwm: fsl-ftm: Change prototype of a helper to prepare further changes
This prepares the driver for further changes that will make it harder to
determine the pwm_chip from a given fsl_pwm_chip. To just not have to
do that, rework fsl_pwm_apply_config() to take a pwm_chip.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:23 +0000 (10:31 +0100)]
pwm: ep93xx: Make use of devm_pwmchip_alloc() function
This prepares the pwm-ep93xx driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:22 +0000 (10:31 +0100)]
pwm: ep93xx: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:21 +0000 (10:31 +0100)]
pwm: dwc-core: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:20 +0000 (10:31 +0100)]
pwm: dwc: Make use of devm_pwmchip_alloc() function
This prepares the pwm-dwc driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Also convert the to_dwc_pwm() helper macro to a static inline to get
some type safety.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:19 +0000 (10:31 +0100)]
pwm: dwc: Prepare removing pwm_chip from driver data
This prepares the driver for further changes that will drop struct
pwm_chip chip from struct dwc_pwm. Use the pwm_chip as driver
data and return value of dwc_pwm_alloc() instead of the dwc_pwm to get
access to the pwm_chip in dwc_pwm_probe() and dwc_pwm_suspend() without
using dwc->chip.
Thanks to Raag Jadav for providing a hunk of this patch that Uwe missed
during creation of this patch.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:18 +0000 (10:31 +0100)]
pwm: cros-ec: Make use of devm_pwmchip_alloc() function
This prepares the pwm-cros-ec driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
The probe function had to be changed a bit because the number of PWMs
must be determined before allocation of the pwm_chip and its private
data now.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:17 +0000 (10:31 +0100)]
pwm: cros-ec: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:16 +0000 (10:31 +0100)]
pwm: cros-ec: Change prototype of helpers to prepare further changes
pwm_chip allocation and registration is about to change. For that the
number of PWM devices must be known earlier in cros_ec_pwm_probe(). So
make cros_ec_pwm_get_duty() and cros_ec_num_pwms() independent of
struct cros_ec_pwm_device which is only available later.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:15 +0000 (10:31 +0100)]
pwm: crc: Make use of devm_pwmchip_alloc() function
This prepares the pwm-crc driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:14 +0000 (10:31 +0100)]
pwm: crc: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:13 +0000 (10:31 +0100)]
pwm: crc: Simplify code to determine the pwmchip's parent device
There is already a pointer to the pwmchip, make use of it directly
instead of using the struct crystalcove_pwm *crc_pwm just obtained from
it. This also has the advantage of not using struct
crystalcove_pwm::chip any more which will be dropped soon.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:12 +0000 (10:31 +0100)]
pwm: clps711x: Make use of devm_pwmchip_alloc() function
This prepares the pwm-clps711x driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:11 +0000 (10:31 +0100)]
pwm: clk: Make use of devm_pwmchip_alloc() function
This prepares the pwm-clk driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Also convert the to_pwm_clk_chip() helper macro to a static inline to
get some type safety.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:10 +0000 (10:31 +0100)]
pwm: clk: Prepare removing pwm_chip from driver data
This prepares the driver for further changes that will drop struct
pwm_chip chip from struct pwm_clk_chip. Use the pwm_chip as driver data
instead of the pwm_clk_chip to get access to the pwm_chip in
pwm_clk_remove() without using pcchip->chip.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:09 +0000 (10:31 +0100)]
pwm: brcmstb: Make use of devm_pwmchip_alloc() function
This prepares the pwm-brcmstb driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:08 +0000 (10:31 +0100)]
pwm: berlin: Make use of devm_pwmchip_alloc() function
This prepares the pwm-berlin driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:07 +0000 (10:31 +0100)]
pwm: berlin: Prepare removing pwm_chip from driver data
This prepares the driver for further changes that will drop struct
pwm_chip chip from struct berlin_pwm_chip. Use the pwm_chip as driver
data instead of the berlin_pwm_chip to get access to the pwm_chip in
berlin_pwm_suspend() and berlin_pwm_resume() without using bpc->chip.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:06 +0000 (10:31 +0100)]
pwm: bcm-kona: Make use of devm_pwmchip_alloc() function
This prepares the pwm-bcm-kona driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:05 +0000 (10:31 +0100)]
pwm: bcm-kona: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:04 +0000 (10:31 +0100)]
pwm: bcm-iproc: Make use of devm_pwmchip_alloc() function
This prepares the pwm-bcm-iproc driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:03 +0000 (10:31 +0100)]
pwm: bcm2835: Make use of devm_pwmchip_alloc() function
This prepares the pwm-bcm2835 driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:02 +0000 (10:31 +0100)]
pwm: atmel-tcb: Make use of devm_pwmchip_alloc() function
This prepares the pwm-atmel-tcb driver to further changes of the pwm
core outlined in the commit introducing devm_pwmchip_alloc(). There is
no intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:01 +0000 (10:31 +0100)]
pwm: atmel-tcb: Prepare removing pwm_chip from driver data
This prepares the driver for further changes that will drop struct
pwm_chip chip from struct atmel_tcb_pwm_chip. Use the pwm_chip as driver
data instead of the atmel_tcb_pwm_chip to get access to the pwm_chip in
the .suspend() and .resume() callbacks and atmel_tcb_pwm_remove()
without using tcbpwm->chip.
Uwe Kleine-König [Wed, 14 Feb 2024 09:31:00 +0000 (10:31 +0100)]
pwm: atmel-tcb: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:59 +0000 (10:30 +0100)]
pwm: atmel-hlcdc: Make use of devm_pwmchip_alloc() function
This prepares the pwm-atmel-hlcdc driver to further changes of the pwm
core outlined in the commit introducing devm_pwmchip_alloc(). There is
no intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:58 +0000 (10:30 +0100)]
pwm: atmel-hlcdc: Prepare removing pwm_chip from driver data
This prepares the driver for further changes that will drop struct
pwm_chip chip from struct atmel_hlcdc_pwm. Use the pwm_chip as driver
data instead of the atmel_hlcdc_pwm to get access to the pwm_chip in
the .suspend() and .resume() callbacks and atmel_hlcdc_pwm_remove()
without using atmel->chip.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:57 +0000 (10:30 +0100)]
pwm: atmel: Make use of devm_pwmchip_alloc() function
This prepares the pwm-atmel driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:56 +0000 (10:30 +0100)]
pwm: atmel: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:55 +0000 (10:30 +0100)]
pwm: atmel: Change prototype of a helper to prepare further changes
This prepares the driver for further changes that will make it harder to
determine the pwm_chip from a given atmel_pwm_chip. To just not have to
do that, rework atmel_pwm_enable_clk_if_on() to take a pwm_chip.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:54 +0000 (10:30 +0100)]
pwm: apple: Make use of devm_pwmchip_alloc() function
This prepares the pwm-apple driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:53 +0000 (10:30 +0100)]
pwm: ab8500: Make use of devm_pwmchip_alloc() function
This prepares the pwm-ab8500 driver to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:51 +0000 (10:30 +0100)]
pwm: ab8500: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:50 +0000 (10:30 +0100)]
pwm: Provide pwmchip_alloc() function and a devm variant of it
This function allocates a struct pwm_chip and driver data. Compared to
the status quo the split into pwm_chip and driver data is new, otherwise
it doesn't change anything relevant (yet).
The intention is that after all drivers are switched to use this
allocation function, its possible to add a struct device to struct
pwm_chip to properly track the latter's lifetime without touching all
drivers again. Proper lifetime tracking is a necessary precondition to
introduce character device support for PWMs (that implements atomic
setting and doesn't suffer from the sysfs overhead of the /sys/class/pwm
userspace support).
The new function pwmchip_priv() (obviously?) only works for chips
allocated with pwmchip_alloc().
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:49 +0000 (10:30 +0100)]
pwm: Provide wrappers for storing and getting driver private data
These functions are useful to store and query driver private data
depending on the pwm_chip. After struct pwm_chip got its own struct
device, this can make use of dev_get_drvdata() and dev_set_drvdata() on
that device. These functions are required already now to convert
drivers to pwmchip_alloc() which must happen before changing
pwm_chip::dev.
Uwe Kleine-König [Wed, 14 Feb 2024 09:30:48 +0000 (10:30 +0100)]
pwm: Provide an inline function to get the parent device of a given chip
Currently a pwm_chip stores in its struct device *dev member a pointer
to the parent device. Preparing a change that embeds a full struct
device in struct pwm_chip, this accessor function should be used in all
drivers directly accessing chip->dev now. This way struct pwm_chip and
this new function can be changed without having to touch all drivers in
the same change set.
Make use of this function in the framework's core sources.
Rafał Miłecki [Wed, 14 Feb 2024 14:04:53 +0000 (15:04 +0100)]
dt-bindings: pwm: mediatek,mt2712: add compatible for MT7988
MT7988 has on-SoC controller that can control up to 8 PWM interfaces. It
differs from blocks on other SoCs (amount of PWMs & registers) so it
needs its own compatible string.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20240214140454.6438-1-zajec5@gmail.com Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Uwe Kleine-König [Fri, 26 Jan 2024 10:16:25 +0000 (11:16 +0100)]
pwm: imx27: Don't use pwm consumer API
Lowlevel driver callbacks are not supposed to use the consumer API
functions. Currently this works, but with the upcoming locking changes
this maybe results in dead locks. So directly access pwm->state.
Uwe Kleine-König [Mon, 29 Jan 2024 08:56:25 +0000 (09:56 +0100)]
pwm: atmel: Don't use pwm consumer API
Lowlevel driver callbacks are not supposed to use the consumer API
functions. Currently this works, but with the upcoming locking changes
this probably results in dead locks.
Uwe Kleine-König [Fri, 26 Jan 2024 12:04:34 +0000 (13:04 +0100)]
pwm: atmel-hlcdc: Don't use pwm consumer API
Lowlevel driver callbacks are not supposed to use the consumer API
functions. Currently this works, but with the upcoming locking changes
this probably results in dead locks.
Uwe Kleine-König [Mon, 29 Jan 2024 08:10:30 +0000 (09:10 +0100)]
pwm: bcm2835: Drop write-only member of driver private data
Since commit fcc760729359 ("pwm: bcm2835: Allow PWM driver to be used in
atomic context") struct bcm2835_pwm::dev is only assigned a value, but
it's never used. So the dev member can just be dropped.
Uwe Kleine-König [Thu, 25 Jan 2024 12:08:23 +0000 (13:08 +0100)]
pwm: Reorder symbols in core.c
This moves the functions called by pwm consumers above the functions
called by pwm providers. When character device support is added later
this is hooked into the chip registration functions. As the needed
callbacks are a kind of consumer and make use of the consumer functions,
having this order is more natural and prevents having to add
declarations for static functions.
Also move the global variables for pwm tables to the respective
functions to have them properly grouped.
pwm: Drop duplicate check against chip->npwm in of_pwm_xlate_with_flags()
args->args[0] is passed as parameter "index" to pwm_request_from_chip().
The latter function also checks for index >= npwm, so
of_pwm_xlate_with_flags() doesn't need to do that.
The default of_xlate callback (of_pwm_xlate_with_flags()) does
everything the drivers expects from its .of_xlate() callback. So drop
the custom implementation.
pwm: Drop useless member .of_pwm_n_cells of struct pwm_chip
Apart from the two of_xlate implementations this member is write-only.
In the of_xlate functions of_pwm_xlate_with_flags() and
of_pwm_single_xlate() it's more sensible to check for args->args_count
because this is what is actually used in the device tree.
pwm: sti: Fix capture for st,pwm-num-chan < st,capture-num-chan
The driver only used the number of pwm channels to set the pwm_chip's
npwm member. The result is that if there are more capture channels than
PWM channels specified in the device tree, only a part of the capture
channel is usable. Fix that by passing the bigger channel count to the
pwm framework. This makes it possible that the .apply() callback is
called with .hwpwm >= pwm_num_devs, catch that case and return an error
code.
Uwe Kleine-König [Fri, 26 Jan 2024 12:04:33 +0000 (13:04 +0100)]
pwm: atmel-hlcdc: Fix clock imbalance related to suspend support
The suspend callback disables the periph clock when the PWM is enabled
and resume reenables this clock if the PWM was disabled before. Judging
from the code comment it's suspend that is wrong here. Fix accordingly.
Linus Torvalds [Sun, 21 Jan 2024 22:01:12 +0000 (14:01 -0800)]
Merge tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs
Pull more bcachefs updates from Kent Overstreet:
"Some fixes, Some refactoring, some minor features:
- Assorted prep work for disk space accounting rewrite
- BTREE_TRIGGER_ATOMIC: after combining our trigger callbacks, this
makes our trigger context more explicit
- A few fixes to avoid excessive transaction restarts on
multithreaded workloads: fstests (in addition to ktest tests) are
now checking slowpath counters, and that's shaking out a few bugs
- Assorted tracepoint improvements
- Starting to break up bcachefs_format.h and move on disk types so
they're with the code they belong to; this will make room to start
documenting the on disk format better.
- A few minor fixes"
* tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs: (46 commits)
bcachefs: Improve inode_to_text()
bcachefs: logged_ops_format.h
bcachefs: reflink_format.h
bcachefs; extents_format.h
bcachefs: ec_format.h
bcachefs: subvolume_format.h
bcachefs: snapshot_format.h
bcachefs: alloc_background_format.h
bcachefs: xattr_format.h
bcachefs: dirent_format.h
bcachefs: inode_format.h
bcachefs; quota_format.h
bcachefs: sb-counters_format.h
bcachefs: counters.c -> sb-counters.c
bcachefs: comment bch_subvolume
bcachefs: bch_snapshot::btime
bcachefs: add missing __GFP_NOWARN
bcachefs: opts->compression can now also be applied in the background
bcachefs: Prep work for variable size btree node buffers
bcachefs: grab s_umount only if snapshotting
...
Linus Torvalds [Sun, 21 Jan 2024 19:14:40 +0000 (11:14 -0800)]
Merge tag 'timers-core-2024-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner:
"Updates for time and clocksources:
- A fix for the idle and iowait time accounting vs CPU hotplug.
The time is reset on CPU hotplug which makes the accumulated
systemwide time jump backwards.
- Assorted fixes and improvements for clocksource/event drivers"
* tag 'timers-core-2024-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug
clocksource/drivers/ep93xx: Fix error handling during probe
clocksource/drivers/cadence-ttc: Fix some kernel-doc warnings
clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings
clocksource/timer-riscv: Add riscv_clock_shutdown callback
dt-bindings: timer: Add StarFive JH8100 clint
dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs
Kent Overstreet [Tue, 16 Jan 2024 21:20:21 +0000 (16:20 -0500)]
bcachefs: opts->compression can now also be applied in the background
The "apply this compression method in the background" paths now use the
compression option if background_compression is not set; this means that
setting or changing the compression option will cause existing data to
be compressed accordingly in the background.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Kent Overstreet [Tue, 16 Jan 2024 18:29:59 +0000 (13:29 -0500)]
bcachefs: Prep work for variable size btree node buffers
bcachefs btree nodes are big - typically 256k - and btree roots are
pinned in memory. As we're now up to 18 btrees, we now have significant
memory overhead in mostly empty btree roots.
And in the future we're going to start enforcing that certain btree node
boundaries exist, to solve lock contention issues - analagous to XFS's
AGIs.
Thus, we need to start allocating smaller btree node buffers when we
can. This patch changes code that refers to the filesystem constant
c->opts.btree_node_size to refer to the btree node buffer size -
btree_buf_bytes() - where appropriate.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
In __bch2_ioctl_subvolume_create(), we grab s_umount unconditionally
and unlock it at the end of the function. There is a comment
"why do we need this lock?" about the lock coming from
commit 42d237320e98 ("bcachefs: Snapshot creation, deletion")
The reason is that __bch2_ioctl_subvolume_create() calls
sync_inodes_sb() which enforce locked s_umount to writeback all dirty
nodes before doing snapshot works.
Fix it by read locking s_umount for snapshotting only and unlocking
s_umount after sync_inodes_sb().
Signed-off-by: Su Yue <glass.su@suse.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Colin Ian King [Tue, 16 Jan 2024 11:07:23 +0000 (11:07 +0000)]
bcachefs: remove redundant variable tmp
The variable tmp is being assigned a value but it isn't being
read afterwards. The assignment is redundant and so tmp can be
removed.
Cleans up clang scan build warning:
warning: Although the value stored to 'ret' is used in the enclosing
expression, the value is never actually read from 'ret'
[deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Kent Overstreet [Tue, 16 Jan 2024 01:37:23 +0000 (20:37 -0500)]
bcachefs: Fix excess transaction restarts in __bchfs_fallocate()
drop_locks_do() should not be used in a fastpath without first trying
the do in nonblocking mode - the unlock and relock will cause excessive
transaction restarts and potentially livelocking with other threads that
are contending for the same locks.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Kent Overstreet [Mon, 15 Jan 2024 22:59:51 +0000 (17:59 -0500)]
bcachefs: Better journal tracepoints
Factor out bch2_journal_bufs_to_text(), and use it in the
journal_entry_full() tracepoint; when we can't get a journal reservation
we need to know the outstanding journal entry sizes to know if the
problem is due to excessive flushing.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>