All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Chris Diamand <chris.diamand@arm.com>
Cc: Sudeep Holla <Sudeep.Holla@arm.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Nishanth Menon <nm@ti.com>, Cai Zhiyong <caizhiyong@huawei.com>,
	"cpgs (cpgs@samsung.com)" <cpgs@samsung.com>
Subject: Re: [PATCH] PM / devfreq: Don't delete sysfs group twice
Date: Fri, 16 Dec 2016 15:48:59 +0900	[thread overview]
Message-ID: <58538E5B.60102@samsung.com> (raw)
In-Reply-To: <20161215104147.GA6504@e107465-lin.cambridge.arm.com>

Hi Chris,

On 2016년 12월 15일 19:41, Chris Diamand wrote:
> Hi!
> 
>> As you mentioned, it is right to remain this code in _remove_devfreq()
>> for other case to unregister devfreq device except for devfreq_remove_device().
> 
> Sure, I'll send out another patch with a comment.
> 
> Although, if anyone does unregister devfreq without devfreq_remove_device(),
> the userspace governor will still be broken.
> 
> I wonder if it would be better to fix this in the governor instead, because
> this problem only affects things using sysfs entries. Something like this:
> 
> --- a/drivers/devfreq/governor_userspace.c
> +++ b/drivers/devfreq/governor_userspace.c
> @@ -112,7 +112,13 @@ out:
>  
>  static void userspace_exit(struct devfreq *devfreq)
>  {
> -	sysfs_remove_group(&devfreq->dev.kobj, &dev_attr_group);
> +	/*
> +	 * Remove the sysfs entry, unless this is being called after
> +	 * device_del(), which should have done this already via kobject_del().
> +	 */
> +	if (devfreq->dev.kobj.sd)
> +		sysfs_remove_group(&devfreq->dev.kobj, &dev_attr_group);
> +
>  	kfree(devfreq->data);
>  	devfreq->data = NULL;
>  }
> 
> It's a bit uglier, but would fix it in all cases - what do you think?-- 

I think so too. But, I agree new patch.

Regards,
Chanwoo Choi

  reply	other threads:[~2016-12-16  6:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161213171211epcas3p3ed8807883967daca28b7abe211446739@epcas3p3.samsung.com>
2016-12-13 17:09 ` [PATCH] PM / devfreq: Don't delete sysfs group twice Chris Diamand
2016-12-14  1:37   ` Chanwoo Choi
2016-12-14  1:38   ` Chanwoo Choi
2016-12-14  2:48     ` Chanwoo Choi
2016-12-14  9:29       ` Sudeep Holla
2016-12-14 10:10         ` Chanwoo Choi
     [not found]         ` <172e4f85358b4f4e9206c4a54b5db056@AM4PR0802MB2210.eurprd08.prod.outlook.com>
2016-12-14 11:32           ` Chris Diamand
2016-12-14 13:48             ` Chanwoo Choi
     [not found]             ` <7a342ead78be4f32a4a37b541fde412b@AM4PR0802MB2210.eurprd08.prod.outlook.com>
2016-12-15 10:41               ` Chris Diamand
2016-12-16  6:48                 ` Chanwoo Choi [this message]
     [not found]                 ` <f4620f8efbf247119640470ec12810fe@AM4PR0802MB2210.eurprd08.prod.outlook.com>
2016-12-16 19:09                   ` [PATCH v2] " Chris Diamand
2016-12-16  2:17               ` Re: [PATCH] " MyungJoo Ham
     [not found] <CGME20161213170941epcas2p1267d3da4c7034777c8de117ed3c0f9fe@epcas2p1.samsung.com>
2016-12-14  0:45 ` MyungJoo Ham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58538E5B.60102@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=Sudeep.Holla@arm.com \
    --cc=caizhiyong@huawei.com \
    --cc=chris.diamand@arm.com \
    --cc=cpgs@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=nm@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.