linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode
@ 2022-08-04 13:07 Dmitry Baryshkov
  2022-08-05 14:16 ` Ulf Hansson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2022-08-04 13:07 UTC (permalink / raw)
  To: Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano, Mark Rutland,
	Lorenzo Pieralisi
  Cc: linux-pm, linux-arm-kernel, linux-arm-msm

The function psci_pd_try_set_osi_mode() will print an error if enabling
OSI mode fails. To ease debugging PSCI issues print corresponding
message if switching to PC mode fails too.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
This is a replacement for [1], now moving the warning from
psci_set_osi_mode() callers to the function iself.

https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/

---
 drivers/cpuidle/cpuidle-psci-domain.c | 4 +---
 drivers/firmware/psci/psci.c          | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
index 3db4fca1172b..821984947ed9 100644
--- a/drivers/cpuidle/cpuidle-psci-domain.c
+++ b/drivers/cpuidle/cpuidle-psci-domain.c
@@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void)
 		return false;
 
 	ret = psci_set_osi_mode(true);
-	if (ret) {
-		pr_warn("failed to enable OSI mode: %d\n", ret);
+	if (ret)
 		return false;
-	}
 
 	return true;
 }
diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index cfb448eabdaa..1628f1edef4a 100644
--- a/drivers/firmware/psci/psci.c
+++ b/drivers/firmware/psci/psci.c
@@ -163,6 +163,8 @@ int psci_set_osi_mode(bool enable)
 			PSCI_1_0_SUSPEND_MODE_PC;
 
 	err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
+	if (err < 0)
+		pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
 	return psci_to_linux_errno(err);
 }
 
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode
  2022-08-04 13:07 [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Dmitry Baryshkov
@ 2022-08-05 14:16 ` Ulf Hansson
  2022-08-05 14:19 ` Mark Rutland
  2022-08-05 15:50 ` Sudeep Holla
  2 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2022-08-05 14:16 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Rafael J. Wysocki, Daniel Lezcano, Mark Rutland,
	Lorenzo Pieralisi, linux-pm, linux-arm-kernel, linux-arm-msm

On Thu, 4 Aug 2022 at 15:07, Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
>
> The function psci_pd_try_set_osi_mode() will print an error if enabling
> OSI mode fails. To ease debugging PSCI issues print corresponding
> message if switching to PC mode fails too.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Seems reasonable to me!

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
> This is a replacement for [1], now moving the warning from
> psci_set_osi_mode() callers to the function iself.
>
> https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/
>
> ---
>  drivers/cpuidle/cpuidle-psci-domain.c | 4 +---
>  drivers/firmware/psci/psci.c          | 2 ++
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
> index 3db4fca1172b..821984947ed9 100644
> --- a/drivers/cpuidle/cpuidle-psci-domain.c
> +++ b/drivers/cpuidle/cpuidle-psci-domain.c
> @@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void)
>                 return false;
>
>         ret = psci_set_osi_mode(true);
> -       if (ret) {
> -               pr_warn("failed to enable OSI mode: %d\n", ret);
> +       if (ret)
>                 return false;
> -       }
>
>         return true;
>  }
> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> index cfb448eabdaa..1628f1edef4a 100644
> --- a/drivers/firmware/psci/psci.c
> +++ b/drivers/firmware/psci/psci.c
> @@ -163,6 +163,8 @@ int psci_set_osi_mode(bool enable)
>                         PSCI_1_0_SUSPEND_MODE_PC;
>
>         err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
> +       if (err < 0)
> +               pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
>         return psci_to_linux_errno(err);
>  }
>
> --
> 2.35.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode
  2022-08-04 13:07 [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Dmitry Baryshkov
  2022-08-05 14:16 ` Ulf Hansson
@ 2022-08-05 14:19 ` Mark Rutland
  2022-09-19 11:58   ` Dmitry Baryshkov
  2022-08-05 15:50 ` Sudeep Holla
  2 siblings, 1 reply; 7+ messages in thread
From: Mark Rutland @ 2022-08-05 14:19 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
	Lorenzo Pieralisi, linux-pm, linux-arm-kernel, linux-arm-msm

On Thu, Aug 04, 2022 at 04:07:50PM +0300, Dmitry Baryshkov wrote:
> The function psci_pd_try_set_osi_mode() will print an error if enabling
> OSI mode fails. To ease debugging PSCI issues print corresponding
> message if switching to PC mode fails too.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
> This is a replacement for [1], now moving the warning from
> psci_set_osi_mode() callers to the function iself.
> 
> https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/
> 
> ---
>  drivers/cpuidle/cpuidle-psci-domain.c | 4 +---
>  drivers/firmware/psci/psci.c          | 2 ++
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
> index 3db4fca1172b..821984947ed9 100644
> --- a/drivers/cpuidle/cpuidle-psci-domain.c
> +++ b/drivers/cpuidle/cpuidle-psci-domain.c
> @@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void)
>  		return false;
>  
>  	ret = psci_set_osi_mode(true);
> -	if (ret) {
> -		pr_warn("failed to enable OSI mode: %d\n", ret);
> +	if (ret)
>  		return false;
> -	}
>  
>  	return true;
>  }
> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> index cfb448eabdaa..1628f1edef4a 100644
> --- a/drivers/firmware/psci/psci.c
> +++ b/drivers/firmware/psci/psci.c
> @@ -163,6 +163,8 @@ int psci_set_osi_mode(bool enable)
>  			PSCI_1_0_SUSPEND_MODE_PC;
>  
>  	err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
> +	if (err < 0)
> +		pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
>  	return psci_to_linux_errno(err);
>  }
>  
> -- 
> 2.35.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode
  2022-08-04 13:07 [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Dmitry Baryshkov
  2022-08-05 14:16 ` Ulf Hansson
  2022-08-05 14:19 ` Mark Rutland
@ 2022-08-05 15:50 ` Sudeep Holla
  2 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2022-08-05 15:50 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano, Sudeep Holla,
	Mark Rutland, Lorenzo Pieralisi, linux-pm, linux-arm-kernel,
	linux-arm-msm

On Thu, Aug 04, 2022 at 04:07:50PM +0300, Dmitry Baryshkov wrote:
> The function psci_pd_try_set_osi_mode() will print an error if enabling
> OSI mode fails. To ease debugging PSCI issues print corresponding
> message if switching to PC mode fails too.
>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode
  2022-08-05 14:19 ` Mark Rutland
@ 2022-09-19 11:58   ` Dmitry Baryshkov
  2022-09-21 14:36     ` Sudeep Holla
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Baryshkov @ 2022-09-19 11:58 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
	Lorenzo Pieralisi, linux-pm, linux-arm-kernel, linux-arm-msm

On 05/08/2022 17:19, Mark Rutland wrote:
> On Thu, Aug 04, 2022 at 04:07:50PM +0300, Dmitry Baryshkov wrote:
>> The function psci_pd_try_set_osi_mode() will print an error if enabling
>> OSI mode fails. To ease debugging PSCI issues print corresponding
>> message if switching to PC mode fails too.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> 
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> 
> Mark.

Granted that this patch has been acked by the maintainers of PSCI 
interface, how do I proceed? Should I submit it to Russel's patch 
tracker? Or do PSCI patches land via some other tree?

> 
>> ---
>> This is a replacement for [1], now moving the warning from
>> psci_set_osi_mode() callers to the function iself.
>>
>> https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/
>>
>> ---
>>   drivers/cpuidle/cpuidle-psci-domain.c | 4 +---
>>   drivers/firmware/psci/psci.c          | 2 ++
>>   2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
>> index 3db4fca1172b..821984947ed9 100644
>> --- a/drivers/cpuidle/cpuidle-psci-domain.c
>> +++ b/drivers/cpuidle/cpuidle-psci-domain.c
>> @@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void)
>>   		return false;
>>   
>>   	ret = psci_set_osi_mode(true);
>> -	if (ret) {
>> -		pr_warn("failed to enable OSI mode: %d\n", ret);
>> +	if (ret)
>>   		return false;
>> -	}
>>   
>>   	return true;
>>   }
>> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
>> index cfb448eabdaa..1628f1edef4a 100644
>> --- a/drivers/firmware/psci/psci.c
>> +++ b/drivers/firmware/psci/psci.c
>> @@ -163,6 +163,8 @@ int psci_set_osi_mode(bool enable)
>>   			PSCI_1_0_SUSPEND_MODE_PC;
>>   
>>   	err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
>> +	if (err < 0)
>> +		pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
>>   	return psci_to_linux_errno(err);
>>   }
>>   
>> -- 
>> 2.35.1
>>

-- 
With best wishes
Dmitry


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode
  2022-09-19 11:58   ` Dmitry Baryshkov
@ 2022-09-21 14:36     ` Sudeep Holla
  2022-09-21 14:43       ` Dmitry Baryshkov
  0 siblings, 1 reply; 7+ messages in thread
From: Sudeep Holla @ 2022-09-21 14:36 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Mark Rutland, Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
	Lorenzo Pieralisi, linux-pm, linux-arm-kernel, linux-arm-msm

On Mon, Sep 19, 2022 at 02:58:57PM +0300, Dmitry Baryshkov wrote:
> On 05/08/2022 17:19, Mark Rutland wrote:
> > On Thu, Aug 04, 2022 at 04:07:50PM +0300, Dmitry Baryshkov wrote:
> > > The function psci_pd_try_set_osi_mode() will print an error if enabling
> > > OSI mode fails. To ease debugging PSCI issues print corresponding
> > > message if switching to PC mode fails too.
> > > 
> > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > 
> > Acked-by: Mark Rutland <mark.rutland@arm.com>
> > 
> > Mark.
> 
> Granted that this patch has been acked by the maintainers of PSCI interface,
> how do I proceed? Should I submit it to Russel's patch tracker? Or do PSCI
> patches land via some other tree?
>

Not sure if I mentioned it elsewhere or in v1, we generally ask Arm SoC
team to pick up patches directly as they are always 1-2 and rarely large
set. You need to cc soc@kernel.org for the same.

> > 
> > > ---
> > > This is a replacement for [1], now moving the warning from
> > > psci_set_osi_mode() callers to the function iself.
> > > 
> > > https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/
> > > 
> > > ---
> > >   drivers/cpuidle/cpuidle-psci-domain.c | 4 +---
> > >   drivers/firmware/psci/psci.c          | 2 ++
> > >   2 files changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
> > > index 3db4fca1172b..821984947ed9 100644
> > > --- a/drivers/cpuidle/cpuidle-psci-domain.c
> > > +++ b/drivers/cpuidle/cpuidle-psci-domain.c
> > > @@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void)
> > >   		return false;
> > >   	ret = psci_set_osi_mode(true);
> > > -	if (ret) {
> > > -		pr_warn("failed to enable OSI mode: %d\n", ret);
> > > +	if (ret)
> > >   		return false;
> > > -	}
> > >   	return true;
> > >   }
> > > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> > > index cfb448eabdaa..1628f1edef4a 100644
> > > --- a/drivers/firmware/psci/psci.c
> > > +++ b/drivers/firmware/psci/psci.c
> > > @@ -163,6 +163,8 @@ int psci_set_osi_mode(bool enable)
> > >   			PSCI_1_0_SUSPEND_MODE_PC;
> > >   	err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
> > > +	if (err < 0)
> > > +		pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
> > >   	return psci_to_linux_errno(err);
> > >   }
> > > -- 
> > > 2.35.1
> > > 
> 
> -- 
> With best wishes
> Dmitry
> 

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode
  2022-09-21 14:36     ` Sudeep Holla
@ 2022-09-21 14:43       ` Dmitry Baryshkov
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2022-09-21 14:43 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Mark Rutland, Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
	Lorenzo Pieralisi, linux-pm, linux-arm-kernel, linux-arm-msm

On 21/09/2022 17:36, Sudeep Holla wrote:
> On Mon, Sep 19, 2022 at 02:58:57PM +0300, Dmitry Baryshkov wrote:
>> On 05/08/2022 17:19, Mark Rutland wrote:
>>> On Thu, Aug 04, 2022 at 04:07:50PM +0300, Dmitry Baryshkov wrote:
>>>> The function psci_pd_try_set_osi_mode() will print an error if enabling
>>>> OSI mode fails. To ease debugging PSCI issues print corresponding
>>>> message if switching to PC mode fails too.
>>>>
>>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>>
>>> Acked-by: Mark Rutland <mark.rutland@arm.com>
>>>
>>> Mark.
>>
>> Granted that this patch has been acked by the maintainers of PSCI interface,
>> how do I proceed? Should I submit it to Russel's patch tracker? Or do PSCI
>> patches land via some other tree?
>>
> 
> Not sure if I mentioned it elsewhere or in v1, we generally ask Arm SoC
> team to pick up patches directly as they are always 1-2 and rarely large
> set. You need to cc soc@kernel.org for the same.

Ack, I'll resend v2 cc'ing soc@

> 
>>>
>>>> ---
>>>> This is a replacement for [1], now moving the warning from
>>>> psci_set_osi_mode() callers to the function iself.
>>>>
>>>> https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/
>>>>
>>>> ---
>>>>    drivers/cpuidle/cpuidle-psci-domain.c | 4 +---
>>>>    drivers/firmware/psci/psci.c          | 2 ++
>>>>    2 files changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
>>>> index 3db4fca1172b..821984947ed9 100644
>>>> --- a/drivers/cpuidle/cpuidle-psci-domain.c
>>>> +++ b/drivers/cpuidle/cpuidle-psci-domain.c
>>>> @@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void)
>>>>    		return false;
>>>>    	ret = psci_set_osi_mode(true);
>>>> -	if (ret) {
>>>> -		pr_warn("failed to enable OSI mode: %d\n", ret);
>>>> +	if (ret)
>>>>    		return false;
>>>> -	}
>>>>    	return true;
>>>>    }
>>>> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
>>>> index cfb448eabdaa..1628f1edef4a 100644
>>>> --- a/drivers/firmware/psci/psci.c
>>>> +++ b/drivers/firmware/psci/psci.c
>>>> @@ -163,6 +163,8 @@ int psci_set_osi_mode(bool enable)
>>>>    			PSCI_1_0_SUSPEND_MODE_PC;
>>>>    	err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0);
>>>> +	if (err < 0)
>>>> +		pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err);
>>>>    	return psci_to_linux_errno(err);
>>>>    }
>>>> -- 
>>>> 2.35.1
>>>>
>>
>> -- 
>> With best wishes
>> Dmitry
>>
> 

-- 
With best wishes
Dmitry


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-21 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 13:07 [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Dmitry Baryshkov
2022-08-05 14:16 ` Ulf Hansson
2022-08-05 14:19 ` Mark Rutland
2022-09-19 11:58   ` Dmitry Baryshkov
2022-09-21 14:36     ` Sudeep Holla
2022-09-21 14:43       ` Dmitry Baryshkov
2022-08-05 15:50 ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).