In addition to the prefix ".exit", ".ARM.extab.exit" and ".ARM.exidx.exit"
must be recognized as exit sections as well. Otherwise, loading modules can
fail without CONFIG_MODULE_UNLOAD depending on the memory layout, when
relocations for the unwind sections refer to the .exit.text section:
imx_sdma: section 16 reloc 0 sym '': relocation 42 out of range
(0x7f015260 -> 0xc0f5a5e8)
where 0x7F000000 is the module load area and 0xC0000000 is the vmalloc
area. Relocation 42 refers to R_ARM_PREL31, which is limited to signed
31bit offsets.
Signed-off-by: Matthias Schiffer <[email protected]>
Signed-off-by: Jessica Yu <[email protected]>
Some archs like ARM store unwind information for .exit.text in sections
with unusual names. As this unwind information refers to .exit.text, it
must not be loaded when .exit.text is not loaded (when CONFIG_MODULE_UNLOAD
is unset); otherwise, loading a module can fail due to relocation failures.
Signed-off-by: Matthias Schiffer <[email protected]>
Signed-off-by: Jessica Yu <[email protected]>
In the unlikely case (thank you CI!), we may find ourselves wanting to
issue a preemption but having no runnable requests left. In this case,
we set the semaphore before computing the preemption and so must unset
it before forgetting (or else we leave the machine busywaiting until the
next request comes along and so likely hang).
v2: Replace readback with only a wmb after asserting the semaphore
Signed-off-by: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Reviewed-by: Mika Kuoppala <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
In ALSA firewire-motu driver, some tracepoints are supported to probe
vendor-specific data fields for SPH and status/control messages in
payload of isochronous packet. At present, the events of tracepoints
are unique each of direction, however the pair of events has the
same structure and print format. It's possible to unify the pair.
This commit unifies the pair. From userspace, direction is specified
by filtering for src/dst fields in the structure.
Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
This reverts commit e703965a12.
When creating this patch, I compared the value of src field to the
value of first byte of cip_header field (SID) in tracing event.
But in this test I used a device which has a quirk to transfer
isochronous packet with invalid SID. The original change is valid.
Fixes: e703965a12 ("ALSA: firewire-lib: fix inverted node IDs for amdtp_packet events")
Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
There are now no users of lubbock_set_misc_wr() outside lubbock.c, so
make this function static.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Robert Jarzmik <[email protected]>
These settings are needed to make the hardware operable.
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Robert Jarzmik <[email protected]>
The PEN2 line needs to be pulled up for the charger to enter high-current
mode. Do this with a static pull on the GPIO.
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Robert Jarzmik <[email protected]>
The dock detection input key is active low. Also add a pinmux for it.
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Robert Jarzmik <[email protected]>
This allows users of the pinctrl driver to specify either
pinctrl-single,bias-pullup = MPF_PULL_UP;
or
pinctrl-single,bias-pulldown = MPF_PULL_DOWN;
To activate the pull bits in the MFP registers.
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Robert Jarzmik <[email protected]>
The external PCF8563 RTC chip's interrupt line is connected to the NMI
line on the SoC.
Add the interrupt line to the device tree.
Fixes: 17ebc33afc ("arm64: allwinner: h6: add PCF8563 RTC on Pine H64 board")
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Chen-Yu Tsai <[email protected]>
_set_opp_custom() receives a set of OPP supplies as its arguments and
the caller of it passes NULL when the supplies are not valid. But
_set_opp_custom(), by mistake, checks for error by performing
IS_ERR(old_supply) on it which will always evaluate to false.
The problem was spotted during of testing of upcoming update for the
NVIDIA Tegra CPUFreq driver.
Cc: stable <[email protected]>
Fixes: 7e535993fa ("OPP: Separate out custom OPP handler specific code")
Reported-by: Marc Dietrich <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
[ Viresh: Massaged changelog ]
Signed-off-by: Viresh Kumar <[email protected]>
This commit replaces printk with pr_debug, so we don't flood kernel log.
Signed-off-by: Paweł Chmiel <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
The driver_find_device() accepts a match function pointer to
filter the devices for lookup, similar to bus/class_find_device().
However, there is a minor difference in the prototype for the
match parameter for driver_find_device() with the now unified
version accepted by {bus/class}_find_device(), where it doesn't
accept a "const" qualifier for the data argument. This prevents
us from reusing the generic match functions for driver_find_device().
For this reason, change the prototype of the driver_find_device() to
make the "match" parameter in line with {bus/class}_find_device()
and adjust its callers to use the const qualifier. Also, we could
now promote the "data" parameter to const as we pass it down
as a const parameter to the match functions.
Cc: Corey Minyard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Cc: Sebastian Ott <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Nehal Shah <[email protected]>
Cc: Shyam Sundar S K <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The prototype of bus_find_device() will be unified with that of
class_find_device() subsequently, but for this purpose the callback
functions passed to it need to take (const void *) as the second
argument. Consequently, they cannot modify the memory pointed to by
that argument which currently is not the case for acpi_dev_match_cb().
However, acpi_dev_match_cb() really need not modify the "match" object
passed to it, because acpi_dev_get_first_match_dev() which uses it via
bus_find_device() can easily convert the result of bus_find_device()
into the pointer to return.
For this reason, update acpi_dev_match_cb() to avoid the redundant
memory updates.
Cc: Len Brown <[email protected]>
Cc: [email protected]
Signed-off-by: Suzuki K Poulose <[email protected]>
Reviewed-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The charge controller can handle 14V but the PTC on the devkit can only
handle 6V so limit the negotiated voltage to 5V.
Signed-off-by: Angus Ainslie (Purism) <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
Call imx_register_uart_clocks() API to keep uart clocks enabled
when earlyprintk or earlycon is active.
Signed-off-by: Anson Huang <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
Some of i.MX SoCs' clock driver use platform driver model,
and they need to call imx_register_uart_clocks() API, so
imx_register_uart_clocks() API should NOT be in .init section.
Signed-off-by: Anson Huang <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
This gets rid of the unnecessary license boilerplate, and avoids
having to deal with individual patches one by one.
No functional changes intended.
Reviewed-by: Corentin Labbe <[email protected]>
Reviewed-by: Jean Delvare <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
The newly added variable is only used in an #if block:
drivers/hwmon/max6650.c: In function 'max6650_probe':
drivers/hwmon/max6650.c:766:33: error: unused variable 'cooling_dev' [-Werror=unused-variable]
Change the #if to if() so the compiler can see what is actually
going on.
Fixes: a8463754a5a9 ("hwmon: (max6650) Use devm function to register thermal device")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Not every chip supported by this driver supports setting the number
of samples for power averaging. Also, the power monitoring register
is not always a 16-bit register, and the configuration bits used for
voltage sampling are different depending on the register width.
Some conditional code is needed to fix the problem.
On top of all that, the compiler complains about problems with
FIELD_GET and FIELD_PREP macros if the file is built with W=1.
Avoid using those macros to silence the warning.
Cc: Krzysztof Adamski <[email protected]>
Cc: Alexander Sverdlin <[email protected]>
Reviewed-by: Krzysztof Adamski <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.
Reported-by: Peter Rosin <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
When calling debugfs functions, there is no need to ever check the
return value. The function can work or not, but the code logic should
never do something different based on this.
Cc: Luca Tettamanti <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Pass errors from i2c_smbus_read_byte_data() back to the caller of
max6650_update_device().
Cc: Jean-Francois Dagenais <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Only tachometer and alarm status registers are modified by the chip.
All other registers only need to be read only once, and reading them
repeatedly does not add any value.
Cc: Jean-Francois Dagenais <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Convert driver to use devm_hwmon_device_register_with_info to simplify
the code and to reduce its size.
Cc: Jean-Francois Dagenais <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Instead of re-reading the alarm register after reporting an alarm,
mark cached values as invalid. While this results in always reading all
data on subsequent reads, it is quite unlikely that such reads will
actually happen before the cache times out. The upside is avoiding
unnecessary unconditional i2c read operations.
Cc: Jean-Francois Dagenais <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
The alarm_en register is read each time the is_visible function is called.
Since it is a configuration register, this is completely unnecessary.
Read it once and cache its value.
Cc: Jean-Francois Dagenais <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Do not overwrite errors reported from i2c functions, and don't ignore
any errors.
Cc: Jean-Francois Dagenais <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Consolidate conversion from pwm value to dac value and from dac value
to pwm value into helper functions.
While doing this, only update the cached dac value if writing it
to the chip was successful after an update. Also, put macro argument
of DIV_FROM_REG() into (), and simplify return statement of
max6650_set_cur_state().
Cc: Jean-Francois Dagenais <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Use devm_thermal_of_cooling_device_register to register the thermal
cooling device. This lets us drop the remove function.
At the same time, use 'dev' variable in probe function consistently.
Cc: Jean-Francois Dagenais <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
The hwmon core registers the hwmon device before adding sensors to the
thermal core. If that fails, the hwmon device is released and an error
is returned to the caller. From the code flow, it appears to be necessary
to free struct hwmon_device *, allocated with kzalloc(), in that
situation. This is incorrect, since the data structure will be freed
automatically in hwmon_dev_release() when device_unregister() is called.
This used to result in a double free, which was found and fixed with
commit 74e3512731 ("hwmon: (core) Fix double-free in
__hwmon_device_register()"). This is, however, not obvious; any reader
may erroneously conclude that the data structure is not freed.
Add comment explaining why kfree() is not necessary in this situation.
Reported-by: Eduardo Valentin <[email protected]>
Cc: Eduardo Valentin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Kbuild test robot reports outside array bounds warnings.
This is reproducible for ARCH=sh allmodconfig with the kernel.org
toolchains available at:
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-sh4-linux.tar.xz
CC [M] drivers/hwmon/smsc47m1.o
drivers/hwmon/smsc47m1.c: In function 'fan_div_store':
drivers/hwmon/smsc47m1.c:370:49: warning: array subscript [0, 2] is outside array bounds of 'u8[3]' {aka 'unsigned char[3]'} [-Warray-bounds]
tmp = 192 - (old_div * (192 - data->fan_preload[nr])
~~~~~~~~~~~~~~~~~^~~~
drivers/hwmon/smsc47m1.c:372:19: warning: array subscript [0, 2] is outside array bounds of 'u8[3]' {aka 'unsigned char[3]'} [-Warray-bounds]
data->fan_preload[nr] = clamp_val(tmp, 0, 191);
~~~~~~~~~~~~~~~~~^~~~
drivers/hwmon/smsc47m1.c:373:53: warning: array subscript [0, 2] is outside array bounds of 'const u8[3]' {aka 'const unsigned char[3]'} [-Warray-bounds]
smsc47m1_write_value(data, SMSC47M1_REG_FAN_PRELOAD[nr],
~~~~~~~~~~~~~~~~~~~~~~~~^~~~
Looking at the code, I believe these are false positives.
While it is ridiculous to patch our driver to make the insane
compiler happy, clarifying the unreachable path will be helpful
not only for compilers but also for humans.
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
[groeck: Use BUG() instead of unreachable() to make objtool happy]
Signed-off-by: Guenter Roeck <[email protected]>
Add a driver to support the Infineon IRPS5401 PMIC. This chip has 5
pages corresponding to 4 switching outputs and one linear (LDO) output.
The switching and LDO outputs have slightly different supported
parameters.
Signed-off-by: Robert Hancock <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Detect the multi-function of voltage, thermal diode and thermistor
from register VT_ADC_MD_REG to set value of tcpu_mask in nct7904_data
struct, set temp[1-5]_input the input values TEMP_CH1~4 and LTD of
temperature. Set temp[6~13]_input the input values of DTS temperature
that correspond to sensors TCPU1~8.
Signed-off-by: amy.shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>