mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Greg KH <greg@kroah.com>
Cc: Damien Wyart <damien.wyart@free.fr>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	James@superbug.demon.co.uk
Subject: Re: ALSA message with 2.6.19-rc4-mm2 (not -mm1)
Date: Mon, 06 Nov 2006 16:34:51 +0100	[thread overview]
Message-ID: <s5hvelsfv1g.wl%tiwai@suse.de> (raw)
In-Reply-To: <20061102222242.GA17744@kroah.com>

At Thu, 2 Nov 2006 14:22:42 -0800,
Greg KH wrote:
> 
> On Thu, Nov 02, 2006 at 11:02:41PM +0100, Damien Wyart wrote:
> > Hello,
> > 
> > > > I notice these messages when 2.6.19-rc4-mm2 boots (also with
> > > > rc3-mm1) but 2.6.19-rc4-mm1 did NOT display them. Related to the
> > > > driver tree ?
> > 
> > * Greg KH <greg@kroah.com> [061102 20:26]:
> > > How many different sound cards do you have in your machine?
> > 
> > Only one, a Sound Blaster Live.
> > 
> > > Can you send me the output of 'ls /sys/class/sound/' with the
> > > 2.6.19-rc4 (or any other non-mm) kernel?
> > 
> > With 2.6.19-rc4-mm2, this gives:
> > admmidi  amidi  card0      dmmidi  hwC0D0  midi      midiC0D1  mixer    pcmC0D0p  pcmC0D2c  pcmC0D3p  sequencer   timer
> > adsp     audio  controlC0  dsp     hwC0D2  midiC0D0  midiC0D2  pcmC0D0c pcmC0D1c  pcmC0D2p  seq       sequencer2
> > 
> > While Vanilla 2.6.19-rc4 leads to:
> > admmidi  amidi  controlC0  dsp     hwC0D2  midiC0D0  midiC0D2  pcmC0D0c pcmC0D1c  pcmC0D2p  seq        sequencer2
> > adsp     audio  dmmidi     hwC0D0  midi    midiC0D1  mixer     pcmC0D0p pcmC0D2c  pcmC0D3p  sequencer  timer
> > 
> > Seems there is an additional 'card0' entry in the first case.
> 
> That should be a symlink right?  Well it will be if you have
> CONFIG_SYSFS_DEPRECATED disabled.  What is the setting of that config
> option?
> 
> > With Vanilla, the relevant part of the bootlog is:
> > 
> > Nov  2 22:49:03 brouette kernel: Advanced Linux Sound Architecture Driver Version 1.0.13 (Sun Oct 22 08:56:16 2006 UTC).
> > Nov  2 22:49:03 brouette kernel: ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 21
> > Nov  2 22:49:03 brouette kernel: ALSA device list:
> > Nov  2 22:49:03 brouette kernel:   #0: SB Live [Unknown] (rev.10, serial:0x80671102) at 0xdf20, irq 21
> > 
> > so exactly the same as in mm2, without the error messages.
> > 
> > As rc4-mm1 doesn't show the problem (and so gives the very same output
> > as plain rc4), I still wonder if this is an interaction with the driver
> > tree ?
> 
> I do have an alsa patch in my tree that adds the "card0" stuff, but it
> looks like it is working for you.  I wonder why we are trying to
> register the same card twice.
> 
> Maybe we always did that and never noticed the failure?
> 
> Takashi, any thoughts?

Well, I've not checked the problem in detail yet (since I'm back from
vacation), but my rough guess is that snd_card_register() is indeed
called multiple times.
It's correct behavior as this function is supposed to be callable
multiple times.  Some components (like emux-synth) are implemented as
a kind of "plug-in", and they call snd_card_register() to assure that
the underlying card tree gets ready.

A simple fix would be like below.  Could you give it a try?


Takashi

===

[PATCH] Don't register card* sysfs entry multiple times

Signed-off-by: Takashi Iwai <tiwai@suse.de>

--- linux-2.6.19-rc4-mm2/sound/core/init.c	2006-11-06 16:29:21.000000000 +0100
+++ linux-2.6.19-rc4-mm2/sound/core/init.c	2006-11-06 16:29:51.000000000 +0100
@@ -496,10 +496,12 @@ int snd_card_register(struct snd_card *c
 	int err;
 
 	snd_assert(card != NULL, return -EINVAL);
-	card->dev = device_create(sound_class, card->parent, 0, "card%i",
-				  card->number);
-	if (IS_ERR(card->dev))
-		card->dev = NULL;
+	if (!card->dev) {
+		card->dev = device_create(sound_class, card->parent, 0,
+					  "card%i", card->number);
+		if (IS_ERR(card->dev))
+			card->dev = NULL;
+	}
 	if ((err = snd_device_register_all(card)) < 0)
 		return err;
 	mutex_lock(&snd_card_mutex);

  parent reply	other threads:[~2006-11-06 15:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-02 10:26 Damien Wyart
2006-11-02 18:27 ` Andrew Morton
2006-11-02 19:26 ` Greg KH
2006-11-02 22:02   ` Damien Wyart
2006-11-02 22:22     ` Greg KH
2006-11-03  6:53       ` Damien Wyart
2006-11-03  7:08         ` Greg KH
2006-11-03  9:38           ` Damien Wyart
2006-11-06 15:34       ` Takashi Iwai [this message]
2006-11-06 17:30         ` Damien Wyart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hvelsfv1g.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=James@superbug.demon.co.uk \
    --cc=akpm@osdl.org \
    --cc=damien.wyart@free.fr \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®