Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-11 Thread Viresh Kumar
On 10-03-21, 23:03, Beata Michalska wrote: > > diff --git a/drivers/opp/core.c b/drivers/opp/core.c > > index c2689386a906..150be4c28c99 100644 > > --- a/drivers/opp/core.c > > +++ b/drivers/opp/core.c > > @@ -1492,7 +1492,11 @@ static struct dev_pm_opp *_opp_get_next(struct > > opp_table *opp_tab

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-10 Thread Beata Michalska
On Wed, Mar 10, 2021 at 02:17:38PM +0530, Viresh Kumar wrote: > On 09-03-21, 12:14, Beata Michalska wrote: > > With the current version, once the _opp_get_next returns opp > > that is the current_opp, the while loop will break, leaving all > > the opps that are on the list after current_opp > > Th

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-10 Thread Viresh Kumar
On 09-03-21, 12:14, Beata Michalska wrote: > With the current version, once the _opp_get_next returns opp > that is the current_opp, the while loop will break, leaving all > the opps that are on the list after current_opp Thanks for your excellent review Beata. I have been missing a lot lately :(

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-09 Thread Beata Michalska
On Tue, Mar 09, 2021 at 10:01:21AM +0530, Viresh Kumar wrote: > On 08-03-21, 18:14, Beata Michalska wrote: > > > -bool _opp_remove_all_static(struct opp_table *opp_table) > > > +/* > > > + * Can't remove the OPP from under the lock, debugfs removal needs to > > > happen > > > + * lock less to avoi

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-08 Thread Viresh Kumar
On 08-03-21, 18:14, Beata Michalska wrote: > > -bool _opp_remove_all_static(struct opp_table *opp_table) > > +/* > > + * Can't remove the OPP from under the lock, debugfs removal needs to > > happen > > + * lock less to avoid circular dependency issues. This must be called > > without > > + * the

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-08 Thread Beata Michalska
; > -8<--------- > > From: Beata Michalska > Date: Thu, 4 Mar 2021 15:07:34 + > Subject: [PATCH] opp: Invalidate current opp when draining the opp list > > The current_opp when set, grabs additional reference on the opp, >

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-08 Thread Viresh Kumar
). Sorry for missing the context completely, I get it now. This is what I have applied instead, please see if it breaks anything or works as expected. -8<- From: Beata Michalska Date: Thu, 4 Mar 2021 15:07:34 +0000 Subject: [PATCH] opp: Invalida

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-05 Thread Beata Michalska
On 3/5/21 4:24 AM, Viresh Kumar wrote: > On 04-03-21, 15:07, Beata Michalska wrote: >> The current_opp when set, grabs additional reference on the opp, >> which is then supposed to be dropped upon releasing the opp table. >> Still both dev_pm_opp_remove_table and dev_pm_opp_remove_all_dynamic >>

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-04 Thread Viresh Kumar
On 04-03-21, 15:07, Beata Michalska wrote: > The current_opp when set, grabs additional reference on the opp, > which is then supposed to be dropped upon releasing the opp table. > Still both dev_pm_opp_remove_table and dev_pm_opp_remove_all_dynamic > will completely drain the OPPs list, including

Re: [PATCH] opp: Invalidate current opp when draining the opp list

2021-03-04 Thread Lukasz Luba
Hi Beata, On 3/4/21 3:07 PM, Beata Michalska wrote: The current_opp when set, grabs additional reference on the opp, which is then supposed to be dropped upon releasing the opp table. Still both dev_pm_opp_remove_table and dev_pm_opp_remove_all_dynamic will completely drain the OPPs list, includ

[PATCH] opp: Invalidate current opp when draining the opp list

2021-03-04 Thread Beata Michalska
The current_opp when set, grabs additional reference on the opp, which is then supposed to be dropped upon releasing the opp table. Still both dev_pm_opp_remove_table and dev_pm_opp_remove_all_dynamic will completely drain the OPPs list, including dropping the additional reference on current_opp. T