Bjorn Andersson
ef6673e836
thermal/drivers/qcom/lmh: Add sc8180x compatible
...
The LMh instances in the Qualcomm SC8180X platform looks to behave
similar to those in SM8150, add additional compatibles to allow
platform specific behavior to be added if needed.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Link: https://lore.kernel.org/r/20220502164504.3972938-1-bjorn.andersson@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:52 +02:00
Biju Das
2d37f5c90b
thermal/drivers/rz2gl: Fix OTP Calibration Register values
...
As per the latest RZ/G2L Hardware User's Manual (Rev.1.10 Apr, 2022),
the bit 31 of TSU OTP Calibration Register(OTPTSUTRIM) indicates
whether bit [11:0] of OTPTSUTRIM is valid or invalid.
This patch updates the code to reflect this change.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
Link: https://lore.kernel.org/r/20220428093346.7552-1-biju.das.jz@bp.renesas.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:52 +02:00
Biju Das
e126ce0bcc
dt-bindings: thermal: rzg2l-thermal: Document RZ/G2UL bindings
...
Document RZ/G2UL TSU bindings. The TSU block on RZ/G2UL is identical to one
found on RZ/G2L SoC. No driver changes are required as generic compatible
string "renesas,rzg2l-tsu" will be used as a fallback.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://lore.kernel.org/r/20220501081930.23743-1-biju.das.jz@bp.renesas.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:52 +02:00
Corentin Labbe
44b965d8c4
thermal: thermal_of: fix typo on __thermal_bind_params
...
Add a missing s to __thermal_bind_param kernel doc comment.
This fixes the following sparse warnings:
drivers/thermal/thermal_of.c:50: warning: expecting prototype for struct __thermal_bind_param. Prototype was for struct __thermal_bind_params instead
Signed-off-by: Corentin Labbe <clabbe@baylibre.com >
Link: https://lore.kernel.org/r/20220426064113.3787826-1-clabbe@baylibre.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:52 +02:00
Jiapeng Chong
cb4487d2b4
tools/thermal: remove unneeded semicolon
...
Fix the following coccicheck warnings:
./tools/thermal/thermometer/thermometer.c:147:3-4: Unneeded semicolon.
Reported-by: Abaci Robot <abaci@linux.alibaba.com >
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com >
Link: https://lore.kernel.org/r/20220427030619.81556-2-jiapeng.chong@linux.alibaba.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:52 +02:00
Jiapeng Chong
f21b57eb12
tools/lib/thermal: remove unneeded semicolon
...
Fix the following coccicheck warnings:
./tools/lib/thermal/commands.c:215:2-3: Unneeded semicolon.
Reported-by: Abaci Robot <abaci@linux.alibaba.com >
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com >
Link: https://lore.kernel.org/r/20220427030619.81556-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:52 +02:00
Zheng Yongjun
e20d136ec7
thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe
...
platform_get_resource() may return NULL, add proper check to
avoid potential NULL dereferencing.
Fixes: 250e211057 ("thermal: broadcom: Add Stingray thermal driver")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com >
Link: https://lore.kernel.org/r/20220425092929.90412-1-zhengyongjun3@huawei.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:52 +02:00
Daniel Lezcano
077df623c8
tools/thermal: Add thermal daemon skeleton
...
This change provides a simple daemon skeleton. It is an example of how
to use the thermal library which wraps all the complex code related to
the netlink and transforms it into a callback oriented code.
The goal of this skeleton is to give a base brick for anyone
interested in writing its own thermal engine or as an example to rely
on to write its own thermal monitoring implementation.
In the future, it will evolve with more features and hopefully more
logic.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Link: https://lore.kernel.org/r/20220420160933.347088-5-daniel.lezcano@linaro.org
2022-05-19 12:11:52 +02:00
Daniel Lezcano
110acbc6a4
tools/thermal: Add a temperature capture tool
...
The 'thermometer' tool allows to capture the temperature of a set of
thermal zones defined in a configuration file at a specified rate.
It is designed to have the lowest possible overhead. It will write the
captured temperature per thermal zone per file so making easier to
write a gnuplot script.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Link: https://lore.kernel.org/r/20220420160933.347088-4-daniel.lezcano@linaro.org
2022-05-19 12:11:52 +02:00
Daniel Lezcano
3b7c5e8adf
tools/thermal: Add util library
...
The next changes will provide a couple of tools using some common
functions provided by this library.
It provides basic wrappers for:
- mainloop
- logging
- timestamp
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Link: https://lore.kernel.org/r/20220420160933.347088-3-daniel.lezcano@linaro.org
2022-05-19 12:11:51 +02:00
Daniel Lezcano
47c4b0de08
tools/lib/thermal: Add a thermal library
...
The thermal framework implements a netlink notification mechanism to
be used by the userspace to have a thermal configuration discovery,
trip point changes or violation, cooling device changes notifications,
etc...
This library provides a level of abstraction for the thermal netlink
notification allowing the userspace to connect to the notification
mechanism more easily. The library is callback oriented.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Link: https://lore.kernel.org/r/20220420160933.347088-2-daniel.lezcano@linaro.org
2022-05-19 12:11:51 +02:00
Manaf Meethalavalappu Pallikunhi
bf70c57751
thermal/drivers/thermal_of: Add change_mode ops support for thermal_of sensor
...
The sensor driver which register through thermal_of interface doesn't
have an option to get thermal zone mode change notification from
thermal core.
Add support for change_mode ops in thermal_of interface so that sensor
driver can use this ops for mode change notification.
Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com >
Link: https://lore.kernel.org/r/1646767586-31908-1-git-send-email-quic_manafm@quicinc.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:51 +02:00
Stefan Wahren
106e0121e2
thermal/drivers/bcm2711: Don't clamp temperature at zero
...
The thermal sensor on BCM2711 is capable of negative temperatures, so don't
clamp the measurements at zero. Since this was the only use for variable t,
drop it.
This change based on a patch by Dom Cobley, who also tested the fix.
Fixes: 59b781352d ("thermal: Add BCM2711 thermal driver")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Link: https://lore.kernel.org/r/20220412195423.104511-1-stefan.wahren@i2se.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:51 +02:00
Dmitry Baryshkov
2caf73969d
thermal/drivers/tsens: Add compat string for the qcom,msm8960
...
On apq8064 (msm8960) platforms the tsens device is created manually by
the gcc driver. Prepare the tsens driver for the qcom,msm8960-tsens
device instantiated from the device tree.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220406002648.393486-3-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:51 +02:00
Dmitry Baryshkov
a63fa2b601
dt-bindings: thermal: qcom-tsens.yaml: add msm8960 compat string
...
Add compatibility string for the thermal sensors on MSM8960/APQ8064
platforms.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://lore.kernel.org/r/20220406002648.393486-2-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:51 +02:00
Massimiliano Minella
9e5f5f15fe
thermal/drivers/k3: Add hwmon support
...
Expose the thermal sensors on K3 AM654 as hwmon devices, so that
temperatures could be read using lm-sensors.
Signed-off-by: Massimiliano Minella <massimiliano.minella@gmail.com >
Link: https://lore.kernel.org/r/20220401151656.913166-1-massimiliano.minella@se.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:51 +02:00
Jishnu Prakash
96f6f333bc
thermal/drivers/qcom: Add support for PMIC5 Gen2 ADCTM
...
Add support for PMIC5 Gen2 ADC_TM, used on PMIC7 chips. It is a
close counterpart of PMIC7 ADC and has the same functionality as
PMIC5 ADC_TM, for threshold monitoring and interrupt generation.
It is present on PMK8350 alone, like PMIC7 ADC and can be used
to monitor up to 8 ADC channels, from any of the PMIC7 PMICs
having ADC on a target, through PBS(Programmable Boot Sequence).
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com >
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Link: https://lore.kernel.org/r/1648991869-20899-5-git-send-email-quic_jprakash@quicinc.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:51 +02:00
Jishnu Prakash
7e70a89a3a
thermal/drivers/qcom: Add support for multiple generations of devices
...
Refactor code to support multiple generations of ADC_TM devices
by defining gen number, irq name and disable, configure, isr and
init APIs in the individual data structs.
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com >
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/1648991869-20899-4-git-send-email-quic_jprakash@quicinc.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:51 +02:00
Jishnu Prakash
238e34ad7d
iio: adc: qcom-vadc-common: add reverse scaling for PMIC5 Gen2 ADC_TM
...
Add reverse scaling function for PMIC5 Gen2 ADC_TM, to convert
temperature to raw ADC code, for setting thresholds for
thermistor channels.
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com >
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Link: https://lore.kernel.org/r/1648991869-20899-3-git-send-email-quic_jprakash@quicinc.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:51 +02:00
Jishnu Prakash
e46e003a48
dt-bindings: thermal: qcom: add PMIC5 Gen2 ADC_TM bindings
...
Add documentation for PMIC5 Gen2 ADC_TM peripheral.
It is used for monitoring ADC channel thresholds for PMIC7-type
PMICs. It is present on PMK8350, like PMIC7 ADC and can be used
to monitor up to 8 ADC channels, from any of the PMIC7 PMICs
on a target, through PBS(Programmable Boot Sequence).
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com >
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/1648991869-20899-2-git-send-email-quic_jprakash@quicinc.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:50 +02:00
Lad Prabhakar
3277e022a1
thermal/drivers/rcar_thermal: Use platform_get_irq_optional() to get the interrupt
...
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.
In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_optional().
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
Link: https://lore.kernel.org/r/20220110144039.5810-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:50 +02:00
Lad Prabhakar
feef7f3252
dt-bindings: thermal: rzg2l-thermal: Document RZ/V2L bindings
...
Document RZ/V2L TSU bindings. The TSU block on RZ/V2L is identical to one
found on RZ/G2L SoC. No driver changes are required as generic compatible
string "renesas,rzg2l-tsu" will be used as a fallback.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com >
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
Link: https://lore.kernel.org/r/20220308212315.4551-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org >
2022-05-19 12:11:50 +02:00
Miaoqian Lin
b520cbe5be
rtc: ftrtc010: Fix error handling in ftrtc010_rtc_probe
...
In the error handling path, the clk_prepare_enable() function
call should be balanced by a corresponding 'clk_disable_unprepare()'
call , as already done in the remove function.
clk_disable_unprepare calls clk_disable() and clk_unprepare().
They will use IS_ERR_OR_NULL to check the argument.
Fixes: ac05fba39c ("rtc: gemini: Add optional clock handling")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
Link: https://lore.kernel.org/r/20220403054912.31739-1-linmq006@gmail.com
2022-05-19 12:08:17 +02:00
Yang Yingliang
d3b43eb505
rtc: mt6397: check return value after calling platform_get_resource()
...
It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.
Fixes: fc2979118f ("rtc: mediatek: Add MT6397 RTC driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
Link: https://lore.kernel.org/r/20220505125043.1594771-1-yangyingliang@huawei.com
2022-05-19 12:05:48 +02:00
Borislav Petkov
0696172956
drm/i915/uc: Fix undefined behavior due to shift overflowing the constant
...
Fix:
In file included from <command-line>:0:0:
drivers/gpu/drm/i915/gt/uc/intel_guc.c: In function ‘intel_guc_send_mmio’:
././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_1047’ \
declared with attribute error: FIELD_PREP: mask is not constant
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
and other build errors due to shift overflowing values.
See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
details as to why it triggers with older gccs only.
v2 by Jani:
- Drop the i915_reg.h changes
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Ruiqi GONG <gongruiqi1@huawei.com >
Cc: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-2-jani.nikula@intel.com
(cherry picked from commit 962bd34bb4 )
2022-05-19 12:50:29 +03:00
Jani Nikula
416e07a84f
drm/i915/reg: fix undefined behavior due to shift overflowing the constant
...
Use REG_GENMASK() and REG_FIELD_PREP() to avoid errors due to
-fsanitize=shift.
References: https://lore.kernel.org/r/20220405151517.29753-12-bp@alien8.de
Reported-by: Borislav Petkov <bp@suse.de >
Reported-by: Ruiqi GONG <gongruiqi1@huawei.com >
Cc: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-1-jani.nikula@intel.com
(cherry picked from commit 230fb39ff7 )
2022-05-19 12:50:29 +03:00
Andi Shyti
183f815d42
drm/i915/gt: Fix use of static in macro mismatch
...
The INTEL_GT_RPS_SYSFS_ATTR was creating to different structures
but. When called with the "static" keyword this is affecting only
the first structure, while the second is created as non static.
Move the static keyword inside the macros to affect both the
structures.
Reported-by: Jani Nikula <jani.nikula@linux.intel.com >
Fixes: 56a709cf77 ("drm/i915/gt: Create per-tile RPS sysfs interfaces")
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220510140447.80200-1-andi.shyti@linux.intel.com
(cherry picked from commit 1ade30812a )
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2022-05-19 12:50:29 +03:00
Jani Nikula
d91e9be0f0
drm/i915/audio: fix audio code enable/disable pipe logging
...
Need to use pipe_name(pipe) instead of pipe directly.
Fixes: 1f31e35f2e ("drm/i915/audio: unify audio codec enable/disable debug logging")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220512161638.272601-1-jani.nikula@intel.com
(cherry picked from commit 945ae909aa )
2022-05-19 12:50:25 +03:00
Maarten Lankhorst
7b1d6924f2
drm/i915: Use i915_gem_object_ggtt_pin_ww for reloc_iomap
...
When removing short term pins, I've changed the the batch buffer
pinning for relocation to use __i915_vma_pin, because
i915_gem_object_ggtt_pin_ww was destroying the old vma. This
caused regressions, because the functions are not identical.
Fix the regressions by calling i915_gem_object_ggtt_pin_ww() again
on ggtt-only platforms, but only if the batch can be pinned without
being moved.
Fixes: b5cfe6f7a6 ("drm/i915: Remove short-term pins from execbuf, v6.")
Cc: Matthew Auld <matthew.auld@intel.com >
Reported-by: Mateusz Jończyk <mat.jonczyk@o2.pl >
Tested-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Acked-by: Matthew Auld <matthew.auld@intel.com >
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5806
Link: https://patchwork.freedesktop.org/patch/msgid/20220511115219.46507-1-maarten.lankhorst@linux.intel.com
(cherry picked from commit 451374eef6 )
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
2022-05-19 12:49:49 +03:00
Yinjun Zhang
e43d940f48
nfp: flower: support ct merging when mangle action exists
...
Current implementation of ct merging doesn't support the case
that the fields mangling in pre_ct rules are matched in post_ct
rules.
This change is to support merging when mangling mac address,
ip address, tos, ttl and l4 port. VLAN and MPLS mangling is
not involved yet.
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com >
Signed-off-by: Louis Peens <louis.peens@corigine.com >
Signed-off-by: Simon Horman <simon.horman@corigine.com >
Link: https://lore.kernel.org/r/20220518075055.130649-1-simon.horman@corigine.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2022-05-19 11:48:30 +02:00
Michael Trimarchi
b885aab3d3
net: fec: Avoid allocating rx buffer using ATOMIC in ndo_open
...
Make ndo_open less sensitive to memory pressure.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com >
Reviewed-by: Jakub Kicinski <kuba@kernel.org >
Link: https://lore.kernel.org/r/20220518062007.10056-1-michael@amarulasolutions.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2022-05-19 11:38:02 +02:00
Yang Yingliang
d87ad457f7
video: fbdev: pxa3xx-gcu: release the resources correctly in pxa3xx_gcu_probe/remove()
...
In pxa3xx_gcu_probe(), the sequence of error lable is wrong, it will
leads some resource leaked, so adjust the sequence to handle the error
correctly, and if pxa3xx_gcu_add_buffer() fails, pxa3xx_gcu_free_buffers()
need be called.
In pxa3xx_gcu_remove(), add missing clk_disable_unpreprare().
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com >
Signed-off-by: Helge Deller <deller@gmx.de >
2022-05-19 11:36:16 +02:00
Yang Li
e60e8a7323
rtc: rzn1: fix platform_no_drv_owner.cocci warning
...
Remove .owner field if calls are used which set it automatically.
./drivers/rtc/rtc-rzn1.c:411:3-8: No need to set .owner here. The core
will do it.
Reported-by: Abaci Robot <abaci@linux.alibaba.com >
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com >
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
Link: https://lore.kernel.org/r/20220518232445.79156-1-yang.lee@linux.alibaba.com
2022-05-19 11:19:30 +02:00
Minghao Chi
40189b7368
video: fbdev: omapfb: simplify the return expression of nec_8048_connect()
...
Simplify the return expression.
Reported-by: Zeal Robot <zealci@zte.com.cn >
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn >
Signed-off-by: Helge Deller <deller@gmx.de >
2022-05-19 11:17:42 +02:00
Minghao Chi
b93a85c145
video: fbdev: omapfb: simplify the return expression of dsi_init_pll_data()
...
Simplify the return expression.
Reported-by: Zeal Robot <zealci@zte.com.cn >
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn >
Signed-off-by: Helge Deller <deller@gmx.de >
2022-05-19 11:16:49 +02:00
Miaoqian Lin
b23789a59f
video: fbdev: clcdfb: Fix refcount leak in clcdfb_of_vram_setup
...
of_parse_phandle() returns a node pointer with refcount incremented, we should
use of_node_put() on it when not need anymore. Add missing of_node_put() to
avoid refcount leak.
Fixes: d10715be03 ("video: ARM CLCD: Add DT support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com >
Signed-off-by: Helge Deller <deller@gmx.de >
2022-05-19 11:11:20 +02:00
Nathan Chancellor
58606220a2
drm/i915: Fix CFI violation with show_dynamic_id()
...
When an attribute group is created with sysfs_create_group(), the
->sysfs_ops() callback is set to kobj_sysfs_ops, which sets the ->show()
callback to kobj_attr_show(). kobj_attr_show() uses container_of() to
get the ->show() callback from the attribute it was passed, meaning the
->show() callback needs to be the same type as the ->show() callback in
'struct kobj_attribute'.
However, show_dynamic_id() has the type of the ->show() callback in
'struct device_attribute', which causes a CFI violation when opening the
'id' sysfs node under drm/card0/metrics. This happens to work because
the layout of 'struct kobj_attribute' and 'struct device_attribute' are
the same, so the container_of() cast happens to allow the ->show()
callback to still work.
Change the type of show_dynamic_id() to match the ->show() callback in
'struct kobj_attributes' and update the type of sysfs_metric_id to
match, which resolves the CFI violation.
Fixes: f89823c212 ("drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interface")
Signed-off-by: Nathan Chancellor <nathan@kernel.org >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Sami Tolvanen <samitolvanen@google.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220513075136.1027007-1-tvrtko.ursulin@linux.intel.com
(cherry picked from commit 18fb42db05 )
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2022-05-19 12:10:57 +03:00
Imre Deak
61e00044c6
drm/i915: Fix 'mixing different enum types' warnings in intel_display_power.c
...
Fix the following sparse warnings:
drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: warning: mixing different enum types:
drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: unsigned int enum intel_display_power_domain
drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: int enum port
drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: warning: mixing different enum types:
drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: unsigned int enum intel_display_power_domain
drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: int enum port
drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: warning: mixing different enum types:
drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: unsigned int enum intel_display_power_domain
drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: unsigned int enum aux_ch
drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: warning: mixing different enum types:
drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: unsigned int enum intel_display_power_domain
drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: unsigned int enum aux_ch
Fixes: 979e1b32e0 ("drm/i915: Sanitize the port -> DDI/AUX power domain mapping for each platform")
Reported-by: Jani Nikula <jani.nikula@intel.com >
Cc: Jouni Högander <jouni.hogander@intel.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220510114957.406070-1-imre.deak@intel.com
(cherry picked from commit 7ecc3cc8a7 )
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2022-05-19 12:10:51 +03:00
YueHaibing
43ab20c599
drm/i915/gt: Fix build error without CONFIG_PM
...
drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c: In function ‘act_freq_mhz_show’:
drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c:276:20: error: implicit declaration of function ‘sysfs_gt_attribute_r_max_func’ [-Werror=implicit-function-declaration]
276 | u32 actual_freq = sysfs_gt_attribute_r_max_func(dev, attr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Move sysfs_gt_attribute_* macros out of #ifdef block to fix this.
Fixes: 56a709cf77 ("drm/i915/gt: Create per-tile RPS sysfs interfaces")
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220506032652.1856-1-yuehaibing@huawei.com
(cherry picked from commit 09708b6d82 )
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2022-05-19 12:10:46 +03:00
Saurabh Sengar
c4b4d7047f
video: fbdev: hyperv_fb: Allow resolutions with size > 64 MB for Gen1
...
This patch fixes a bug where GEN1 VMs doesn't allow resolutions greater
than 64 MB size (eg 7680x4320). Unnecessary PCI check limits Gen1 VRAM
to legacy PCI BAR size only (ie 64MB). Thus any, resolution requesting
greater then 64MB (eg 7680x4320) would fail. MMIO region assigning this
memory shouldn't be limited by PCI bar size.
Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com >
Reviewed-by: Dexuan Cui <decui@microsoft.com >
Signed-off-by: Helge Deller <deller@gmx.de >
2022-05-19 11:05:31 +02:00
Lai Jiangshan
47f33de4aa
x86/sev: Mark the code returning to user space as syscall gap
...
When returning to user space, %rsp is user-controlled value.
If it is a SNP-guest and the hypervisor decides to mess with the
code-page for this path while a CPU is executing it, a potential #VC
could hit in the syscall return path and mislead the #VC handler.
So make ip_within_syscall_gap() return true in this case.
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Acked-by: Joerg Roedel <jroedel@suse.de >
Link: https://lore.kernel.org/r/20220412124909.10467-1-jiangshanlai@gmail.com
2022-05-19 10:56:46 +02:00
Sunil V L
3f68e69520
riscv/efi_stub: Add support for RISCV_EFI_BOOT_PROTOCOL
...
Add support for getting the boot hart ID from the Linux EFI stub using
RISCV_EFI_BOOT_PROTOCOL. This method is preferred over the existing DT
based approach since it works irrespective of DT or ACPI.
The specification of the protocol is hosted at:
https://github.com/riscv-non-isa/riscv-uefi
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com >
Acked-by: Palmer Dabbelt <palmer@rivosinc.com >
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com >
Link: https://lore.kernel.org/r/20220519051512.136724-2-sunilvl@ventanamicro.com
[ardb: minor tweaks for coding style and whitespace]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org >
2022-05-19 10:22:17 +02:00
Borislav Petkov
962bd34bb4
drm/i915/uc: Fix undefined behavior due to shift overflowing the constant
...
Fix:
In file included from <command-line>:0:0:
drivers/gpu/drm/i915/gt/uc/intel_guc.c: In function ‘intel_guc_send_mmio’:
././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_1047’ \
declared with attribute error: FIELD_PREP: mask is not constant
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
and other build errors due to shift overflowing values.
See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
details as to why it triggers with older gccs only.
v2 by Jani:
- Drop the i915_reg.h changes
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Ruiqi GONG <gongruiqi1@huawei.com >
Cc: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-2-jani.nikula@intel.com
2022-05-19 11:08:58 +03:00
Jani Nikula
230fb39ff7
drm/i915/reg: fix undefined behavior due to shift overflowing the constant
...
Use REG_GENMASK() and REG_FIELD_PREP() to avoid errors due to
-fsanitize=shift.
References: https://lore.kernel.org/r/20220405151517.29753-12-bp@alien8.de
Reported-by: Borislav Petkov <bp@suse.de >
Reported-by: Ruiqi GONG <gongruiqi1@huawei.com >
Cc: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-1-jani.nikula@intel.com
2022-05-19 11:00:46 +03:00
Joel Stanley
8dc7aa0a72
ARM: dts: aspeed: ast2600-evb: Enable GFX device
...
Enable the GFX device with a framebuffer memory region.
Signed-off-by: Joel Stanley <joel@jms.id.au >
Signed-off-by: Tommy Haung <tommy_huang@aspeedtech.com >
Reviewed-by: Joel Stanley <joel@jms.id.au >
Link: https://lore.kernel.org/r/20220302024930.18758-3-tommy_huang@aspeedtech.com
Signed-off-by: Joel Stanley <joel@jms.id.au >
2022-05-19 17:18:56 +09:30
Joel Stanley
4fa40bfa25
ARM: dts: aspeed: Add GFX node to AST2600
...
The GFX device is present in the AST2600 SoC.
Signed-off-by: Joel Stanley <joel@jms.id.au >
Signed-off-by: Tommy Haung <tommy_huang@aspeedtech.com >
Reviewed-by: Joel Stanley <joel@jms.id.au >
Link: https://lore.kernel.org/r/20220302024930.18758-2-tommy_huang@aspeedtech.com
Signed-off-by: Joel Stanley <joel@jms.id.au >
2022-05-19 17:18:56 +09:30
Howard Chiu
0ef77237c5
ARM: dts: aspeed: ast2600-evb: Enable virtual hub
...
Enable Aspeed VHub for HID emulation
Signed-off-by: Howard Chiu <howard_chiu@aspeedtech.com >
Link: https://lore.kernel.org/r/SG2PR06MB23155E8A6193118544A7DBF3E61E9@SG2PR06MB2315.apcprd06.prod.outlook.com
Signed-off-by: Joel Stanley <joel@jms.id.au >
2022-05-19 17:14:20 +09:30
Howard Chiu
08daf2c891
ARM: dts: aspeed: ast2600-evb: Enable video engine
...
Enable video engine and reserve memory for it.
Signed-off-by: Howard Chiu <howard_chiu@aspeedtech.com >
Link: https://lore.kernel.org/r/SG2PR06MB23159B914BF7EF937FEDD2B5E61E9@SG2PR06MB2315.apcprd06.prod.outlook.com
Signed-off-by: Joel Stanley <joel@jms.id.au >
2022-05-19 17:13:25 +09:30
Brandon Wyman
f6b6795004
ARM: dts: aspeed: everest, rainier: Add power-ffs-sync-history GPIO
...
The IBM Everest and Rainier systems have a GPIO line that goes to the
power supplies. It has a dual function: 1) Fans Full Speed, and 2) Sync
input history.
Signed-off-by: Brandon Wyman <bjwyman@gmail.com >
Link: https://lore.kernel.org/r/20220421213638.1151193-1-bjwyman@gmail.com
Signed-off-by: Joel Stanley <joel@jms.id.au >
2022-05-19 17:12:52 +09:30
Graeme Gregory
7b46aa7c00
ARM: dts: aspeed: Add Nuvia DC-SCM BMC
...
Add initial version of device tree for Nuvia DC-SCM BMC which is
equipped with Aspeed AST2600 BMC SoC.
Signed-off-by: Graeme Gregory <quic_ggregory@quicinc.com >
Signed-off-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com >
Link: https://lore.kernel.org/r/20220325190247.468079-1-quic_jaehyoo@quicinc.com
Signed-off-by: Joel Stanley <joel@jms.id.au >
2022-05-19 17:08:10 +09:30