Merge tag 'rpi-poe-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/nsaenz...
authorArnd Bergmann <arnd@arndb.de>
Thu, 1 Apr 2021 18:56:49 +0000 (20:56 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 1 Apr 2021 18:56:49 +0000 (20:56 +0200)
Raspberry Pi driver updates for v5.13:
  - Fix-up all RPi firmware drivers so as for unbind to happen in an
    orderly fashion
  - Support for RPi's PoE hat PWM bus

* tag 'rpi-poe-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi:
  pwm: Add Raspberry Pi Firmware based PWM bus
  dt-bindings: pwm: Add binding for RPi firmware PWM bus
  input: raspberrypi-ts: Release firmware handle when not needed
  staging: vchiq: Release firmware handle on unbind
  soc: bcm: raspberrypi-power: Release firmware handle on unbind
  reset: raspberrypi: Release firmware handle on unbind
  gpio: raspberrypi-exp: Release firmware handle on unbind
  clk: bcm: rpi: Release firmware handle on unbind
  firmware: raspberrypi: Introduce devm_rpi_firmware_get()
  firmware: raspberrypi: Keep count of all consumers

Link: https://lore.kernel.org/r/20210322174232.29549-1-nsaenz@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/soc/renesas/rmobile-sysc.c
drivers/tee/optee/Makefile
drivers/tee/optee/call.c
drivers/tee/optee/optee_trace.h [new file with mode: 0644]

index 9046b8c..204e613 100644 (file)
@@ -14,8 +14,6 @@
 #include <linux/delay.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_platform.h>
-#include <linux/platform_device.h>
 #include <linux/pm.h>
 #include <linux/pm_clock.h>
 #include <linux/pm_domain.h>
@@ -344,6 +342,8 @@ static int __init rmobile_init_pm_domains(void)
                        of_node_put(np);
                        break;
                }
+
+               fwnode_dev_initialized(&np->fwnode, true);
        }
 
        put_special_pds();
index 56263ae..3aa33ea 100644 (file)
@@ -6,3 +6,6 @@ optee-objs += rpc.o
 optee-objs += supp.o
 optee-objs += shm_pool.o
 optee-objs += device.o
+
+# for tracing framework to find optee_trace.h
+CFLAGS_call.o := -I$(src)
index 7a77e37..6132cc8 100644 (file)
@@ -14,6 +14,8 @@
 #include <linux/uaccess.h>
 #include "optee_private.h"
 #include "optee_smc.h"
+#define CREATE_TRACE_POINTS
+#include "optee_trace.h"
 
 struct optee_call_waiter {
        struct list_head list_node;
@@ -138,9 +140,11 @@ u32 optee_do_call_with_arg(struct tee_context *ctx, phys_addr_t parg)
        while (true) {
                struct arm_smccc_res res;
 
+               trace_optee_invoke_fn_begin(&param);
                optee->invoke_fn(param.a0, param.a1, param.a2, param.a3,
                                 param.a4, param.a5, param.a6, param.a7,
                                 &res);
+               trace_optee_invoke_fn_end(&param, &res);
 
                if (res.a0 == OPTEE_SMC_RETURN_ETHREAD_LIMIT) {
                        /*
diff --git a/drivers/tee/optee/optee_trace.h b/drivers/tee/optee/optee_trace.h
new file mode 100644 (file)
index 0000000..7c954ee
--- /dev/null
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * optee trace points
+ *
+ * Copyright (C) 2021 Synaptics Incorporated
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM optee
+
+#if !defined(_TRACE_OPTEE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_OPTEE_H
+
+#include <linux/arm-smccc.h>
+#include <linux/tracepoint.h>
+#include "optee_private.h"
+
+TRACE_EVENT(optee_invoke_fn_begin,
+       TP_PROTO(struct optee_rpc_param *param),
+       TP_ARGS(param),
+
+       TP_STRUCT__entry(
+               __field(void *, param)
+               __array(u32, args, 8)
+       ),
+
+       TP_fast_assign(
+               __entry->param = param;
+               BUILD_BUG_ON(sizeof(*param) < sizeof(__entry->args));
+               memcpy(__entry->args, param, sizeof(__entry->args));
+       ),
+
+       TP_printk("param=%p (%x, %x, %x, %x, %x, %x, %x, %x)", __entry->param,
+                 __entry->args[0], __entry->args[1], __entry->args[2],
+                 __entry->args[3], __entry->args[4], __entry->args[5],
+                 __entry->args[6], __entry->args[7])
+);
+
+TRACE_EVENT(optee_invoke_fn_end,
+       TP_PROTO(struct optee_rpc_param *param, struct arm_smccc_res *res),
+       TP_ARGS(param, res),
+
+       TP_STRUCT__entry(
+               __field(void *, param)
+               __array(unsigned long, rets, 4)
+       ),
+
+       TP_fast_assign(
+               __entry->param = param;
+               BUILD_BUG_ON(sizeof(*res) < sizeof(__entry->rets));
+               memcpy(__entry->rets, res, sizeof(__entry->rets));
+       ),
+
+       TP_printk("param=%p ret (%lx, %lx, %lx, %lx)", __entry->param,
+                 __entry->rets[0], __entry->rets[1], __entry->rets[2],
+                 __entry->rets[3])
+);
+#endif /* _TRACE_OPTEE_H */
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE optee_trace
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>