01 Nov, 2011
1 commit
-
The implicit presence of module.h lured several users into
incorrectly thinking that they only needed/used modparam.h
but once we clean up the module.h presence, these will show
up as build failures, so fix 'em now.Signed-off-by: Paul Gortmaker
12 Jul, 2011
1 commit
-
Signed-off-by: Takashi Iwai
14 Jun, 2011
1 commit
-
Kill tasklet usage in rawmidi core code. Use workq for the event callback
instead of tasklet (which is used only in core/seq/seq_midi.c).Signed-off-by: Takashi Iwai
17 Oct, 2010
1 commit
-
When a driver module is unloaded and the last still open file is a raw
MIDI device, the card and its devices will be actually freed in the
snd_card_file_remove() call when that file is closed. Afterwards, rmidi
and rmidi->card point into freed memory, so the module pointer is likely
to be garbage.
(This was introduced by commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a.)Signed-off-by: Clemens Ladisch
Reported-by: Krzysztof Foltman
Cc: 2.6.30-2.6.35
Signed-off-by: Takashi Iwai
09 Sep, 2010
1 commit
-
If we pass in a device which is higher than SNDRV_RAWMIDI_DEVICES then
the "next device" should be -1. This function just returns device + 1.But the main thing is that "device + 1" can lead to a (harmless) integer
overflow and that annoys static analysis tools.[fix the case for device == SNDRV_RAWMIDI_DEVICE by tiwai]
Signed-off-by: Dan Carpenter
Signed-off-by: Takashi Iwai
13 Apr, 2010
1 commit
-
Set no_llseek to llseek file ops of each sound component (but for hwdep).
This avoids the implicit BKL invocation via generic_file_llseek() used
as default when fops.llseek is NULL.Also call nonseekable_open() at each open ops to ensure the file flags
have no seek bit.Signed-off-by: Takashi Iwai
10 Dec, 2009
1 commit
-
While Linux provided an O_SYNC flag basically since day 1, it took until
Linux 2.4.0-test12pre2 to actually get it implemented for filesystems,
since that day we had generic_osync_around with only minor changes and the
great "For now, when the user asks for O_SYNC, we'll actually give
O_DSYNC" comment. This patch intends to actually give us real O_SYNC
semantics in addition to the O_DSYNC semantics. After Jan's O_SYNC
patches which are required before this patch it's actually surprisingly
simple, we just need to figure out when to set the datasync flag to
vfs_fsync_range and when not.This patch renames the existing O_SYNC flag to O_DSYNC while keeping it's
numerical value to keep binary compatibility, and adds a new real O_SYNC
flag. To guarantee backwards compatiblity it is defined as expanding to
both the O_DSYNC and the new additional binary flag (__O_SYNC) to make
sure we are backwards-compatible when compiled against the new headers.This also means that all places that don't care about the differences can
just check O_DSYNC and get the right behaviour for O_SYNC, too - only
places that actuall care need to check __O_SYNC in addition. Drivers and
network filesystems have been updated in a fail safe way to always do the
full sync magic if O_DSYNC is set. The few places setting O_SYNC for
lower layers are kept that way for now to stay failsafe.We enforce that O_DSYNC is set when __O_SYNC is set early in the open path
to make sure we always get these sane options.Note that parisc really screwed up their headers as they already define a
O_DSYNC that has always been a no-op. We try to repair it by using it for
the new O_DSYNC and redefinining O_SYNC to send both the traditional
O_SYNC numerical value _and_ the O_DSYNC one.Cc: Richard Henderson
Cc: Ivan Kokshaysky
Cc: Grant Grundler
Cc: "David S. Miller"
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: Thomas Gleixner
Cc: Al Viro
Cc: Andreas Dilger
Acked-by: Trond Myklebust
Acked-by: Kyle McMartin
Acked-by: Ulrich Drepper
Signed-off-by: Christoph Hellwig
Signed-off-by: Andrew Morton
Signed-off-by: Jan Kara
10 Nov, 2009
6 commits
-
Record the pid of the task that opened a RawMIDI substream.
Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
The substream_opened field is to count the number of opened substreams,
not the number of times that any substreams have been opened.Furthermore, all substreams being opened does not imply that the next
open would fail, due to the possibility of O_APPEND. With this wrong
check, opening a substream multiple times would succeed only if the
device had more unopened substreams.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai -
Commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a in 2.6.30 broke the
error handling code in rawmidi_open_priv().If only the output substream of a RawMIDI device has been opened and
if this device is then opened with O_RDWR | O_APPEND and if the
initialization of the input substream fails (either because of low
memory or because the device driver's open callback fails), then the
runtime structure of the already open output substream will be freed
and all following writes through the first handle will cause
snd_rawmidi_write() to use the NULL runtime pointer.Signed-off-by: Clemens Ladisch
Cc:
Signed-off-by: Takashi Iwai -
Commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a in 2.6.30 dropped the
check that a substream must already have been opened with O_APPEND to be
able to open it a second time.This would make it possible for a substream to be switched to append
mode, which would mean that non-atomic writes would fail unexpectedly.Signed-off-by: Clemens Ladisch
Cc:
Signed-off-by: Takashi Iwai -
Commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a in 2.6.30 moved the
substream initialization code to where it would be executed every time
the substream is opened.This had the consequence that any further opening would drop and leak
the data in the existing buffer, and that the device driver's open
callback would be called multiple times, unexpectedly.Signed-off-by: Clemens Ladisch
Cc:
Signed-off-by: Takashi Iwai
06 Nov, 2009
1 commit
-
Instead of storing the PID number, take a reference to the task's pid
structure. This protects against duplicates due to PID overflows, and
using pid_vnr() ensures that the PID returned by snd_ctl_elem_info() is
correct as seen from the current namespace.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
15 Jul, 2009
1 commit
-
Sending an Active Sensing message when closing a port can interfere with
the following data if the port is reopened and a note-on is sent before
the device's timeout has elapsed. Therefore, it is better to disable
this setting by default.Signed-off-by: Clemens Ladisch
Signed-off-by: Takashi Iwai
09 Mar, 2009
2 commits
-
Refactor rawmidi open/close code messes.
Signed-off-by: Takashi Iwai
-
The module refcount should be handled in the register_mutex to avoid
possible races with module unloading.Signed-off-by: Takashi Iwai
18 Dec, 2008
1 commit
-
Replace all tasklet_hi_schedule() callers with the normal
tasklet_schedule(). The former often causes troubles with
RT-kernels, and has actually no merit.Signed-off-by: Takashi Iwai
03 Nov, 2008
1 commit
-
The drivers (e.g. mtpav) may call rawmidi functions in irq handlers
even though the streams are not opened. This results in Oops or panic.This patch adds the rawmidi state check before actually operating the
rawmidi buffers.Tested-by: Ingo Molnar
Signed-off-by: Takashi Iwai
25 Sep, 2008
1 commit
-
The PCM and rawmidi open callbacks have a lock against card->controls_list
but it takes a wrong one, card->controls_rwsem, instead of a right one
card->ctl_files_rwlock. This patch fixes them.This change also fixes automatically the potential deadlocks due to
mm->mmap_sem in munmap and copy_from/to_user, reported by Sitsofe
Wheeler:A: snd_ctl_elem_user_tlv(): card->controls_rwsem => mm->mmap_sem
B: snd_pcm_open(): card->open_mutex => card->controls_rwsem
C: munmap: mm->mmap_sem => snd_pcm_release(): card->open_mutexThe patch breaks the chain.
Signed-off-by: Takashi Iwai
13 Aug, 2008
1 commit
-
Kill snd_assert() in sound/core/*, either removed or replaced with
if () with snd_BUG_ON().Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
01 Feb, 2008
2 commits
-
snd_rawmidi_kernel_read1/write1 weren't annotated but used
copy_to_user/copy_from_user when one of parameters (kernel) was equal to 0
remove it and add properly annotated parameterSigned-off-by: Marcin Ślusarz
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
This header file exists only for some hacks to adapt alsa-driver
tree. It's useless for building in the kernel. Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it. This should be really killed in
future.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
16 Oct, 2007
2 commits
-
Signed-off-by: Jaroslav Kysela
-
This patch cleans up duplicate includes in
sound/core/Signed-off-by: Jesper Juhl
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
09 May, 2007
1 commit
-
Remove includes of where it is not used/needed.
Suggested by Al Viro.Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).Signed-off-by: Randy Dunlap
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Feb, 2007
1 commit
-
Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.Signed-off-by: Arjan van de Ven
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 Feb, 2007
1 commit
-
This patch converts most uses of list_for_each to list_for_each_entry all
across alsa. In some place apparently an item can be on a list with
different pointers so of course that isn't compatible with list_for_each, I
therefore didn't touch those places.Signed-off-by: Johannes Berg
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
20 Dec, 2006
1 commit
-
If snd_rawmidi_new() failed to allocate substreams for input
(snd_rawmidi_alloc_substreams() failed to populate a
&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]), it will try to
free rawmidi instance by snd_rawmidi_free().
But it will cause oops because snd_rawmidi_free() tries to free
both of substreams list but list for output
(&rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT]) is not initialized yet.Signed-off-by: Akinobu Mita
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
23 Sep, 2006
3 commits
-
The PCM and rawmidi substreams can be selected explicitly by opening
control handle and set via *_PREFER_SUBDEVICE ioctl. But, when
multiple controls are opened, the driver gets confused.
The patch fixes the initialization of prefer_*_subdevice and the
check of multiple controls. The first set subdevice is picked up
as the valid one.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Orignally proposed by Sam Revitch .
Unregister device files at disconnection to avoid the futher accesses.
Also, the dev_unregister callback is removed and replaced with the
combination of disconnect + free.
A new function snd_card_free_when_closed() is introduced, which is
used in USB disconnect callback.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
- Add the linked list to each proc entry to enable a single-shot
disconnection (unregister)
- Deprecate snd_info_unregister(), use snd_info_free_entry()
- Removed NULL checks of snd_info_free_entry()Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
23 Jun, 2006
2 commits
-
Removed zero-initializations of static variables.
A tiny optimization.Signed-off-by: Takashi Iwai
-
Remove unneeded read/write_size fields in proc text ops.
snd_info_set_text_ops() is fixed, too.Signed-off-by: Takashi Iwai
29 Mar, 2006
1 commit
-
Get rid of unnessesary casts of kmalloc() return value in sound/
Signed-off-by: Jesper Juhl
Cc: Jaroslav Kysela
Cc: Takashi Iwai
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
22 Mar, 2006
1 commit
-
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.Signed-off-by: Ingo Molnar
Signed-off-by: Andrew Morton
Signed-off-by: Takashi Iwai
03 Jan, 2006
4 commits
-
Modules: RawMidi Midlevel,HDA generic driver
This patch contains the following possible cleanups:
- pci/hda/hda_proc.c should #include 'hda_local.h' for including the
prototype of it's global function snd_hda_codec_proc_new()
- core/rawmidi.c: make the needlessly global and EXPORT_SYMBOL'ed
function snd_rawmidi_info() staticSigned-off-by: Adrian Bunk
Signed-off-by: Takashi Iwai -
Modules: RawMidi Midlevel
When the output buffer size is changed, runtime->avail must be
adjusted to the new size; otherwise, draining of a bigger buffer would
appear to fail because avail does not reach buffer_size.Signed-off-by: Clemens Ladisch
-
Instead of storing the pointers to the device-specific structures in an
array, put them into the struct snd_minor, and look them up dynamically.This makes the device type modules independent of the minor number
encoding.Signed-off-by: Clemens Ladisch
-
Instead of a comment string, store the device type in the snd_minor
structure. This makes snd_minor more flexible, and has the nice side
effect that we don't need anymore to create a separate snd_minor
template for registering a device but can pass the file_operations
directly to snd_register_device().Signed-off-by: Clemens Ladisch