mbox series

[00/13] soundwire: intel: add power management support

Message ID 20200721203723.18305-1-yung-chuan.liao@linux.intel.com (mailing list archive)
Headers show
Series soundwire: intel: add power management support | expand

Message

Bard Liao July 21, 2020, 8:37 p.m. UTC
This series adds power management support for Intel soundwire links.

Bard Liao (1):
  soundwire: intel: reinitialize IP+DSP in .prepare(), but only when
    resuming

Pierre-Louis Bossart (10):
  soundwire: intel: Add basic power management support
  soundwire: intel: add pm_runtime support
  soundwire: intel: reset pm_runtime status during system resume
  soundwire: intel: fix race condition on system resume
  soundwire: intel: call helper to reset Slave states on resume
  soundwire: intel: pm_runtime idle scheduling
  soundwire: intel: add CLK_STOP_TEARDOWN for pm_runtime suspend
  soundwire: intel: add CLK_STOP_NOT_ALLOWED support
  soundwire: intel_init: handle power rail dependencies for clock stop
    mode
  soundwire: intel: support clock_stop mode without quirks

Rander Wang (2):
  soundwire: intel: add CLK_STOP_BUS_RESET support
  soundwire: intel: refine runtime pm for SDW_INTEL_CLK_STOP_BUS_RESET

 drivers/soundwire/cadence_master.h |   4 +
 drivers/soundwire/intel.c          | 448 ++++++++++++++++++++++++++++-
 drivers/soundwire/intel.h          |   2 +
 drivers/soundwire/intel_init.c     |  19 +-
 4 files changed, 465 insertions(+), 8 deletions(-)

Comments

Vinod Koul Aug. 17, 2020, 12:08 p.m. UTC | #1
On 22-07-20, 04:37, Bard Liao wrote:
> This series adds power management support for Intel soundwire links.

I had applied except 3 & 9 (few skipped in middle due to conflict while
applying), BUT I get a build failure on patch 2 onwards :(

drivers/soundwire/intel_init.c: In function ‘sdw_intel_cleanup’:
drivers/soundwire/intel_init.c:72:4: error: implicit declaration of function ‘pm_runtime_disable’ [-Werror=implicit-function-declaration]
   72 |    pm_runtime_disable(&link->pdev->dev);

I suspect due to missing header? I was on x64 build with allmodconfig

So only patch 1 is applied and pushed now
Pierre-Louis Bossart Aug. 17, 2020, 2:46 p.m. UTC | #2
On 8/17/20 7:08 AM, Vinod Koul wrote:
> On 22-07-20, 04:37, Bard Liao wrote:
>> This series adds power management support for Intel soundwire links.
> 
> I had applied except 3 & 9 (few skipped in middle due to conflict while
> applying), BUT I get a build failure on patch 2 onwards :(
> 
> drivers/soundwire/intel_init.c: In function ‘sdw_intel_cleanup’:
> drivers/soundwire/intel_init.c:72:4: error: implicit declaration of function ‘pm_runtime_disable’ [-Werror=implicit-function-declaration]
>     72 |    pm_runtime_disable(&link->pdev->dev);
> 
> I suspect due to missing header? I was on x64 build with allmodconfig
> 
> So only patch 1 is applied and pushed now

I just tried on these series applied on top of soundwire/next

commit 9b3b4b3f2f2af863d2f6dd65afd295a5a673afa2 (soundwire/next)

     soundwire: intel: Add basic power management support

And I don't see any issue?

If you want to double-check merge issues, I pushed the code here: 
https://github.com/plbossart/sound/tree/sdw/pm_runtime_soundwire_next

I am really not sure what conflicts you are referring to, git am worked 
fine for me, only skipped the first patch that's already applied.

$git am ~/Downloads/alsa/122/\[PATCH\ *
Applying: soundwire: intel: Add basic power management support
error: patch failed: drivers/soundwire/intel.c:463
error: drivers/soundwire/intel.c: patch does not apply
Patch failed at 0001 soundwire: intel: Add basic power management support
hint: Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --skip
Applying: soundwire: intel: add pm_runtime support
Applying: soundwire: intel: reset pm_runtime status during system resume
Applying: soundwire: intel: fix race condition on system resume
Applying: soundwire: intel: call helper to reset Slave states on resume
Applying: soundwire: intel: reinitialize IP+DSP in .prepare(), but only 
when resuming
Applying: soundwire: intel: pm_runtime idle scheduling
Applying: soundwire: intel: add CLK_STOP_TEARDOWN for pm_runtime suspend
Applying: soundwire: intel: add CLK_STOP_BUS_RESET support
Applying: soundwire: intel: add CLK_STOP_NOT_ALLOWED support
Applying: soundwire: intel_init: handle power rail dependencies for 
clock stop mode
Applying: soundwire: intel: support clock_stop mode without quirks
Applying: soundwire: intel: refine runtime pm for 
SDW_INTEL_CLK_STOP_BUS_RESET

I tried the compilation twice, once with our default SOF config and once 
with allmodconfig.

make drivers/soundwire/ W=1
   GEN     Makefile
   YACC    scripts/genksyms/parse.tab.[ch]
/data/pbossart/ktest/broonie-next/scripts/genksyms/parse.y: warning: 9 
shift/reduce conflicts [-Wconflicts-sr]
/data/pbossart/ktest/broonie-next/scripts/genksyms/parse.y: warning: 5 
reduce/reduce conflicts [-Wconflicts-rr]
   HOSTCC  scripts/genksyms/parse.tab.o
   HOSTCC  scripts/genksyms/lex.lex.o
   HOSTLD  scripts/genksyms/genksyms
   CC      scripts/mod/empty.o
   MKELF   scripts/mod/elfconfig.h
   HOSTCC  scripts/mod/modpost.o
   CC      scripts/mod/devicetable-offsets.s
   HOSTCC  scripts/mod/file2alias.o
   HOSTCC  scripts/mod/sumversion.o
   HOSTLD  scripts/mod/modpost
   CC      kernel/bounds.s
   CC      arch/x86/kernel/asm-offsets.s
   CALL    /data/pbossart/ktest/broonie-next/scripts/checksyscalls.sh
   CALL    /data/pbossart/ktest/broonie-next/scripts/atomic/check-atomics.sh
   DESCEND  objtool
   CC [M]  drivers/soundwire/bus_type.o
   CC [M]  drivers/soundwire/bus.o
   CC [M]  drivers/soundwire/master.o
   CC [M]  drivers/soundwire/slave.o
   CC [M]  drivers/soundwire/mipi_disco.o
   CC [M]  drivers/soundwire/stream.o
   CC [M]  drivers/soundwire/sysfs_slave.o
   CC [M]  drivers/soundwire/sysfs_slave_dpn.o
   CC [M]  drivers/soundwire/debugfs.o
   LD [M]  drivers/soundwire/soundwire-bus.o
   CC [M]  drivers/soundwire/cadence_master.o
   LD [M]  drivers/soundwire/soundwire-cadence.o
   CC [M]  drivers/soundwire/intel.o
   CC [M]  drivers/soundwire/intel_init.o
   LD [M]  drivers/soundwire/soundwire-intel.o
   CC [M]  drivers/soundwire/qcom.o
   LD [M]  drivers/soundwire/soundwire-qcom.o
Pierre-Louis Bossart Aug. 17, 2020, 4:10 p.m. UTC | #3
>> I had applied except 3 & 9 (few skipped in middle due to conflict while
>> applying), BUT I get a build failure on patch 2 onwards :(
>>
>> drivers/soundwire/intel_init.c: In function ‘sdw_intel_cleanup’:
>> drivers/soundwire/intel_init.c:72:4: error: implicit declaration of 
>> function ‘pm_runtime_disable’ [-Werror=implicit-function-declaration]
>>     72 |    pm_runtime_disable(&link->pdev->dev);
>>
>> I suspect due to missing header? I was on x64 build with allmodconfig
>>
>> So only patch 1 is applied and pushed now
> 
> I just tried on these series applied on top of soundwire/next
> 
> commit 9b3b4b3f2f2af863d2f6dd65afd295a5a673afa2 (soundwire/next)
> 
>      soundwire: intel: Add basic power management support
> 
> And I don't see any issue?

Sorry, I misunderstood the issue. Yes indeed the #include 
<linux/pm_runtime.h> is added to the wrong patch, I see Bard fixed this 
in our tree. Not sure what happened here, I ran a patch-by-patch 
compilation test a long time ago and kbuild was silent. Thanks for 
spotting this.

> If you want to double-check merge issues, I pushed the code here: 
> https://github.com/plbossart/sound/tree/sdw/pm_runtime_soundwire_next
> 
> I am really not sure what conflicts you are referring to, git am worked 
> fine for me, only skipped the first patch that's already applied.

But the point about conflicts does remain, I am not sure why you skipped 
patches, I have no merge conflicts on my side.
Vinod Koul Aug. 18, 2020, 6:29 a.m. UTC | #4
On 17-08-20, 11:10, Pierre-Louis Bossart wrote:
> 
> 
> > > I had applied except 3 & 9 (few skipped in middle due to conflict while
> > > applying), BUT I get a build failure on patch 2 onwards :(
> > > 
> > > drivers/soundwire/intel_init.c: In function ‘sdw_intel_cleanup’:
> > > drivers/soundwire/intel_init.c:72:4: error: implicit declaration of
> > > function ‘pm_runtime_disable’
> > > [-Werror=implicit-function-declaration]
> > >     72 |    pm_runtime_disable(&link->pdev->dev);
> > > 
> > > I suspect due to missing header? I was on x64 build with allmodconfig
> > > 
> > > So only patch 1 is applied and pushed now
> > 
> > I just tried on these series applied on top of soundwire/next
> > 
> > commit 9b3b4b3f2f2af863d2f6dd65afd295a5a673afa2 (soundwire/next)
> > 
> >      soundwire: intel: Add basic power management support
> > 
> > And I don't see any issue?
> 
> Sorry, I misunderstood the issue. Yes indeed the #include
> <linux/pm_runtime.h> is added to the wrong patch, I see Bard fixed this in
> our tree. Not sure what happened here, I ran a patch-by-patch compilation
> test a long time ago and kbuild was silent. Thanks for spotting this.
> 
> > If you want to double-check merge issues, I pushed the code here:
> > https://github.com/plbossart/sound/tree/sdw/pm_runtime_soundwire_next
> > 
> > I am really not sure what conflicts you are referring to, git am worked
> > fine for me, only skipped the first patch that's already applied.
> 
> But the point about conflicts does remain, I am not sure why you skipped
> patches, I have no merge conflicts on my side.

As noted above, I tried to apply except 3 & 9 due to questions on them.
It is quite normal that dependencies fail to apply, not sure why you are
confused.