Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path
@ 2025-03-03  9:08 Souradeep Chowdhury
  2025-03-03  9:10 ` kernel test robot
  2025-03-13  9:12 ` Souradeep Chowdhury
  0 siblings, 2 replies; 5+ messages in thread
From: Souradeep Chowdhury @ 2025-03-03  9:08 UTC (permalink / raw)
  To: Mathieu Poirier, Bjorn Andersson, linux-remoteproc, linux-kernel
  Cc: stable, Souradeep Chowdhury

Add device awake calls in case of rproc boot and rproc shutdown path.
Currently, device awake call is only present in the recovery path
of remoteproc. If a user stops and starts rproc by using the sysfs
interface, then on pm suspension the firmware loading fails. Keep the
device awake in such a case just like it is done for the recovery path.

Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
---
 drivers/remoteproc/remoteproc_core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index c2cf0d277729..908a7b8f6c7e 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1916,7 +1916,8 @@ int rproc_boot(struct rproc *rproc)
 		pr_err("invalid rproc handle\n");
 		return -EINVAL;
 	}
-
+	
+	pm_stay_awake(rproc->dev.parent);
 	dev = &rproc->dev;
 
 	ret = mutex_lock_interruptible(&rproc->lock);
@@ -1961,6 +1962,7 @@ int rproc_boot(struct rproc *rproc)
 		atomic_dec(&rproc->power);
 unlock_mutex:
 	mutex_unlock(&rproc->lock);
+	pm_relax(rproc->dev.parent);
 	return ret;
 }
 EXPORT_SYMBOL(rproc_boot);
@@ -1991,6 +1993,7 @@ int rproc_shutdown(struct rproc *rproc)
 	struct device *dev = &rproc->dev;
 	int ret = 0;
 
+	pm_stay_awake(rproc->dev.parent);
 	ret = mutex_lock_interruptible(&rproc->lock);
 	if (ret) {
 		dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret);
@@ -2027,6 +2030,7 @@ int rproc_shutdown(struct rproc *rproc)
 	rproc->table_ptr = NULL;
 out:
 	mutex_unlock(&rproc->lock);
+	pm_relax(rproc->dev.parent);
 	return ret;
 }
 EXPORT_SYMBOL(rproc_shutdown);
-- 
2.34.1


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

* Re: [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path
  2025-03-03  9:08 [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path Souradeep Chowdhury
@ 2025-03-03  9:10 ` kernel test robot
  2025-03-13  9:12 ` Souradeep Chowdhury
  1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2025-03-03  9:10 UTC (permalink / raw)
  To: Souradeep Chowdhury; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1

Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path
Link: https://lore.kernel.org/stable/20250303090852.301720-1-quic_schowdhu%40quicinc.com

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




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

* Re: [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path
  2025-03-03  9:08 [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path Souradeep Chowdhury
  2025-03-03  9:10 ` kernel test robot
@ 2025-03-13  9:12 ` Souradeep Chowdhury
  2025-03-13 10:03   ` Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Souradeep Chowdhury @ 2025-03-13  9:12 UTC (permalink / raw)
  To: Mathieu Poirier, Bjorn Andersson, linux-remoteproc, linux-kernel; +Cc: stable

Gentle Reminder.


On 3/3/2025 2:38 PM, Souradeep Chowdhury wrote:
> Add device awake calls in case of rproc boot and rproc shutdown path.
> Currently, device awake call is only present in the recovery path
> of remoteproc. If a user stops and starts rproc by using the sysfs
> interface, then on pm suspension the firmware loading fails. Keep the
> device awake in such a case just like it is done for the recovery path.
>
> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
> ---
>   drivers/remoteproc/remoteproc_core.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index c2cf0d277729..908a7b8f6c7e 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -1916,7 +1916,8 @@ int rproc_boot(struct rproc *rproc)
>   		pr_err("invalid rproc handle\n");
>   		return -EINVAL;
>   	}
> -
> +	
> +	pm_stay_awake(rproc->dev.parent);
>   	dev = &rproc->dev;
>   
>   	ret = mutex_lock_interruptible(&rproc->lock);
> @@ -1961,6 +1962,7 @@ int rproc_boot(struct rproc *rproc)
>   		atomic_dec(&rproc->power);
>   unlock_mutex:
>   	mutex_unlock(&rproc->lock);
> +	pm_relax(rproc->dev.parent);
>   	return ret;
>   }
>   EXPORT_SYMBOL(rproc_boot);
> @@ -1991,6 +1993,7 @@ int rproc_shutdown(struct rproc *rproc)
>   	struct device *dev = &rproc->dev;
>   	int ret = 0;
>   
> +	pm_stay_awake(rproc->dev.parent);
>   	ret = mutex_lock_interruptible(&rproc->lock);
>   	if (ret) {
>   		dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret);
> @@ -2027,6 +2030,7 @@ int rproc_shutdown(struct rproc *rproc)
>   	rproc->table_ptr = NULL;
>   out:
>   	mutex_unlock(&rproc->lock);
> +	pm_relax(rproc->dev.parent);
>   	return ret;
>   }
>   EXPORT_SYMBOL(rproc_shutdown);


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

* Re: [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path
  2025-03-13  9:12 ` Souradeep Chowdhury
@ 2025-03-13 10:03   ` Greg KH
  2025-03-17  6:45     ` Souradeep Chowdhury
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2025-03-13 10:03 UTC (permalink / raw)
  To: Souradeep Chowdhury
  Cc: Mathieu Poirier, Bjorn Andersson, linux-remoteproc, linux-kernel,
	stable

On Thu, Mar 13, 2025 at 02:42:10PM +0530, Souradeep Chowdhury wrote:
> Gentle Reminder.
> 
> 
> On 3/3/2025 2:38 PM, Souradeep Chowdhury wrote:
> > Add device awake calls in case of rproc boot and rproc shutdown path.
> > Currently, device awake call is only present in the recovery path
> > of remoteproc. If a user stops and starts rproc by using the sysfs
> > interface, then on pm suspension the firmware loading fails. Keep the
> > device awake in such a case just like it is done for the recovery path.
> > 
> > Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
> > ---
> >   drivers/remoteproc/remoteproc_core.c | 6 +++++-
> >   1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> > index c2cf0d277729..908a7b8f6c7e 100644
> > --- a/drivers/remoteproc/remoteproc_core.c
> > +++ b/drivers/remoteproc/remoteproc_core.c
> > @@ -1916,7 +1916,8 @@ int rproc_boot(struct rproc *rproc)
> >   		pr_err("invalid rproc handle\n");
> >   		return -EINVAL;
> >   	}
> > -
> > +	
> > +	pm_stay_awake(rproc->dev.parent);
> >   	dev = &rproc->dev;
> >   	ret = mutex_lock_interruptible(&rproc->lock);
> > @@ -1961,6 +1962,7 @@ int rproc_boot(struct rproc *rproc)
> >   		atomic_dec(&rproc->power);
> >   unlock_mutex:
> >   	mutex_unlock(&rproc->lock);
> > +	pm_relax(rproc->dev.parent);
> >   	return ret;
> >   }
> >   EXPORT_SYMBOL(rproc_boot);
> > @@ -1991,6 +1993,7 @@ int rproc_shutdown(struct rproc *rproc)
> >   	struct device *dev = &rproc->dev;
> >   	int ret = 0;
> > +	pm_stay_awake(rproc->dev.parent);
> >   	ret = mutex_lock_interruptible(&rproc->lock);
> >   	if (ret) {
> >   		dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret);
> > @@ -2027,6 +2030,7 @@ int rproc_shutdown(struct rproc *rproc)
> >   	rproc->table_ptr = NULL;
> >   out:
> >   	mutex_unlock(&rproc->lock);
> > +	pm_relax(rproc->dev.parent);
> >   	return ret;
> >   }
> >   EXPORT_SYMBOL(rproc_shutdown);
> 
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

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

* Re: [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path
  2025-03-13 10:03   ` Greg KH
@ 2025-03-17  6:45     ` Souradeep Chowdhury
  0 siblings, 0 replies; 5+ messages in thread
From: Souradeep Chowdhury @ 2025-03-17  6:45 UTC (permalink / raw)
  To: Greg KH
  Cc: Mathieu Poirier, Bjorn Andersson, linux-remoteproc, linux-kernel,
	stable



On 3/13/2025 3:33 PM, Greg KH wrote:
> On Thu, Mar 13, 2025 at 02:42:10PM +0530, Souradeep Chowdhury wrote:
>> Gentle Reminder.
>>
>>
>> On 3/3/2025 2:38 PM, Souradeep Chowdhury wrote:
>>> Add device awake calls in case of rproc boot and rproc shutdown path.
>>> Currently, device awake call is only present in the recovery path
>>> of remoteproc. If a user stops and starts rproc by using the sysfs
>>> interface, then on pm suspension the firmware loading fails. Keep the
>>> device awake in such a case just like it is done for the recovery path.
>>>
>>> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
>>> ---
>>>    drivers/remoteproc/remoteproc_core.c | 6 +++++-
>>>    1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
>>> index c2cf0d277729..908a7b8f6c7e 100644
>>> --- a/drivers/remoteproc/remoteproc_core.c
>>> +++ b/drivers/remoteproc/remoteproc_core.c
>>> @@ -1916,7 +1916,8 @@ int rproc_boot(struct rproc *rproc)
>>>    		pr_err("invalid rproc handle\n");
>>>    		return -EINVAL;
>>>    	}
>>> -
>>> +	
>>> +	pm_stay_awake(rproc->dev.parent);
>>>    	dev = &rproc->dev;
>>>    	ret = mutex_lock_interruptible(&rproc->lock);
>>> @@ -1961,6 +1962,7 @@ int rproc_boot(struct rproc *rproc)
>>>    		atomic_dec(&rproc->power);
>>>    unlock_mutex:
>>>    	mutex_unlock(&rproc->lock);
>>> +	pm_relax(rproc->dev.parent);
>>>    	return ret;
>>>    }
>>>    EXPORT_SYMBOL(rproc_boot);
>>> @@ -1991,6 +1993,7 @@ int rproc_shutdown(struct rproc *rproc)
>>>    	struct device *dev = &rproc->dev;
>>>    	int ret = 0;
>>> +	pm_stay_awake(rproc->dev.parent);
>>>    	ret = mutex_lock_interruptible(&rproc->lock);
>>>    	if (ret) {
>>>    		dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret);
>>> @@ -2027,6 +2030,7 @@ int rproc_shutdown(struct rproc *rproc)
>>>    	rproc->table_ptr = NULL;
>>>    out:
>>>    	mutex_unlock(&rproc->lock);
>>> +	pm_relax(rproc->dev.parent);
>>>    	return ret;
>>>    }
>>>    EXPORT_SYMBOL(rproc_shutdown);
>>
> <formletter>
>
> This is not the correct way to submit patches for inclusion in the
> stable kernel tree.  Please read:
>      https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> for how to do this properly.
>
> </formletter>
Thanks for the instructions, corrected in the next version.


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

end of thread, other threads:[~2025-03-17  6:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03  9:08 [PATCH v1] remoteproc: Add device awake calls in rproc boot and shutdown path Souradeep Chowdhury
2025-03-03  9:10 ` kernel test robot
2025-03-13  9:12 ` Souradeep Chowdhury
2025-03-13 10:03   ` Greg KH
2025-03-17  6:45     ` Souradeep Chowdhury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox