alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs
@ 2012-04-05 12:45 Fabio Estevam
  2012-04-05 12:45 ` [PATCH 2/2] ASoC: imx-audmux: Check for NULL pointer Fabio Estevam
  2012-04-05 14:25 ` [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2012-04-05 12:45 UTC (permalink / raw)
  To: alsa-devel; +Cc: joancarles, Fabio Estevam, broonie, Fabio Estevam, kernel

Doing a 'cat /sys/kernel/debug/audmux/ssi7' causes the following oops to be printed by the kernel:

Uhandled fault: external abort on non-linefetch (0x008) at 0xf53b003c
Internal error: : 8 [#1] PREEMPT
Modules linked in:
CPU: 0    Not tainted  (3.3.0-00033-gecc726e-dirty #307)
PC is at audmux_read_file+0x68/0x2f4
LR is at clk_enable+0x3c/0x48
pc : [<c001b8c8>]   lr : [<c00190a0>]    psr: a0000013
sp : c3ad3f38  ip : c30a4000  fp : 00000003
r10: 00001000  r9 : be83fb00  r8 : c3ad3f80
r7 : c3ad3f80  r6 : 00000007  r5 : 00031010  r4 : c30a5000
r3 : f53b0000  r2 : 0000003c  r1 : 380fa100  r0 : c068dda0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 83034000  DAC: 00000015
Process cat (pid: 1042, stack limit = 0xc3ad2270)
Stack: (0xc3ad3f38 to 0xc3ad4000)
3f20:                                                      c3139180 00000000
3f40: c3bc6500 00001000 be83fb00 c3ad3f80 00001000 c3ad2000 00000000 c0095f3c
3f60: 00000003 c3bc6508 c3bc6500 be83fb00 00000000 00000000 00001000 c0096010
3f80: 00000000 00000000 b6fe2050 00000000 00001000 be83fb00 00000003 00000003
3fa0: c000eb88 c000e9e0 00001000 be83fb00 00000003 be83fb00 00001000 00000000
3fc0: 00001000 be83fb00 00000003 00000003 00000001 00000001 00000000 00000003
3fe0: 000bec8c be83fae0 0000f808 b6ea8d5c 60000010 00000003 7dff7ede 749bedf1
[<c001b8c8>] (audmux_read_file+0x68/0x2f4) from [<c0095f3c>] (vfs_read+0xb0/0x144)
[<c0095f3c>] (vfs_read+0xb0/0x144) from [<c0096010>] (sys_read+0x40/0x70)
[<c0096010>] (sys_read+0x40/0x70) from [<c000e9e0>] (ret_fast_syscall+0x0/0x2c)
Code: e1a02186 e2822004 e3500000 e7935186 (e7937002)
---[ end trace 4d046e31309023de ]---

Fix the ssi port numbers in sysfs to fix this problem.

Reported-by: Joan Carles <joancarles@fqingenieria.es>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/imx-audmux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index 1765a19..d467a1b 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -152,7 +152,7 @@ static void __init audmux_debugfs_init(void)
 		return;
 	}
 
-	for (i = 1; i < 8; i++) {
+	for (i = 0; i < MX31_AUDMUX_PORT6_SSI_PINS_6 + 1; i++) {
 		snprintf(buf, sizeof(buf), "ssi%d", i);
 		if (!debugfs_create_file(buf, 0444, audmux_debugfs_root,
 					 (void *)i, &audmux_debugfs_fops))
-- 
1.7.1

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

* [PATCH 2/2] ASoC: imx-audmux: Check for NULL pointer
  2012-04-05 12:45 [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs Fabio Estevam
@ 2012-04-05 12:45 ` Fabio Estevam
       [not found]   ` <4F7D94CC.80300@pengutronix.de>
  2012-04-05 14:25 ` [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2012-04-05 12:45 UTC (permalink / raw)
  To: alsa-devel; +Cc: joancarles, Fabio Estevam, broonie, Fabio Estevam, kernel

Check for NULL pointer before accessing it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/imx-audmux.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index d467a1b..21d67bb 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -76,6 +76,9 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
 	if (audmux_clk)
 		clk_prepare_enable(audmux_clk);
 
+	if (!audmux_base)
+		return -ENOSYS;
+
 	ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port));
 	pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port));
 
-- 
1.7.1

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

* Re: [PATCH 2/2] ASoC: imx-audmux: Check for NULL pointer
       [not found]   ` <4F7D94CC.80300@pengutronix.de>
@ 2012-04-05 12:55     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-04-05 12:55 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: joancarles, Fabio Estevam, alsa-devel, Fabio Estevam, kernel


[-- Attachment #1.1: Type: text/plain, Size: 401 bytes --]

On Thu, Apr 05, 2012 at 02:49:16PM +0200, Marc Kleine-Budde wrote:
> On 04/05/2012 02:45 PM, Fabio Estevam wrote:

> >  	if (audmux_clk)
> >  		clk_prepare_enable(audmux_clk);

> > +	if (!audmux_base)
> > +		return -ENOSYS;

> What about "clk_prepare_enable"? Do you need to undo it in case of an error?

Or alternatively just reverse the order of the two tests so you don't
need to worry about that.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs
  2012-04-05 12:45 [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs Fabio Estevam
  2012-04-05 12:45 ` [PATCH 2/2] ASoC: imx-audmux: Check for NULL pointer Fabio Estevam
@ 2012-04-05 14:25 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-04-05 14:25 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: joancarles, Fabio Estevam, alsa-devel, kernel


[-- Attachment #1.1: Type: text/plain, Size: 436 bytes --]

On Thu, Apr 05, 2012 at 09:45:51AM -0300, Fabio Estevam wrote:
> Doing a 'cat /sys/kernel/debug/audmux/ssi7' causes the following oops to be printed by the kernel:

Applied both, thanks.  For bug fixes like this which apply to the -rc
releases you should generally submit against the stable tree (or Linus'
tree) so they can be sent to Linus during -rc.  Fortunately git am just
figured things out easily so no problem this time round.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2012-04-05 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 12:45 [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs Fabio Estevam
2012-04-05 12:45 ` [PATCH 2/2] ASoC: imx-audmux: Check for NULL pointer Fabio Estevam
     [not found]   ` <4F7D94CC.80300@pengutronix.de>
2012-04-05 12:55     ` Mark Brown
2012-04-05 14:25 ` [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs Mark Brown

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