* [PATCH] cpufreq: exit() callback is optional
@ 2024-04-12 5:49 Viresh Kumar
[not found] ` <5759bc29.32d04.18ed0ef5037.Coremail.sensor1010@163.com>
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Viresh Kumar @ 2024-04-12 5:49 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
Cc: linux-pm, Vincent Guittot, sensor1010, linux-kernel
The exit() callback is optional and shouldn't be called without checking
a valid pointer first.
Also, we must clear freq_table pointer even if the exit() callback isn't
present.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 66e10a19d76a..fd9c3ed21f49 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1679,10 +1679,13 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy)
*/
if (cpufreq_driver->offline) {
cpufreq_driver->offline(policy);
- } else if (cpufreq_driver->exit) {
- cpufreq_driver->exit(policy);
- policy->freq_table = NULL;
+ return;
}
+
+ if (cpufreq_driver->exit)
+ cpufreq_driver->exit(policy);
+
+ policy->freq_table = NULL;
}
static int cpufreq_offline(unsigned int cpu)
@@ -1740,7 +1743,7 @@ static void cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
}
/* We did light-weight exit earlier, do full tear down now */
- if (cpufreq_driver->offline)
+ if (cpufreq_driver->offline && cpufreq_driver->exit)
cpufreq_driver->exit(policy);
up_write(&policy->rwsem);
--
2.31.1.272.g89b43f80a514
^ permalink raw reply related [flat|nested] 14+ messages in thread[parent not found: <5759bc29.32d04.18ed0ef5037.Coremail.sensor1010@163.com>]
* Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <5759bc29.32d04.18ed0ef5037.Coremail.sensor1010@163.com> @ 2024-04-12 6:24 ` Viresh Kumar [not found] ` <1b53a162.32e95.18ed0fdb13e.Coremail.sensor1010@163.com> 0 siblings, 1 reply; 14+ messages in thread From: Viresh Kumar @ 2024-04-12 6:24 UTC (permalink / raw) To: lizhe; +Cc: rafael, linux-pm, Vincent Guittot, linux-kernel On 12-04-24, 14:12, lizhe wrote: > I was the first one to find this problem, so the patch should be submitted by me. :) This patch doesn't take away any of the work you have done. What you are trying to do is simplify drivers with empty exit callback and the unused return value of the callback. And what I am trying to do is fix a bug in the cpufreq core, which only makes your other patches more acceptable. So no, you never identified the problem this patch is trying to solve. Please don't feel that anyone is trying to take away your hardwork. That's not how things are done here. We appreciate anyone who is spending time to make the kernel better. If I were to take credit of your work, then I would have sent a big patch to fix the exit() callback issue you are trying to solve, with randomly sent patches. -- viresh ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <1b53a162.32e95.18ed0fdb13e.Coremail.sensor1010@163.com>]
* Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <1b53a162.32e95.18ed0fdb13e.Coremail.sensor1010@163.com> @ 2024-04-12 6:32 ` Viresh Kumar [not found] ` <2117690204.533771.1712904398042.JavaMail.root@mail-tracker-145-3ep34-c9h23-5f64cf7787-82gdh> 0 siblings, 1 reply; 14+ messages in thread From: Viresh Kumar @ 2024-04-12 6:32 UTC (permalink / raw) To: gregkh; +Cc: lizhe, rafael, linux-pm, Vincent Guittot, linux-kernel Getting the Cc list back, + Greg. Greg, Looks like another one of those experiments with the community ? :) On 12-04-24, 14:27, lizhe wrote: > You are really disgusting and have no manners at all. This makes people feel disgusted with your company. > > > > ---- Replied Message ---- > | From | Viresh Kumar<viresh.kumar@linaro.org> | > | Date | 04/12/2024 14:24 | > | To | lizhe<sensor1010@163.com> | > | Cc | rafael<rafael@kernel.org>、linux-pm<linux-pm@vger.kernel.org>、Vincent Guittot<vincent.guittot@linaro.org>、linux-kernel<linux-kernel@vger.kernel.org> | > | Subject | Re: [PATCH] cpufreq: exit() callback is optional | > On 12-04-24, 14:12, lizhe wrote: > > I was the first one to find this problem, so the patch should be submitted by me. > > :) > > This patch doesn't take away any of the work you have done. What you are trying > to do is simplify drivers with empty exit callback and the unused return value > of the callback. > > And what I am trying to do is fix a bug in the cpufreq core, which only makes > your other patches more acceptable. > > So no, you never identified the problem this patch is trying to solve. > > Please don't feel that anyone is trying to take away your hardwork. That's not > how things are done here. We appreciate anyone who is spending time to make the > kernel better. > > If I were to take credit of your work, then I would have sent a big patch to fix > the exit() callback issue you are trying to solve, with randomly sent patches. -- viresh ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <2117690204.533771.1712904398042.JavaMail.root@mail-tracker-145-3ep34-c9h23-5f64cf7787-82gdh>]
* Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <2117690204.533771.1712904398042.JavaMail.root@mail-tracker-145-3ep34-c9h23-5f64cf7787-82gdh> @ 2024-04-12 7:57 ` Greg KH [not found] ` <663acff5.349d4.18ed18da6ff.Coremail.sensor1010@163.com> 0 siblings, 1 reply; 14+ messages in thread From: Greg KH @ 2024-04-12 7:57 UTC (permalink / raw) To: lizhe Cc: viresh.kumar, grygorii.strashko, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm On Fri, Apr 12, 2024 at 02:46:25PM +0800, lizhe wrote: > Look at what you've done, it really makes people feel extremely disgusted with your company. Your company will receive a very bad reputation. I think you need to stop now, this is not doing anything productive at all and is not acceptable. greg k-h ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <663acff5.349d4.18ed18da6ff.Coremail.sensor1010@163.com>]
* Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <663acff5.349d4.18ed18da6ff.Coremail.sensor1010@163.com> @ 2024-04-12 9:14 ` Greg KH 2024-04-12 9:23 ` Viresh Kumar 2024-04-12 9:21 ` Viresh Kumar 1 sibling, 1 reply; 14+ messages in thread From: Greg KH @ 2024-04-12 9:14 UTC (permalink / raw) To: lizhe Cc: viresh.kumar, grygorii.strashko, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm On Fri, Apr 12, 2024 at 05:05:05PM +0800, lizhe wrote: > I found it first and submitted it to the main line first. Please be fair and just. Let him withdraw his patch. lore.kernel.org links for this please? ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] cpufreq: exit() callback is optional 2024-04-12 9:14 ` Greg KH @ 2024-04-12 9:23 ` Viresh Kumar 0 siblings, 0 replies; 14+ messages in thread From: Viresh Kumar @ 2024-04-12 9:23 UTC (permalink / raw) To: Greg KH Cc: lizhe, grygorii.strashko, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm On 12-04-24, 11:14, Greg KH wrote: > On Fri, Apr 12, 2024 at 05:05:05PM +0800, lizhe wrote: > > I found it first and submitted it to the main line first. Please be fair and just. Let him withdraw his patch. > > lore.kernel.org links for this please? Yeah, I just posted those in a separate reply. There was some confusion in the beginning and I already acked the concerned patch few hours back. Rafael may apply them later. Not sure why the emails are still coming despite that.. -- viresh ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <663acff5.349d4.18ed18da6ff.Coremail.sensor1010@163.com> 2024-04-12 9:14 ` Greg KH @ 2024-04-12 9:21 ` Viresh Kumar 2024-04-12 10:28 ` Greg KH 1 sibling, 1 reply; 14+ messages in thread From: Viresh Kumar @ 2024-04-12 9:21 UTC (permalink / raw) To: lizhe Cc: Greg KH, grygorii.strashko, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm On 12-04-24, 17:05, lizhe wrote: > I found it first and submitted it to the main line first. Please be fair and just. Let him withdraw his patch. Well, I decided not to reply to your emails anymore but this needs to be clarified a bit now. You sent a lot of patches, over and over again and it was a mess. I saw the this [1] series first and went over to read the code and fixed an issue which I found (by the $subject patch). Later I read your other patch [2], which I Acked roughly two hours back and yes you did send a patch that fixed the problem partially. I never saw it earlier, which is okay and it happens. Despite me giving an Ack to your patch, you have sent half-a-dozen more emails.. Then I posted a newer version of my patch some time back, removing the bits you already fixed [3]. That is all one side of the story. But all the noise you have created here has really demotivated people to review your stuff now. -- Viresh [1] https://lore.kernel.org/all/20240410132132.3526-1-sensor1010@163.com/ [2] https://lore.kernel.org/all/20240411231818.2471-1-sensor1010@163.com/ [3] https://lore.kernel.org/all/68294ce534668c6ab3b71a1b3e6650227c6e1f20.1712911186.git.viresh.kumar@linaro.org/ ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] cpufreq: exit() callback is optional 2024-04-12 9:21 ` Viresh Kumar @ 2024-04-12 10:28 ` Greg KH [not found] ` <28e13fe5.bc4.18ed2962985.Coremail.sensor1010@163.com> 0 siblings, 1 reply; 14+ messages in thread From: Greg KH @ 2024-04-12 10:28 UTC (permalink / raw) To: Viresh Kumar Cc: lizhe, grygorii.strashko, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm On Fri, Apr 12, 2024 at 02:51:08PM +0530, Viresh Kumar wrote: > On 12-04-24, 17:05, lizhe wrote: > > I found it first and submitted it to the main line first. Please be fair and just. Let him withdraw his patch. > > Well, I decided not to reply to your emails anymore but this needs to > be clarified a bit now. > > You sent a lot of patches, over and over again and it was a mess. I > saw the this [1] series first and went over to read the code and fixed > an issue which I found (by the $subject patch). > > Later I read your other patch [2], which I Acked roughly two hours > back and yes you did send a patch that fixed the problem partially. I > never saw it earlier, which is okay and it happens. Despite me giving > an Ack to your patch, you have sent half-a-dozen more emails.. > > Then I posted a newer version of my patch some time back, removing the > bits you already fixed [3]. > > That is all one side of the story. But all the noise you have created > here has really demotivated people to review your stuff now. > > -- > Viresh > > [1] https://lore.kernel.org/all/20240410132132.3526-1-sensor1010@163.com/ > [2] https://lore.kernel.org/all/20240411231818.2471-1-sensor1010@163.com/ > [3] https://lore.kernel.org/all/68294ce534668c6ab3b71a1b3e6650227c6e1f20.1712911186.git.viresh.kumar@linaro.org/ Thanks for the links, I don't see that you did anything wrong here at all. Lizhe, you seem to be confused as to how kernel development works. I suggest you take some time off and read up on how this all is supposed to happen and then work with some local people, in person, to get this figured out first, before submitting changes again. thanks, greg k-h ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <28e13fe5.bc4.18ed2962985.Coremail.sensor1010@163.com>]
* Re:Re:Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <28e13fe5.bc4.18ed2962985.Coremail.sensor1010@163.com> @ 2024-04-12 14:31 ` lizhe 2024-04-12 14:41 ` lizhe 1 sibling, 0 replies; 14+ messages in thread From: lizhe @ 2024-04-12 14:31 UTC (permalink / raw) To: viresh.kumar, Greg KH Cc: grygorii.strashko, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm [-- Attachment #1.1.1: Type: text/plain, Size: 2358 bytes --] HI i will review how it all started. 1. i reported the vulnerability to the maintainer. 2. manitaner replay me 3. i report to main line 4. you reply me 5 . you report to main line You submitted the patch to the mainline after you learned about the vulnerability from the patch I submitted At 2024-04-12 21:54:00, "lizhe" <sensor1010@163.com> wrote: Hi Viresh Kumar please add my name to the signature. because i discovered this vulnerability. please reply me. thanks At 2024-04-12 18:28:56, "Greg KH" <gregkh@linuxfoundation.org> wrote: >On Fri, Apr 12, 2024 at 02:51:08PM +0530, Viresh Kumar wrote: >> On 12-04-24, 17:05, lizhe wrote: >> > I found it first and submitted it to the main line first. Please be fair and just. Let him withdraw his patch. >> >> Well, I decided not to reply to your emails anymore but this needs to >> be clarified a bit now. >> >> You sent a lot of patches, over and over again and it was a mess. I >> saw the this [1] series first and went over to read the code and fixed >> an issue which I found (by the $subject patch). >> >> Later I read your other patch [2], which I Acked roughly two hours >> back and yes you did send a patch that fixed the problem partially. I >> never saw it earlier, which is okay and it happens. Despite me giving >> an Ack to your patch, you have sent half-a-dozen more emails.. >> >> Then I posted a newer version of my patch some time back, removing the >> bits you already fixed [3]. >> >> That is all one side of the story. But all the noise you have created >> here has really demotivated people to review your stuff now. >> >> -- >> Viresh >> >> [1] https://lore.kernel.org/all/20240410132132.3526-1-sensor1010@163.com/ >> [2] https://lore.kernel.org/all/20240411231818.2471-1-sensor1010@163.com/ >> [3] https://lore.kernel.org/all/68294ce534668c6ab3b71a1b3e6650227c6e1f20.1712911186.git.viresh.kumar@linaro.org/ > >Thanks for the links, I don't see that you did anything wrong here at >all. > >Lizhe, you seem to be confused as to how kernel development works. I >suggest you take some time off and read up on how this all is supposed >to happen and then work with some local people, in person, to get this >figured out first, before submitting changes again. > >thanks, > >greg k-h [-- Attachment #1.1.2: Type: text/html, Size: 5554 bytes --] [-- Attachment #1.2: 01.png --] [-- Type: image/png, Size: 348854 bytes --] [-- Attachment #1.3: 08.png --] [-- Type: image/png, Size: 306234 bytes --] [-- Attachment #1.4: 06.png --] [-- Type: image/png, Size: 132311 bytes --] [-- Attachment #1.5: 07.png --] [-- Type: image/png, Size: 170643 bytes --] [-- Attachment #1.6: 09.png --] [-- Type: image/png, Size: 132699 bytes --] [-- Attachment #2: 01.png --] [-- Type: image/png, Size: 348854 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re:Re:Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <28e13fe5.bc4.18ed2962985.Coremail.sensor1010@163.com> 2024-04-12 14:31 ` lizhe @ 2024-04-12 14:41 ` lizhe 2024-04-22 11:21 ` shuah 1 sibling, 1 reply; 14+ messages in thread From: lizhe @ 2024-04-12 14:41 UTC (permalink / raw) To: viresh.kumar, Greg KH, torvalds Cc: grygorii.strashko, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm [-- Attachment #1.1.1: Type: text/plain, Size: 2494 bytes --] Let's both take a step back and add my signature to the patch, since I was the one who discovered and reported the vulnerability. HI i will review how it all started. 1. i reported the vulnerability to the maintainer. 2. manitaner replay me 3. i report to main line 4. you reply me 5 . you report to main line You submitted the patch to the mainline after you learned about the vulnerability from the patch I submitted At 2024-04-12 21:54:00, "lizhe" <sensor1010@163.com> wrote: Hi Viresh Kumar please add my name to the signature. because i discovered this vulnerability. please reply me. thanks At 2024-04-12 18:28:56, "Greg KH" <gregkh@linuxfoundation.org> wrote: >On Fri, Apr 12, 2024 at 02:51:08PM +0530, Viresh Kumar wrote: >> On 12-04-24, 17:05, lizhe wrote: >> > I found it first and submitted it to the main line first. Please be fair and just. Let him withdraw his patch. >> >> Well, I decided not to reply to your emails anymore but this needs to >> be clarified a bit now. >> >> You sent a lot of patches, over and over again and it was a mess. I >> saw the this [1] series first and went over to read the code and fixed >> an issue which I found (by the $subject patch). >> >> Later I read your other patch [2], which I Acked roughly two hours >> back and yes you did send a patch that fixed the problem partially. I >> never saw it earlier, which is okay and it happens. Despite me giving >> an Ack to your patch, you have sent half-a-dozen more emails.. >> >> Then I posted a newer version of my patch some time back, removing the >> bits you already fixed [3]. >> >> That is all one side of the story. But all the noise you have created >> here has really demotivated people to review your stuff now. >> >> -- >> Viresh >> >> [1] https://lore.kernel.org/all/20240410132132.3526-1-sensor1010@163.com/ >> [2] https://lore.kernel.org/all/20240411231818.2471-1-sensor1010@163.com/ >> [3] https://lore.kernel.org/all/68294ce534668c6ab3b71a1b3e6650227c6e1f20.1712911186.git.viresh.kumar@linaro.org/ > >Thanks for the links, I don't see that you did anything wrong here at >all. > >Lizhe, you seem to be confused as to how kernel development works. I >suggest you take some time off and read up on how this all is supposed >to happen and then work with some local people, in person, to get this >figured out first, before submitting changes again. > >thanks, > >greg k-h [-- Attachment #1.1.2: Type: text/html, Size: 6379 bytes --] [-- Attachment #1.2: 01.png --] [-- Type: image/png, Size: 348854 bytes --] [-- Attachment #1.3: 08.png --] [-- Type: image/png, Size: 306234 bytes --] [-- Attachment #1.4: 06.png --] [-- Type: image/png, Size: 132311 bytes --] [-- Attachment #1.5: 07.png --] [-- Type: image/png, Size: 170643 bytes --] [-- Attachment #1.6: 09.png --] [-- Type: image/png, Size: 132699 bytes --] [-- Attachment #2: 01.png --] [-- Type: image/png, Size: 348854 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Re:Re:Re: [PATCH] cpufreq: exit() callback is optional 2024-04-12 14:41 ` lizhe @ 2024-04-22 11:21 ` shuah [not found] ` <5c601757.54f80.18f05956113.Coremail.sensor1010@163.com> 0 siblings, 1 reply; 14+ messages in thread From: shuah @ 2024-04-22 11:21 UTC (permalink / raw) To: lizhe Cc: grygorii.strashko, viresh.kumar, Greg KH, torvalds, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm, Shuah Khan Hi Lizhe, On 4/12/24 08:41, lizhe wrote: > > Let's both take a step back and add my signature to the patch, > since I was the one who discovered and reported the vulnerability. > > You might have discovered the vulnerability and sent in a patch. After that, it is totally up to the maintainer to decide to accept or reject the patch. Developers can't demand their patches to be reviewed and/or accepted. They can request a review and inclusion if maintainer deems it acceptable. In this email thread, I can see that maintainers and developers have been advising you to understand the kernel development process. Refer to the following document to understand the process: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst Refer to the following Contributor Covenant Code of Conduct to understand the code of conduct the Linux kernel community abides by: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/code-of-conduct.rst thanks, -- Shuah (On behalf of the Code of Conduct Committee) ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <5c601757.54f80.18f05956113.Coremail.sensor1010@163.com>]
* Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <5c601757.54f80.18f05956113.Coremail.sensor1010@163.com> @ 2024-05-03 21:30 ` Shuah Khan 0 siblings, 0 replies; 14+ messages in thread From: Shuah Khan @ 2024-05-03 21:30 UTC (permalink / raw) To: lizhe, shuah Cc: grygorii.strashko, viresh.kumar, Greg KH, torvalds, gregory.clement, grant.likely, bsegall, broonie, bristot, brgl, f.fainelli, fancer.lancer, festevam, Finn Thain, rafael, linux-pm, Shuah Khan On 4/22/24 05:33, lizhe wrote: > The maintainer's obvious robbery behavior. > I submitted patches to the main branch. After receiving them, the maintainer submitted patches again, and the patches contained the patches I submitted. > That is to say, the patches submitted by the maintainer included mine. It is the maintainer who failed to follow the rules. > What's wrong with me submitting patches to the main branch according to the rules! > This is the last email I will be sending to you. It doesn't appear you are willing to engage with the kernel community in a productive and constructive manner. > Refer to the following document to understand the process: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst> > > Refer to the following Contributor Covenant Code of Conduct to understand the > code of conduct the Linux kernel community abides by: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/code-of-conduct.rst <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/code-of-conduct.rst> > -- thanks, Shuah (On behalf of the Code of Conduct Committee) ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <7bd5d6c1.32db8.18ed0f5e6c3.Coremail.sensor1010@163.com>]
* Re: [PATCH] cpufreq: exit() callback is optional [not found] ` <7bd5d6c1.32db8.18ed0f5e6c3.Coremail.sensor1010@163.com> @ 2024-04-12 6:27 ` Viresh Kumar 0 siblings, 0 replies; 14+ messages in thread From: Viresh Kumar @ 2024-04-12 6:27 UTC (permalink / raw) To: lizhe; +Cc: rafael, linux-pm, Vincent Guittot, linux-kernel On 12-04-24, 14:19, lizhe wrote: > Why did you do that? Why did you plagiarize others' achievements? Is this the style of Linaro? Even if your changes make sense, the discussions needs to be healthy. I am a co-maintainer of the cpufreq subsystem and its mine and Rafael's responsibility to keep things moving in the right direction. This patch fixes a issue you never mentioned over LKML. Lets not make this awkward, it won't help anyone. Thanks. -- viresh ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] cpufreq: exit() callback is optional 2024-04-12 5:49 [PATCH] cpufreq: exit() callback is optional Viresh Kumar [not found] ` <5759bc29.32d04.18ed0ef5037.Coremail.sensor1010@163.com> [not found] ` <7bd5d6c1.32db8.18ed0f5e6c3.Coremail.sensor1010@163.com> @ 2024-04-12 11:08 ` Rafael J. Wysocki 2 siblings, 0 replies; 14+ messages in thread From: Rafael J. Wysocki @ 2024-04-12 11:08 UTC (permalink / raw) To: Viresh Kumar Cc: Rafael J. Wysocki, linux-pm, Vincent Guittot, sensor1010, linux-kernel On Fri, Apr 12, 2024 at 7:49 AM Viresh Kumar <viresh.kumar@linaro.org> wrote: > > The exit() callback is optional and shouldn't be called without checking > a valid pointer first. > > Also, we must clear freq_table pointer even if the exit() callback isn't > present. > > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> > --- > drivers/cpufreq/cpufreq.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 66e10a19d76a..fd9c3ed21f49 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -1679,10 +1679,13 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy) > */ > if (cpufreq_driver->offline) { > cpufreq_driver->offline(policy); > - } else if (cpufreq_driver->exit) { > - cpufreq_driver->exit(policy); > - policy->freq_table = NULL; > + return; > } > + > + if (cpufreq_driver->exit) > + cpufreq_driver->exit(policy); > + > + policy->freq_table = NULL; > } > > static int cpufreq_offline(unsigned int cpu) > @@ -1740,7 +1743,7 @@ static void cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) > } > > /* We did light-weight exit earlier, do full tear down now */ > - if (cpufreq_driver->offline) > + if (cpufreq_driver->offline && cpufreq_driver->exit) > cpufreq_driver->exit(policy); > > up_write(&policy->rwsem); > -- I have applied this patch (for 6.10 because I don't think it is urgent) because it addresses both issues with missing ->exit() driver callback checks. I honestly don't think it would be better to apply a separate patch for each of them. Thanks! ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-05-03 21:30 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-12 5:49 [PATCH] cpufreq: exit() callback is optional Viresh Kumar
[not found] ` <5759bc29.32d04.18ed0ef5037.Coremail.sensor1010@163.com>
2024-04-12 6:24 ` Viresh Kumar
[not found] ` <1b53a162.32e95.18ed0fdb13e.Coremail.sensor1010@163.com>
2024-04-12 6:32 ` Viresh Kumar
[not found] ` <2117690204.533771.1712904398042.JavaMail.root@mail-tracker-145-3ep34-c9h23-5f64cf7787-82gdh>
2024-04-12 7:57 ` Greg KH
[not found] ` <663acff5.349d4.18ed18da6ff.Coremail.sensor1010@163.com>
2024-04-12 9:14 ` Greg KH
2024-04-12 9:23 ` Viresh Kumar
2024-04-12 9:21 ` Viresh Kumar
2024-04-12 10:28 ` Greg KH
[not found] ` <28e13fe5.bc4.18ed2962985.Coremail.sensor1010@163.com>
2024-04-12 14:31 ` lizhe
2024-04-12 14:41 ` lizhe
2024-04-22 11:21 ` shuah
[not found] ` <5c601757.54f80.18f05956113.Coremail.sensor1010@163.com>
2024-05-03 21:30 ` Shuah Khan
[not found] ` <7bd5d6c1.32db8.18ed0f5e6c3.Coremail.sensor1010@163.com>
2024-04-12 6:27 ` Viresh Kumar
2024-04-12 11:08 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox