Commit Graph

974110 Commits

Author SHA1 Message Date
Elliot Berman
21c713f8e8 FROMLIST: BACKPORT: Kbuild: Support nested composite objects
Kbuild composite objects only supports one level of composite objects.
That is, a composite object may only be composed of real compilable
source files.

As a simple example, the following Kbuild description is now supported:

bar-a-y := a/bar0.o a/bar1.o
bar-b-y := b/bar2.o b/bar3.o

foo-objs := bar-a.o bar-b.o

obj-m += foo.o

Add such support by recursively searching for composite objects and
listing them in $(multi-used-*) and $(real-obj-*).

Signed-off-by: Elliot Berman <eberman@codeaurora.org>

Bug: 175420575
Change-Id: I08880422bc462c38b80f1a8bd85498250898c85e
Link: https://lore.kernel.org/linux-kbuild/1611343638-28206-3-git-send-email-eberman@codeaurora.org/
[eberman@codeaurora.org: Fix compile error so that multi-search does not
 recurse when foo-y contains foo.o]
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2021-03-03 15:45:49 -08:00
Elliot Berman
e52f4d9d2d FROMGIT: Kbuild: Make composite object searching more generic
Reduce repeated logic around expanding composite objects.

Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Bug: 175420575
Change-Id: I2e28126544c10c3d45bbe31c8a56efca2659d988
(cherry picked from commit 1c3fae740aabaeb4d6b4174fc189592eba1b77d0
 https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2021-03-03 15:45:49 -08:00
Elliot Berman
99b31ce046 Revert "ANDROID: kbuild: simplify cmd_mod"
This reverts commit 631b20dd6c ("ANDROID: kbuild: simplify cmd_mod")
since this causes regression in how Kbuild handles dependencies.

Bug: 175420575
Change-Id: I162eedf19357287c5ab9840ed84081d071aa320b
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2021-03-03 15:45:48 -08:00
Elliot Berman
ba0368ed3a Revert "ANDROID: kbuild: handle excessively long argument lists"
This reverts commit f50aeaf27c ("ANDROID: kbuild: handle excessively
long argument lists") since it causes regression in how kbuild handles
dependencies.

Bug: 175420575
Change-Id: I5ed5e883e7b0886dee8491dd888aa82d42452e79
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2021-03-03 15:45:48 -08:00
Lukas Bulwahn
0d34ce8aa7 UPSTREAM: fs: anon_inodes: rephrase to appropriate kernel-doc
Commit e7e832ce6fa7 ("fs: add LSM-supporting anon-inode interface") adds
more kerneldoc description, but also a few new warnings on
anon_inode_getfd_secure() due to missing parameter descriptions.

Rephrase to appropriate kernel-doc for anon_inode_getfd_secure().

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
(cherry picked from commit 365982aba1f264dba26f0908700d62bfa046918c)

Bug: 160737021
Bug: 169683130
Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>
Change-Id: I7b8882d9da9ac37bc285dfb753bbe9ddf1f9fd04
2021-03-03 16:18:33 +00:00
Ray Chi
0fc375dc14 FROMGIT: usb: dwc3: document usb_psy in struct dwc3
The new struct member was added to struct dwc3, but
a documentation was missing:

drivers/usb/dwc3/core.h:1273: warning: Function parameter or member 'usb_psy' not described in 'dwc3'

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ray Chi <raychi@google.com>
Link: https://lore.kernel.org/r/20210303095802.2801733-1-raychi@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5e17812c22bcd65fa9202595eef4bbf8fa814144
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I666941ff5927cee36024188d6277585aa94c8032
2021-03-03 14:53:08 +01:00
Colin Ian King
af93035b6a FROMGIT: usb: dwc3: Fix dereferencing of null dwc->usb_psy
Currently the null check logic on dwc->usb_psy is inverted as it allows
calls to power_supply_put with a null dwc->usb_psy causing a null
pointer dereference. Fix this by removing the ! operator.

Addresses-Coverity: ("Dereference after null check")
Fixes: 59fa3def35de ("usb: dwc3: add a power supply for current control")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210303095826.6143-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d05a12f0478cbae41f26f62af767e86bd550ffb9
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3c6183dc33f17affe0136db30151508785dd4e6e
2021-03-03 14:53:08 +01:00
Qais Yousef
ab6e10de9d ANDROID: cgroup/cpuset: Fix suspicous RCU usage WARNING
task_cs() is called from cpuset_cpus_allowed_fallback() without
holding the read_rcu_lock() causing the below splat.

Fix by holding the rcu_read_lock().

[    0.090199] =============================
[    0.090399] WARNING: suspicious RCU usage
[    0.090600] 5.10.19-00939-gc3bf09a68b63-dirty #368 Not tainted
[    0.090837] -----------------------------
[    0.091000] include/linux/cgroup.h:494 suspicious rcu_dereference_check() usage!
[    0.091246]
[    0.091246] other info that might help us debug this:
[    0.091246]
[    0.091499]
[    0.091499] rcu_scheduler_active = 1, debug_locks = 1
[    0.091738] 4 locks held by swapper/0/1:
[    0.091902]  #0: ffff800014e3f510 (cpu_add_remove_lock){+.+.}-{3:3}, at: cpu_up+0x100/0x190
[    0.092726]  #1: ffff800014e3f6b0 (cpu_hotplug_lock){++++}-{0:0}, at: _cpu_up+0x4c/0x1c8
[    0.093540]  #2: ffff800014e47478 (smpboot_threads_lock){+.+.}-{3:3}, at: smpboot_create_threads+0x34/0xc0
[    0.094399]  #3: ffff0008001d0878 (&p->pi_lock){....}-{2:2}, at: try_to_wake_up+0x58/0x828
[    0.095199]
[    0.095199] stack backtrace:
[    0.095425] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.10.19-00939-gc3bf09a68b63-dirty #368
[    0.095670] Hardware name: Foundation-v8A (DT)
[    0.095834] Call trace:
[    0.096099]  dump_backtrace+0x0/0x1a8
[    0.096353]  show_stack+0x18/0x68
[    0.096571]  dump_stack+0xf8/0x168
[    0.096817]  lockdep_rcu_suspicious+0xe4/0xf8
[    0.097063]  cpuset_cpus_allowed_fallback+0x184/0x1f8
[    0.097299]  select_fallback_rq+0x24c/0x2c0
[    0.097526]  try_to_wake_up+0x1e4/0x828
[    0.097740]  wake_up_process+0x18/0x28
[    0.097999]  kthread_park+0x74/0xc8
[    0.098209]  __smpboot_create_thread.part.0+0x90/0x168
[    0.098486]  smpboot_create_threads+0x84/0xc0
[    0.098699]  cpuhp_invoke_callback+0xe8/0xe50
[    0.098947]  _cpu_up+0xe0/0x1c8
[    0.099126]  cpu_up+0x120/0x190
[    0.099399]  bringup_nonboot_cpus+0x94/0xd0
[    0.099659]  smp_init+0x30/0x8c
[    0.099873]  kernel_init_freeable+0x1d4/0x328
[    0.100099]  kernel_init+0x14/0x118
[    0.100339]  ret_from_fork+0x10/0x34

Bug: 178507149
Fixes: 210463b39c ("FROMLIST: cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1")
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: Ib7688e7d0c37cbf119d806ce79157a467b9e35f6
2021-03-03 09:02:19 +00:00
Michael Specter
e6ceb1881c ANDROID: Adding kprobes build configs for Cuttlefish
Bug: 181054145
Change-Id: Ibb1362479469eae9c294f71a483e500db05b04e1
Signed-off-by: Michael Specter <mikespecter@google.com>
2021-03-03 02:03:02 +00:00
Cristian Marussi
34de0762fb FROMLIST: firmware: arm_scmi: add dynamic scmi devices creation
Having added the support for SCMI protocols as modules in order to let
vendors extend the SCMI core with their own additions it seems odd to
then force SCMI drivers built on top to use a static device table to
declare their devices since this way any new SCMI drivers addition
would need the core SCMI device table to be updated too.

Remove the static core device table and let SCMI drivers to simply declare
which device/protocol pair they need at initialization time: the core will
then take care to generate such devices dynamically during platform
initialization or at module loading time, as long as the requested
underlying protocol is defined in the DT.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ibe69c2f6169b078ad274d06000dbdcf0aee42901
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:35 -08:00
Cristian Marussi
db15cd2926 FROMLIST: firmware: arm_scmi: add protocol modularization support
Extend SCMI protocols accounting mechanism to address possible module
usage and add the support to possibly define new protocols as loadable
modules.

Keep Standard protocols built into the SCMI core.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I75f2e400c0fe6a0692a1acc2e20f54a3c7336ab7
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:35 -08:00
Cristian Marussi
ee250b6df6 FROMLIST: firmware: arm_scmi: make notify_priv really private
Notification private data is currently accessible via handle->notify_priv;
this data was indeed meant to be private to the notification core support
and not to be accessible by SCMI drivers: make it private hiding it inside
instance descriptor struct scmi_info and accessible only via dedicated
helpers.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ic0a1c0610f9726f3ebde388e685ee20343533d33
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:35 -08:00
Cristian Marussi
bb35ff40d5 FROMLIST: firmware: arm_scmi: cleanup events registration transient code
Remove all the events registration code used to ease the transition to the
new interface based on protocol handles..

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I8470b8cf24ce2e4d004e207a4213003e524f45e5
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:35 -08:00
Cristian Marussi
1b8df55e4f FROMLIST: firmware: arm_scmi: cleanup unused core xfer wrappers
Remove unused core scmi_xfer wrappers now that we have migrated all
protocols to the new interface based on protocol handles.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I9b69f34ecb7630da9cc3f4f33ff68e6016deb690
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:35 -08:00
Cristian Marussi
d09db08be5 FROMLIST: firmware: arm_scmi: cleanup legacy protocol init code
Now that all protocols and drivers have been ported to the new interface
based on protocol handles and get/put operations, remove all the legacy
transient initialization code.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ic0870f5d5ee520aa9ba126d83e0adcdabda98fdf
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:34 -08:00
Cristian Marussi
8e441da50f FROMLIST: firmware: arm_scmi: make references to handle const
Now that all the protocol private variable data have been moved out of
struct scmi_handle, mark all of its references as const.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I90fb65928da4ec2e4e8043ac5d2179fdaf5fa705
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:34 -08:00
Cristian Marussi
30da353917 FROMLIST: firmware: arm_scmi: remove legacy scmi_voltage_ops protocol interface
Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I9984ae75fb216fc2080d6351087807a01d76d884
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:34 -08:00
Cristian Marussi
f473ac3b66 FROMLIST: regulator: scmi: port driver to the new scmi_voltage_proto_ops interface
Port driver to the new SCMI Voltage interface based on protocol handles
and common devm_get_ops().

Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Mark Brown <broonie@kernel.org>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ieacb5b40cd696fdbec0d4b052cf52c0165dcf792
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:34 -08:00
Cristian Marussi
b974b071e2 FROMLIST: firmware: arm_scmi: port Voltage protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->voltage_ops still
around to ease transition.

Remove handle->voltage_priv now unused.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I3a0c415891792c46bc94179f063068fe913efe5f
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:34 -08:00
Cristian Marussi
b75183098d FROMLIST: firmware: arm_scmi: port SystemPower protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations.

Remove handle->system_priv now unused.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I0cc9e9735f5bc81af29dc483e5aaa6c3467a65bb
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:34 -08:00
Cristian Marussi
aa063a1bd2 FROMLIST: firmware: arm_scmi: remove legacy scmi_sensor_ops protocol interface
Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I6e463c6e080542d664483250bfe1b691cf458d42
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:33 -08:00
Cristian Marussi
efe20430de FROMLIST: hwmon: (scmi) port driver to the new scmi_sensor_proto_ops interface
Port driver to the new SCMI Sensor interface based on protocol handles
and common devm_get_ops().

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Id42bb46e2f83d9389407836c6d154467a68d847e
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:33 -08:00
Cristian Marussi
5d63c651d6 FROMLIST: firmware: arm_scmi: port Sensor protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->sensor_ops still
around to ease transition.

Remove handle->sensor_priv now unused.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I5928b7dfa0828139c9c4edf81169ea875119ebc6
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:33 -08:00
Cristian Marussi
7552e331c6 FROMLIST: firmware: arm_scmi: remove legacy scmi_reset_ops protocol interface
Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I6d7ba8b4ab0383a4fff8c4057a7249f24f2ac453
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:33 -08:00
Cristian Marussi
b2fc2b3791 FROMLIST: reset: reset-scmi: port driver to the new scmi_reset_proto_ops interface
Port driver to the new SCMI Reset interface based on protocol handles
and common devm_get_ops().

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I245669aea9d2719b3008905d2428cbf62a9cf974
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:33 -08:00
Cristian Marussi
ee69aeba56 FROMLIST: firmware: arm_scmi: port Reset protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->reset_ops still
around to ease transition.

Remove handle->reset_priv now unused.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Iaf3ded6b344194dcfc4fcef5fc5cbadb6f8da07c
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:32 -08:00
Cristian Marussi
cf6cde9f1d FROMLIST: firmware: arm_scmi: remove legacy scmi_clk_ops protocol interface
Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I8deb2f967d9333bb6f6cf88fb1bb4f7aed622608
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:32 -08:00
Cristian Marussi
bcd627f631 FROMLIST: clk: scmi: port driver to the new scmi_clk_proto_ops interface
Port driver to the new SCMI Clock interface based on protocol handles
and common devm_get_ops().

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ieea7fd7fb8536c54c90ed19717a8a6239252482b
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:32 -08:00
Cristian Marussi
1d2b863ec9 FROMLIST: firmware: arm_scmi: port Clock protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->clk_ops still
around to ease transition.

Remove handle->clock_priv now unused.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I57fffd97027470f96ffde4222ea997b67285207d
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:32 -08:00
Cristian Marussi
478ad998ea FROMLIST: firmware: arm_scmi: remove legacy scmi_power_ops protocol interface
Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I2b5d3129ca54b5eae810682a5fbd9ca2fe49c9f7
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:32 -08:00
Cristian Marussi
b3498e7475 FROMLIST: firmware: arm_scmi: port GenPD driver to the new scmi_power_proto_ops interface
Port driver to the new SCMI Power interface based on protocol handles
and common devm_get_ops().

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I400f0356b880711875713054fd9330c7fd97f7c7
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:32 -08:00
Cristian Marussi
ec2e9785ce FROMLIST: firmware: arm_scmi: port Power protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->power_ops still
around to ease transition.

Remove handle->power_priv now unused.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Iaaaa1094d8cff6eec7ea6a21cbf0be9dbaa6fb32
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:31 -08:00
Cristian Marussi
6ffe326ac2 FROMLIST: firmware: arm_scmi: remove legacy scmi_perf_ops protocol interface
Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ifd74693644daae8e0aa1ee5997cdb4edf1ed8460
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:31 -08:00
Cristian Marussi
8b0d407157 FROMLIST: cpufreq: scmi: port driver to the new scmi_perf_proto_ops interface
Port driver to the new SCMI Perf interface based on protocol handles
and common devm_get_ops().

Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Id27af751053ba5f289a3989fdaa6cd28e8e2fa66
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:31 -08:00
Cristian Marussi
213ea76908 FROMLIST: firmware: arm_scmi: port Perf protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->perf_ops still
around to ease transition.

Remove handle->perf_priv now unused.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ia8d5dc1c40c392df41e19873064900f681588a9c
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:31 -08:00
Cristian Marussi
59d6bfe64f FROMLIST: firmware: arm_scmi: port Base protocol to new interface
Port Base protocol to new protocol handles based interface.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I57264cc7d4708e513ae85b69099bf32a274b0e16
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:31 -08:00
Cristian Marussi
f4423d3944 FROMLIST: firmware: arm_scmi: add helper to access revision area memory
Add an helper to grab, from a protocol handle, the handle common memory
area allocated to store SCMI version data which is exposed on sysfs.
Such helper will be needed by SCMI Base protocol initialization once it
will be moved to new protocol handles scheme.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ic1d9a6c0b7940abfc7e370c0d955aae83c449c6a
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:31 -08:00
Cristian Marussi
a3433ea580 FROMLIST: firmware: arm_scmi: add new protocol handle core xfer ops
Add new core SCMI xfer operations based on protocol handles to enable
protocols to builds and send their own protocol specific messages.

Keep old original scmi_xfer_ operations interface as wrappers around the
new interface in order to let coexist old and new interfaces to ease
protocol by protocol migration.

In order to support such migration the above wrappers and some additional
transient code is also introduced in this commit: it will be later removed
as a whole once the full migration of protocols and SCMI drivers will have
been completed.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ia2a11c4f20573f9185e591625faa017883857b55
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:30 -08:00
Cristian Marussi
a0a8e0f761 FROMLIST: firmware: arm_scmi: convert events registration to protocol handles
Convert refactored events registration routines to use protocol handles.

In order to maintain bisectability and to allow protocols and drivers
to be later ported to the new protocol handle interface one by one,
introduce here also some transient code and typing that will be removed
later in order to ease such transition.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ic74cc4576b9189c0fff8968b8063a86375bb7ae7
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:30 -08:00
Cristian Marussi
834134abe6 FROMLIST: firmware: arm_scmi: refactor events registration
Add a new refactored protocol events registration helper and invoke it
from the centralized initialization process triggered by get_ops() and
friends.

Add a .get_num_sources as a new optional callback amongst protocol events
operations; finally remove events registration call-sites from within the
legacy protocol init routines.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ib875eb3ec6be086c7d02175a6ff3742eb112026e
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:30 -08:00
Cristian Marussi
0c203b198e FROMLIST: firmware: arm_scmi: introduce new devres notification ops
Expose to the SCMI drivers a new alternative devres managed notifications
API based on protocol handles.

All drivers still keep using the old API, no functional change.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I3867be1ada472e5d09335cb8be25cbcac84763b1
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:30 -08:00
Cristian Marussi
d25dc33d27 FROMLIST: firmware: arm_scmi: make notifications aware of protocols users
Account for any active registered notifier against the proper related
protocol; do not consider pending event handlers, only active handlers
will concur to protocol usage accounting.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ic705bf7ccf5dfbd46f687c467a7597ba141ef04e
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:30 -08:00
Cristian Marussi
4225eb5ab1 FROMLIST: firmware: arm_scmi: add devm_acquire_protocol helper
Add a method to get hold of a protocol, causing it to be initialized and
its resource accounting updated, without getting access to its operations
and handle.

Some protocols, like SCMI SystemPower, do not expose any protocol ops to
the Kernel OSPM agent but still need to be at least initialized: this
helper avoids the need to invoke a full devm_get_protocol() only to get
the protocol initialized while throwing away unused the protocol ops and
handle.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ic40ef47b4133e761db8eb3e93d00ab6b7c3c2fb8
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:29 -08:00
Cristian Marussi
bfacf9cff5 FROMLIST: firmware: arm_scmi: introduce devres get/put protocols operations
Expose to the SCMI drivers a new devres managed common protocols API based
on generic get/put methods and protocol handles.

All drivers still keep using the old API, no functional change.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Icd8d74fb4b40318f0acfcd882728d1ea1f33f363
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:29 -08:00
Cristian Marussi
bd376903a5 FROMLIST: firmware: arm_scmi: introduce protocol handle definitions
Add basic protocol handles definitions and private data helpers support.

A protocol handle identifies a protocol instance initialized against a
specific handle; it embeds all the references to the core SCMI xfer methods
that will be needed by a protocol implementation to build and send its own
protocol specific messages using common core methods.

As such, in the interface, a protocol handle will be passed down from the
core to the protocol specific initialization callback at init time.

Anyway at this point only definitions are introduced, all protocols
initialization code and SCMI drivers probing is still based on the old
interface, so no functional change.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I30e1f6ca36c660ef887c263db13031c077c815db
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:29 -08:00
Cristian Marussi
cf516fb6f7 FROMLIST: firmware: arm_scmi: review protocol registration interface
Extend common protocol registration routines and provide some new generic
protocols get/put helpers that can track protocols usage and automatically
perform the proper initialization and de-initialization on demand when
required.

Convert all standard protocols to use this new registration scheme while
keeping them all still using the usual initialization logic bound to SCMI
devices probing.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I8d40f1f25f8d007f1fa4788f432a7ffeb012e1c2
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:29 -08:00
Cristian Marussi
f1f7d0dfe6 UPSTREAM: firmware: arm_scmi: Fix call site of scmi_notification_exit
Call scmi_notification_exit() only when SCMI platform driver instance has
been really successfully removed.

Link: https://lore.kernel.org/r/20210112191326.29091-1-cristian.marussi@arm.com
Fixes: 6b8a69131d ("firmware: arm_scmi: Enable notification core")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
[sudeep.holla: Move the call outside the list mutex locking]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

(cherry picked from commit a90b6543bf062d65292b2c76f1630507d1c9d8ec)
Bug: 171409184
Change-Id: I163c317178e00a9177fc57cce78ffaef1781fa8d
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:29 -08:00
Sudeep Holla
3f910da297 UPSTREAM: MAINTAINERS: Update ARM SCMI entry
Cristian is actively developing new features and more involved than me.
So add Cristian as a designated reviewer. Also add the newly added scmi
regulator driver to the list.

Link: https://lore.kernel.org/r/20210105151945.406093-1-sudeep.holla@arm.com
Cc: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

(cherry picked from commit 6054d97ab512732239391a5c24f044e4f042a062)
Bug: 171409184
Change-Id: I4418377ca19d39f5d30a6c72d6ef91c9caf452e5
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:29 -08:00
Jim Quinlan
3ff2080a11 UPSTREAM: firmware: arm_scmi: Augment SMC/HVC to allow optional interrupt
The SMC/HVC SCMI transport is modified to allow the completion of an
SCMI message to be indicated by an interrupt rather than the return of
the smc/hvc call. This accommodates the existing behavior of the
BrcmSTB SCMI "platform".

Link: https://lore.kernel.org/r/20201222145603.40192-3-jim2101024@gmail.com
Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
[sudeep.holla: added call to reinit_completion, whitespace cleanup, dropped
 irrelavant info in the commit log]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

(cherry picked from commit dd820ee21d5e0795096a6e0e47c0183d96464949)
Bug: 171409184
Change-Id: I0267e59fad1ae7ac17eccb44322f9eebbf13e920
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:28 -08:00
Jim Quinlan
94696ee4a7 UPSTREAM: dt-bindings: arm: Add optional interrupt to smc/hvc SCMI transport
In the normal use of smc/hvc as SCMI transport, the message completion
is indicated by the return of the SMC call. This binding provides for
an optional interrupt named "a2p" which can be used instead to indicate
the completion of a message.

Link: https://lore.kernel.org/r/20201222145603.40192-2-jim2101024@gmail.com
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
[sudeep.holla: minor wording changes to the commit log]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

(cherry picked from commit 99a064fb3a73920262119efead4d5048b7da2f55)
Bug: 171409184
Change-Id: Ib9a89d395e04ad9f74c22d7a0197da9662b7f688
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:28 -08:00