All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: linux-kernel@vger.kernel.org, dbasehore@chromium.org,
	dianders@chromium.org, Chanwoo Choi <cw00.choi@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] CHROMIUM: devfreq: rk3399: Clear edev->dev drvdata before enabling dfi
Date: Fri, 1 Sep 2017 17:47:01 -0700	[thread overview]
Message-ID: <20170902004659.GA105370@google.com> (raw)
In-Reply-To: <20170901235237.18390-1-jeffy.chen@rock-chips.com>

On Sat, Sep 02, 2017 at 07:52:37AM +0800, Jeffy Chen wrote:
> Currently we are using edev->dev drvdata to get rk3399-dmc data, but
> it would be inited to edev in devfreq_event_add_edev.
> 
> So we need to clear the edev->dev drvdata before enabling dfi, to
> prevent dfi from getting the wrong rk3399-dmc data when the irq
> triggered too early.

Your description doesn't match your code. You say you're clearing
evdev->dev driver data but...

> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
> 
>  drivers/devfreq/rk3399_dmc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
> index 1b89ebbad02c..12f9f03f349f 100644
> --- a/drivers/devfreq/rk3399_dmc.c
> +++ b/drivers/devfreq/rk3399_dmc.c
> @@ -429,6 +429,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>  
>  	rk3399_devfreq_dmc_profile.initial_freq = data->rate;
>  
> +	platform_set_drvdata(pdev, NULL);

...here you're only clearing the drvdata for the platform device. Is
that a mistake? (Hint: that's not what you uploaded on the Chromium OS
instance, where you presumably tested this.)

And if you're really trying to do what your commit message says:

We're having two different files fight over who owns the edev drvdata?
That seems like a big no-no.

We should work out who's the real owner of 'drvdata', and find some
other solution for the others.

Brian

>  	data->devfreq = devm_devfreq_add_device(dev,
>  					   &rk3399_devfreq_dmc_profile,
>  					   "simple_ondemand",
> -- 
> 2.11.0
> 
> 

  reply	other threads:[~2017-09-02  0:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 23:52 [PATCH] CHROMIUM: devfreq: rk3399: Clear edev->dev drvdata before enabling dfi Jeffy Chen
2017-09-02  0:47 ` Brian Norris [this message]
2017-09-02  1:51   ` jeffy

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=20170902004659.GA105370@google.com \
    --to=briannorris@chromium.org \
    --cc=cw00.choi@samsung.com \
    --cc=dbasehore@chromium.org \
    --cc=dianders@chromium.org \
    --cc=jeffy.chen@rock-chips.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.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.