Commit Graph

266 Commits

Author SHA1 Message Date
Takashi Iwai c793cbfd61 ALSA: aloop: Fix racy hw constraints adjustment
commit 898dfe4687f460ba337a01c11549f87269a13fa2 upstream.

The aloop driver tries to update the hw constraints of the connected
target on the cable of the opened PCM substream.  This is done by
adding the extra hw constraints rules referring to the substream
runtime->hw fields, while the other substream may update the runtime
hw of another side on the fly.

This is, however, racy and may result in the inconsistent values when
both PCM streams perform the prepare concurrently.  One of the reason
is that it overwrites the other's runtime->hw field; which is not only
racy but also broken when it's called before the open of another side
finishes.  And, since the reference to runtime->hw isn't protected,
the concurrent write may give the partial value update and become
inconsistent.

This patch is an attempt to fix and clean up:
- The prepare doesn't change the runtime->hw of other side any longer,
  but only update the cable->hw that is referred commonly.
- The extra rules refer to the loopback_pcm object instead of the
  runtime->hw.  The actual hw is deduced from cable->hw.
- The extra rules take the cable_lock to protect against the race.

Fixes: b1c73fc8e6 ("ALSA: snd-aloop: Fix hw_params restrictions and checking")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:46:27 +02:00
Takashi Iwai 9d277e243e ALSA: aloop: Fix inconsistent format due to incomplete rule
commit b088b53e20c7d09b5ab84c5688e609f478e5c417 upstream.

The extra hw constraint rule for the formats the aloop driver
introduced has a slight flaw, where it doesn't return a positive value
when the mask got changed.  It came from the fact that it's basically
a copy&paste from snd_hw_constraint_mask64().  The original code is
supposed to be a single-shot and it modifies the mask bits only once
and never after, while what we need for aloop is the dynamic hw rule
that limits the mask bits.

This difference results in the inconsistent state, as the hw_refine
doesn't apply the dependencies fully.  The worse and surprisingly
result is that it causes a crash in OSS emulation when multiple
full-duplex reads/writes are performed concurrently (I leave why it
triggers Oops to readers as a homework).

For fixing this, replace a few open-codes with the standard
snd_mask_*() macros.

Reported-by: syzbot+3902b5220e8ca27889ca@syzkaller.appspotmail.com
Fixes: b1c73fc8e6 ("ALSA: snd-aloop: Fix hw_params restrictions and checking")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:46:27 +02:00
Takashi Iwai 2ad98ce6ac ALSA: aloop: Release cable upon open error path
commit 9685347aa0a5c2869058ca6ab79fd8e93084a67f upstream.

The aloop runtime object and its assignment in the cable are left even
when opening a substream fails.  This doesn't mean any memory leak,
but it still keeps the invalid pointer that may be referred by the
another side of the cable spontaneously, which is a potential Oops
cause.

Clean up the cable assignment and the empty cable upon the error path
properly.

Fixes: 597603d615 ("ALSA: introduce the snd-aloop module for the PCM loopback")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:46:26 +02:00
Takashi Iwai 00a7a75559 ALSA: dummy: Fix a use-after-free at closing
commit d5dbbe6569481bf12dcbe3e12cff72c5f78d272c upstream.

syzkaller fuzzer spotted a potential use-after-free case in snd-dummy
driver when hrtimer is used as backend:
> ==================================================================
> BUG: KASAN: use-after-free in rb_erase+0x1b17/0x2010 at addr ffff88005e5b6f68
>  Read of size 8 by task syz-executor/8984
> =============================================================================
> BUG kmalloc-192 (Not tainted): kasan: bad access detected
> -----------------------------------------------------------------------------
>
> Disabling lock debugging due to kernel taint
> INFO: Allocated in 0xbbbbbbbbbbbbbbbb age=18446705582212484632
> ....
> [<      none      >] dummy_hrtimer_create+0x49/0x1a0 sound/drivers/dummy.c:464
> ....
> INFO: Freed in 0xfffd8e09 age=18446705496313138713 cpu=2164287125 pid=-1
> [<      none      >] dummy_hrtimer_free+0x68/0x80 sound/drivers/dummy.c:481
> ....
> Call Trace:
>  [<ffffffff8179e59e>] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:333
>  [<     inline     >] rb_set_parent include/linux/rbtree_augmented.h:111
>  [<     inline     >] __rb_erase_augmented include/linux/rbtree_augmented.h:218
>  [<ffffffff82ca5787>] rb_erase+0x1b17/0x2010 lib/rbtree.c:427
>  [<ffffffff82cb02e8>] timerqueue_del+0x78/0x170 lib/timerqueue.c:86
>  [<ffffffff814d0c80>] __remove_hrtimer+0x90/0x220 kernel/time/hrtimer.c:903
>  [<     inline     >] remove_hrtimer kernel/time/hrtimer.c:945
>  [<ffffffff814d23da>] hrtimer_try_to_cancel+0x22a/0x570 kernel/time/hrtimer.c:1046
>  [<ffffffff814d2742>] hrtimer_cancel+0x22/0x40 kernel/time/hrtimer.c:1066
>  [<ffffffff85420531>] dummy_hrtimer_stop+0x91/0xb0 sound/drivers/dummy.c:417
>  [<ffffffff854228bf>] dummy_pcm_trigger+0x17f/0x1e0 sound/drivers/dummy.c:507
>  [<ffffffff85392170>] snd_pcm_do_stop+0x160/0x1b0 sound/core/pcm_native.c:1106
>  [<ffffffff85391b26>] snd_pcm_action_single+0x76/0x120 sound/core/pcm_native.c:956
>  [<ffffffff85391e01>] snd_pcm_action+0x231/0x290 sound/core/pcm_native.c:974
>  [<     inline     >] snd_pcm_stop sound/core/pcm_native.c:1139
>  [<ffffffff8539754d>] snd_pcm_drop+0x12d/0x1d0 sound/core/pcm_native.c:1784
>  [<ffffffff8539d3be>] snd_pcm_common_ioctl1+0xfae/0x2150 sound/core/pcm_native.c:2805
>  [<ffffffff8539ee91>] snd_pcm_capture_ioctl1+0x2a1/0x5e0 sound/core/pcm_native.c:2976
>  [<ffffffff8539f2ec>] snd_pcm_kernel_ioctl+0x11c/0x160 sound/core/pcm_native.c:3020
>  [<ffffffff853d9a44>] snd_pcm_oss_sync+0x3a4/0xa30 sound/core/oss/pcm_oss.c:1693
>  [<ffffffff853da27d>] snd_pcm_oss_release+0x1ad/0x280 sound/core/oss/pcm_oss.c:2483
>  .....

A workaround is to call hrtimer_cancel() in dummy_hrtimer_sync() which
is called certainly before other blocking ops.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2019-07-27 21:41:56 +02:00
Takashi Iwai e063b1a0b8 ALSA: dummy: Implement timer backend switching more safely
commit ddce57a6f0a2d8d1bfacfa77f06043bc760403c2 upstream.

Currently the selected timer backend is referred at any moment from
the running PCM callbacks.  When the backend is switched, it's
possible to lead to inconsistency from the running backend.  This was
pointed by syzkaller fuzzer, and the commit [7ee96216c31a: ALSA:
dummy: Disable switching timer backend via sysfs] disabled the dynamic
switching for avoiding the crash.

This patch improves the handling of timer backend switching.  It keeps
the reference to the selected backend during the whole operation of an
opened stream so that it won't be changed by other streams.

Together with this change, the hrtimer parameter is reenabled as
writable now.

NOTE: this patch also turned out to fix the still remaining race.
Namely, ops was still replaced dynamically at dummy_pcm_open:

  static int dummy_pcm_open(struct snd_pcm_substream *substream)
  {
  ....
          dummy->timer_ops = &dummy_systimer_ops;
          if (hrtimer)
                  dummy->timer_ops = &dummy_hrtimer_ops;

Since dummy->timer_ops is common among all streams, and when the
replacement happens during accesses of other streams, it may lead to a
crash.  This was actually triggered by syzkaller fuzzer and KASAN.

This patch rewrites the code not to use the ops shared by all streams
any longer, too.

BugLink: http://lkml.kernel.org/r/CACT4Y+aZ+xisrpuM6cOXbL21DuM0yVxPYXf4cD4Md9uw0C3dBQ@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-19 14:22:40 -08:00
Takashi Iwai 3e24e598a4 ALSA: dummy: Disable switching timer backend via sysfs
commit 7ee96216c31aabe1eb42fb91ff50dae9fcd014b2 upstream.

ALSA dummy driver can switch the timer backend between system timer
and hrtimer via its hrtimer module option.  This can be also switched
dynamically via sysfs, but it may lead to a memory corruption when
switching is done while a PCM stream is running; the stream instance
for the newly switched timer method tries to access the memory that
was allocated by another timer method although the sizes differ.

As the simplest fix, this patch just disables the switch via sysfs by
dropping the writable bit.

BugLink: http://lkml.kernel.org/r/CACT4Y+ZGEeEBntHW5WHn2GoeE0G_kRrCmUh6=dWyy-wfzvuJLg@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-19 14:22:39 -08:00
Eldad Zack 74c34ca1cc ALSA: pcm_format_to_bits strong-typed conversion
Add a function to handle conversion from snd_pcm_format_t
to bitwise with proper typing.

Change such conversions to use this function and silence sparse
warnings.

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-29 13:36:15 +02:00
Pavel Machek 13627549f3 ALSA: sound kconfig typo
Fix english in sound/drivers/Kconfig.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-24 14:02:36 +02:00
Yacine Belkadi eb7c06e8e9 ALSA: add/change some comments describing function return values
script/kernel-doc reports the following type of warnings (when run in verbose
mode):

Warning(sound/core/init.c:152): No description found for return value of
'snd_card_create'

To fix that:
- add missing descriptions of function return values
- use "Return:" sections to describe those return values

Along the way:
- complete some descriptions
- fix some typos

Signed-off-by: Yacine Belkadi <yacine.belkadi.1@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-12 08:32:53 +01:00
Takashi Iwai 2faea5274f Merge branch 'for-linus' into for-next
Merge pending fixes that haven't pulled into 3.8.
2013-02-05 14:48:03 +01:00
Takashi Iwai edac894389 ALSA: aloop: Fix Oops while PM resume
snd-aloop driver has no proper PM implementation, thus the PM resume
may trigger Oops due to leftover timer instance.  This patch adds the
missing suspend/resume implementation.

Reported-and-tested-by: El boulangero <elboulangero@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-04 10:28:15 +01:00
Takashi Iwai 86b2723725 ALSA: Make snd_printd() and snd_printdd() inline
Because currently snd_printd() and snd_printdd() macros are expanded
to empty when CONFIG_SND_DEBUG=n, a compile warning like below
appears sometimes, and we had to covert it by ugly ifdefs:
  sound/pci/hda/patch_sigmatel.c: In function ‘stac92hd71bxx_fixup_hp’:
  sound/pci/hda/patch_sigmatel.c:2434:24: warning: unused variable ‘spec’ [-Wunused-variable]

For "fixing" these issues better, this patch replaces snd_printd() and
snd_printdd() definitions with empty inline functions instead of
macros.  This should have the same effect but shut up warnings like
above.

But since we had already put ifdefs, changing to inline functions
would trigger compile errors.  So, such ifdefs is removed in this
patch.

In addition, snd_pci_quirk name field is defined only when
CONFIG_SND_DEBUG_VERBOSE is set, and the reference to it in
snd_printdd() argument triggers the build errors, too.  For avoiding
these errors, introduce a new macro snd_pci_quirk_name() that is
defined no matter how the debug option is set.

Reported-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-25 18:32:14 +01:00
Bill Pemberton fbbb01a12d ALSA: drivers: remove __dev* attributes
CONFIG_HOTPLUG is going away as an option.  As result the __dev*
markings will be going away.

Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
and __devexit.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-07 07:34:32 +01:00
Takashi Iwai 0d144de9af ALSA: vx: hard dependency on the standard fw loader
Yet again like previous two commits, drop the old hwdep user-space
firmware code from vx driver (snd-vxpocket and snd-vx222).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-22 17:48:01 +01:00
Kees Cook 02d08f8baa ALSA: sound/drivers: remove CONFIG_EXPERIMENTAL
This config item has not carried much meaning for a while now and is
almost always enabled by default. As agreed during the Linux kernel
summit, remove it.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-25 00:16:38 +02:00
Takashi Iwai 999fc9f6aa ALSA: aloop - Close races at restarting the stream
There are small races opened in the check of running bit and the timer
lock.  Instead of adding yet more flag, just protect the whole racy
codes with the existing cable->lock.  As a bonus, we can get rid of
timer_lock now.

Reported-and-tested-by: Omair Mohammed Abdullah <omair.m.abdullah@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-21 10:53:14 +02:00
Takashi Iwai 4d4ca1e839 Merge branch 'dummy-ctl-inactive' of git://git.alsa-project.org/alsa-kprivate into for-next
Quite a few mixer applications do not handle deactivated controls
correctly.  This patch adds such controls to snd-dummy to make
crash^H^H^H^H^Htesting these apps easier.
2012-10-21 09:57:22 +02:00
Clemens Ladisch 16e434670e ALSA: dummy: allow disabling mixer controls
To make the testing of deactivated mixer controls easier (and for people
with common hardware, possible), add a control that deactivates some
other controls.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2012-10-20 23:46:13 +02:00
Omair Mohammed Abdullah d4f1e48bd1 ALSA: aloop - add locking to timer access
When the loopback timer handler is running, calling del_timer() (for STOP
trigger) will not wait for the handler to complete before deactivating the
timer. The timer gets rescheduled in the handler as usual. Then a subsequent
START trigger will try to start the timer using add_timer() with a timer pending
leading to a kernel panic.

Serialize the calls to add_timer() and del_timer() using a spin lock to avoid
this.

Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-06 16:50:28 +02:00
Peter Senna Tschudin 395d9dd5dd sound: Remove unnecessary semicolon
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
        cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-06 16:47:53 +02:00
Wei Yongjun 3a4a7ef567 ALSA: opl4: use list_move_tail instead of list_del/list_add_tail
Using list_move_tail() instead of list_del() + list_add_tail().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-05 09:14:45 +02:00
Takashi Iwai d34e4e00ad ALSA: platform: Check CONFIG_PM_SLEEP instead of CONFIG_PM
When CONFIG_PM is set but CONFIG_PM_SLEEP is unset,
SIMPLE_DEV_PM_OPS() ignores the given functions, and this leads to
compile warnings.

For avoiding this, simply check CONFIG_PM_SLEEP instead of CONFIG_PM.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 15:47:15 +02:00
Takashi Iwai bc733d4952 ALSA: mpu401: Fix missing initialization of irq field
The irq field of struct snd_mpu401 is supposed to be initialized to -1.
Since it's set to zero as of now, a probing error before the irq
installation results in a kernel warning "Trying to free already-free
IRQ 0".

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=44821
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-25 14:04:04 +02:00
Takashi Iwai 68cb2b5592 ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy
suspend/resume ops.

Since we change vx222, vx_core and vxpocket have to be converted,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 08:23:03 +02:00
Takashi Iwai 284e7ca75f ALSA: convert PM ops of platform_driver to new pm ops
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 07:58:19 +02:00
Takashi Iwai 8bf01d8abc ALSA: Add missing .owner=THIS_MODULE to platform_driver definitions
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-02 17:50:05 +02:00
Jaroslav Kysela b012513c66 ALSA: snd-aloop - improve the sample copy accurracy
Maintain both streams (playback, capture) synchronized. Previous code
didn't take in account the small byte count drifts caused by the irq
position rounding.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-15 08:34:38 +02:00
Lucas De Marchi 970e248649 Documentation: remove references to /etc/modprobe.conf
Usage of /etc/modprobe.conf file was deprecated by module-init-tools and
is no longer parsed by new kmod tool. References to this file are
replaced in Documentation, comments and Kconfig according to the
context.

There are also some references to the old /etc/modules.conf from 2.4
kernels that are being removed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-30 16:03:15 -07:00
Rusty Russell a67ff6a540 ALSA: module_param: make bool parameters really bool
module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-19 10:34:41 +01:00
Axel Lin a09452eeb7 ALSA: convert sound/* to use module_platform_driver()
This patch converts the drivers in sound/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-27 18:43:48 +01:00
Paul Gortmaker d81a6d7176 sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed
These aren't modules, but they do make use of these macros, so
they will need export.h to get that definition.  Previously,
they got it via the implicit module.h inclusion.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:22 -04:00
Paul Gortmaker da155d5b40 sound: Add module.h to the previously silent sound users
Lots of sound drivers were getting module.h via the implicit presence
of it in <linux/device.h> but we are going to clean that up.  So
fix up those users now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:21 -04:00
Paul Gortmaker 65a772172b sound: fix drivers needing module.h not moduleparam.h
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 <paul.gortmaker@windriver.com>
2011-10-31 19:31:19 -04:00
Takashi Iwai 9430148d80 Merge branch 'topic/remove-irqf_disable' into for-linus 2011-10-26 23:51:48 +02:00
Takashi Iwai 6b69a0e520 ALSA: aloop - Use vmalloc buffer
snd-aloop driver is virtual and has no need for allocating contiguous
pages.  It'll be more system-friendly to use vmalloc buffers.

Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-24 12:16:29 +02:00
Yong Zhang 88e24c3a4b sound: irq: Remove IRQF_DISABLED
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-22 11:19:20 +02:00
Clemens Ladisch dba8b46992 ALSA: mpu401: clean up interrupt specification
The semantics of snd_mpu401_uart_new()'s interrupt parameters are
somewhat counterintuitive:  To prevent the function from allocating its
own interrupt, either the irq number must be invalid, or the irq_flags
parameter must be zero.  At the same time, the irq parameter being
invalid specifies that the mpu401 code has to work without an interrupt
allocated by the caller.  This implies that, if there is an interrupt
and it is allocated by the caller, the irq parameter must be set to
a valid-looking number which then isn't actually used.

With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value,
which forces us to handle the parameters differently.

This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the
device interrupt is handled by the caller, and makes the allocation of
the interrupt to depend only on the irq parameter.  As suggested by
Takashi, the irq_flags parameter was dropped because, when used, it had
the constant value IRQF_DISABLED.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-14 11:00:51 +02:00
Ralf Baechle 8e1b5adfbe i8253: Make pcsp sound driver use the shared i8253_lock
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Acked-by: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Link: http://lkml.kernel.org/r/20110601180610.532642190@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-06-09 15:01:39 +02:00
Ralf Baechle 334955ef96 i8253: Create linux/i8253.h and use it in all 8253 related files
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180610.054254048@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

 arch/arm/mach-footbridge/isa-timer.c |    2 +-
 arch/mips/cobalt/time.c              |    2 +-
 arch/mips/jazz/irq.c                 |    2 +-
 arch/mips/kernel/i8253.c             |    2 +-
 arch/mips/mti-malta/malta-time.c     |    2 +-
 arch/mips/sgi-ip22/ip22-time.c       |    2 +-
 arch/mips/sni/time.c                 |    2 +-
 arch/x86/kernel/apic/apic.c          |    2 +-
 arch/x86/kernel/apm_32.c             |    2 +-
 arch/x86/kernel/hpet.c               |    2 +-
 arch/x86/kernel/i8253.c              |    2 +-
 arch/x86/kernel/time.c               |    2 +-
 drivers/block/hd.c                   |    2 +-
 drivers/clocksource/i8253.c          |    2 +-
 drivers/input/gameport/gameport.c    |    2 +-
 drivers/input/joystick/analog.c      |    2 +-
 drivers/input/misc/pcspkr.c          |    2 +-
 include/linux/i8253.h                |   11 +++++++++++
 sound/drivers/pcsp/pcsp.h            |    2 +-
 19 files changed, 29 insertions(+), 18 deletions(-)
2011-06-09 15:01:37 +02:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Takashi Iwai 98d21df431 ALSA: aloop - Fix possible IRQ lock inversion
loopback_pos_update() can be called in the timer callback, thus the lock
held should be irq-safe.  Otherwise you'll get AB/BA deadlock together
with substream->self_group.lock.

Reported-and-tested-by: Knut Petersen <Knut_Petersen@t-online.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-18 07:31:53 +01:00
Takashi Iwai ddfb319926 ALSA: use linux/io.h to fix compile warnings
For helping to reduce Greert's regression list...
  src/sound/drivers/mtpav.c: error: implicit declaration of function 'inb'
  src/sound/drivers/mtpav.c: error: implicit declaration of function 'outb'
  ...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-02 17:49:53 +01:00
Joe Perches a8cc0f421b ALSA: ml403-ac97cr: Use vsprintf extension %pR for struct resource
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-12-14 10:45:15 +01:00
Takashi Iwai f3305da35a Merge remote branch 'alsa/devel' into topic/misc 2010-10-20 12:22:11 +02:00
Jaroslav Kysela 5de9e45fcf ALSA: snd-aloop - add pause support
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-20 09:35:43 +02:00
Jaroslav Kysela dd04bb12d0 ALSA: snd-aloop - fix locking issues (running flag updates)
On SMP machines, the cable->running update must be atomic, otherwise
stream is not started correctly sometimes.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-20 09:35:38 +02:00
Jaroslav Kysela e74670b6fd ALSA: snd-aloop: add cable#0 and cable#1 files to proc card tree
Show some useful runtime information using procfs.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-18 11:08:21 +02:00
Takashi Iwai 57e35381bc Merge remote branch 'alsa/devel' into topic/misc 2010-10-17 10:12:42 +02:00
Jaroslav Kysela 0db7102305 ALSA: snd-aloop - fix issue in the timer start function
In some circumstances (the rate shift value was changed), the irq_pos
value may be higher than the fraction value in the timer start function.
Check for it.

Also, to avoid value overflow, decrease maximum period size.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-14 21:54:17 +02:00
Takashi Iwai e799d0bce6 Merge remote branch 'alsa/devel' into topic/misc 2010-10-11 13:56:12 +02:00