From: Takashi Iwai <tiwai@suse.de>
To: Nicholas Mc Guire <der.herr@hofr.at>
Cc: Nicholas Mc Guire <hofrat@osadl.org>,
Jaroslav Kysela <perex@perex.cz>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mips/ad1843: convert time to jiffies HZ independent
Date: Mon, 15 Jun 2015 13:22:08 +0200 [thread overview]
Message-ID: <s5hpp4xgqsf.wl-tiwai@suse.de> (raw)
In-Reply-To: <20150614171659.GA15401@opentech.at>
At Sun, 14 Jun 2015 19:16:59 +0200,
Nicholas Mc Guire wrote:
>
> On Sun, 14 Jun 2015, Takashi Iwai wrote:
>
> > At Sun, 14 Jun 2015 10:20:59 +0200,
> > Nicholas Mc Guire wrote:
> > >
> > > PI compliance scanning with coccinelle flagged:
> > > ./sound/mips/ad1843.c:503:2-32: WARNING:
> > > timeout (5) seems HZ dependent
> > >
> > > This was introduced in 'commit 862c2c0a61c5 ("ALSA: ALSA driver for SGI O2
> > > audio board")'. schedule_timeout_interruptible() expects a timeout in
> > > jiffies so the numeric constant makes the effective timeout HZ dependent.
> > > Simply put it through msecs_to_jiffies() to make it HZ independent.
> > >
> > > Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> > > ---
> > >
> > > The loop here is bounded by 500 jiffies and it does not seem reasonable that
> > > it would loop 10 times faster on HZ=1000 configs over HZ=100 configs. The
> > > conversion via msecs_to_jiffies(5) ensures that it will loop at most 100
> > > times for all configs of HZ which seems reasonable (to me) but needs to be
> > > checked by someone that knows the details of this driver.
> >
> > Using 5ms looks reasonable for this case. However,
> > schedule_timeout_interruptible() isn't. This is a loop that won't
> > break. So, the best would be to replace it with msleep() or its
> > friends.
> >
> > > Note that the CONFIG_SND_PCM_OSS dependency was not listed in the
> > > Depends on: in Kconfig (which it probably should)
> >
> > Why at all? It has nothing to do with OSS.
> >
> the procedure to see the problem I used was
> (linux-next 20150612)
> make ip32_defconfig ARCH=mips
> make menuconfig ARCH=mips
> Device Drivers
> ...
> <M> Sound card support --->
> <M> Advanced Linux Sound Architecture --->
> [*] MIPS sound devices --->
> <M> SGI O2 Audio
>
> compiling fails with:
> MODPOST 95 modules
> ERROR: "snd_pcm_period_elapsed" [sound/mips/snd-sgi-o2.ko] undefined!
> ERROR: "snd_pcm_set_ops" [sound/mips/snd-sgi-o2.ko] undefined!
> ERROR: "snd_pcm_lib_get_vmalloc_page" [sound/mips/snd-sgi-o2.ko] undefined!
> ERROR: "snd_pcm_lib_ioctl" [sound/mips/snd-sgi-o2.ko] undefined!
> ERROR: "_snd_pcm_lib_alloc_vmalloc_buffer" [sound/mips/snd-sgi-o2.ko] undefined!
> ERROR: "snd_pcm_new" [sound/mips/snd-sgi-o2.ko] undefined!
> ERROR: "snd_pcm_lib_free_vmalloc_buffer" [sound/mips/snd-sgi-o2.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
>
> as the pcm_lib functions depend on SND_PCM I added that - So
> if I add the below patch the problem goes away and the module
> build correclty - not saying that this is the right fix though
> (did not look into it in more detail yet)
Yes, this dependency fix is correct, and I queued your patch now.
But the dependency on CONFIG_SND_PCM_OSS is wrong.
A similar fix is needed for HAL2, and I fixed it, too.
thanks,
Takashi
> >From d9cb7d166613e6129f021a913f66f377f5ac56c0 Mon Sep 17 00:00:00 2001
> From: Nicholas Mc Guire <hofrat@osadl.org>
> Date: Sun, 14 Jun 2015 19:06:19 +0200
> Subject: [PATCH] ALSA: let SND_SGI_O2 select SND_PCM
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> sound/mips/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/mips/Kconfig b/sound/mips/Kconfig
> index d2f615a..7875af0 100644
> --- a/sound/mips/Kconfig
> +++ b/sound/mips/Kconfig
> @@ -12,6 +12,7 @@ if SND_MIPS
> config SND_SGI_O2
> tristate "SGI O2 Audio"
> depends on SGI_IP32
> + select SND_PCM
> help
> Sound support for the SGI O2 Workstation.
>
> --
> 1.7.10.4
>
next prev parent reply other threads:[~2015-06-15 11:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-14 8:20 [PATCH] mips/ad1843: convert time to jiffies HZ independent Nicholas Mc Guire
2015-06-14 16:53 ` Takashi Iwai
2015-06-14 17:16 ` Nicholas Mc Guire
2015-06-15 11:22 ` Takashi Iwai [this message]
2015-06-15 16:27 ` Nicholas Mc Guire
2015-06-15 18:40 ` [alsa-devel] " Takashi Iwai
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=s5hpp4xgqsf.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=der.herr@hofr.at \
--cc=hofrat@osadl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
/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