All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Do not write to invalid registers on the wm9712.
@ 2009-12-22 17:28 Eric Millbrandt
  2009-12-22 17:59 ` Liam Girdwood
  2009-12-22 23:46 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Millbrandt @ 2009-12-22 17:28 UTC (permalink / raw)
  To: patch; +Cc: grant.likely, alsa-devel, Eric Millbrandt

This patch fixes a bug where "virtual" registers were being written to the
ac97 bus.  This was causing unrelated registers to become corrupted (headphone 0x04,
touchscreen 0x78, etc).

This patch duplicates protection that was included in the wm9713 driver.

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>
---
 sound/soc/codecs/wm9712.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 0ac1215..e237bf6 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -463,7 +463,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
 {
        u16 *cache = codec->reg_cache;

-       soc_ac97_ops.write(codec->ac97, reg, val);
+       if (reg < 0x7c)
+               soc_ac97_ops.write(codec->ac97, reg, val);
        reg = reg >> 1;
        if (reg < (ARRAY_SIZE(wm9712_reg)))
                cache[reg] = val;
--
1.6.3.1


This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

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

* Re: [PATCH 1/1] Do not write to invalid registers on the wm9712.
  2009-12-22 17:28 [PATCH 1/1] Do not write to invalid registers on the wm9712 Eric Millbrandt
@ 2009-12-22 17:59 ` Liam Girdwood
  2009-12-22 23:46 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2009-12-22 17:59 UTC (permalink / raw)
  To: Eric Millbrandt; +Cc: grant.likely, alsa-devel, patch, Mark Brown

On Tue, 2009-12-22 at 12:28 -0500, Eric Millbrandt wrote:
> This patch fixes a bug where "virtual" registers were being written to the
> ac97 bus.  This was causing unrelated registers to become corrupted (headphone 0x04,
> touchscreen 0x78, etc).
> 
> This patch duplicates protection that was included in the wm9713 driver.
> 
> Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>
> ---
>  sound/soc/codecs/wm9712.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
> index 0ac1215..e237bf6 100644
> --- a/sound/soc/codecs/wm9712.c
> +++ b/sound/soc/codecs/wm9712.c
> @@ -463,7 +463,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
>  {
>         u16 *cache = codec->reg_cache;
> 
> -       soc_ac97_ops.write(codec->ac97, reg, val);
> +       if (reg < 0x7c)
> +               soc_ac97_ops.write(codec->ac97, reg, val);
>         reg = reg >> 1;
>         if (reg < (ARRAY_SIZE(wm9712_reg)))
>                 cache[reg] = val;
> --

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>

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

* Re: [PATCH 1/1] Do not write to invalid registers on the wm9712.
  2009-12-22 17:28 [PATCH 1/1] Do not write to invalid registers on the wm9712 Eric Millbrandt
  2009-12-22 17:59 ` Liam Girdwood
@ 2009-12-22 23:46 ` Mark Brown
  2009-12-23 15:00   ` Eric Millbrandt
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2009-12-22 23:46 UTC (permalink / raw)
  To: Eric Millbrandt; +Cc: grant.likely, alsa-devel, patch

On Tue, Dec 22, 2009 at 12:28:58PM -0500, Eric Millbrandt wrote:
> This patch fixes a bug where "virtual" registers were being written to the
> ac97 bus.  This was causing unrelated registers to become corrupted (headphone 0x04,
> touchscreen 0x78, etc).
> 
> This patch duplicates protection that was included in the wm9713 driver.
> 
> Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>

This looks like a reasonable fix but it doesn't apply against current
kernels.  Could you please regenerate it against

  git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.33

Please do also remember to CC the maintainers of the relevant kernel
subsystems on submitted patches - scripts/get_maintainer.pl is helpful
here.  Things only sent to mailing lists sometimes get lost due to the
volume.

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

* Re: [PATCH 1/1] Do not write to invalid registers on the wm9712.
  2009-12-22 23:46 ` Mark Brown
@ 2009-12-23 15:00   ` Eric Millbrandt
  2009-12-23 15:23     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Millbrandt @ 2009-12-23 15:00 UTC (permalink / raw)
  To: 'Mark Brown'
  Cc: grant.likely@secretlab.ca, alsa-devel@alsa-project.org,
	patch@alsa-project.org

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

...
> This looks like a reasonable fix but it doesn't apply against current
> kernels.  Could you please regenerate it against
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-
> 2.6.33
>

It looks like the legal jargon post-pended to the patch creates grief for git.  I am resubmitting the patch as an attachment so that is will not get mangled.

Eric

This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

[-- Attachment #2: 0001-Do-not-write-to-invalid-registers-on-the-wm9712.patch --]
[-- Type: application/octet-stream, Size: 1134 bytes --]

From a0f77bf886854fd4c084404fdb4ac578cd68cc6a Mon Sep 17 00:00:00 2001
From: Eric Millbrandt <emillbrandt@dekaresearch.com>
Date: Tue, 22 Dec 2009 10:13:24 -0500
Subject: [PATCH 1/1] Do not write to invalid registers on the wm9712.

This patch fixes a bug where "virtual" registers were being written to the
ac97 bus.  This was causing unrelated registers to become corrupted (headphone 0x04,
touchscreen 0x78, etc).

This patch duplicates protection that was included in the wm9713 driver.

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>
---
 sound/soc/codecs/wm9712.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 0ac1215..e237bf6 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -463,7 +463,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
 {
 	u16 *cache = codec->reg_cache;
 
-	soc_ac97_ops.write(codec->ac97, reg, val);
+	if (reg < 0x7c)
+		soc_ac97_ops.write(codec->ac97, reg, val);
 	reg = reg >> 1;
 	if (reg < (ARRAY_SIZE(wm9712_reg)))
 		cache[reg] = val;
-- 
1.6.3.1


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH 1/1] Do not write to invalid registers on the wm9712.
  2009-12-23 15:00   ` Eric Millbrandt
@ 2009-12-23 15:23     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2009-12-23 15:23 UTC (permalink / raw)
  To: Eric Millbrandt
  Cc: grant.likely@secretlab.ca, alsa-devel@alsa-project.org,
	patch@alsa-project.org

On Wed, Dec 23, 2009 at 10:00:37AM -0500, Eric Millbrandt wrote:

> It looks like the legal jargon post-pended to the patch creates grief for
> git.  I am resubmitting the patch as an attachment so that is will not get
> mangled.

Applied, thanks.  The signature won't have done anything to affect the
patch - the unified diff format can handle comments and other descriptive
text interspersed with the code without problems.

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

end of thread, other threads:[~2009-12-23 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-22 17:28 [PATCH 1/1] Do not write to invalid registers on the wm9712 Eric Millbrandt
2009-12-22 17:59 ` Liam Girdwood
2009-12-22 23:46 ` Mark Brown
2009-12-23 15:00   ` Eric Millbrandt
2009-12-23 15:23     ` Mark Brown

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.