Earlier I unifdefed PageCompound, so that snd_pcm_mmap_control_nopage and
others can give out a 0-order component of a higher-order page, which won't
be mistakenly freed when zap_pte_range unmaps it. But many Bad page states
reported a PG_reserved was freed after all: I had missed that we need to
say __GFP_COMP to get compound page behaviour.
Some of these higher-order pages are allocated by snd_malloc_pages, some by
snd_malloc_dev_pages; or if SBUS, by sbus_alloc_consistent - but that has
no gfp arg, so add __GFP_COMP into its sparc32/64 implementations.
I'm still rather puzzled that DRM seems not to need a similar change.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Modules: HWDEP Midlevel,PCM Midlevel,RawMidi Midlevel,ALSA Core
Replace usage of CONFIG_SND_MAJOR with snd_major, where appropriate.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Modules: ALSA Core,ALSA Minor Numbers
Remove the unused and undefined symbols SNDRV_DEVICE_TYPE_{MIXER,
PCM_PLOOP,PCM_CLOOP}, and introduce a new symbol SNDRV_MINOR_GLOBAL
for non-card-specific devices like the sequencer or the timer.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Use schedule_timeout_{,un}interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also use
human-time conversion functions instead of hard-coded division to avoid
rounding issues.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Modules: ALSA sequencer
When no default timer frequency has been set, initialize_timer() just
uses the maximum frequency supported by the timer, which is ridiculously
high on 96 kHz timers.
This patch introduces a default frequency of 1000 Hz for this case, and
makes sure that a frequency set by the user isn't too high.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Modules: Timer Midlevel
Split or rewrite lines that are longer than 80 characters, and remove
whitespaces at the end of lines.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Modules: Timer Midlevel
The return value of list_entry() already has the type from the second
argument, so we don't need to typecase it again.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Modules: RTC timer driver,Timer Midlevel
Add a module pointer to the timer structure and use it for refcounting
instead of the card's module pointer to prevent the global timer
modules (rtctimer and hpetimer) from being removed while in use.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
- Remove vmalloc wrapper
- Add release_and_free_resource() to remove kfree_nocheck() from each driver
and simplify the code
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Modules: ALSA Core,ALSA<-OSS emulation
Remove a global function snd_task_name(), and move it local
to snd-pcm-oss module.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Modules: Documentation,PCM Midlevel,Timer Midlevel,ALSA Core
Use the standard getnstimeofday() function instead of ALSA's own one.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Remove snd_runtime_check() macro.
This macro worsens the readability of codes. They should be either
normal if() or removable asserts.
Also, the assert displays stack-dump, instead of only the last caller
pointer.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Modules: ALSA sequencer
Remove the last parameter of snd_seq_timer_set_tick_resolution()
because it is always one.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Modules: RTC timer driver
The check whether rtctimer_freq is a power of two can be done easier
with a simple bit operation.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Modules: RTC timer driver
The rtc_inc variable is never used outside the interrupt handler, and
is always one where it matters, so we can just remove it.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Remove PageReserved() calls from core code by tightening VM_RESERVED
handling in mm/ to cover PageReserved functionality.
PageReserved special casing is removed from get_page and put_page.
All setting and clearing of PageReserved is retained, and it is now flagged
in the page_alloc checks to help ensure we don't introduce any refcount
based freeing of Reserved pages.
MAP_PRIVATE, PROT_WRITE of VM_RESERVED regions is tentatively being
deprecated. We never completely handled it correctly anyway, and is be
reintroduced in future if required (Hugh has a proof of concept).
Once PageReserved() calls are removed from kernel/power/swsusp.c, and all
arch/ and driver code, the Set and Clear calls, and the PG_reserved bit can
be trivially removed.
Last real user of PageReserved is swsusp, which uses PageReserved to
determine whether a struct page points to valid memory or not. This still
needs to be addressed (a generic page_is_ram() should work).
A last caveat: the ZERO_PAGE is now refcounted and managed with rmap (and
thus mapcounted and count towards shared rss). These writes to the struct
page could cause excessive cacheline bouncing on big systems. There are a
number of ways this could be addressed if it is an issue.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Refcount bug fix for filemap_xip.c
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Convert everyone who uses platform_bus_type to include
linux/platform_device.h.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
In PM v1, all devices were called at SUSPEND_DISABLE level. Then
all devices were called at SUSPEND_SAVE_STATE level, and finally
SUSPEND_POWER_DOWN level. However, with PM v2, to maintain
compatibility for platform devices, I arranged for the PM v2
suspend/resume callbacks to call the old PM v1 suspend/resume
callbacks three times with each level in order so that existing
drivers continued to work.
Since this is obsolete infrastructure which is no longer necessary,
we can remove it. Here's an (untested) patch to do exactly that.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The previous patch adding the ability to nest struct class_device
changed the paramaters to the call class_device_create(). This patch
fixes up all in-kernel users of the function.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The patch fixes Oops from sound drivers using generic platform device
but have no suspend/resume callbacks.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- added typedef unsigned int __nocast gfp_t;
- replaced __nocast uses for gfp flags with gfp_t - it gives exactly
the same warnings as far as sparse is concerned, doesn't change
generated code (from gcc point of view we replaced unsigned int with
typedef) and documents what's going on far better.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ALSA Core,ALSA sequencer
Add an option to make the RTC timer the default sequencer timer. This
becomes necessary for precise MIDI timing when the system timer runs at
less than 1000 Hz.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
ALSA Core
A new function snd_card_set_generic_dev() is introduced to add the
'generic device' support for devices without proper bus on sysfs.
It's a last resort, and should be removed in future when they have
a proper bus, instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA Core,RawMidi Midlevel,ALSA<-OSS emulation,ALSA sequencer
RME32 driver,RME96 driver,EMU10K1/EMU10K2 driver,NM256 driver
Add sparse annotations where we do strange this with __iomem/__user
pointers.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
This patch introduces a memory-leak tracking version of kzalloc for ALSA.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Add register_sound_special_device() function to allow assignment of
device pointer to a specific OSS device for HAL.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
PCM Midlevel
Fixed the handling of boundary in PCM 32bit compat layer.
Positions in hwsync are bound in the 32bit boundary size.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Memalloc module,PCM Midlevel,Timer Midlevel,GUS Library,AC97 Codec
ALI5451 driver,RME9652 driver
Make some functions/variables that are used in only one file static.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
PCM Midlevel,ALSA<-OSS emulation,USB USX2Y
This patch removes open_flag from struct _snd_pcm_substream.
All of its uses are substituted by querying struct _snd_pcm_substream's
member ffile instead.
Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA Core
This patch adds the __init macro to snd_memory_init().
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
fixed kconfig dependencies on ISA_DMA_API for parts of sound/* that rely
on it.
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>