20 Jul, 2007
5 commits
-
Convert the snd_assert()s to simple if()s to prevent crashes when one of
the timer instance ioctls is called before the file is bound to a timer
device.Signed-off-by: Clemens Ladisch
Signed-off-by: Jaroslav Kysela -
The check of a substream in snd_pcm_drain() might not be always correct
since runtime can point a different substream (although the PCM state
of each linked substream should be same, in theory).
This patch fixes it.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Fixed the invalid use of schedule_timeout_interruptible() without
checking pending signals. Simply replaced with schedule_timeout().
Suggestions thanks to Jeff Garzik.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc).
Here is a short excerpt of the semantic patch performing
this transformation:@@
type T2;
expression x;
identifier f,fld;
expression E;
expression E1,E2;
expression e1,e2,e3,y;
statement S;
@@x =
- kmalloc
+ kzalloc
(E1,E2)
... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\)
- memset((T2)x,0,E1);@@
expression E1,E2,E3;
@@- kzalloc(E1 * E2,E3)
+ kcalloc(E1,E2,E3)[akpm@linux-foundation.org: get kcalloc args the right way around]
Signed-off-by: Yoann Padioleau
Cc: Richard Henderson
Cc: Ivan Kokshaysky
Acked-by: Russell King
Cc: Bryan Wu
Acked-by: Jiri Slaby
Cc: Dave Airlie
Acked-by: Roland Dreier
Cc: Jiri Kosina
Acked-by: Dmitry Torokhov
Cc: Benjamin Herrenschmidt
Acked-by: Mauro Carvalho Chehab
Acked-by: Pierre Ossman
Cc: Jeff Garzik
Cc: "David S. Miller"
Acked-by: Greg KH
Cc: James Bottomley
Cc: "Antonino A. Daplas"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
unregister_chrdev() always returns 0. There is no need to check the return
value.Signed-off-by: Akinobu Mita
Cc: "David S. Miller"
Cc: Takashi Iwai
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 May, 2007
3 commits
-
When launching 'jackd -d alsa', lockdep issues the following warning:
[39701.405086] =============================================
[39701.405093] [ INFO: possible recursive locking detected ]
[39701.405107] 2.6.21-rc5-mm4 #2
[39701.405109] ---------------------------------------------
[39701.405112] jackd/17366 is trying to acquire lock:
[39701.405114] (&substream->self_group.lock){....}, at: [] snd_pcm_action_group+0x90/0x240
[39701.405131]
[39701.405131] but task is already holding lock:
[39701.405134] (&substream->self_group.lock){....}, at: [] snd_pcm_action_lock_irq+0x3f/0xb0
[39701.405141]
[39701.405142] other info that might help us debug this:
[39701.405145] 3 locks held by jackd/17366:
[39701.405147] #0: (snd_pcm_link_rwlock){....}, at: [] snd_pcm_action_lock_irq+0x27/0xb0
[39701.405155] #1: (&substream->group->lock){....}, at: [] snd_pcm_action_lock_irq+0x38/0xb0
[39701.405163] #2: (&substream->self_group.lock){....}, at: [] snd_pcm_action_lock_irq+0x3f/0xb0
[39701.405171]
[39701.405171] stack backtrace:
[39701.405174] [] show_trace_log_lvl+0x1a/0x30
[39701.405179] [] show_trace+0x12/0x20
[39701.405183] [] dump_stack+0x16/0x20
[39701.405187] [] __lock_acquire+0xbd0/0x1040
[39701.405193] [] lock_acquire+0x70/0x90
[39701.405197] [] _spin_lock+0x36/0x50
[39701.405203] [] snd_pcm_action_group+0x90/0x240
[39701.405207] [] snd_pcm_action_lock_irq+0x53/0xb0
[39701.405211] [] snd_pcm_common_ioctl1+0x35f/0xfb0
[39701.405215] [] snd_pcm_playback_ioctl1+0x34/0x420
[39701.405219] [] snd_pcm_playback_ioctl+0x43/0x50
[39701.405223] [] do_ioctl+0x28/0x80
[39701.405229] [] vfs_ioctl+0x57/0x290
[39701.405233] [] sys_ioctl+0x39/0x60
[39701.405237] [] sysenter_past_esp+0x5d/0x99
[39701.405240] =======================
The attached lockdep annotation silences the warning.Signed-off-by: Frederik Deweerdt
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Replacing (n & (n-1)) in the context of power of 2 checks
with is_power_of_2Signed-off-by: vignesh babu
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Added a new macro snd_pcm_group_for_each_entry() just for code cleanup.
Old macros, snd_pcm_group_for_each() and snd_pcm_group_substream_entry(),
are removed.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
09 May, 2007
2 commits
-
Fix various typos in kernel docs and Kconfigs, 2.6.21-rc4.
Signed-off-by: Matt LaPlante
Signed-off-by: Adrian Bunk -
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
03 May, 2007
1 commit
-
I noticed that many source files include while they do
not appear to need it. Here is an attempt to clean it all up.In order to find all possibly affected files, I searched for all
files including but without any other occurence of "pci"
or "PCI". I removed the include statement from all of these, then I
compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
false positives manually.My tests covered 66% of the affected files, so there could be false
positives remaining. Untested files are:arch/alpha/kernel/err_common.c
arch/alpha/kernel/err_ev6.c
arch/alpha/kernel/err_ev7.c
arch/ia64/sn/kernel/huberror.c
arch/ia64/sn/kernel/xpnet.c
arch/m68knommu/kernel/dma.c
arch/mips/lib/iomap.c
arch/powerpc/platforms/pseries/ras.c
arch/ppc/8260_io/enet.c
arch/ppc/8260_io/fcc_enet.c
arch/ppc/8xx_io/enet.c
arch/ppc/syslib/ppc4xx_sgdma.c
arch/sh64/mach-cayman/iomap.c
arch/xtensa/kernel/xtensa_ksyms.c
arch/xtensa/platform-iss/setup.c
drivers/i2c/busses/i2c-at91.c
drivers/i2c/busses/i2c-mpc.c
drivers/media/video/saa711x.c
drivers/misc/hdpuftrs/hdpu_cpustate.c
drivers/misc/hdpuftrs/hdpu_nexus.c
drivers/net/au1000_eth.c
drivers/net/fec_8xx/fec_main.c
drivers/net/fec_8xx/fec_mii.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/fs_enet/mac-fcc.c
drivers/net/fs_enet/mac-fec.c
drivers/net/fs_enet/mac-scc.c
drivers/net/fs_enet/mii-bitbang.c
drivers/net/fs_enet/mii-fec.c
drivers/net/ibm_emac/ibm_emac_core.c
drivers/net/lasi_82596.c
drivers/parisc/hppb.c
drivers/sbus/sbus.c
drivers/video/g364fb.c
drivers/video/platinumfb.c
drivers/video/stifb.c
drivers/video/valkyriefb.c
include/asm-arm/arch-ixp4xx/dma.h
sound/oss/au1550_ac97.cI would welcome test reports for these files. I am fine with removing
the untested files from the patch if the general opinion is that these
changes aren't safe. The tested part would still be nice to have.Note that this patch depends on another header fixup patch I submitted
to LKML yesterday:
[PATCH] scatterlist.h needs types.h
http://lkml.org/lkml/2007/3/01/141Signed-off-by: Jean Delvare
Cc: Badari Pulavarty
Signed-off-by: Greg Kroah-Hartman
15 Feb, 2007
1 commit
-
After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there. Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm. I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).Signed-off-by: Tim Schmielau
Acked-by: Russell King
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
12 commits
-
The fix for sysfs breakage with CONFIG_SYSFS_DEPRECATED was flown
away by the conflicted merge of the ALSA git tree. The patch below
fixes it again.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Fix possible rwsem deadlocks in sequencer code at removal of
sequencer ports. The list_lock of port group can be double
locked.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
snd_internval_list() may access invalid memory in the case count = 0
is given. It shouldn't be passed, but it'd better to make the code
a bit more robust.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
snd_card_file_remove() can free the snd_card.
Touch hw->* only before calling snd_card_file_remove().
Unrelated: Allow hwdep devices not to have own ops.release();Signed-off-by: Karsten Wiese
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Remove the final useless reference to the obsolete KERNELD feature.
Signed-off-by: Robert P. J. Day
Signed-off-by: Andrew Morton
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Make the control flow clear with indentation, adds some comments
and improves error reporting.Signed-off-by: Oliver Neukum
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Added a helper function snd_pci_quirk_lookup()
to look up PCI SSID quirk list.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Now that everyone uses snd_ctl_new1() and noone is using snd_ctl_new()
anymore, we can make it static.Signed-off-by: Adrian Bunk
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
Users ask us many times about the maximum DMA size for PCM devices. This
file gives them a hint in KB.Signed-off-by: Jaroslav Kysela
-
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 -
This patch adds a struct device pointer to struct snd_pcm in order to be
able to give it a different device than the card. It defaults to the card's
device, however, so it should behave identically for drivers not touching
the field.Signed-off-by: Johannes Berg
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
This patch adds snd_register_device_for_dev taking a struct device
pointer to link the new device to and makes snd_register_device a simple
static inline wrapper around it.Signed-off-by: Johannes Berg
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela
30 Jan, 2007
1 commit
-
The recent change for a new sysfs tree with card* object breaks the
/sys/class/sound tree if CONFIG_SYSFS_DEPRECATED is enabled.
The device in each entry doesn't point the correct device object:/sys/class/sound
...
|-- pcmC0D0c
| |-- dev
| |-- device -> ../../../class/sound/card0
| |-- pcm_class
| |-- power
| | `-- wakeup
| |-- subsystem -> ../../../class/sound
| `-- ueventAlso, this change breaks some drivers (like sound/arm/*) referring
card->dev directly to obtain the device object for memory handling.This patch reverts the semantics of card->dev to the former version,
which points to a real device object. The card* object is stored in a
new card->card_dev field, instead. The device parent is chosen either
card->dev or card->card_dev according to CONFIG_SYSFS_DEPRECATED to
keep the tree compatibility.
Also, card* isn't created if CONFIG_SYSFS_DEPRECATED is enabled. The
reason of card* object is a root of all beloing devices, and it makes
little sense if each sound device points to the real device object
directly.Signed-off-by: Takashi Iwai
Acked-by: Monty Montgomery
Signed-off-by: Greg Kroah-Hartman
20 Dec, 2006
7 commits
-
If snd_pcm_new_stream() fails to initalize a substream (if
snd_pcm_substream_proc_init() returns error), snd_pcm_new_stream()
immediately return without unlinking that kfree()d substram.
It causes oops when snd_pcm_free() iterates the list of substream to
free them by invalid reference.Signed-off-by: Akinobu Mita
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
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 -
Fixed the race among multiple threads accessing the OSS PCM
instance concurrently by simply introducing a mutex for protecting
a setup of the PCM.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
This patch removes some obviously dead code spotted by the Coverity
checker.Signed-off-by: Adrian Bunk
Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
The case where silence_size < boundary was broken because different
parts of the snd_pcm_playback_silence() function disagreed about whether
silence_start should point to the start or to the end of the buffer part
to be silenced.
This patch changes the code to always use to the start, which also
simplifies several calculations.Signed-off-by: Clemens Ladisch
Signed-off-by: Jaroslav Kysela -
Use the roundup macro instead of manual calculations.
Signed-off-by: Clemens Ladisch
Signed-off-by: Jaroslav Kysela -
Use the ALIGN macro instead of manual calculations.
Signed-off-by: Clemens Ladisch
Signed-off-by: Jaroslav Kysela
14 Dec, 2006
1 commit
-
Run this:
#!/bin/sh
for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
echo "De-casting $f..."
perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
doneAnd then go through and reinstate those cases where code is casting pointers
to non-pointers.And then drop a few hunks which conflicted with outstanding work.
Cc: Russell King , Ian Molton
Cc: Mikael Starvik
Cc: Yoshinori Sato
Cc: Roman Zippel
Cc: Geert Uytterhoeven
Cc: Ralf Baechle
Cc: Paul Mackerras
Cc: Kyle McMartin
Cc: Benjamin Herrenschmidt
Cc: Martin Schwidefsky
Cc: "David S. Miller"
Cc: Jeff Dike
Cc: Greg KH
Cc: Jens Axboe
Cc: Paul Fulghum
Cc: Alan Cox
Cc: Karsten Keil
Cc: Mauro Carvalho Chehab
Cc: Jeff Garzik
Cc: James Bottomley
Cc: Ian Kent
Cc: Steven French
Cc: David Woodhouse
Cc: Neil Brown
Cc: Jaroslav Kysela
Cc: Takashi Iwai
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 Dec, 2006
1 commit
-
Signed-off-by: Josef Sipek
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Dec, 2006
1 commit
-
Some drivers are returning OOM when it is not in response to a memory
shortage.Signed-off-by: Nick Piggin
Cc: Dave Airlie
Cc: Jaroslav Kysela
Cc: Takashi Iwai
Cc: Greg KH
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
02 Dec, 2006
1 commit
-
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.It also makes the struct sound_card to show up as a "real" device
where all the different sound class devices are placed as childs
and different card attribute files can hang off of. /sys/class/sound is
still a flat directory, but the symlink targets of all devices belonging
to the same card, point the the /sys/devices tree below the new card
device object.Thanks to Kay for the updates to this patch.
Signed-off-by: Kay Sievers
Acked-by: Jaroslav Kysela
Signed-off-by: Greg Kroah-Hartman
28 Nov, 2006
2 commits
-
Fix hang-up at disconnection of usb-audio devices while accessing PCM.
Don't handle PCM operations any more after shutdown flag is set.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela -
The calls to rtc_control() from inside the interrupt handler can upset
the RTC code, so move our interrupt handling code to a tasklet.Signed-off-by: Clemens Ladisch
Signed-off-by: Jaroslav Kysela
22 Oct, 2006
1 commit
-
Fixed the addition of user-defined boolean controls, the private
data size is corrected to be handled properly.Signed-off-by: Takashi Iwai
Signed-off-by: Jaroslav Kysela