Add a check for valid cpu and create cpu isolation cooling
device only for those cpu's which passes this check.
Change-Id: Ic931a1aa51857ed109555e055879cb39da11f3cf
Signed-off-by: Priyansh Jain <quic_priyjain@quicinc.com>
There is a chance that userspace cooling device cur_state or
min_state sysfs node can request any random value. It may be
a value greater than max supported state. In that case if
cooling device is not bailing out, cooling device stats module
may behave unexpectedly.
Validate whether cur_state or min_state request is within the
range of max supported state or not for each cooling device.
If it is greater than max_state, bail out for that request for
different cooling devices.
Change-Id: If6422327b2bf4235617203588a5fe5805bf918f2
Signed-off-by: Gopala Krishna Nuthaki <quic_gnuthaki@quicinc.com>
Change a variable type in QMI encode logic to avoid
buffer overflow scenario.
Change-Id: I11b10cce0e9ab5b02738b2ba13e637df979e9310
Signed-off-by: Gopala Krishna Nuthaki <gnuthaki@codeaurora.org>
Add new virtual sensor definition for penta-cpu-max-step for MSM8917.
This virtual sensor can be used to monitor the overall temperature
of CPU cluster device.
Change-Id: I6a587b42cb4a474e1ce53ebbf893bbc168f22be4
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Add a snapshot of RPM SMD cooling device driver from msm-4.14
as of 'commit <f7835e76aab01> ("drivers: thermal: Add support
for RPM SMD cooling device")'.
Change-Id: Ica341e96a2951e5c48dcef66883b5c0af24ba60f
Signed-off-by: Gopala Krishna Nuthaki <gnuthaki@codeaurora.org>
Add driver to enable/disable pre-configured thermal zones
selectively at runtime based on efuse value. It uses QFPROM
nvmem cell interface to read efuse data. It supports multiple
efuse condtion and if any of them fails, driver just exit
with default enabled thermal zones.
Change-Id: I9bca61eb1ae9eeceff4ee0dd630c1ddb5967e2a5
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add new 3 QMI beamer ADC sensors to qmi sensor driver. It enables
thermal framework can configure thermal zone and monitor these sensors
from apps side.
Change-Id: Ifc577ccd312ab57e1f6a88269884c4c92b306264
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Currently thermal framework passes min_state value as ULONG_MAX to
clear the vote. But the min_state callback API for few cooling device
drivers are checking whether requested state is within cooling device
max limit or not. If it is not within max limit, it returns error.
It leads to a case where framework clears the request, but cooling
device is still holding previous request.
If min_state request is greater than max_state, cap the min_state
request to max state and apply max state vote for cooling device.
Change-Id: I69d8f1af704532b6a223c34ad825d231e50b8ca3
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add support to enable legacy LMH hardware features like different LMH
algorithms enablement, LMH profile change feature etc. to limits
driver. These feature will be optional and will be enabled based on
devicetree flag.
Change-Id: I1949c574b0783d9f363c8ac068f9b5250b49b119
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Signed-off-by: Asha Magadi Venkateshamurthy <amagad@codeaurora.org>
Add new compatible field and corresponding device data
for PMIC4 ADC_TM to distinguish it from PMIC5, which
has different device data.
Change-Id: I6c9f20963248c763a6df1f996fd25bdfd6749fa3
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
Signed-off-by: Asha Magadi Venkateshamurthy <amagad@codeaurora.org>
Added initialization for PMIC4 to support SDM660.
Change-Id: I9703bb8dee21ee084917b044f7aa83a5087b49b4
Signed-off-by: Asha Magadi Venkateshamurthy <amagad@codeaurora.org>
Due to an error in the specification of the multiple compatible strings
in the match table, nodes defined with compatible string "adc-tm5-iio"
failed to probe. Fix this.
Change-Id: I6cf544b202dfb0773215aeaeae8a12bae5b79dde
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Correct calculation of value written to ADC_TM measurement enable
register.
Change-Id: I14a6f585bb0cee678aa6eee749ba3e983ba47173
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
Add support for PMIC7 ADC_TM peripheral in ADC_TM common driver files.
Add main ADC_TM driver file for PMIC7. As register offsets and SW flows
have changed significantly for ADC_TM due to ADC architecture change,
this new driver is required for ADC_TM on PMIC7.
Change-Id: I9211552317955c503b7287876e11cd161c37f706
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
Add support for CDSP DCVS and CDSP hardware cooling devices to QMI
cooling device driver. These cooling devices can be used to mitigate
CDSP subsystem at high temperature via qmi interface.
Change-Id: Ia9906b07ebca4bd6158b68e6e100405ebaa30b60
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add a new virtual sensor based on gpu and skin sensors. This sensor will
do a weighted average of both the sensors.
Change-Id: I403ab74814090604f54c4f5858bbdfb77930a930
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
During bcl soc thermal zone register, framework calls soc set trip
function and if it is already violated state, it schedules workqueue
to evaluate trip and notify the framework. But if this workqueue
get scheduled prior to thermal zone register complete, there is a
chance that workqueue will use uninitialized thermal zone pointer
to notify thermal framework for re-evaluation. It leads to
unexpected behaviour.
Check whether thermal zone variable is initialized or not. If it is
initialized, then only notify thermal framework for re-evaluation.
Post thermal zone registration, the bcl soc driver explicitly request
to re-evalute trip immediately. It ensures that if above condition
happens, after thermal zone register, it will notify framework.
Change-Id: I2797140847d8ddc462053c1a40f2404f55971c81
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
There is a chance that userspace cooling device cur_state sysfs node
can request any random value. It may be a value greater than
max supported state. In that case if cooling device is not
bailing out, cooling device stats module may behave unexpectedly.
Validate whether cur_state request is within the range of max
supported state or not for each cooling device. If it is greater than
max_state, bail out for that request for different cooling devices.
Change-Id: Iaa6216ad1d2f1e5b92469cd3904715dd6c0b940c
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add new virtual sensor definition for hepta-cpu-max-step for BENGAL.
This virtual sensor can be used to monitor the overall temperature of
CPU subsystem.
Change-Id: Iaf22102a26a0f0f274adef0f0a09f89007677e89
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
There is a chance that BCL interrupt can trigger with no level status
bit set. In such cases, BCL irq handler notifies the framework for
BCL thermal zone re-evaluation. This spurious interrupt notification
may lead to some unwanted race condition with previous valid
notification or passive worker thread re-evaluation.
Check interrupt status register prior to framework notification and
notify framework only if respective status bit for each level is set.
Pass BCL level thermal zone trip value while notifying to framework.
Change-Id: Icff4b86ea738d18f06252f66a54d67083bfd51a0
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
For some pmic, based on pmic FG/QG ADC range, BCL Ibat scaling factor
needs to be changed. Add an optional devicetree property to choose
QG_ADC with 5A range. If this property is defined, ibat scaling
factor will be divided by two. By default ibat scaling factor will be
one corresponding to FG_ADC with 10A range.
Change-Id: I9f176f61a7187e5307943ee473e06bc9261c0a56
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
The qmi APIs return a positive transaction result value on successful
qmi message update for all qmi cooling devices. The qmi cooling
devices return the same value for cooling device state update request
from thermal framework. But thermal framework expects zero as return
value for successful cdev update and then only it will update cooling
device stats for that cooling device.
Update qmi cooling device driver to return zero on successful cooling
device state update to thermal framework.
Change-Id: Id9d59ed2c88c7e95dc2746a061e0ebadf0477a30
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add a snapshot of CX IPeak cooling device driver from msm-4.14 as of
'commit <829fee7bd3d86> ("driver: thermal: Update CX Ipeak driver to
support CX Ipeak v1.1 hardware")'.
Change-Id: I29eba311f835948c57784375c2cc11a3566bfd57
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
For adc_tm instances of type iio, drvdata is not set before
exiting probe, which may lead to issues when dev_pm_ops are
used. Set drvdata for these adc_tm instances too.
Change-Id: If78162455abf44d3071a8816582262d776a12318
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
Update ADC_TM channel configuration API by writing separately to
each configuration register.
Change-Id: Ieca4b95d137b23c901eaac43d1ae26aa813e1b6d
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
Add support for an additional charge state mitigation device. Also rename
the pa_1 to pa_fr1 and modem_skin# to mmw_skin# mitigation devices.
Change-Id: I1ea5889dbfdfaff77d3d0c9bbdbcbfc3b744501c
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Add driver to read limits cdsp Isense calibration data from SMEM
and enable sysfs file support to userspace daemon to access this data.
This driver is needed to avoid multiple re-calibration.
Change-Id: I1f1a70937034db388297c1ab52e12dcc468ee1dd
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add support for an additional pa mitigation device. This support will
enable the driver to expose both the pa based mitigation devices.
Change-Id: I750b39a3813c8d85da1800db860b1aa3a9041739
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
* refs/heads/tmp-d1f7f3b:
Linux 4.19.51
ALSA: seq: Cover unsubscribe_port() in list_mutex
drm/vc4: fix fb references in async update
ovl: support stacked SEEK_HOLE/SEEK_DATA
ovl: check the capability before cred overridden
Revert "drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v3)"
Revert "Bluetooth: Align minimum encryption key size for LE and BR/EDR connections"
percpu: do not search past bitmap when allocating an area
gpio: vf610: Do not share irq_chip
soc: renesas: Identify R-Car M3-W ES1.3
usb: typec: fusb302: Check vconn is off when we start toggling
ARM: exynos: Fix undefined instruction during Exynos5422 resume
pwm: Fix deadlock warning when removing PWM device
ARM: dts: exynos: Always enable necessary APIO_1V8 and ABB_1V8 regulators on Arndale Octa
pwm: tiehrpwm: Update shadow register for disabling PWMs
dmaengine: idma64: Use actual device for DMA transfers
ice: Add missing case in print_link_msg for printing flow control
gpio: gpio-omap: add check for off wake capable gpios
PCI: xilinx: Check for __get_free_pages() failure
block, bfq: increase idling for weight-raised queues
video: imsttfb: fix potential NULL pointer dereferences
video: hgafb: fix potential NULL pointer dereference
scsi: qla2xxx: Reset the FCF_ASYNC_{SENT|ACTIVE} flags
PCI: rcar: Fix 64bit MSI message address handling
PCI: rcar: Fix a potential NULL pointer dereference
net: hns3: return 0 and print warning when hit duplicate MAC
power: supply: max14656: fix potential use-before-alloc
platform/x86: intel_pmc_ipc: adding error handling
ARM: OMAP2+: pm33xx-core: Do not Turn OFF CEFUSE as PPA may be using it
drm/amd/display: Use plane->color_space for dpp if specified
PCI: rpadlpar: Fix leaked device_node references in add/remove paths
ARM: dts: imx6qdl: Specify IMX6QDL_CLK_IPG as "ipg" clock to SDMA
ARM: dts: imx6sx: Specify IMX6SX_CLK_IPG as "ipg" clock to SDMA
ARM: dts: imx6ul: Specify IMX6UL_CLK_IPG as "ipg" clock to SDMA
ARM: dts: imx7d: Specify IMX7D_CLK_IPG as "ipg" clock to SDMA
ARM: dts: imx6sll: Specify IMX6SLL_CLK_IPG as "ipg" clock to SDMA
ARM: dts: imx6sx: Specify IMX6SX_CLK_IPG as "ahb" clock to SDMA
ARM: dts: imx53: Specify IMX5_CLK_IPG as "ahb" clock to SDMA
ARM: dts: imx50: Specify IMX5_CLK_IPG as "ahb" clock to SDMA
ARM: dts: imx51: Specify IMX5_CLK_IPG as "ahb" clock to SDMA
soc: rockchip: Set the proper PWM for rk3288
clk: rockchip: Turn on "aclk_dmac1" for suspend on rk3288
soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher
PCI: keystone: Prevent ARM32 specific code to be compiled for ARM64
platform/chrome: cros_ec_proto: check for NULL transfer function
i40e: Queues are reserved despite "Invalid argument" error
x86/PCI: Fix PCI IRQ routing table memory leak
net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending
switchtec: Fix unintended mask of MRPC event
iommu/arm-smmu-v3: Don't disable SMMU in kdump kernel
vfio: Fix WARNING "do not call blocking ops when !TASK_RUNNING"
nfsd: avoid uninitialized variable warning
nfsd: allow fh_want_write to be called twice
fuse: retrieve: cap requested size to negotiated max_write
nvmem: sunxi_sid: Support SID on A83T and H5
nvmem: core: fix read buffer in place
ALSA: hda - Register irq handler after the chip initialization
netfilter: nf_flow_table: fix netdev refcnt leak
netfilter: nf_flow_table: check ttl value in flow offload data path
nvme-pci: shutdown on timeout during deletion
nvme-pci: unquiesce admin queue on shutdown
PCI: designware-ep: Use aligned ATU window for raising MSI interrupts
misc: pci_endpoint_test: Fix test_reg_bar to be updated in pci_endpoint_test
iommu/vt-d: Set intel_iommu_gfx_mapped correctly
blk-mq: move cancel of requeue_work into blk_mq_release
watchdog: fix compile time error of pretimeout governors
watchdog: imx2_wdt: Fix set_timeout for big timeout values
netfilter: nf_tables: fix base chain stat rcu_dereference usage
mips: Make sure dt memory regions are valid
netfilter: nf_conntrack_h323: restore boundary check correctness
netfilter: nf_flow_table: fix missing error check for rhashtable_insert_fast
mmc: mmci: Prevent polling for busy detection in IRQ context
ovl: do not generate duplicate fsnotify events for "fake" path
PCI: dwc: Free MSI IRQ page in dw_pcie_free_msi()
PCI: dwc: Free MSI in dw_pcie_host_init() error path
uml: fix a boot splat wrt use of cpu_all_mask
configfs: fix possible use-after-free in configfs_register_group
percpu: remove spurious lock dependency between percpu and sched
f2fs: fix to do checksum even if inode page is uptodate
f2fs: fix to do sanity check on valid block count of segment
f2fs: fix to use inline space only if inline_xattr is enable
f2fs: fix to avoid panic in dec_valid_block_count()
f2fs: fix to clear dirty inode in error path of f2fs_iget()
f2fs: fix to do sanity check on free nid
f2fs: fix to avoid panic in f2fs_remove_inode_page()
f2fs: fix to avoid panic in f2fs_inplace_write_data()
f2fs: fix to avoid panic in do_recover_data()
ntp: Allow TAI-UTC offset to be set to zero
mailbox: stm32-ipcc: check invalid irq
pwm: meson: Use the spin-lock only to protect register modifications
EDAC/mpc85xx: Prevent building as a module
bpf: fix undefined behavior in narrow load handling
drm/nouveau/kms/gv100-: fix spurious window immediate interlocks
objtool: Don't use ignore flag for fake jumps
drm/bridge: adv7511: Fix low refresh rate selection
drm/nouveau/kms/gf119-gp10x: push HeadSetControlOutputResource() mthd when encoders change
perf/x86/intel: Allow PEBS multi-entry in watermark mode
mfd: twl6040: Fix device init errors for ACCCTL register
drm/nouveau/disp/dp: respect sink limits when selecting failsafe link configuration
mfd: intel-lpss: Set the device in reset state when init
mfd: tps65912-spi: Add missing of table registration
drivers: thermal: tsens: Don't print error message on -EPROBE_DEFER
thermal: rcar_gen3_thermal: disable interrupt in .remove
kernel/sys.c: prctl: fix false positive in validate_prctl_map()
mm/slab.c: fix an infinite loop in leaks_show()
mm/cma_debug.c: fix the break condition in cma_maxchunk_get()
mm: page_mkclean vs MADV_DONTNEED race
mm/cma.c: fix the bitmap status to show failed allocation reason
initramfs: free initrd memory if opening /initrd.image fails
mm/cma.c: fix crash on CMA allocation if bitmap allocation fails
mem-hotplug: fix node spanned pages when we have a node with only ZONE_MOVABLE
hugetlbfs: on restore reserve error path retain subpool reservation
mm/hmm: select mmu notifier when selecting HMM
ARM: prevent tracing IPI_CPU_BACKTRACE
drm/pl111: Initialize clock spinlock early
ipc: prevent lockup on alloc_msg and free_msg
sysctl: return -EINVAL if val violates minmax
fs/fat/file.c: issue flush after the writeback of FAT
rapidio: fix a NULL pointer dereference when create_workqueue() fails
x86: Fix RETPOLINE_CFLAGS check
BACKPORT: kheaders: Do not regenerate archive if config is not changed
BACKPORT: kheaders: Move from proc to sysfs
BACKPORT: Provide in-kernel headers to make extending kernel easier
UPSTREAM: binder: check for overflow when alloc for security context
Conflicts:
arch/arm/kernel/smp.c
Change-Id: I3ea68f5be5910b6ae24d16194db149c24c36da36
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
Add support for modem wlan cooling device for qmi cooling device
driver. It enables thermal framework to use this cooling device
mitigation for any thermal zone.
Change-Id: I740394d6f1fcaffdf6f2982d01af5bcdfd7f209a
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add support for monitoring new sensors that are available in the modem
sub system. This will enable the driver to register them as thermal zone
and perform any mitigation when a threshold is reached.
Change-Id: I436e05249e52e25cbf017b2c923e1d3efe62303a
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
CPU cooling device register and handling max and min limit
functionalities are moved to cpu clock driver and cpu vdd min voltage
cooling device driver respectively. Add support to selectively
register cooling devices for LMH DCVSh driver so that other LMH DCVSh
features can be enabled without cooling device register.
Change-Id: I9e346c2410ff34c5b1dc9d0fdc19970a403007cc
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
[ Upstream commit fc7d18cf6a923cde7f5e7ba2c1105bb106d3e29a ]
We print a calibration failure message on -EPROBE_DEFER from
nvmem/qfprom as follows:
[ 3.003090] qcom-tsens 4a9000.thermal-sensor: version: 1.4
[ 3.005376] qcom-tsens 4a9000.thermal-sensor: tsens calibration failed
[ 3.113248] qcom-tsens 4a9000.thermal-sensor: version: 1.4
This confuses people when, in fact, calibration succeeds later when
nvmem/qfprom device is available. Don't print this message on a
-EPROBE_DEFER.
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Core isolation and unisolation is done inside the critical section with
the core isolation mutex. There is a possibility of deadlock, when the
core unisolation and core online from userspace happens simultaneously.
To avoid this move the core isolation and unisolation outside the
critical section so that deadlock is avoided.
Change-Id: Ic685a69ce8aa9929a3f12a7d0f287444748f1e26
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Increased resolution of mapping between raw adc code and temperature
for thermistors. Adjust thresholds written to ensure interrupts get
triggered correctly for temperatures read.
In addition, measure temperature causing threshold violation and
provide it directly to thermal framework instead of waiting for thermal
framework to read it.
Change-Id: I4330c659a91021ef44fa17c9c79e379105aa8fc3
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
Add support for shared interrupt handler to LMH DCVS. It helps to
notify scheduler properly for target which has common LMH hardware
and different clock domains.
Ignore thermal zone register error in case if thermal zone is not
defined for the shared LMH DCVS instance.
Change-Id: I2f0aa3da4e5a1d032602dd7c1e595830c7883c4e
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
LMH DCVSh driver always expects the properties like interrupts, affinity
and reg as mandatory devicetree properties. The driver in certain
targets will have to just be probed with just isens regulator devicetree
properties with the others. In order to handle that make all the
properties as optional.
Change-Id: I5cacf7cce4b184d6926ae74d6097c9f956dd6595
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
BCL peripheral will eventually translate all the vbat and ibat
interrupts to mitigation level interrupts. And the interrupts also will
correspond to the levels instead of the vbat or ibat events. So use
these interrupts in HLOS to trigger mitigation.
The vbat and ibat will still be registered as sensors, but they wont
support interrupts and hence no mitigation for violation. Instead the
levels will be registered as interrupts and the mitigation config should
be based on this mitigation level sensor.
Change-Id: I45d2f63f2390eb4c59c45ca7d8aff758e1f88ce0
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>