Krzysztof Kozlowski
d9bad836cf
cpufreq: qcom-cpufreq-hw: fix double IO unmap and resource release on exit
commit ba5e770c96 upstream.
Commit 054a3ef683 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data
during probe") moved getting memory resource and iomap from
qcom_cpufreq_hw_cpu_init() to the probe function, however it left
untouched cleanup in qcom_cpufreq_hw_cpu_exit().
During device unbind this will lead to doule release of resource and
double iounmap(), first by qcom_cpufreq_hw_cpu_exit() and second via
managed resources:
resource: Trying to free nonexistent resource <0x0000000018593000-0x0000000018593fff>
Trying to vunmap() nonexistent vm area (0000000088a7d4dc)
...
vunmap (mm/vmalloc.c:2771 (discriminator 1))
iounmap (mm/ioremap.c:60)
devm_ioremap_release (lib/devres.c:19)
devres_release_all (drivers/base/devres.c:506 drivers/base/devres.c:535)
device_unbind_cleanup (drivers/base/dd.c:523)
device_release_driver_internal (drivers/base/dd.c:1248 drivers/base/dd.c:1263)
device_driver_detach (drivers/base/dd.c:1300)
unbind_store (drivers/base/bus.c:243)
drv_attr_store (drivers/base/bus.c:127)
sysfs_kf_write (fs/sysfs/file.c:137)
kernfs_fop_write_iter (fs/kernfs/file.c:334)
vfs_write (include/linux/fs.h:1851 fs/read_write.c:491 fs/read_write.c:584)
ksys_write (fs/read_write.c:637)
__arm64_sys_write (fs/read_write.c:646)
invoke_syscall (arch/arm64/include/asm/current.h:19 arch/arm64/kernel/syscall.c:57)
el0_svc_common.constprop.0 (arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/syscall.c:150)
do_el0_svc (arch/arm64/kernel/syscall.c:194)
el0_svc (arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/entry-common.c:133 arch/arm64/kernel/entry-common.c:142 arch/arm64/kernel/entry-common.c:638)
el0t_64_sync_handler (arch/arm64/kernel/entry-common.c:656)
el0t_64_sync (arch/arm64/kernel/entry.S:591)
Fixes: 054a3ef683 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data during probe")
Cc: <stable@vger.kernel.org>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-11 23:16:50 +09:00
..
2023-04-05 09:07:26 +02:00
2023-04-21 13:39:10 -07:00
2023-05-11 23:16:49 +09:00
2023-04-10 13:35:54 -07:00
2023-04-10 10:23:15 -07:00
2023-05-11 23:16:47 +09:00
2023-05-11 23:16:49 +09:00
2023-05-11 23:16:50 +09:00
2023-05-11 23:16:50 +09:00
2023-04-04 15:37:25 -07:00
2023-03-31 18:17:21 +05:30
2023-04-14 13:48:56 +02:00
2023-04-07 00:10:04 +08:00
2023-05-01 08:32:25 +09:00
2023-05-11 23:16:48 +09:00
2023-04-12 17:26:00 -07:00
2023-05-11 23:16:48 +09:00
2023-04-15 11:06:49 -07:00
2023-05-11 23:16:49 +09:00
2023-04-13 12:17:32 -03:00
2023-04-23 07:46:52 -07:00
2023-04-04 09:10:55 -03:00
2023-05-11 23:16:48 +09:00
2023-05-11 23:16:48 +09:00
2023-04-05 11:43:51 +02:00
2023-03-23 12:02:00 +01:00
2023-04-15 16:55:09 -07:00
2023-05-11 23:16:49 +09:00
2023-04-14 07:13:48 +02:00
2023-04-13 15:21:56 -07:00
2023-05-11 23:16:47 +09:00
2023-03-27 17:31:22 +02:00
2023-05-11 23:16:47 +09:00
2023-05-11 23:16:50 +09:00
2023-04-06 10:13:23 -07:00
2023-03-24 19:17:22 -07:00
2023-05-11 23:16:50 +09:00
2023-04-11 12:41:59 +01:00
2023-03-27 17:23:08 +02:00
2023-04-15 10:49:47 -07:00
2023-05-11 23:16:50 +09:00
2023-04-19 13:49:31 -07:00
2023-05-11 23:16:48 +09:00
2023-04-03 17:54:01 +02:00
2023-04-11 18:12:19 +02:00
2023-05-11 23:16:49 +09:00
2023-04-02 21:12:34 -04:00
2023-05-11 23:16:48 +09:00
2023-04-04 14:22:12 -04:00
2023-04-04 11:01:58 -04:00
2023-04-13 20:47:58 +02:00