All of lore.kernel.org
 help / color / mirror / Atom feed
* regarding references taken on platform and codec driver modules
@ 2011-01-03 11:00 Harsha, Priya
  2011-01-03 15:54 ` Mark Brown
  0 siblings, 1 reply; 12+ messages in thread
From: Harsha, Priya @ 2011-01-03 11:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

Hi,

I have 4 dai_link instances as below. (the codec_name and platform_name are 
the same for all the 4 instances)

struct snd_soc_dai_link mfld_msic_dailink[] = {
        {
                .name = "Intel MSIC Headset",
                .stream_name = "Codec",
                .cpu_dai_name = "Headset-cpu-dai",
                .codec_dai_name = "Intel MSIC Headset",
                .codec_name = "mid-msic-codec",
                .platform_name = "mid-audio-platform",
                .init = msic_init,
        },
        {
                .name = "Intel MSIC Speaker",
                .stream_name = "Speaker",
                .cpu_dai_name = "Speaker-cpu-dai",
                .codec_dai_name = "Intel MSIC Speaker",
                .codec_name = "mid-msic-codec",
                .platform_name = "mid-audio-platform",
                .init = NULL,
        },
        {
                .name = "Intel MSIC Vibra",
                .stream_name = "Vibra1",
                .cpu_dai_name = "Vibra 1-cpu-dai",
                .codec_dai_name = "Intel MSIC Vibra",
                .codec_name = "mid-msic-codec",
                .platform_name = "mid-audio-platform",
                .init = NULL,
        },
        {
                .name = "Intel MSIC Haptic",
                .stream_name = "Vibra2",
                .cpu_dai_name = "Vibra 2-cpu-dai",
                .codec_dai_name = "Intel MSIC Haptic",
                .codec_name =  "mid-msic-codec",
                .platform_name = "mid-audio-platform",
                .init = NULL,
        },
};

When the soc_bind_dai_link is called
  For every dai_link instance, reference to codec, platform and cpu_dai are taken

When soc_remove_dai_link is called, the reference is released as follows
  For cpu_dai after checking if cpu_dai->probed is 1
 
  For codec and platform, it checks for codec->probed and platform->probed
  So for the first instance of dai_link, the reference of codec and platform are
  removed correctly but for the other instances, it finds that codec->probed and
  platform->probed are 0 and does not remove the reference. As a result, the
  reference count of codec and platform drivers remain as 3 and the rmmod on
  those driver modules fail.

Is there anything that I am doing wrong here or missing out?

Thanks,
Harsha

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: regarding references taken on platform and codec driver modules
@ 2011-01-03  8:26 Harsha, Priya
  0 siblings, 0 replies; 12+ messages in thread
From: Harsha, Priya @ 2011-01-03  8:26 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

>Hi,
>
>In soc-core.c, I see that try_module_get() is used to get reference count on the
>codec and platform drivers. But I don't see try_module_put() to remove the
>reference count after usage.
>
>Because of this, my reference count on codec and platform driver is never
>reduced and I am not able to do rmmod of these drivers. But I can rmmod the
>machine driver as there are no reference count taken on it.
>
>Is this intentional to avoid rmmod of these modules? Or this is to be fixed
>
Please ignore this email.
>-Harsha

^ permalink raw reply	[flat|nested] 12+ messages in thread
* regarding references taken on platform and codec driver modules
@ 2011-01-03  7:09 Harsha, Priya
  0 siblings, 0 replies; 12+ messages in thread
From: Harsha, Priya @ 2011-01-03  7:09 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

Hi,

In soc-core.c, I see that try_module_get() is used to get reference count on the
codec and platform drivers. But I don't see try_module_put() to remove the
reference count after usage.

Because of this, my reference count on codec and platform driver is never
reduced and I am not able to do rmmod of these drivers. But I can rmmod the
machine driver as there are no reference count taken on it.

Is this intentional to avoid rmmod of these modules? Or this is to be fixed

-Harsha

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

end of thread, other threads:[~2011-01-10 19:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-03 11:00 regarding references taken on platform and codec driver modules Harsha, Priya
2011-01-03 15:54 ` Mark Brown
2011-01-03 16:27   ` Harsha, Priya
2011-01-03 16:35     ` Mark Brown
2011-01-03 17:56       ` Harsha, Priya
2011-01-04 15:48         ` Mark Brown
2011-01-05  6:00           ` Harsha, Priya
2011-01-05 17:19             ` Koul, Vinod
2011-01-06  9:11             ` Koul, Vinod
2011-01-10 19:01               ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2011-01-03  8:26 Harsha, Priya
2011-01-03  7:09 Harsha, Priya

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.