Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625044 > unrolled thread

[Query] Enabling parent device clock from resume_noirq

Started byKishon Vijay Abraham I <kishon@ti.com>
First post2017-04-18 08:10 +0200
Last post2017-04-19 13:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [Query] Enabling parent device clock from resume_noirq Kishon Vijay Abraham I <kishon@ti.com> - 2017-04-18 08:10 +0200
    Re: [Query] Enabling parent device clock from resume_noirq Grygorii Strashko <grygorii.strashko@ti.com> - 2017-04-18 22:10 +0200
      Re: [Query] Enabling parent device clock from resume_noirq Kishon Vijay Abraham I <kishon@ti.com> - 2017-04-19 13:20 +0200

#1625044 — [Query] Enabling parent device clock from resume_noirq

FromKishon Vijay Abraham I <kishon@ti.com>
Date2017-04-18 08:10 +0200
Subject[Query] Enabling parent device clock from resume_noirq
Message-ID<txuuS-2Go-7@gated-at.bofh.it>
Hi,

resume_noirq callbacks are used in PCIe core to restore PCI state (this
accesses PCI module). So the clocks of PCI module has to be enabled before
resume_noirq.

The clocks for the PCI module in DRA7xx is provided by PIPE3 PHY device which
in turn gets it's clock from OCP2SCP device. During resume_noirq callbacks,
pm_runtime is disabled, so pm_runtime_get_sync is ineffective. However
pm_runtime can be enabled using pm_runtime_force_resume. Now the problem is
adding pm_runtime_force_resume() in resume_noirq callback of pci-dra7xx driver
will enable only the pm_runtime of PCI device but not PIPE3 PHY or OCP2SCP.
Adding pm_runtime_force_resume() in resume_noirq callback of PIPE3 PHY driver
or OCP2SCP driver will not help if the resume_noirq callbacks in PIP3PHY driver
and OCP2SCP driver are invoked after the resume_noirq of pci-dra7xx driver.

How to enable the pm_runtime of parent devices in resume_noirq callback? Does
existing pm_runtime framework has support for that?

Thanks
Kishon

[toc] | [next] | [standalone]


#1625611

FromGrygorii Strashko <grygorii.strashko@ti.com>
Date2017-04-18 22:10 +0200
Message-ID<txHBL-22s-1@gated-at.bofh.it>
In reply to#1625044
+ linux-pm

On 04/18/2017 01:07 AM, Kishon Vijay Abraham I wrote:
> Hi,
> 
> resume_noirq callbacks are used in PCIe core to restore PCI state (this
> accesses PCI module). So the clocks of PCI module has to be enabled before
> resume_noirq.
> 
> The clocks for the PCI module in DRA7xx is provided by PIPE3 PHY device which
> in turn gets it's clock from OCP2SCP device. During resume_noirq callbacks,
> pm_runtime is disabled, so pm_runtime_get_sync is ineffective. However
> pm_runtime can be enabled using pm_runtime_force_resume. Now the problem is
> adding pm_runtime_force_resume() in resume_noirq callback of pci-dra7xx driver
> will enable only the pm_runtime of PCI device but not PIPE3 PHY or OCP2SCP.
> Adding pm_runtime_force_resume() in resume_noirq callback of PIPE3 PHY driver
> or OCP2SCP driver will not help if the resume_noirq callbacks in PIP3PHY driver
> and OCP2SCP driver are invoked after the resume_noirq of pci-dra7xx driver.
> 
> How to enable the pm_runtime of parent devices in resume_noirq callback? Does
> existing pm_runtime framework has support for that?
> 

Most probably you've hit the issue described in [1].
In general, if pci-dra7xx is consumer of  PIPE3 PHY device and 
PIPE3 PHY device is child of OCP2SCP then suspend/resume order should be
- pci-dra7xx
- PIPE3 PHY
- OCP2SCP
 and resume
- OCP2SCP
- PIPE3 PHY
- pci-dra7xx
and in this case  pm_runtime_force_x() might work.

Hence, approach [1] was not accepted (personally I still like it) and
"Functional dependencies tracking support" was introduced instead by commit 9ed9895 [2]
you can try it.

But, as per code, I'm not sure that Functional dependencies properly tracked in 
pm_runtime_force_x() functions.

PS: you can try to reorder device's nodes in DT and place PCI node after "ocp2scp" :P

[1] "driver core: Ensure proper suspend/resume ordering"
 https://patchwork.kernel.org/patch/7153201/
[2] https://patchwork.kernel.org/patch/9404547/
-- 
regards,
-grygorii

[toc] | [prev] | [next] | [standalone]


#1626027

FromKishon Vijay Abraham I <kishon@ti.com>
Date2017-04-19 13:20 +0200
Message-ID<txVOp-2NI-3@gated-at.bofh.it>
In reply to#1625611
Hi,

On Wednesday 19 April 2017 01:35 AM, Grygorii Strashko wrote:
> + linux-pm
> 
> On 04/18/2017 01:07 AM, Kishon Vijay Abraham I wrote:
>> Hi,
>>
>> resume_noirq callbacks are used in PCIe core to restore PCI state (this
>> accesses PCI module). So the clocks of PCI module has to be enabled before
>> resume_noirq.
>>
>> The clocks for the PCI module in DRA7xx is provided by PIPE3 PHY device which
>> in turn gets it's clock from OCP2SCP device. During resume_noirq callbacks,
>> pm_runtime is disabled, so pm_runtime_get_sync is ineffective. However
>> pm_runtime can be enabled using pm_runtime_force_resume. Now the problem is
>> adding pm_runtime_force_resume() in resume_noirq callback of pci-dra7xx driver
>> will enable only the pm_runtime of PCI device but not PIPE3 PHY or OCP2SCP.
>> Adding pm_runtime_force_resume() in resume_noirq callback of PIPE3 PHY driver
>> or OCP2SCP driver will not help if the resume_noirq callbacks in PIP3PHY driver
>> and OCP2SCP driver are invoked after the resume_noirq of pci-dra7xx driver.
>>
>> How to enable the pm_runtime of parent devices in resume_noirq callback? Does
>> existing pm_runtime framework has support for that?
>>
> 
> Most probably you've hit the issue described in [1].
> In general, if pci-dra7xx is consumer of  PIPE3 PHY device and 
> PIPE3 PHY device is child of OCP2SCP then suspend/resume order should be
> - pci-dra7xx
> - PIPE3 PHY
> - OCP2SCP
>  and resume
> - OCP2SCP
> - PIPE3 PHY
> - pci-dra7xx
> and in this case  pm_runtime_force_x() might work.
> 
> Hence, approach [1] was not accepted (personally I still like it) and
> "Functional dependencies tracking support" was introduced instead by commit 9ed9895 [2]
> you can try it.
> 
> But, as per code, I'm not sure that Functional dependencies properly tracked in 
> pm_runtime_force_x() functions.
> 
> PS: you can try to reorder device's nodes in DT and place PCI node after "ocp2scp" :P

reordering helps ;-) I'll try the functional dependencies.

Thanks for the hint :-)

Cheers
Kishon

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web