linux-stable/drivers/firmware
Stephen Boyd f6ea568f0d firmware: qcom_scm: Reduce locking section for __get_convention()
We shouldn't need to hold this spinlock here around the entire SCM call
into the firmware and back. Instead, we should be able to query the
firmware, potentially in parallel with other CPUs making the same
convention detection firmware call, and then grab the lock to update the
calling convention detected. The convention doesn't change at runtime so
calling into firmware more than once is possibly wasteful but simpler.
Besides, this is the slow path, not the fast path where we've already
detected the convention used.

More importantly, this allows us to add more logic here to workaround
the case where the firmware call to check for availability isn't
implemented in the firmware at all. In that case we can check the
firmware node compatible string and force a calling convention.

Note that we remove the 'has_queried' logic that is repeated twice. That
could lead to the calling convention being printed multiple times to the
kernel logs if the bool is true but __query_convention() is running on
multiple CPUs. We also shorten the time where the lock is held, but we
keep the lock held around the printk because it doesn't seem hugely
important to drop it for that.

Cc: Elliot Berman <eberman@codeaurora.org>
Cc: Brian Masney <masneyb@onstation.org>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Fixes: 9a434cee77 ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210223214539.1336155-3-swboyd@chromium.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-04-06 21:25:23 -05:00
..
arm_scmi firmware: arm_scmi: Fix call site of scmi_notification_exit 2021-01-13 14:30:16 +00:00
broadcom firmware: bcm47xx_sprom: Fix -Wmissing-prototypes warnings 2020-08-17 13:47:28 +02:00
efi clang-lto series for v5.12-rc1 2021-02-23 09:28:51 -08:00
google firmware: google: make coreboot driver's remove callback return void 2021-02-09 12:12:43 +01:00
imx firmware: imx: select SOC_BUS to fix firmware build 2021-01-18 15:49:07 +08:00
meson firmware: meson-sm: enable build as module 2020-10-26 13:36:05 -07:00
psci psci: Add accessor for psci_0_1_function_ids 2020-12-04 08:44:24 +00:00
smccc firmware: smccc: Introduce SMCCC TRNG framework 2021-01-21 17:42:46 +00:00
tegra firmware: tegra: fix strncpy()/strncat() confusion 2020-11-10 20:15:17 +01:00
xilinx ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
arm_scpi.c
arm_sdei.c arm64: sdei: move uaccess logic to arch/arm64/ 2020-12-02 19:46:14 +00:00
dmi-id.c
dmi-sysfs.c firmware: dmi-sysfs: Replace zero-length array with flexible-array member 2020-06-15 23:08:04 -05:00
dmi_scan.c Replace HTTP links with HTTPS ones: DMI/SMBIOS SUPPORT 2020-07-16 11:46:24 +02:00
edd.c
iscsi_ibft.c ibft: Replace zero-length array with flexible-array 2020-06-15 23:08:31 -05:00
iscsi_ibft_find.c
Kconfig firmware: fix a spelling mistake "managament" -> "management" in Kconfig 2020-12-09 15:42:19 +01:00
Makefile firmware: arm_scmi: Enable building as a single module 2020-09-14 07:31:03 +01:00
memmap.c
pcdp.c
pcdp.h firmware: pcdp: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
qcom_scm-legacy.c
qcom_scm-smc.c firmware: qcom_scm: Reduce locking section for __get_convention() 2021-04-06 21:25:23 -05:00
qcom_scm.c firmware: qcom_scm: Reduce locking section for __get_convention() 2021-04-06 21:25:23 -05:00
qcom_scm.h firmware: qcom_scm: Reduce locking section for __get_convention() 2021-04-06 21:25:23 -05:00
qemu_fw_cfg.c fw_cfg: Add support for parisc architecture 2020-10-15 08:10:37 +02:00
raspberrypi.c firmware: fix spelling typo of 'wtih' 2020-11-14 00:23:55 +01:00
scpi_pm_domain.c
stratix10-rsu.c firmware: stratix10-rsu: fix warnings 2020-07-02 14:48:48 +02:00
stratix10-svc.c firmware: stratix10-svc: extend svc to support new RSU features 2020-07-02 14:48:48 +02:00
ti_sci.c firmware: ti_sci: rm: Remove unused config() from ti_sci_rm_ringacc_ops 2020-11-01 19:38:04 -08:00
ti_sci.h firmware: ti_sci: rm: Add new ops for ring configuration 2020-11-01 19:38:02 -08:00
trusted_foundations.c
turris-mox-rwtm.c firmware: turris-mox-rwtm: support ECDSA signatures via debugfs 2020-07-18 22:35:01 +02:00