diff mbox series

[7/7] arm64: dts: qcom: sm8650: Add hwlock to remoteproc

Message ID 20240516-hwspinlock-bust-v1-7-47a90a859238@quicinc.com (mailing list archive)
State Superseded
Headers show
Series Add support for hwspinlock bust | expand

Commit Message

Chris Lew May 16, 2024, 10:58 p.m. UTC
Add the hwlock property to remoteproc. This enables the remoteproc to
try and bust the smem hwspinlock if the remoteproc has crashed while
holding the hwspinlock.

Signed-off-by: Chris Lew <quic_clew@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sm8650.dtsi | 3 +++
 1 file changed, 3 insertions(+)

Comments

Krzysztof Kozlowski May 22, 2024, 7:27 a.m. UTC | #1
On 17/05/2024 00:58, Chris Lew wrote:
> Add the hwlock property to remoteproc. This enables the remoteproc to
> try and bust the smem hwspinlock if the remoteproc has crashed while
> holding the hwspinlock.
> 
> Signed-off-by: Chris Lew <quic_clew@quicinc.com>
> ---
>  arch/arm64/boot/dts/qcom/sm8650.dtsi | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi
> index 62a6e77730bc..a65a1679f003 100644
> --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi
> @@ -2878,6 +2878,7 @@ remoteproc_mpss: remoteproc@4080000 {
>  
>  			qcom,smem-states = <&smp2p_modem_out 0>;
>  			qcom,smem-state-names = "stop";
> +			hwlocks = <&tcsr_mutex 3>;

lock #3 is used by smem, so this proves you are taking someone else's
lock. I commented on this in the binding, but let's be specific:

NAK, please carry:

Nacked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Bjorn Andersson May 22, 2024, 5:51 p.m. UTC | #2
On Wed, May 22, 2024 at 09:27:29AM +0200, Krzysztof Kozlowski wrote:
> On 17/05/2024 00:58, Chris Lew wrote:
> > Add the hwlock property to remoteproc. This enables the remoteproc to
> > try and bust the smem hwspinlock if the remoteproc has crashed while
> > holding the hwspinlock.
> > 
> > Signed-off-by: Chris Lew <quic_clew@quicinc.com>
> > ---
> >  arch/arm64/boot/dts/qcom/sm8650.dtsi | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi
> > index 62a6e77730bc..a65a1679f003 100644
> > --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi
> > @@ -2878,6 +2878,7 @@ remoteproc_mpss: remoteproc@4080000 {
> >  
> >  			qcom,smem-states = <&smp2p_modem_out 0>;
> >  			qcom,smem-state-names = "stop";
> > +			hwlocks = <&tcsr_mutex 3>;
> 
> lock #3 is used by smem, so this proves you are taking someone else's
> lock.

The lock is a shared resource, it's not "some else's lock".

Regards,
Bjorn

> I commented on this in the binding, but let's be specific:
> 
> NAK, please carry:
> 
> Nacked-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> Best regards,
> Krzysztof
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi
index 62a6e77730bc..a65a1679f003 100644
--- a/arch/arm64/boot/dts/qcom/sm8650.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi
@@ -2878,6 +2878,7 @@  remoteproc_mpss: remoteproc@4080000 {
 
 			qcom,smem-states = <&smp2p_modem_out 0>;
 			qcom,smem-state-names = "stop";
+			hwlocks = <&tcsr_mutex 3>;
 
 			status = "disabled";
 
@@ -5024,6 +5025,7 @@  remoteproc_adsp: remoteproc@30000000 {
 
 			qcom,smem-states = <&smp2p_adsp_out 0>;
 			qcom,smem-state-names = "stop";
+			hwlocks = <&tcsr_mutex 3>;
 
 			status = "disabled";
 
@@ -5183,6 +5185,7 @@  remoteproc_cdsp: remoteproc@32300000 {
 
 			qcom,smem-states = <&smp2p_cdsp_out 0>;
 			qcom,smem-state-names = "stop";
+			hwlocks = <&tcsr_mutex 3>;
 
 			status = "disabled";