LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: myungjoo.ham@samsung.com,
	Kyungmin Park <kyungmin.park@samsung.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"heiko@sntech.de" <heiko@sntech.de>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"dbasehore@chromium.org" <dbasehore@chromium.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dianders@google.com" <dianders@google.com>,
	"groek@google.com" <groek@google.com>,
	"kernel@collabora.com" <kernel@collabora.com>,
	Lin Huang <hl@rock-chips.com>,
	Elaine Zhang <zhangqing@rock-chips.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	"linux-rockchip@lists.infradead.org"
	<linux-rockchip@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Jeffy Chen <jeffy.chen@rock-chips.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH 6/6] devfreq: rk3399_dmc: register devfreq notification to dmc driver.
Date: Tue, 24 Apr 2018 10:01:03 +0200	[thread overview]
Message-ID: <a213bb68-2a47-b7b9-d35f-cc5355f9c1be@collabora.com> (raw)
In-Reply-To: <20180424042233epcms1p7b27cb007b11ed467d773ce93d8bc7ed4@epcms1p7>

Hi

On 24/04/18 06:22, MyungJoo Ham wrote:
>> From: Lin Huang <hl@rock-chips.com>
>>
>> Because dmc may also access the PMU_BUS_IDLE_REQ register, we need to
>> ensure that the pd driver and the dmc driver will not access at this
>> register at the same time.
>>
>> Signed-off-by: Lin Huang <hl@rock-chips.com>
>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> ---
>>
>> drivers/devfreq/rk3399_dmc.c      | 47 +----------------------
>> drivers/soc/rockchip/pm_domains.c | 31 +++++++++++++++
>> include/soc/rockchip/rk3399_dmc.h | 63 +++++++++++++++++++++++++++++++
>> 3 files changed, 96 insertions(+), 45 deletions(-)
>> create mode 100644 include/soc/rockchip/rk3399_dmc.h
>>
>> diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
>> index 5bfca028eaaf..a1f320634d69 100644
>> --- a/drivers/devfreq/rk3399_dmc.c
>> +++ b/drivers/devfreq/rk3399_dmc.c
> []
>> diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
>> index 53efc386b1ad..7acc836e7eb7 100644
>> --- a/drivers/soc/rockchip/pm_domains.c
>> +++ b/drivers/soc/rockchip/pm_domains.c
> []
>> +static int dmc_notify(struct notifier_block *nb, unsigned long event,
>> +		      void *data)
>> +{
>> +	if (event == DEVFREQ_PRECHANGE)
>> +		mutex_lock(&dmc_pmu->mutex);
>> +	else if (event == DEVFREQ_POSTCHANGE)
>> +		mutex_unlock(&dmc_pmu->mutex);
>> +
>> +	return NOTIFY_OK;
>> +}
>> +
> 
> Doesn't this incur a deadlock?
> 
> 1. devfreq.c:update_freq calls devfreq_notify_transition(DEVFREQ_PRECHANGE)
> 2. pm_domain.c:dmc_notify calls mutex_lock(dmc_pmu->mutex)
> 3. devfreq.c:update_freq calls target callback
> 4. rk3399_dmc.c:rk3399_dmcfreq_target calls mutex_lock(&dmcfreq->lock)
>    >>>>>> update_freq cannot proceed. <<<<
> 

Mmm, makes sense, but I did not detect this deadlock.

As this patch is controversial let me remove this patch from these series and
I'll send again with the other series that applies on top of these, the series I
am working on are to add ddrfreq support in the drm rockchip driver. Thinking
about it I guess makes more sense as 1-5 are just cleanups, 6 is a bit
different, maybe more related to the work I am doing.

Best regards,
  Enric

> 
> Cheers,
> MyungJoo
> 

      reply	other threads:[~2018-04-24  8:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 10:40 [PATCH 0/6] devfreq: rk3399_dmc: improve rk3399_dmc driver and it's documentation Enric Balletbo i Serra
2018-04-19 10:40 ` [PATCH 1/6] dt-bindings: devfreq: rk3399_dmc: improve binding documentation Enric Balletbo i Serra
2018-04-19 10:40 ` [PATCH 2/6] dt-bindings: clock: add DDR3 standard speed bins Enric Balletbo i Serra
2018-04-19 11:10   ` Heiko Stuebner
2018-04-19 11:30     ` Enric Balletbo i Serra
2018-04-20 10:58       ` Heiko Stuebner
2018-04-19 10:40 ` [PATCH 3/6] devfreq: rk3399_dmc: remove wait for dcf irq event Enric Balletbo i Serra
2018-04-24  3:55   ` Chanwoo Choi
2018-04-19 10:40 ` [PATCH 4/6] dt-bindings: devfreq: rk3399_dmc: remove interrupts as is not required Enric Balletbo i Serra
2018-04-24  3:56   ` Chanwoo Choi
2018-04-19 10:40 ` [PATCH 5/6] devfreq: rk3399_dmc: do not print error when get supply and clk defer Enric Balletbo i Serra
2018-04-23 10:44   ` Ulf Hansson
2018-04-23 13:37     ` Ezequiel Garcia
2018-04-24  3:55   ` Chanwoo Choi
2018-04-19 10:40 ` [PATCH 6/6] devfreq: rk3399_dmc: register devfreq notification to dmc driver Enric Balletbo i Serra
2018-04-24  4:08   ` Chanwoo Choi
2018-04-23 10:53 ` [PATCH 0/6] devfreq: rk3399_dmc: improve rk3399_dmc driver and it's documentation Ulf Hansson
     [not found] ` <CGME20180419104054epcas5p49612174afb26493bcd937a0232b9b1df@epcms1p3>
2018-04-24  1:53   ` [PATCH 1/6] dt-bindings: devfreq: rk3399_dmc: improve binding documentation MyungJoo Ham
     [not found] ` <CGME20180419104056epcas2p29c74949b650fea596900e395dec662e8@epcms1p7>
2018-04-24  2:31   ` [PATCH 3/6] devfreq: rk3399_dmc: remove wait for dcf irq event MyungJoo Ham
     [not found] ` <CGME20180419104057epcas5p311ecfdeb6cb535cd7100232d282ac323@epcms1p4>
2018-04-24  2:33   ` [PATCH 5/6] devfreq: rk3399_dmc: do not print error when get supply and clk defer MyungJoo Ham
     [not found] ` <CGME20180419104059epcas2p3fe5aba95859e02307556200a42bc1ac2@epcms1p7>
2018-04-24  4:22   ` [PATCH 6/6] devfreq: rk3399_dmc: register devfreq notification to dmc driver MyungJoo Ham
2018-04-24  8:01     ` Enric Balletbo i Serra [this message]

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=a213bb68-2a47-b7b9-d35f-cc5355f9c1be@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc=cw00.choi@samsung.com \
    --cc=dbasehore@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@google.com \
    --cc=geert+renesas@glider.be \
    --cc=groek@google.com \
    --cc=heiko@sntech.de \
    --cc=hl@rock-chips.com \
    --cc=jeffy.chen@rock-chips.com \
    --cc=kernel@collabora.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=zhangqing@rock-chips.com \
    --subject='Re: [PATCH 6/6] devfreq: rk3399_dmc: register devfreq notification to dmc driver.' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).