version 9:
- fix pwm commit message header
- re-oerder nodes in DT file
version 8:
- rebase on v4.10-rc4
- fix comments done by Thierry on PWM
- reword "reg" parameter description
- change kernel kernel in IIO ABI documentation
version 7:
- rebase on v4.10-rc2
- remove iio_device code from driver and keep only the trigger part
version 6:
- rename stm32-gptimer in stm32-timers.
- change "st,stm32-gptimer" compatible to "st,stm32-timers".
- modify "st,breakinput" parameter in pwm part.
- split DT patch in 2
version 5:
- fix comments done on version 4
- rebased on kernel 4.9-rc8
- change nodes names and re-order then by addresses
version 4:
- fix comments done on version 3
- don't use interrupts anymore in IIO timer
- detect hardware capabilities at probe time to simplify binding
version 3:
- no change on mfd and pwm divers patches
- add cross reference between bindings
- change compatible to "st,stm32-timer-trigger"
- fix attributes access rights
- use string instead of int for master_mode and slave_mode
- document device attributes in sysfs-bus-iio-timer-stm32
- update DT with the new compatible
version 2:
- keep only one compatible per driver
- use DT parameters to describe hardware block configuration:
- pwm channels, complementary output, counter size, break input
- triggers accepted and create by IIO timers
- change DT to limite use of reference to the node
- interrupt is now in IIO timer driver
- rename stm32-mfd-timer to stm32-timers (for general purpose timer)
The following patches enable PWM and IIO Timer features for STM32 platforms.
Those two features are mixed into the registers of the same hardware block
(named general purpose timer) which lead to introduce a multifunctions driver
on the top of them to be able to share the registers.
In STM32f4 14 instances of timer hardware block exist, even if they all have
the same register mapping they could have a different number of pwm channels
and/or different triggers capabilities. We use various parameters in DT to
describe the differences between hardware blocks
The MFD (stm32-timers.c) takes care of clock and register mapping
by using regmap. stm32_timers structure is provided to its sub-node to
share those information.
PWM driver is implemented into pwm-stm32.c. Depending of the instance we may
have up to 4 channels, sometime with complementary outputs or 32 bits counter
instead of 16 bits. Some hardware blocks may also have a break input function
which allows to stop pwm depending of a level, defined in devicetree, on an
external pin.
IIO timer driver (stm32-timer-trigger.c and stm32-timer-trigger.h) define a list
of hardware triggers usable by hardware blocks like ADC, DAC or other timers.
The matrix of possible connections between blocks is quite complex so we use
trigger names and is_stm32_iio_timer_trigger() function to be sure that
triggers are valid and configure the IPs.
At run time IIO timer hardware blocks can configure (through "master_mode"
IIO device attribute) which internal signal (counter enable, reset,
comparison block, etc...) is used to generate the trigger.
Benjamin Gaignard (8):
MFD: add bindings for STM32 Timers driver
MFD: add STM32 Timers driver
dt-bindings: pwm: Add STM32 bindings
pwm: add driver for STM32 plaftorm
IIO: add bindings for STM32 timer trigger driver
IIO: add STM32 timer trigger driver
ARM: dts: stm32: add Timers driver for stm32f429 MCU
ARM: dts: stm32: Enable pwm1 and pwm3 for stm32f469-disco
.../ABI/testing/sysfs-bus-iio-timer-stm32 | 29 ++
.../bindings/iio/timer/stm32-timer-trigger.txt | 23 ++
.../devicetree/bindings/mfd/stm32-timers.txt | 46 +++
.../devicetree/bindings/pwm/pwm-stm32.txt | 35 ++
arch/arm/boot/dts/stm32f429.dtsi | 275 ++++++++++++++
arch/arm/boot/dts/stm32f469-disco.dts | 28 ++
drivers/iio/trigger/Kconfig | 9 +
drivers/iio/trigger/Makefile | 1 +
drivers/iio/trigger/stm32-timer-trigger.c | 342 ++++++++++++++++++
drivers/mfd/Kconfig | 11 +
drivers/mfd/Makefile | 2 +
drivers/mfd/stm32-timers.c | 80 +++++
drivers/pwm/Kconfig | 9 +
drivers/pwm/Makefile | 1 +
drivers/pwm/pwm-stm32.c | 398 +++++++++++++++++++++
include/linux/iio/timer/stm32-timer-trigger.h | 62 ++++
include/linux/mfd/stm32-timers.h | 71 ++++
17 files changed, 1422 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-timer-stm32
create mode 100644 Documentation/devicetree/bindings/iio/timer/stm32-timer-trigger.txt
create mode 100644 Documentation/devicetree/bindings/mfd/stm32-timers.txt
create mode 100644 Documentation/devicetree/bindings/pwm/pwm-stm32.txt
create mode 100644 drivers/iio/trigger/stm32-timer-trigger.c
create mode 100644 drivers/mfd/stm32-timers.c
create mode 100644 drivers/pwm/pwm-stm32.c
create mode 100644 include/linux/iio/timer/stm32-timer-trigger.h
create mode 100644 include/linux/mfd/stm32-timers.h
--
1.9.1
The goal of this RFC is to understand if a common ioctl for specific memory
regions allocations is needed/welcome.
Obviously it will not replace allocation done in linux kernel frameworks like
v4l2, drm/kms or others, but offer an alternative when you don't want/need to
use them for buffer allocation.
To keep a compatibility with what already exist allocated buffers are exported
in userland as dmabuf file descriptor (like ION is doing).
"Unix Device Memory Allocator" project [1] wants to create a userland library
which may allow to select, depending of the devices constraint, the best
back-end for allocation. With this RFC I would to propose to have common ioctl
for a maximum of allocators to avoid to duplicated back-ends for this library.
One of the issues that lead me to propose this RFC it is that since the beginning
it is a problem to allocate contiguous memory (CMA) without using v4l2 or
drm/kms so the first allocator available in this RFC use CMA memory.
An other question is: do we have others memory regions that could be interested
by this new framework ? I have in mind that some title memory regions could use
it or replace ION heaps (system, carveout, etc...).
Maybe it only solve CMA allocation issue, in this case there is no need to create
a new framework but only a dedicated ioctl.
Maybe the first thing to do is to change the name and the location of this
module, suggestions are welcome.
I have testing this code with the following program:
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "simple-allocator.h"
#define LENGTH 1024*16
void main (void)
{
struct simple_allocate_data data;
int fd = open("/dev/cma0", O_RDWR, 0);
int ret;
void *mem;
if (fd < 0) {
printf("Can't open /dev/cma0\n");
return;
}
memset(&data, 0, sizeof(data));
data.length = LENGTH;
data.flags = O_RDWR | O_CLOEXEC;
ret = ioctl(fd, SA_IOC_ALLOC, &data);
if (ret) {
printf("Buffer allocation failed\n");
goto end;
}
mem = mmap(0, LENGTH, PROT_READ | PROT_WRITE, MAP_SHARED, data.fd, 0);
if (mem == MAP_FAILED) {
printf("mmap failed\n");
}
memset(mem, 0xFF, LENGTH);
munmap(mem, LENGTH);
printf("test simple allocator CMA OK\n");
end:
close(fd);
}
[1] https://github.com/cubanismo/allocator
Benjamin Gaignard (2):
Create Simple Allocator module
add CMA simple allocator module
Documentation/simple-allocator.txt | 81 ++++++++++
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/simpleallocator/Kconfig | 17 +++
drivers/simpleallocator/Makefile | 2 +
drivers/simpleallocator/simple-allocator-cma.c | 187 ++++++++++++++++++++++++
drivers/simpleallocator/simple-allocator-priv.h | 33 +++++
drivers/simpleallocator/simple-allocator.c | 180 +++++++++++++++++++++++
include/uapi/linux/simple-allocator.h | 35 +++++
9 files changed, 538 insertions(+)
create mode 100644 Documentation/simple-allocator.txt
create mode 100644 drivers/simpleallocator/Kconfig
create mode 100644 drivers/simpleallocator/Makefile
create mode 100644 drivers/simpleallocator/simple-allocator-cma.c
create mode 100644 drivers/simpleallocator/simple-allocator-priv.h
create mode 100644 drivers/simpleallocator/simple-allocator.c
create mode 100644 include/uapi/linux/simple-allocator.h
--
1.9.1
Tree/Branch: master
Git describe: v4.10-rc5-71-ga4685d2
Commit: a4685d2f58 Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Build Time: 88 min 58 sec
Passed: 8 / 10 ( 80.00 %)
Failed: 2 / 10 ( 20.00 %)
Errors: 10
Warnings: 0
Section Mismatches: 0
Failed defconfigs:
arm64-allmodconfig
Errors:
arm64-allmodconfig
../kernel/sysctl_binary.c:1483:1: fatal error: error writing to /tmp/ccdidgz2.s: No space left on device
../arch/arm64/kernel/cpu-reset.S:17:0: fatal error: closing dependency file arch/arm64/kernel/.cpu-reset.o.d: No space left on device
../mm/maccess.c:7:0: fatal error: closing dependency file mm/.maccess.o.d: No space left on device
../arch/arm64/kvm/../../../virt/kvm/arm/vgic/vgic-mmio.c:583:1: fatal error: error writing to /tmp/ccc0uo18.s: No space left on device
../arch/arm64/kvm/../../../virt/kvm/arm/vgic/vgic-mmio-v3.c:654:1: fatal error: error writing to /tmp/ccXgcjH4.s: No space left on device
../arch/arm64/kernel/probes/simulate-insn.c:215:1: fatal error: error writing to /tmp/ccYFBFWu.s: No space left on device
../kernel/sys.c:2425:1: fatal error: error writing to /tmp/ccapnTIC.s: No space left on device
../kernel/signal.c:3651:1: fatal error: error writing to /tmp/ccrv3xkg.s: No space left on device
../include/linux/export.h:63:22: fatal error: error writing to /tmp/cc91nLLK.s: No space left on device
../mm/page_alloc.c:7484:1: fatal error: error writing to /tmp/ccVHZCyw.s: No space left on device
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
-------------------------------------------------------------------------------
Errors summary: 10
1 ../mm/page_alloc.c:7484:1: fatal error: error writing to /tmp/ccVHZCyw.s: No space left on device
1 ../mm/maccess.c:7:0: fatal error: closing dependency file mm/.maccess.o.d: No space left on device
1 ../kernel/sysctl_binary.c:1483:1: fatal error: error writing to /tmp/ccdidgz2.s: No space left on device
1 ../kernel/sys.c:2425:1: fatal error: error writing to /tmp/ccapnTIC.s: No space left on device
1 ../kernel/signal.c:3651:1: fatal error: error writing to /tmp/ccrv3xkg.s: No space left on device
1 ../include/linux/export.h:63:22: fatal error: error writing to /tmp/cc91nLLK.s: No space left on device
1 ../arch/arm64/kvm/../../../virt/kvm/arm/vgic/vgic-mmio.c:583:1: fatal error: error writing to /tmp/ccc0uo18.s: No space left on device
1 ../arch/arm64/kvm/../../../virt/kvm/arm/vgic/vgic-mmio-v3.c:654:1: fatal error: error writing to /tmp/ccXgcjH4.s: No space left on device
1 ../arch/arm64/kernel/probes/simulate-insn.c:215:1: fatal error: error writing to /tmp/ccYFBFWu.s: No space left on device
1 ../arch/arm64/kernel/cpu-reset.S:17:0: fatal error: closing dependency file arch/arm64/kernel/.cpu-reset.o.d: No space left on device
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm64-allmodconfig : FAIL, 10 errors, 0 warnings, 0 section mismatches
Errors:
../kernel/sysctl_binary.c:1483:1: fatal error: error writing to /tmp/ccdidgz2.s: No space left on device
../arch/arm64/kernel/cpu-reset.S:17:0: fatal error: closing dependency file arch/arm64/kernel/.cpu-reset.o.d: No space left on device
../mm/maccess.c:7:0: fatal error: closing dependency file mm/.maccess.o.d: No space left on device
../arch/arm64/kvm/../../../virt/kvm/arm/vgic/vgic-mmio.c:583:1: fatal error: error writing to /tmp/ccc0uo18.s: No space left on device
../arch/arm64/kvm/../../../virt/kvm/arm/vgic/vgic-mmio-v3.c:654:1: fatal error: error writing to /tmp/ccXgcjH4.s: No space left on device
../arch/arm64/kernel/probes/simulate-insn.c:215:1: fatal error: error writing to /tmp/ccYFBFWu.s: No space left on device
../kernel/sys.c:2425:1: fatal error: error writing to /tmp/ccapnTIC.s: No space left on device
../kernel/signal.c:3651:1: fatal error: error writing to /tmp/ccrv3xkg.s: No space left on device
../include/linux/export.h:63:22: fatal error: error writing to /tmp/cc91nLLK.s: No space left on device
../mm/page_alloc.c:7484:1: fatal error: error writing to /tmp/ccVHZCyw.s: No space left on device
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
arm64-allnoconfig
arm-multi_v5_defconfig
arm-multi_v7_defconfig
x86_64-defconfig
arm-allmodconfig
arm-allnoconfig
x86_64-allnoconfig
arm-multi_v4t_defconfig
arm64-defconfig
Hi Rafael,
This series is based over the other OPP series [1] which is ready to be
merged and is fully reviewed.
In this series, 11 out of 12 patches have Reviewed-by from Stephen. Only
the 7th patch hasn't got any of those.
@Stephen: Can you see if you can do a generic review of it as well?
Thanks for continuing to review this stuff.
The RCU locking isn't well suited for the OPP core. The RCU locking fits
better for reader heavy stuff, while the OPP core have at max one or two
readers only at a time.
Over that, it was getting very confusing the way RCU locking was used
within the OPP core. The individual OPPs are mostly well handled, i.e.
for an update a new structure was created and then that replaced the
older one. But the OPP tables were updated directly all the time from
various parts of the core. Though they were mostly used from within RCU
locked region, they didn't had much to do with RCU and were governed by
the mutex instead.
And that mixed with the 'opp_table_lock' has made the core even more
confusing.
Similar concerns were shared by Stephen Boyd earlier [2].
This patchset simplifies the locking in OPP core to great extent using
Kernel reference counting mechanism along with per OPP table mutex.
And finally it gets rid of RCU locking as well.
Each and every patch of this series is individually:
- build tested
- boot tested with cpufreq-dt.ko module. Insmod and rmmod to make sure
the OPPs and the OPP tables are getting freed.
More testing is also done by various build and boot bots for last few
days. And they reported lots of issues (both build and boot time) that
helped making this series more robust:
- Kernel CI (Linaro)
- Fengguang Wu's bot (Intel)
V1->V2:
- Minor documentation fixes pointed out by Stephen
- dev_pm_opp_put() is called only if OPP is valid (in the 7th patch)
--
viresh
[1] https://marc.info/?l=linux-kernel&m=148334828916156&w=2
[2] https://marc.info/?l=linux-kernel&m=147742717527548&w=2
Viresh Kumar (12):
PM / OPP: Add per OPP table mutex
PM / OPP: Add 'struct kref' to OPP table
PM / OPP: Return opp_table from dev_pm_opp_set_*() routines
PM / OPP: Take reference of the OPP table while adding/removing OPPs
PM / OPP: Use dev_pm_opp_get_opp_table() instead of _add_opp_table()
PM / OPP: Add 'struct kref' to struct dev_pm_opp
PM / OPP: Update OPP users to put reference
PM / OPP: Take kref from _find_opp_table()
PM / OPP: Move away from RCU locking
PM / OPP: Simplify _opp_set_availability()
PM / OPP: Simplify dev_pm_opp_get_max_volt_latency()
PM / OPP: Update Documentation to remove RCU specific bits
Documentation/power/opp.txt | 52 +-
arch/arm/mach-omap2/pm.c | 5 +-
drivers/base/power/opp/core.c | 888 +++++++++++------------------------
drivers/base/power/opp/cpu.c | 66 +--
drivers/base/power/opp/of.c | 94 +---
drivers/base/power/opp/opp.h | 31 +-
drivers/clk/tegra/clk-dfll.c | 17 +-
drivers/cpufreq/exynos5440-cpufreq.c | 5 +-
drivers/cpufreq/imx6q-cpufreq.c | 10 +-
drivers/cpufreq/mt8173-cpufreq.c | 8 +-
drivers/cpufreq/omap-cpufreq.c | 4 +-
drivers/cpufreq/sti-cpufreq.c | 13 +-
drivers/devfreq/devfreq.c | 14 +-
drivers/devfreq/exynos-bus.c | 14 +-
drivers/devfreq/governor_passive.c | 4 +-
drivers/devfreq/rk3399_dmc.c | 16 +-
drivers/devfreq/tegra-devfreq.c | 4 +-
drivers/thermal/cpu_cooling.c | 11 +-
drivers/thermal/devfreq_cooling.c | 15 +-
include/linux/pm_opp.h | 48 +-
20 files changed, 433 insertions(+), 886 deletions(-)
--
2.7.1.410.g6faf27b
Tree/Branch: master
Git describe: v4.10-rc4-281-gc497f8d
Commit: c497f8d172 Merge tag 'usb-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Build Time: 103 min 9 sec
Passed: 8 / 10 ( 80.00 %)
Failed: 2 / 10 ( 20.00 %)
Errors: 1
Warnings: 0
Section Mismatches: 0
Failed defconfigs:
arm64-allmodconfig
Errors:
arm64-allmodconfig
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
-------------------------------------------------------------------------------
Errors summary: 1
5 cat: write error: No space left on device
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm64-allmodconfig : FAIL, 5 errors, 0 warnings, 0 section mismatches
Errors:
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
cat: write error: No space left on device
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
arm64-allnoconfig
arm-multi_v5_defconfig
arm-multi_v7_defconfig
x86_64-defconfig
arm-allmodconfig
arm-allnoconfig
x86_64-allnoconfig
arm-multi_v4t_defconfig
arm64-defconfig