ALSA: ice1712: fix: lock samplerate when samplerate locking is enabled
I found that the sampling rate locking setting of the ice1712 sound driver
was only half-respected : when the driver was locked to, let's say, 44100Hz,
and a usermode app was requesting 48000Hz playback, the request was succesful
although the soundcard would continue to run at 44100Hz.
Here's a patch that will make those requests to fail.
The code in pcm_lib updating runtime->hw_ptr_interrupt expects
that runtime->boundary is divisible with runtime->period_size.
Thanks are going to Clemens Ladisch for the notice.
Fix the runtime->boundary calculation using buffer_size * period_size
as base and find a least common multiple for 32bit platforms when
the expression might overflow.
Jaroslav Kysela [Tue, 26 Jan 2010 16:08:24 +0000 (17:08 +0100)]
ALSA: pcm_lib - return back hw_ptr_interrupt
Clemens Ladisch noted for hw_ptr_removal in "cleanup & merge hw_ptr
update functions" commit:
"It is possible for the status/delay ioctls to be called when the sound
card's pointer register alreay shows a position at the beginning of the
new period, but immediately before the interrupt is actually executed.
(This happens regularly on a SMP machine with mplayer.) When that
happens, the code thinks that the position must be at least one period
ahead of the current position and drops an entire buffer of data."
Return back the hw_ptr_interrupt variable. The last interrupt pointer
is always computed from the latest hw_ptr instead of tracking it
separately (in this case all hw_ptr checks and modifications might
influence also hw_ptr_interrupt and it is difficult to keep it
consistent).
Jaroslav Kysela [Thu, 21 Jan 2010 09:32:15 +0000 (10:32 +0100)]
ALSA: pcm_core: Fix wake_up() optimization
This change fixes the "ALSA: pcm_lib - optimize wake_up() calls for PCM I/O"
commit. New sleeping queue is introduced to separate user space and kernel
space wake_ups. runtime->nowake is renamed to twake (transfer wake).
As snd_seq_timer_set_tick_resolution() is always called with the same
three fields of struct snd_seq_timer, it suffices to give that as the
only parameter.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Takashi Iwai [Thu, 14 Jan 2010 08:16:52 +0000 (09:16 +0100)]
ALSA: Add snd_pci_quirk_lookup_id()
Added a new function to look up a quirk entry with the given PCI SSID
instead of a pci device pointer. This can be used when the searched ID
is overridden for debugging or such a purpose.
Jaroslav Kysela [Thu, 7 Jan 2010 14:36:31 +0000 (15:36 +0100)]
ALSA: pcm_lib - optimize wake_up() calls for PCM I/O
As noted by pl bossart <bossart.nospam@gmail.com>, the PCM I/O routines
(snd_pcm_lib_write1, snd_pcm_lib_read1) should block wake_up() calls
until all samples are not processed.
Do general cleanup in snd_pcm_update_hw_ptr*() routines and merge them.
The main change is hw_ptr_interrupt variable removal to simplify code
logic. This variable can be computed directly from hw_ptr.
Ensure that updated hw_ptr is not lower than previous one (it was possible
with old code in some obscure situations when interrupt was delayed or
the lowlevel driver returns wrong ring buffer position value).
John S. Gruber [Sun, 27 Dec 2009 17:19:58 +0000 (12:19 -0500)]
ALSA: usb-audio: relax urb data align. restriction HVR-950Q and HVR-850 only
Addressing audio quality problem.
In sound/usb/usbaudio.c, for the Hauppage HVR-950Q and HVR-850 only, change
retire_capture_urb to allow transfers on audio sub-slot boundaries rather
than audio slots boundaries.
With these devices the left and right channel samples can be split between
two different urbs. Throwing away extra channel samples causes a sound
quality problem for stereo streams as the left and right channels are
swapped repeatedly, perhaps many times per second.
Urbs unaligned on sub-slot boundaries are still truncated to the next
lowest stride (audio slot) to retain synchronization on samples even
though left/right channel synchronization may be lost in this case.
Detect the quirk using a case statement in snd_usb_audio_probe.
Clemens Ladisch [Sun, 27 Dec 2009 17:19:57 +0000 (12:19 -0500)]
ALSA: usb-audio: make buffer pointer based on bytes instead on frames
Since there are devices that do not align the size of their data packets
to frame boundaries, the driver needs to be able to keep track of
partial frames. This patch prepares for support for such devices by
changing the hwptr_done variable from a frame counter to a byte counter.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel T Chen [Sun, 27 Dec 2009 23:52:08 +0000 (18:52 -0500)]
ALSA: hda: Refactor powerdown for Realtek HDA codecs
This patch converts the alc889 Aspire-specific powerdown to a generic
one. Like the previous effort, it currently only handles Front and PCM
but can be easily extended to cover other nids. The existing hook for
alc889 Aspire-specific remains enabled. Upon further testing, I've added
its use for ALC861_AUTO as well. Following patches will enable them for
other quirks.
Tested-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Daniel T Chen <crimsun@ubuntu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
The second command will produce sound in the analog lineout _as well as_
HDMI sink. The root cause is, device 0 "reuses" the same stream tag that
was used by device 3, and the "intelhdmi - sticky stream id" patch leaves
the HDMI codec in a functional state. So the HDMI codec happily accepts
the audio samples which reuse its stream tag.
The proposed solution is to remember the last device each azx_dev was
assigned to, and prefer to
1) reuse the azx_dev (and hence the stream tag) the HDMI codec last used
2) or assign a never-used azx_dev for HDMI
With this patch and the above two speaker-test commands,
HDMI codec will use stream tag 8 and Analog codec will use 5.
The stream tag used by HDMI codec won't be reused by others, as long
as we don't run out of the 4 playback azx_dev's. The legacy Analog
codec will continue to use stream tag 5 because its device id is 0
(this is a bit tricky).
Linus Torvalds [Thu, 24 Dec 2009 21:01:29 +0000 (13:01 -0800)]
Merge branch 'sysctl' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc-2.6
* 'sysctl' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc-2.6:
SYSCTL: Add a mutex to the page_alloc zone order sysctl
SYSCTL: Print binary sysctl warnings (nearly) only once
Linus Torvalds [Thu, 24 Dec 2009 21:00:02 +0000 (13:00 -0800)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (34 commits)
classmate-laptop: add support for Classmate PC ACPI devices
hp-wmi: Fix two memleaks
acer-wmi, msi-wmi: Remove needless DMI MODULE_ALIAS
dell-wmi: do not keep driver loaded on unsupported boxes
wmi: Free the allocated acpi objects through wmi_get_event_data
drivers/platform/x86/acerhdf.c: check BIOS information whether it begins with string of table
acerhdf: add new BIOS versions
acerhdf: limit modalias matching to supported
toshiba_acpi: convert to seq_file
asus_acpi: convert to seq_file
ACPI: do not select ACPI_DOCK from ATA_ACPI
sony-laptop: enumerate rfkill devices using SN06
sony-laptop: rfkill support for newer models
ACPI: fix OSC regression that caused aer and pciehp not to load
MAINTAINERS: add maintainer for msi-wmi driver
fujitu-laptop: fix tests of acpi_evaluate_integer() return value
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c: avoid cross-CPU interrupts by using smp_call_function_any()
ACPI: processor: remove _PDC object list from struct acpi_processor
ACPI: processor: change acpi_processor_set_pdc() interface
ACPI: processor: open code acpi_processor_cleanup_pdc
...
Linus Torvalds [Thu, 24 Dec 2009 20:59:11 +0000 (12:59 -0800)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
ocfs2/trivial: Use le16_to_cpu for a disk value in xattr.c
ocfs2/trivial: Use proper mask for 2 places in hearbeat.c
Ocfs2: Let ocfs2 support fiemap for symlink and fast symlink.
Ocfs2: Should ocfs2 support fiemap for S_IFDIR inode?
ocfs2: Use FIEMAP_EXTENT_SHARED
fiemap: Add new extent flag FIEMAP_EXTENT_SHARED
ocfs2: replace u8 by __u8 in ocfs2_fs.h
ocfs2: explicit declare uninitialized var in user_cluster_connect()
ocfs2-devel: remove redundant OCFS2_MOUNT_POSIX_ACL check in ocfs2_get_acl_nolock()
ocfs2: return -EAGAIN instead of EAGAIN in dlm
ocfs2/cluster: Make fence method configurable - v2
ocfs2: Set MS_POSIXACL on remount
ocfs2: Make acl use the default
ocfs2: Always include ACL support
Linus Torvalds [Thu, 24 Dec 2009 20:57:45 +0000 (12:57 -0800)]
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
VIDEO: cyberpro: pci_request_regions needs a persistent name
ARM: dma-isa: request cascade channel after registering it
ARM: footbridge: trim down old ISA rtc setup
ARM: fix PAGE_KERNEL
ARM: Fix wrong shared bit for CPU write buffer bug test
ARM: 5857/1: ARM: dmabounce: fix build
ARM: 5856/1: Fix bug of uart0 platfrom data for nuc900
ARM: 5855/1: putc support for nuc900
ARM: 5854/1: fix compiling error for NUC900
ARM: 5849/1: ARMv7: fix Oprofile events count
ARM: add missing include to nwflash.c
ARM: Kill CONFIG_CPU_32
ARM: Convert VFP/Crunch/XscaleCP thread_release() to exit_thread()
ARM: 5853/1: ARM: Fix build break on ARM v6 and v7
Linus Torvalds [Thu, 24 Dec 2009 20:54:02 +0000 (12:54 -0800)]
Merge branch 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Ensure all PG_dcache_dirty pages are written back.
sh: mach-ecovec24: setup.c detailed correction
serial: sh-sci: Convert tremaining ctrl_xxx I/O routines to __raw_xxx.
serial: sh-sci: earlyprintk zero uartclk fix
sh: Only use bl bit toggling for sleeping idle.
sh: Restore bl bit toggling in idle loop.
sh: Fix up MAX_DMA_CHANNELS definition when DMA is disabled.
sh: dmaengine support for SH7785
sh: dmaengine support for sh7724.
Russell King [Thu, 24 Dec 2009 12:52:44 +0000 (12:52 +0000)]
ARM: footbridge: trim down old ISA rtc setup
This fixes a "start_kernel(): bug: interrupts were enabled early".
rtc_cmos now takes care of initializing the ISA RTC and reading the
current time and date from it; there's no need to repeat that here,
thereby causing interrupts to be enabled too early.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Russell King [Thu, 24 Dec 2009 10:16:21 +0000 (10:16 +0000)]
ARM: fix PAGE_KERNEL
PAGE_KERNEL should not be executable; any area marked executable can
be prefetched into the instruction cache. We don't want vmalloc areas
to be read in this way.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Borislav Petkov [Mon, 21 Dec 2009 17:13:01 +0000 (18:13 +0100)]
amd64_edac: make driver loading more robust
Currently, the module does not initialize fully when the DIMMs aren't
ECC but remains still loaded. Propagate the error when no instance of
the driver is properly initialized and prevent further loading.
Reorganize and polish error handling in amd64_edac_init() while at it.
Borislav Petkov [Mon, 21 Dec 2009 13:52:53 +0000 (14:52 +0100)]
amd64_edac: fix K8 chip select reporting
Fix the case when amd64_debug_display_dimm_sizes() reports only half the
amount of DRAM on it because it doesn't account for when the single DCT
operates in 128-bit mode and merges chip selects from different DIMMs.
Reported-by: Johannes Hirte <johannes.hirte@fem.tu-ilmenau.de>
LKML-Reference: <200912112202.48173.johannes.hirte@fem.tu-ilmenau.de> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
classmate-laptop: add support for Classmate PC ACPI devices
This add supports for devices like keyboard, backlight, tablet and
accelerometer.
This work is supported by International Syst S/A.
[randy.dunlap@oracle.com: cmpc_acpi: depends on ACPI]
[akpm@linux-foundation.org: readability tweaks]
[akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Markus Pietrek [Thu, 24 Dec 2009 06:12:02 +0000 (15:12 +0900)]
sh: Ensure all PG_dcache_dirty pages are written back.
With some of the cache rework an address aliasing optimization was added,
but this managed to fail on certain mappings resulting in pages with
PG_dcache_dirty set never writing back their dcache lines. This patch
reverts to the earlier behaviour of simply always writing back when the
dirty bit is set.
Signed-off-by: Markus Pietrek <Markus.Pietrek@emtrion.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Thu, 24 Dec 2009 05:52:43 +0000 (14:52 +0900)]
serial: sh-sci: Convert tremaining ctrl_xxx I/O routines to __raw_xxx.
ctrl_xxx() is an antiquated SH interface, while __raw_xxx is the standard
API that accomplishes the same thing. As such, this converts the
remaining sh-sci straggles over, which enables the driver to be wired up
for ARM SH-Mobile CPUs as well.
Now that we have WMI autoloading
the DMI matching is not needed anymore.
Signed-off-by: Thomas Renninger <trenn@suse.de> Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk> Acked-by: Anisse Astier <anisse@astier.eu> Signed-off-by: Len Brown <len.brown@intel.com>
Anisse Astier [Fri, 4 Dec 2009 09:10:09 +0000 (10:10 +0100)]
wmi: Free the allocated acpi objects through wmi_get_event_data
These function allocate an acpi object by calling wmi_get_event_data, which
then calls acpi_evaluate_object, and it is not freed afterwards.
And kernel doc is fixed for parameters of wmi_get_event_data.
Signed-off-by: Anisse Astier <anisse@astier.eu> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
Peter Feuerer [Tue, 22 Dec 2009 00:20:06 +0000 (16:20 -0800)]
drivers/platform/x86/acerhdf.c: check BIOS information whether it begins with string of table
BIOS information is now checked whether it begins with the strings stored
in the BIOS table. Previous method did a strcmp, what lead to problems if
BIOS information has appended whitespaces.
Signed-off-by: Peter Feuerer <peter@piie.net> Cc: Borislav Petkov <petkovbb@gmail.com> Cc: Andreas Mohr <andi@lisas.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Peter Feuerer [Tue, 22 Dec 2009 00:20:05 +0000 (16:20 -0800)]
acerhdf: add new BIOS versions
Add new BIOS versions for following netbooks: Aspire 1810xx, Packard Bell
DOTMU.
Signed-off-by: Peter Feuerer <peter@piie.net> Cc: Borislav Petkov <petkovbb@gmail.com> Cc: Andreas Mohr <andi@lisas.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Stefan Bader [Tue, 22 Dec 2009 00:20:04 +0000 (16:20 -0800)]
acerhdf: limit modalias matching to supported
BugLink: https://bugs.launchpad.net/ubuntu/+bug/435958
The module alias currently matches any Acer computer but when loaded the
BIOS checks will only succeed on Aspire One models. This causes a invalid
BIOS warning for all other models (seen on Aspire 4810T). This is not
fatal but worries users that see this message. Limiting the moule alias
to models starting with AOA or DOA for Packard Bell.
Signed-off-by: Stefan Bader <stefan.bader@canonical.com> Acked-by: Borislav Petkov <petkovbb@gmail.com> Acked-by: Peter Feuerer <peter@piie.net> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Alexey Dobriyan [Tue, 22 Dec 2009 00:20:02 +0000 (16:20 -0800)]
toshiba_acpi: convert to seq_file
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: John W. Linville <linville@tuxdriver.com> Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Alexey Dobriyan [Tue, 22 Dec 2009 00:20:01 +0000 (16:20 -0800)]
asus_acpi: convert to seq_file
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Corentin Chary <corentincj@iksaif.net> Cc: Karol Kozimor <sziwan@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Carlos R. Mafra [Tue, 22 Dec 2009 21:45:39 +0000 (13:45 -0800)]
ACPI: do not select ACPI_DOCK from ATA_ACPI
In March 2008 commit 0ac4a3c2fbbcadc3e96e4dc47d4ae802d66e6f67 ("ACPI: fix
ATA_ACPI build") made CONFIG_ACPI_DOCK be selected by CONFIG_ATA_ACPI because
of a build error when CONFIG_ATA_ACPI=y and CONFIG_ACPI_DOCK=m.
However, in September 2008 commit 898b054f3eec5921320ae8614b5bdd7b07ea5b43
("dock: make dock driver not a module") removed the possibility of having
CONFIG_ACPI_DOCK=m and therefore there is no need for selecting it when
CONFIG_ATA_ACPI=y.
This makes the kernel ~5 Kb smaller for people who don't have a dock by
allowing them to not have ACPI_DOCK compiled-in because of ATA_ACPI=y.
Signed-off-by: Carlos R. Mafra <crmafra@aei.mpg.de> Cc: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Mattia Dongili [Wed, 16 Dec 2009 15:08:36 +0000 (00:08 +0900)]
sony-laptop: enumerate rfkill devices using SN06
SN06 makes sure we get back a longer buffer which seems to be necessary
going forward as the SNC devices describes more and more devices (or
features more precisely). Moreover SN06 should be called with only the
descriptor offset to make sure we hit the rfkill controlling function
(F124 or F135) with a 0 argument to get a full list of features.
Signed-off-by: Mattia Dongili <malattia@linux.it> Tested-by: Miguel Rodríguez Pérez <miguelrp@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Mattia Dongili [Wed, 16 Dec 2009 15:08:35 +0000 (00:08 +0900)]
sony-laptop: rfkill support for newer models
Vaio Type X and possibly other new models use F135 as the radio
frequency controlling function attached to the SNC device. In the
indexed table this corresponds to 0x0135 (surpise!).
Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Len Brown <len.brown@intel.com>
Linus Torvalds [Thu, 24 Dec 2009 02:27:51 +0000 (18:27 -0800)]
Merge branch 'i2c-fixes' of git://git.fluff.org/bjdooks/linux
* 'i2c-fixes' of git://git.fluff.org/bjdooks/linux:
i2c-omap: OMAP3: Fix I2C lockup during timeout/error cases
i2c-omap: Don't write IE state in unidle if 0
i2c-bfin-twi: fix CLKDIV calculation
Tao Ma [Tue, 22 Dec 2009 02:32:15 +0000 (10:32 +0800)]
ocfs2/trivial: Use proper mask for 2 places in hearbeat.c
I just noticed today that there are 2 places of "mlog(0,...)"
in fs/ocfs2/cluster/heartbeat.c, but actually have no default
mask prefix in that file.
So change them to mlog(ML_HEARTBEAT,...).
Signed-off-by: Tao Ma <tao.ma@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Tristan Ye [Tue, 22 Dec 2009 01:11:58 +0000 (09:11 +0800)]
Ocfs2: Let ocfs2 support fiemap for symlink and fast symlink.
For fast symlink, it can be treated the same as inlined files since
the data extent we want to return of both case all were stored in
metadata block. For symlink, it can be simply treated the same as we
did for regular files.
Signed-off-by: Tristan Ye <tristan.ye@oracle.com> Acked-by: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Manjunatha GK [Fri, 11 Dec 2009 05:39:08 +0000 (11:09 +0530)]
i2c-omap: OMAP3: Fix I2C lockup during timeout/error cases
Current OMAP3 I2C driver code does not follow the correct sequence for soft
reset. Due to this, lock up issues are reported during timeout/error cases.
This patch fixes above issue by disabling I2C controller as per OMAP3430 TRM
for soft reset. As per TRM, I2C controller needs to be disabled as a first
step during soft reset.
Here is correct soft reset sequence:
a. Ensure that the module is disabled
(clear the I2Ci.I2C_CON[15] I2C_EN bit to 0).
b. Set the I2Ci.I2C_SYSC[1] SRST bit to 1.
c. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1.
d. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to
indicate the software reset is complete.
Cory Maccarrone [Wed, 23 Dec 2009 01:06:13 +0000 (18:06 -0700)]
i2c-omap: Don't write IE state in unidle if 0
Commit ef871432... (i2c-omap: OMAP3: PM: (re)init for every transfer
to support off-mode) introduced a change which make the dev->iestate
contents be written to the OMAP_I2C_IE_REG every time omap_i2c_unidle
is called. Previously, the state was only written if it wasn't equal
to zero.
In omap_i2c_probe, omap_i2c_unidle() is called prior to omap_i2c_init(),
in which case dev->iestate has not yet been initialized and will be set
to zero. Having this value written to the registers causes deadlock
while booting.
As such, this change restores the original functionality.
Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>