All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Timo Wischer <twischer@de.adit-jv.com>
Subject: Re: [PATCH v2 8/8] ALSA: aloop: Support runtime change of snd_timer via info interface
Date: Thu, 07 Nov 2019 09:06:26 +0100	[thread overview]
Message-ID: <s5hk18c860t.wl-tiwai@suse.de> (raw)
In-Reply-To: <20191105143218.5948-9-andrew_gabbasov@mentor.com>

On Tue, 05 Nov 2019 15:32:18 +0100,
Andrew Gabbasov wrote:
> 
> Show and change sound card timer source with read-write info
> file in proc filesystem. Initial string can still be set as
> module parameter.
> 
> The timer source string value can be changed at any time,
> but it is latched by PCM substream open callback (the first one
> for a particular cable). At this point it is actually used, that
> is the string is parsed, and the timer is looked up and opened.
> 
> The timer source is set for a loopback card (the same as initial
> setting by module parameter), but every cable uses the value,
> current at the moment of open.
> 
> Setting the value to empty string switches the timer to jiffies.
> 
> Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>

Unfortunately the whole code here are racy.  It may lead to a crash or
use-after-free easily.  Some locking is needed definitely.


thanks,

Takashi

WARNING: multiple messages have this Message-ID (diff)
From: Takashi Iwai <tiwai@suse.de>
To: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Cc: Timo Wischer <twischer@de.adit-jv.com>,
	alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH v2 8/8] ALSA: aloop: Support runtime change of snd_timer via info interface
Date: Thu, 07 Nov 2019 09:06:26 +0100	[thread overview]
Message-ID: <s5hk18c860t.wl-tiwai@suse.de> (raw)
In-Reply-To: <20191105143218.5948-9-andrew_gabbasov@mentor.com>

On Tue, 05 Nov 2019 15:32:18 +0100,
Andrew Gabbasov wrote:
> 
> Show and change sound card timer source with read-write info
> file in proc filesystem. Initial string can still be set as
> module parameter.
> 
> The timer source string value can be changed at any time,
> but it is latched by PCM substream open callback (the first one
> for a particular cable). At this point it is actually used, that
> is the string is parsed, and the timer is looked up and opened.
> 
> The timer source is set for a loopback card (the same as initial
> setting by module parameter), but every cable uses the value,
> current at the moment of open.
> 
> Setting the value to empty string switches the timer to jiffies.
> 
> Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>

Unfortunately the whole code here are racy.  It may lead to a crash or
use-after-free easily.  Some locking is needed definitely.


thanks,

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

  reply	other threads:[~2019-11-07  8:06 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 14:32 [PATCH v2 0/8] ALSA: aloop: Support sound timer as clock source instead of jiffies Andrew Gabbasov
2019-11-05 14:32 ` [alsa-devel] " Andrew Gabbasov
2019-11-05 14:32 ` [PATCH v2 1/8] ALSA: aloop: Describe units of variables Andrew Gabbasov
2019-11-05 14:32   ` [alsa-devel] " Andrew Gabbasov
2019-11-05 14:32   ` [PATCH v2 2/8] ALSA: aloop: loopback_timer_start: Support return of error code Andrew Gabbasov
2019-11-05 14:32     ` [alsa-devel] " Andrew Gabbasov
2019-11-05 14:32     ` [PATCH v2 3/8] ALSA: aloop: loopback_timer_stop: " Andrew Gabbasov
2019-11-05 14:32       ` [alsa-devel] " Andrew Gabbasov
2019-11-05 14:32       ` [PATCH v2 4/8] ALSA: aloop: Use callback functions for timer specific implementations Andrew Gabbasov
2019-11-05 14:32         ` [alsa-devel] " Andrew Gabbasov
2019-11-05 14:32         ` [PATCH v2 5/8] ALSA: aloop: Rename all jiffies timer specific functions Andrew Gabbasov
2019-11-05 14:32           ` [alsa-devel] " Andrew Gabbasov
2019-11-05 14:32           ` [PATCH v2 6/8] ALSA: aloop: Move CABLE_VALID_BOTH to the top of file Andrew Gabbasov
2019-11-05 14:32             ` [alsa-devel] " Andrew Gabbasov
2019-11-05 14:32             ` [PATCH v2 7/8] ALSA: aloop: Support selection of snd_timer instead of jiffies Andrew Gabbasov
2019-11-05 14:32               ` [alsa-devel] " Andrew Gabbasov
2019-11-05 14:32               ` [PATCH v2 8/8] ALSA: aloop: Support runtime change of snd_timer via info interface Andrew Gabbasov
2019-11-05 14:32                 ` [alsa-devel] " Andrew Gabbasov
2019-11-07  8:06                 ` Takashi Iwai [this message]
2019-11-07  8:06                   ` Takashi Iwai
2019-11-07 10:40                   ` Gabbasov, Andrew
2019-11-07 10:40                     ` [alsa-devel] " Gabbasov, Andrew
2019-11-07 10:50                     ` Takashi Iwai
2019-11-07 10:50                       ` [alsa-devel] " Takashi Iwai
2019-11-06  0:43               ` [PATCH v2 7/8] ALSA: aloop: Support selection of snd_timer instead of jiffies kbuild test robot
2019-11-06  0:43                 ` kbuild test robot
2019-11-06  0:43                 ` [alsa-devel] " kbuild test robot
2019-11-06 21:25               ` kbuild test robot
2019-11-06 21:25                 ` kbuild test robot
2019-11-06 21:25                 ` [alsa-devel] " kbuild test robot
2019-11-07  8:05               ` Takashi Iwai
2019-11-07  8:05                 ` [alsa-devel] " Takashi Iwai
2019-11-08 18:09                 ` Andrew Gabbasov
2019-11-08 18:09                   ` [alsa-devel] " Andrew Gabbasov
2019-11-11 11:17                 ` Andrew Gabbasov
2019-11-11 11:17                   ` [alsa-devel] " Andrew Gabbasov
2019-11-06 15:51       ` [PATCH v2 3/8] ALSA: aloop: loopback_timer_stop: Support return of error code Takashi Iwai
2019-11-06 15:51         ` [alsa-devel] " Takashi Iwai
2019-11-06 17:45         ` Andrew Gabbasov
2019-11-06 17:45           ` [alsa-devel] " Andrew Gabbasov
2019-11-06 15:50     ` [PATCH v2 2/8] ALSA: aloop: loopback_timer_start: " Takashi Iwai
2019-11-06 15:50       ` [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=s5hk18c860t.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andrew_gabbasov@mentor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=twischer@de.adit-jv.com \
    /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 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.