linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64()
@ 2017-05-23  0:12 Matthias Kaehlcke
  2017-05-24 17:41 ` Applied "ASoC: Intel: sst: Remove unused function sst_restore_shim64()" to the asoc tree Mark Brown
  2017-06-07 21:40 ` [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64() Takashi Iwai
  0 siblings, 2 replies; 7+ messages in thread
From: Matthias Kaehlcke @ 2017-05-23  0:12 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, Vinod Koul
  Cc: alsa-devel, linux-kernel, Douglas Anderson, Matthias Kaehlcke

Looks like the function has never been used since it was added by commit
b0d94acd634a ("ASoC: Intel: mrfld - add shim save restore"). Removing it
fixes the following warning when building with clang:

sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
    'sst_restore_shim64' [-Werror,-Wunused-function]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 sound/soc/intel/atom/sst/sst.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
index f9ba71315e33..fb608d3a90c8 100644
--- a/sound/soc/intel/atom/sst/sst.c
+++ b/sound/soc/intel/atom/sst/sst.c
@@ -397,22 +397,6 @@ static inline void sst_save_shim64(struct intel_sst_drv *ctx,
 	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
 }
 
-static inline void sst_restore_shim64(struct intel_sst_drv *ctx,
-				      void __iomem *shim,
-				      struct sst_shim_regs64 *shim_regs)
-{
-	unsigned long irq_flags;
-
-	/*
-	 * we only need to restore IMRX for this case, rest will be
-	 * initialize by FW or driver when firmware is loaded
-	 */
-	spin_lock_irqsave(&ctx->ipc_spin_lock, irq_flags);
-	sst_shim_write64(shim, SST_IMRX, shim_regs->imrx);
-	sst_shim_write64(shim, SST_CSR, shim_regs->csr);
-	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
-}
-
 void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
 {
 	pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);
-- 
2.13.0.303.g4ebf302169-goog

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Applied "ASoC: Intel: sst: Remove unused function sst_restore_shim64()" to the asoc tree
  2017-05-23  0:12 [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64() Matthias Kaehlcke
@ 2017-05-24 17:41 ` Mark Brown
  2017-06-07 21:40 ` [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64() Takashi Iwai
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-05-24 17:41 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Mark Brown, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Vinod Koul, alsa-devel, linux-kernel,
	Douglas Anderson, alsa-devel

The patch

   ASoC: Intel: sst: Remove unused function sst_restore_shim64()

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 9a075265c6dc040e2946d21f4f9d082495bd5460 Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka@chromium.org>
Date: Mon, 22 May 2017 17:12:58 -0700
Subject: [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64()

Looks like the function has never been used since it was added by commit
b0d94acd634a ("ASoC: Intel: mrfld - add shim save restore"). Removing it
fixes the following warning when building with clang:

sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
    'sst_restore_shim64' [-Werror,-Wunused-function]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/atom/sst/sst.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
index d97556a3772c..2d43b8693c0c 100644
--- a/sound/soc/intel/atom/sst/sst.c
+++ b/sound/soc/intel/atom/sst/sst.c
@@ -397,22 +397,6 @@ static inline void sst_save_shim64(struct intel_sst_drv *ctx,
 	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
 }
 
-static inline void sst_restore_shim64(struct intel_sst_drv *ctx,
-				      void __iomem *shim,
-				      struct sst_shim_regs64 *shim_regs)
-{
-	unsigned long irq_flags;
-
-	/*
-	 * we only need to restore IMRX for this case, rest will be
-	 * initialize by FW or driver when firmware is loaded
-	 */
-	spin_lock_irqsave(&ctx->ipc_spin_lock, irq_flags);
-	sst_shim_write64(shim, SST_IMRX, shim_regs->imrx);
-	sst_shim_write64(shim, SST_CSR, shim_regs->csr);
-	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
-}
-
 void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
 {
 	pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64()
  2017-05-23  0:12 [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64() Matthias Kaehlcke
  2017-05-24 17:41 ` Applied "ASoC: Intel: sst: Remove unused function sst_restore_shim64()" to the asoc tree Mark Brown
@ 2017-06-07 21:40 ` Takashi Iwai
  2017-06-07 21:53   ` Matthias Kaehlcke
  2017-06-09  3:40   ` Vinod Koul
  1 sibling, 2 replies; 7+ messages in thread
From: Takashi Iwai @ 2017-06-07 21:40 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Liam Girdwood, Vinod Koul, Mark Brown, Jaroslav Kysela,
	alsa-devel, Douglas Anderson, linux-kernel

On Tue, 23 May 2017 02:12:58 +0200,
Matthias Kaehlcke wrote:
> 
> Looks like the function has never been used since it was added by commit
> b0d94acd634a ("ASoC: Intel: mrfld - add shim save restore"). Removing it
> fixes the following warning when building with clang:
> 
> sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
>     'sst_restore_shim64' [-Werror,-Wunused-function]
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>

Hmm, although this patch was already merged, I now think this is
rather a bug.  If the restore is never executed, why the counterpart,
sst_save_shim64() is required at all at runtime suspend?

Vinod?


thanks,

Takashi

> ---
>  sound/soc/intel/atom/sst/sst.c | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
> index f9ba71315e33..fb608d3a90c8 100644
> --- a/sound/soc/intel/atom/sst/sst.c
> +++ b/sound/soc/intel/atom/sst/sst.c
> @@ -397,22 +397,6 @@ static inline void sst_save_shim64(struct intel_sst_drv *ctx,
>  	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
>  }
>  
> -static inline void sst_restore_shim64(struct intel_sst_drv *ctx,
> -				      void __iomem *shim,
> -				      struct sst_shim_regs64 *shim_regs)
> -{
> -	unsigned long irq_flags;
> -
> -	/*
> -	 * we only need to restore IMRX for this case, rest will be
> -	 * initialize by FW or driver when firmware is loaded
> -	 */
> -	spin_lock_irqsave(&ctx->ipc_spin_lock, irq_flags);
> -	sst_shim_write64(shim, SST_IMRX, shim_regs->imrx);
> -	sst_shim_write64(shim, SST_CSR, shim_regs->csr);
> -	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
> -}
> -
>  void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
>  {
>  	pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);
> -- 
> 2.13.0.303.g4ebf302169-goog
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64()
  2017-06-07 21:40 ` [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64() Takashi Iwai
@ 2017-06-07 21:53   ` Matthias Kaehlcke
  2017-06-08  7:02     ` Takashi Iwai
  2017-06-09  3:40   ` Vinod Koul
  1 sibling, 1 reply; 7+ messages in thread
From: Matthias Kaehlcke @ 2017-06-07 21:53 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Liam Girdwood, Vinod Koul, Mark Brown, Jaroslav Kysela,
	alsa-devel, Douglas Anderson, linux-kernel

Hi Takashi,

El Wed, Jun 07, 2017 at 11:40:19PM +0200 Takashi Iwai ha dit:

> On Tue, 23 May 2017 02:12:58 +0200,
> Matthias Kaehlcke wrote:
> > 
> > Looks like the function has never been used since it was added by commit
> > b0d94acd634a ("ASoC: Intel: mrfld - add shim save restore"). Removing it
> > fixes the following warning when building with clang:
> > 
> > sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
> >     'sst_restore_shim64' [-Werror,-Wunused-function]
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> 
> Hmm, although this patch was already merged, I now think this is
> rather a bug.  If the restore is never executed, why the counterpart,
> sst_save_shim64() is required at all at runtime suspend?

Doug Anderson also noticed this and removed the function and struct
sst_shim_regs64:

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?h=for-next&id=98cf2c03b467fa67df58cb52adeb85b425cabcb2

> > ---
> >  sound/soc/intel/atom/sst/sst.c | 16 ----------------
> >  1 file changed, 16 deletions(-)
> > 
> > diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
> > index f9ba71315e33..fb608d3a90c8 100644
> > --- a/sound/soc/intel/atom/sst/sst.c
> > +++ b/sound/soc/intel/atom/sst/sst.c
> > @@ -397,22 +397,6 @@ static inline void sst_save_shim64(struct intel_sst_drv *ctx,
> >  	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
> >  }
> >  
> > -static inline void sst_restore_shim64(struct intel_sst_drv *ctx,
> > -				      void __iomem *shim,
> > -				      struct sst_shim_regs64 *shim_regs)
> > -{
> > -	unsigned long irq_flags;
> > -
> > -	/*
> > -	 * we only need to restore IMRX for this case, rest will be
> > -	 * initialize by FW or driver when firmware is loaded
> > -	 */
> > -	spin_lock_irqsave(&ctx->ipc_spin_lock, irq_flags);
> > -	sst_shim_write64(shim, SST_IMRX, shim_regs->imrx);
> > -	sst_shim_write64(shim, SST_CSR, shim_regs->csr);
> > -	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
> > -}
> > -
> >  void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
> >  {
> >  	pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64()
  2017-06-07 21:53   ` Matthias Kaehlcke
@ 2017-06-08  7:02     ` Takashi Iwai
  0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2017-06-08  7:02 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Liam Girdwood, Vinod Koul, Mark Brown, Jaroslav Kysela,
	alsa-devel, Douglas Anderson, linux-kernel

On Wed, 07 Jun 2017 23:53:29 +0200,
Matthias Kaehlcke wrote:
> 
> Hi Takashi,
> 
> El Wed, Jun 07, 2017 at 11:40:19PM +0200 Takashi Iwai ha dit:
> 
> > On Tue, 23 May 2017 02:12:58 +0200,
> > Matthias Kaehlcke wrote:
> > > 
> > > Looks like the function has never been used since it was added by commit
> > > b0d94acd634a ("ASoC: Intel: mrfld - add shim save restore"). Removing it
> > > fixes the following warning when building with clang:
> > > 
> > > sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
> > >     'sst_restore_shim64' [-Werror,-Wunused-function]
> > > 
> > > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > 
> > Hmm, although this patch was already merged, I now think this is
> > rather a bug.  If the restore is never executed, why the counterpart,
> > sst_save_shim64() is required at all at runtime suspend?
> 
> Doug Anderson also noticed this and removed the function and struct
> sst_shim_regs64:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?h=for-next&id=98cf2c03b467fa67df58cb52adeb85b425cabcb2

Yes, I know.  But I wonder it were a failure to remove before
confirming that.


thanks,

Takashi

> 
> > > ---
> > >  sound/soc/intel/atom/sst/sst.c | 16 ----------------
> > >  1 file changed, 16 deletions(-)
> > > 
> > > diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
> > > index f9ba71315e33..fb608d3a90c8 100644
> > > --- a/sound/soc/intel/atom/sst/sst.c
> > > +++ b/sound/soc/intel/atom/sst/sst.c
> > > @@ -397,22 +397,6 @@ static inline void sst_save_shim64(struct intel_sst_drv *ctx,
> > >  	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
> > >  }
> > >  
> > > -static inline void sst_restore_shim64(struct intel_sst_drv *ctx,
> > > -				      void __iomem *shim,
> > > -				      struct sst_shim_regs64 *shim_regs)
> > > -{
> > > -	unsigned long irq_flags;
> > > -
> > > -	/*
> > > -	 * we only need to restore IMRX for this case, rest will be
> > > -	 * initialize by FW or driver when firmware is loaded
> > > -	 */
> > > -	spin_lock_irqsave(&ctx->ipc_spin_lock, irq_flags);
> > > -	sst_shim_write64(shim, SST_IMRX, shim_regs->imrx);
> > > -	sst_shim_write64(shim, SST_CSR, shim_regs->csr);
> > > -	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
> > > -}
> > > -
> > >  void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
> > >  {
> > >  	pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64()
  2017-06-07 21:40 ` [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64() Takashi Iwai
  2017-06-07 21:53   ` Matthias Kaehlcke
@ 2017-06-09  3:40   ` Vinod Koul
  2017-06-09  7:05     ` Takashi Iwai
  1 sibling, 1 reply; 7+ messages in thread
From: Vinod Koul @ 2017-06-09  3:40 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Matthias Kaehlcke, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	alsa-devel, Douglas Anderson, linux-kernel

On Wed, Jun 07, 2017 at 11:40:19PM +0200, Takashi Iwai wrote:
> On Tue, 23 May 2017 02:12:58 +0200,
> Matthias Kaehlcke wrote:
> > 
> > Looks like the function has never been used since it was added by commit
> > b0d94acd634a ("ASoC: Intel: mrfld - add shim save restore"). Removing it
> > fixes the following warning when building with clang:
> > 
> > sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
> >     'sst_restore_shim64' [-Werror,-Wunused-function]
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> 
> Hmm, although this patch was already merged, I now think this is
> rather a bug.  If the restore is never executed, why the counterpart,
> sst_save_shim64() is required at all at runtime suspend?
> 
> Vinod?

It was supposed to be required in early BYT boards. I do not seem to recall
why the call to sst_restore_shim64 was removed from resume routine, it was
there when we added it and due to file move git log is useless.

Any idea how to get changes to file before the file was moved?

> thanks,
> 
> Takashi
> 
> > ---
> >  sound/soc/intel/atom/sst/sst.c | 16 ----------------
> >  1 file changed, 16 deletions(-)
> > 
> > diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
> > index f9ba71315e33..fb608d3a90c8 100644
> > --- a/sound/soc/intel/atom/sst/sst.c
> > +++ b/sound/soc/intel/atom/sst/sst.c
> > @@ -397,22 +397,6 @@ static inline void sst_save_shim64(struct intel_sst_drv *ctx,
> >  	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
> >  }
> >  
> > -static inline void sst_restore_shim64(struct intel_sst_drv *ctx,
> > -				      void __iomem *shim,
> > -				      struct sst_shim_regs64 *shim_regs)
> > -{
> > -	unsigned long irq_flags;
> > -
> > -	/*
> > -	 * we only need to restore IMRX for this case, rest will be
> > -	 * initialize by FW or driver when firmware is loaded
> > -	 */
> > -	spin_lock_irqsave(&ctx->ipc_spin_lock, irq_flags);
> > -	sst_shim_write64(shim, SST_IMRX, shim_regs->imrx);
> > -	sst_shim_write64(shim, SST_CSR, shim_regs->csr);
> > -	spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
> > -}
> > -
> >  void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
> >  {
> >  	pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);
> > -- 
> > 2.13.0.303.g4ebf302169-goog
> > 
> > 

-- 
~Vinod

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64()
  2017-06-09  3:40   ` Vinod Koul
@ 2017-06-09  7:05     ` Takashi Iwai
  0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2017-06-09  7:05 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Matthias Kaehlcke, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	alsa-devel, Douglas Anderson, linux-kernel

On Fri, 09 Jun 2017 05:40:04 +0200,
Vinod Koul wrote:
> 
> On Wed, Jun 07, 2017 at 11:40:19PM +0200, Takashi Iwai wrote:
> > On Tue, 23 May 2017 02:12:58 +0200,
> > Matthias Kaehlcke wrote:
> > > 
> > > Looks like the function has never been used since it was added by commit
> > > b0d94acd634a ("ASoC: Intel: mrfld - add shim save restore"). Removing it
> > > fixes the following warning when building with clang:
> > > 
> > > sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
> > >     'sst_restore_shim64' [-Werror,-Wunused-function]
> > > 
> > > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > 
> > Hmm, although this patch was already merged, I now think this is
> > rather a bug.  If the restore is never executed, why the counterpart,
> > sst_save_shim64() is required at all at runtime suspend?
> > 
> > Vinod?
> 
> It was supposed to be required in early BYT boards. I do not seem to recall
> why the call to sst_restore_shim64 was removed from resume routine, it was
> there when we added it and due to file move git log is useless.
> 
> Any idea how to get changes to file before the file was moved?

Try to pass --follow option to git log.

sst_save_shim64() and sst_restore_shim64() were introduced at
  b0d94acd634a5cff7fe5fc46131a23997e8d0f60
but not actually used.

The call of sst_save_shim64() was added in
  336cfbb05edf7b122ea927dad6c746608723eb25
but already without the counter-part for restore.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-09  7:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-23  0:12 [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64() Matthias Kaehlcke
2017-05-24 17:41 ` Applied "ASoC: Intel: sst: Remove unused function sst_restore_shim64()" to the asoc tree Mark Brown
2017-06-07 21:40 ` [PATCH] ASoC: Intel: sst: Remove unused function sst_restore_shim64() Takashi Iwai
2017-06-07 21:53   ` Matthias Kaehlcke
2017-06-08  7:02     ` Takashi Iwai
2017-06-09  3:40   ` Vinod Koul
2017-06-09  7:05     ` Takashi Iwai

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).