kernel-fxtec-pro1x/drivers/firmware
Cristian Marussi bccb966e93 firmware: arm_scmi: Fix SCMI genpd domain probing
[ Upstream commit e0f1a30cf184821499eeb67daedd7a3f21bbcb0b ]

When, at probe time, an SCMI communication failure inhibits the capacity
to query power domains states, such domains should be skipped.

Registering partially initialized SCMI power domains with genpd will
causes kernel panic.

 arm-scmi timed out in resp(caller: scmi_power_state_get+0xa4/0xd0)
 scmi-power-domain scmi_dev.2: failed to get state for domain 9
 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
 Mem abort info:
   ESR = 0x96000006
   EC = 0x25: DABT (current EL), IL = 32 bits
   SET = 0, FnV = 0
   EA = 0, S1PTW = 0
 Data abort info:
   ISV = 0, ISS = 0x00000006
   CM = 0, WnR = 0
 user pgtable: 4k pages, 48-bit VAs, pgdp=00000009f3691000
 [0000000000000000] pgd=00000009f1ca0003, p4d=00000009f1ca0003, pud=00000009f35ea003, pmd=0000000000000000
 Internal error: Oops: 96000006 [#1] PREEMPT SMP
 CPU: 2 PID: 381 Comm: bash Not tainted 5.8.0-rc1-00011-gebd118c2cca8 #2
 Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Jan  3 2020
 Internal error: Oops: 96000006 [#1] PREEMPT SMP
 pstate: 80000005 (Nzcv daif -PAN -UAO BTYPE=--)
 pc : of_genpd_add_provider_onecell+0x98/0x1f8
 lr : of_genpd_add_provider_onecell+0x48/0x1f8
 Call trace:
  of_genpd_add_provider_onecell+0x98/0x1f8
  scmi_pm_domain_probe+0x174/0x1e8
  scmi_dev_probe+0x90/0xe0
  really_probe+0xe4/0x448
  driver_probe_device+0xfc/0x168
  device_driver_attach+0x7c/0x88
  bind_store+0xe8/0x128
  drv_attr_store+0x2c/0x40
  sysfs_kf_write+0x4c/0x60
  kernfs_fop_write+0x114/0x230
  __vfs_write+0x24/0x50
  vfs_write+0xbc/0x1e0
  ksys_write+0x70/0xf8
  __arm64_sys_write+0x24/0x30
  el0_svc_common.constprop.3+0x94/0x160
  do_el0_svc+0x2c/0x98
  el0_sync_handler+0x148/0x1a8
  el0_sync+0x158/0x180

Do not register any power domain that failed to be queried with genpd.

Fixes: 898216c97e ("firmware: arm_scmi: add device power domain support using genpd")
Link: https://lore.kernel.org/r/20200619220330.12217-1-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:14:48 +02:00
..
arm_scmi firmware: arm_scmi: Fix SCMI genpd domain probing 2020-08-19 08:14:48 +02:00
broadcom firmware: bcm47xx_nvram: Support small (0x6000 B) NVRAM partitions 2018-04-23 16:39:35 +01:00
efi efi: Make it possible to disable efivar_ssdt entirely 2020-07-09 09:37:13 +02:00
google firmware: coreboot: Let OF core populate platform device 2020-01-27 14:49:55 +01:00
meson firmware: meson-sm: rework meson_sm_init to use module_platform_driver_probe 2018-03-07 17:33:52 -08:00
tegra firmware: tegra: adjust tested variable 2018-03-08 14:43:13 +01:00
arm_scpi.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
arm_sdei.c firmware: arm_sdei: fix double-lock on hibernate with shared events 2020-04-17 10:48:39 +02:00
dcdbas.c platform/x86: Fix dell driver init order 2018-03-14 11:05:53 -07:00
dcdbas.h
dell_rbu.c firmware: dell_rbu: Make payload memory uncachable 2019-11-20 18:47:41 +01:00
dmi-id.c firmware: dmi: Add access to the SKU ID string 2018-06-17 14:09:42 +02:00
dmi-sysfs.c firmware: dmi: handle missing DMI data gracefully 2018-02-03 11:25:20 +01:00
dmi_scan.c firmware: dmi: Fix unlikely out-of-bounds read in save_mem_devices 2020-01-27 14:51:19 +01:00
edd.c edd: don't spam log if no EDD information is present 2018-03-27 09:51:23 +02:00
iscsi_ibft.c iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND 2019-08-16 10:12:45 +02:00
iscsi_ibft_find.c
Kconfig iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND 2019-08-16 10:12:45 +02:00
Makefile firmware: arm_scmi: add basic driver infrastructure for SCMI 2018-02-28 16:37:57 +00:00
memmap.c
pcdp.c
pcdp.h
psci.c firmware/psci: Expose SMCCC version through psci_ops 2018-02-06 22:54:11 +00:00
psci_checker.c drivers/firmware/psci: Fix memory leakage in alloc_init_cpu_groups() 2020-07-29 10:16:46 +02:00
qcom_scm-32.c firmware: qcom: scm: Fix crash in qcom_scm_call_atomic1() 2018-05-24 22:36:45 -05:00
qcom_scm-64.c firmware: qcom: scm: Ensure 'a0' status code is treated as signed 2019-12-17 20:35:42 +01:00
qcom_scm.c firmware: qcom_scm: fix bogous abuse of dma-direct internals 2020-06-25 15:32:53 +02:00
qcom_scm.h
qemu_fw_cfg.c firmware: Fix a reference count leak. 2020-08-11 15:32:33 +02:00
raspberrypi.c firmware: raspberrypi: Fix firmware calls with large buffers 2019-12-13 08:51:26 +01:00
scpi_pm_domain.c
ti_sci.c firmware: ti_sci: Always request response from firmware 2019-09-19 09:09:39 +02:00
ti_sci.h firmware: ti_sci: Switch to SPDX Licensing 2018-05-04 23:10:23 -07:00