All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-clk@vger.kernel.org,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	"Sylwester Nawrocki" <snawrocki@kernel.org>,
	"Chanwoo Choi" <cw00.choi@samsung.com>,
	"Bartłomiej Żołnierkiewicz" <b.zolnierkie@samsung.com>,
	"Andrzej Hajda" <a.hajda@samsung.com>
Subject: Re: [PATCH 1/2] clk: samsung: Use NOIRQ stage for Exynos5433 clocks suspend/resume
Date: Thu, 30 Aug 2018 13:12:23 +0200	[thread overview]
Message-ID: <20180830111224eucas1p13ce54ae974ddfaada05e265bba926f0b~PpR2FY2zD2568825688eucas1p1D@eucas1p1.samsung.com> (raw)
In-Reply-To: <CAJKOXPeKEBZ8u9h2=bKtk6GhVVbsV719qGS_5oyy98B+qZQx9g@mail.gmail.com>



On 2018-08-30 12:45, Krzysztof Kozlowski wrote:
> On Thu, 30 Aug 2018 at 12:34, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>> Hi Krzysztof,
>>
>> On 2018-08-30 12:25, Krzysztof Kozlowski wrote:
>>> On Thu, 30 Aug 2018 at 11:59, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>>>> On 2018-08-30 08:29, Krzysztof Kozlowski wrote:
>>>>> On Wed, 29 Aug 2018 at 18:00, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>>>>>> Clocks should be suspended as late as possible and resumed as early as
>>>>>> possible to let other drivers do their own suspend/resume tasks. NOIRQ
>>>>>> callbacks better suit this requirement.
>>>>> I think that's not a good reason to use the noirq versions. These are
>>>>> to solve the races with interrupt handlers, not to manually order
>>>>> callbacks.
>>>> Then please tell me which other solution should I use to make clock
>>>> available
>>>> on Exynos5433 during NOIRQ suspend/resume phase. dw-mmc driver requires to
>>>> access its clocks in NOIRQ resume.
>>> Indeed I found the usage of noirq in the dw-mmc driver which made me
>>> wondering why it is there... and if you look at explanation, the noirq
>>> is only for the purpose of clearing wakeup interrupt in CLKSEL
>>> register.
>>>
>>> Further code refactoring moved more and more code to suspend_noirq,
>>> including the runtime PM part. This probably should not be part of
>>> suspend_noirq but regular suspend. Then all the need of manual
>>> ordering would go away. So the answer to your question - try fixing
>>> buggy dw-mmc driver. :)
>> It is not the bug in dw-mmc driver. It clearly needs to access some its
>> registers during NOIRQ phase. However accessing registers requires to
>> have clocks enabled, which is being handled by runtime PM. There is
>> nothing broken here.
> Ah I missed that point and I see you fixed that case in "mmc:
> dw_mmc-exynos: fix potential external abort in resume_noirq()". The
> true reasoning for this patch is that soc clk driver should suspend
> after every other suspend callback which is using clocks... It would
> be nice to explain this particular scenario in commit msg.
>
> However both dw-mmc and clk will be now in suspend noirq phase so do
> you have any guarantees that dw-mmc will be suspended after clk?

Frankly speaking this works now, because the devices are populated in
the order of their presence in device-tree. When the order would be
reverse, dw-mmc driver will defer probe until clocks are registered.
This would be enough to ensure proper suspend/resume order, because all
deferred devices are moved to the end of dpm_list (the list of device
used for system suspend/resume calls), see deferred_probe_work_func()
and comments there.

This is however still not fully resolved problem that has to be
addressed one day. Andrzej Hajda will have a speech on this topic at
Open Source Summit:

https://osseu18.sched.com/event/FxYd/deferred-problem-issues-with-complex-dependencies-between-devices-in-linux-kernel-andrzej-hajda-samsung

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

  reply	other threads:[~2018-08-30 15:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180829160021eucas1p10f21691116ac17ed9d226afe72b7de0b@eucas1p1.samsung.com>
2018-08-29 16:00 ` [PATCH 0/2] Prepare Exynos5433 clocks driver for system suspend/resume Marek Szyprowski
     [not found]   ` <CGME20180829160024eucas1p1049ff966800cdc44e876d546978df399@eucas1p1.samsung.com>
2018-08-29 16:00     ` [PATCH 1/2] clk: samsung: Use NOIRQ stage for Exynos5433 clocks suspend/resume Marek Szyprowski
2018-08-29 23:21       ` Chanwoo Choi
2018-08-30  6:29       ` Krzysztof Kozlowski
2018-08-30  9:59         ` Marek Szyprowski
2018-08-30 10:25           ` Krzysztof Kozlowski
2018-08-30 10:34             ` Marek Szyprowski
2018-08-30 10:45               ` Krzysztof Kozlowski
2018-08-30 11:12                 ` Marek Szyprowski [this message]
2018-08-30 13:01                   ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829160024eucas1p19b9912baece05c529f6bcf64b986bba9@eucas1p1.samsung.com>
2018-08-29 16:00     ` [PATCH 2/2] clk: samsung: exynos5433: Add suspend state for TOP, CPIF & PERIC CMUs Marek Szyprowski
2018-08-29 23:30       ` Chanwoo Choi
2018-08-31  6:38       ` Krzysztof Kozlowski

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='20180830111224eucas1p13ce54ae974ddfaada05e265bba926f0b~PpR2FY2zD2568825688eucas1p1D@eucas1p1.samsung.com' \
    --to=m.szyprowski@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=snawrocki@kernel.org \
    /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.