Hi Guys,
The cpu_cooling driver is designed to use CPU frequency scaling to avoid
high thermal states for a platform. But it wasn't glued really well with
cpufreq core.
This series tries to improve interactions between cpufreq core and
cpu_cooling driver and does some fixes/cleanups to the cpu_cooling
driver.
I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have
pushed them for 0-day build bot and kernel CI testing as well. We should
know if something is broken with these.
@Javi: It would be good if you can give them a test, specially because
of your work on the "power" specific bits in the driver.
Pushed here as well:
git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git thermal/cooling
V1->V2:
- Name cpufreq cooling dev as cpufreq_cdev everywhere (Eduardo).
--
viresh
Viresh Kumar (17):
thermal: cpu_cooling: Avoid accessing potentially freed structures
thermal: cpu_cooling: rearrange globals
thermal: cpu_cooling: Name cpufreq cooling devices as cpufreq_cdev
thermal: cpu_cooling: replace cool_dev with cdev
thermal: cpu_cooling: remove cpufreq_cooling_get_level()
thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state()
thermal: cpu_cooling: use cpufreq_policy to register cooling device
cpufreq: create cpufreq_table_count_valid_entries()
thermal: cpu_cooling: store cpufreq policy
thermal: cpu_cooling: OPPs are registered for all CPUs
thermal: cpu_cooling: get rid of 'allowed_cpus'
thermal: cpu_cooling: merge frequency and power tables
thermal: cpu_cooling: create structure for idle time stats
thermal: cpu_cooling: get_level() can't fail
thermal: cpu_cooling: don't store cpu_dev in cpufreq_cdev
thermal: cpu_cooling: 'freq' can't be zero in cpufreq_state2power()
thermal: cpu_cooling: Rearrange struct cpufreq_cooling_device
drivers/cpufreq/arm_big_little.c | 2 +-
drivers/cpufreq/cpufreq-dt.c | 2 +-
drivers/cpufreq/cpufreq_stats.c | 13 +-
drivers/cpufreq/dbx500-cpufreq.c | 2 +-
drivers/cpufreq/mt8173-cpufreq.c | 4 +-
drivers/cpufreq/qoriq-cpufreq.c | 3 +-
drivers/thermal/cpu_cooling.c | 579 ++++++++-------------
drivers/thermal/imx_thermal.c | 22 +-
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 22 +-
include/linux/cpu_cooling.h | 32 +-
include/linux/cpufreq.h | 14 +
11 files changed, 297 insertions(+), 398 deletions(-)
--
2.12.0.432.g71c3a4f4ba37
Tree/Branch: v3.18.50
Git describe: v3.18.50
Commit: 630b59cde7 Linux 3.18.50
Build Time: 61 min 14 sec
Passed: 9 / 9 (100.00 %)
Failed: 0 / 9 ( 0.00 %)
Errors: 0
Warnings: 29
Section Mismatches: 0
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
10 warnings 0 mismatches : arm64-allmodconfig
4 warnings 0 mismatches : arm-multi_v7_defconfig
21 warnings 0 mismatches : arm-allmodconfig
2 warnings 0 mismatches : arm-multi_v5_defconfig
1 warnings 0 mismatches : x86_64-defconfig
-------------------------------------------------------------------------------
Warnings Summary: 29
6 ../drivers/tty/sysrq.c:956:33: warning: array subscript is above array bounds [-Warray-bounds]
2 ../include/linux/dynamic_debug.h:78:3: warning: unsupported argument to '__builtin_return_address'
2 ../fs/nfs/nfs4proc.c:3062:10: warning: switch condition has boolean value [-Wswitch-bool]
2 ../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
2 ../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
1 ../include/uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
1 ../include/linux/kernel.h:707:17: warning: comparison of distinct pointer types lacks a cast
1 ../fs/btrfs/extent_io.c:2166:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/usb/gadget/function/f_ncm.c:203:0: warning: "NCAPS" redefined
1 ../drivers/staging/vt6655/device_main.c:2997:1: warning: the frame size of 1312 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ../drivers/staging/bcm/CmHost.c:1564:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/staging/bcm/CmHost.c:1546:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/staging/bcm/CmHost.c:1503:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/pci/host/pcie-xilinx.c:154:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
1 ../drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:467:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:307:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:303:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/net/ethernet/dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined! [-Wcpp]
1 ../drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1192 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ../drivers/iommu/intel-iommu.c:1762:25: warning: unused variable 'drhd' [-Wunused-variable]
1 ../drivers/infiniband/ulp/iser/iser_verbs.c:1206:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/infiniband/ulp/iser/iser_verbs.c:1201:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/infiniband/ulp/iser/iser_verbs.c:1175:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/infiniband/ulp/iser/iser_verbs.c:1174:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/infiniband/hw/qib/qib_qp.c:44:0: warning: "BITS_PER_PAGE" redefined
1 ../drivers/block/drbd/drbd_bitmap.c:483:0: warning: "BITS_PER_PAGE_MASK" redefined
1 ../drivers/block/drbd/drbd_bitmap.c:482:0: warning: "BITS_PER_PAGE" redefined
1 ../arch/arm/mach-cns3xxx/pcie.c:313:1: warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=]
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm64-allmodconfig : PASS, 0 errors, 10 warnings, 0 section mismatches
Warnings:
../drivers/block/drbd/drbd_bitmap.c:482:0: warning: "BITS_PER_PAGE" redefined
../drivers/block/drbd/drbd_bitmap.c:483:0: warning: "BITS_PER_PAGE_MASK" redefined
../drivers/infiniband/hw/qib/qib_qp.c:44:0: warning: "BITS_PER_PAGE" redefined
../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
../drivers/net/ethernet/dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined! [-Wcpp]
../drivers/staging/bcm/CmHost.c:1503:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/staging/bcm/CmHost.c:1546:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/staging/bcm/CmHost.c:1564:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
../drivers/usb/gadget/function/f_ncm.c:203:0: warning: "NCAPS" redefined
-------------------------------------------------------------------------------
arm-multi_v7_defconfig : PASS, 0 errors, 4 warnings, 0 section mismatches
Warnings:
../fs/nfs/nfs4proc.c:3062:10: warning: switch condition has boolean value [-Wswitch-bool]
../drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized]
../drivers/tty/sysrq.c:956:33: warning: array subscript is above array bounds [-Warray-bounds]
../drivers/tty/sysrq.c:956:33: warning: array subscript is above array bounds [-Warray-bounds]
-------------------------------------------------------------------------------
arm-allmodconfig : PASS, 0 errors, 21 warnings, 0 section mismatches
Warnings:
../arch/arm/mach-cns3xxx/pcie.c:313:1: warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../fs/btrfs/extent_io.c:2166:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../fs/nfs/nfs4proc.c:3062:10: warning: switch condition has boolean value [-Wswitch-bool]
../include/linux/kernel.h:707:17: warning: comparison of distinct pointer types lacks a cast
../drivers/infiniband/ulp/iser/iser_verbs.c:1174:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/infiniband/ulp/iser/iser_verbs.c:1175:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/infiniband/ulp/iser/iser_verbs.c:1201:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/infiniband/ulp/iser/iser_verbs.c:1206:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../include/linux/dynamic_debug.h:78:3: warning: unsupported argument to '__builtin_return_address'
../include/linux/dynamic_debug.h:78:3: warning: unsupported argument to '__builtin_return_address'
../drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1192 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../drivers/pci/host/pcie-xilinx.c:154:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:303:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:307:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:467:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
../drivers/tty/sysrq.c:956:33: warning: array subscript is above array bounds [-Warray-bounds]
../drivers/tty/sysrq.c:956:33: warning: array subscript is above array bounds [-Warray-bounds]
../include/uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
../drivers/staging/vt6655/device_main.c:2997:1: warning: the frame size of 1312 bytes is larger than 1024 bytes [-Wframe-larger-than=]
-------------------------------------------------------------------------------
arm-multi_v5_defconfig : PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
../drivers/tty/sysrq.c:956:33: warning: array subscript is above array bounds [-Warray-bounds]
../drivers/tty/sysrq.c:956:33: warning: array subscript is above array bounds [-Warray-bounds]
-------------------------------------------------------------------------------
x86_64-defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../drivers/iommu/intel-iommu.c:1762:25: warning: unused variable 'drhd' [-Wunused-variable]
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
x86_64-allnoconfig
arm64-allnoconfig
arm-allnoconfig
arm64-defconfig