Linus Torvalds [Wed, 23 Dec 2009 18:01:20 +0000 (10:01 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: hda - Add STAC9205 PCI_QUIRK for Dell Vostro 1700
ASoC: Do not write to invalid registers on the wm9712.
ALSA: hda - Set mixer name after codec patch
ASoC: add missing parameter to mx27vis_hifi_hw_free()
ASoC: sh: FSI:: don't check platform_get_irq's return value against zero
ALSA: sound/core/pcm_timer.c: use lib/gcd.c
ALSA: hda - Add MSI blacklist
ALSA: hda - Add support for the new 27 inch IMacs
ALSA: hda - Fix NULL dereference with enable_beep=0 option
Takashi Iwai [Wed, 23 Dec 2009 17:50:17 +0000 (18:50 +0100)]
Merge branch 'fix/hda' into for-linus
Takashi Iwai [Wed, 23 Dec 2009 17:50:13 +0000 (18:50 +0100)]
Merge branch 'fix/asoc' into for-linus
Takashi Iwai [Wed, 23 Dec 2009 17:49:55 +0000 (18:49 +0100)]
Merge branch 'fix/misc' into for-linus
Anisse Astier [Wed, 23 Dec 2009 16:28:45 +0000 (17:28 +0100)]
ALSA: hda - Add STAC9205 PCI_QUIRK for Dell Vostro 1700
Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Randy Dunlap [Wed, 23 Dec 2009 17:23:33 +0000 (09:23 -0800)]
kfifo: fix Error/broken kernel-doc notation
Fix kernel-doc errors and warnings in new header file kfifo.h.
Don't use kernel-doc "/**" for internal functions whose comments
are not in kernel-doc format.
kernel-doc section header names (like "Note:") must be unique
per function. Looks like I need to document that.
Error(include/linux/kfifo.h:76): duplicate section name 'Note'
Warning(include/linux/kfifo.h:88): Excess function parameter 'size' description in 'INIT_KFIFO'
Error(include/linux/kfifo.h:101): duplicate section name 'Note'
Warning(include/linux/kfifo.h:257): No description found for parameter 'fifo'
(many of this last type, from internal functions)
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Wed, 23 Dec 2009 17:12:57 +0000 (09:12 -0800)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: Revert 738d2be, simplify set_task_cpu()
Linus Torvalds [Wed, 23 Dec 2009 17:12:20 +0000 (09:12 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
quota: Improve checking of quota file header
jbd: jbd-debug and jbd2-debug should be writable
ext4: fix sleep inside spinlock issue with quota and dealloc (#14739)
ext4: Fix potential quota deadlock
quota: Fix 64-bit limits setting on 32-bit archs
ext3: Replace lock/unlock_super() with an explicit lock for resizing
ext3: Replace lock/unlock_super() with an explicit lock for the orphan list
ext3: ext3_mark_recovery_complete() doesn't need to use lock_super
ext3: Remove outdated comment about lock_super()
quota: Move duplicated code to separate functions
ext4: Convert to generic reserved quota's space management.
quota: decouple fs reserved space from quota reservation
Add unlocked version of inode_add_bytes() function
ext3: quota macros cleanup [V2]
Linus Torvalds [Wed, 23 Dec 2009 16:59:32 +0000 (08:59 -0800)]
Merge branch 'drm-linus' of git://git./linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (35 commits)
drm/radeon/kms: add definitions for v4 power tables
drm/radeon/kms: never combine LVDS with another encoder
drm/radeon/kms: Check module arguments to be valid V2
drm/radeon/kms: Avoid crash when trying to cleanup uninitialized structure
drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v4)
drm/radeon/kms: add 3DC compression support
drm/radeon/kms: allow rendering while no colorbuffer is set on r300
drm/radeon/kms: enable memory clock reading on legacy (V2)
drm/radeon/kms: prevent parallel AtomBIOS calls
drm/radeon/kms: set proper default tv standard
drm/radeon/kms: fix legacy rmx
drm/radeon/kms/atom: fill in proper defines for digital setup
drm/kms: silencing a false positive warning.
drm/mm: fix logic for selection of best fit block
drm/vmwgfx: Use TTM handles instead of SIDs as user-space surface handles.
drm/vmwgfx: Return -ERESTARTSYS when interrupted by a signal.
drm/vmwgfx: Fix unlocked ioctl and add proper access control
drm/radeon: fix build on 64-bit with some compilers.
drivers/gpu: Use kzalloc for allocating only one thing
DRM: Rename clamp variable
...
Stefani Seibold [Wed, 23 Dec 2009 08:10:48 +0000 (09:10 +0100)]
Fix usb_serial_probe() problem introduced by the recent kfifo changes
The USB serial code was a new user of the kfifo API, and it was missed
when porting things to the new kfifo API.
Please make the write_fifo in place. Here is my patch to fix the
regression and full ported version.
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Reported-and-tested-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Eric Millbrandt [Tue, 22 Dec 2009 15:13:24 +0000 (10:13 -0500)]
ASoC: Do not write to invalid registers on the wm9712.
This patch fixes a bug where "virtual" registers were being written to the ac97
bus. This was causing unrelated registers to become corrupted (headphone 0x04,
touchscreen 0x78, etc).
This patch duplicates protection that was included in the wm9713 driver.
Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
Jan Kara [Mon, 21 Dec 2009 20:57:04 +0000 (21:57 +0100)]
quota: Improve checking of quota file header
When we are asked for vfsv0 quota format and the file is in vfsv1
format (or vice versa), refuse to use the quota file. Also return
with error when we don't like the header of quota file.
Signed-off-by: Jan Kara <jack@suse.cz>
Yin Kangkai [Tue, 15 Dec 2009 22:48:25 +0000 (14:48 -0800)]
jbd: jbd-debug and jbd2-debug should be writable
jbd-debug and jbd2-debug is currently read-only (S_IRUGO), which is not
correct. Make it writable so that we can start debuging.
Signed-off-by: Yin Kangkai <kangkai.yin@intel.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Dmitry Monakhov [Thu, 10 Dec 2009 16:36:27 +0000 (16:36 +0000)]
ext4: fix sleep inside spinlock issue with quota and dealloc (#14739)
Unlock i_block_reservation_lock before vfs_dq_reserve_block().
This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=14739
CC: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Dmitry Monakhov [Thu, 10 Dec 2009 03:31:45 +0000 (03:31 +0000)]
ext4: Fix potential quota deadlock
We have to delay vfs_dq_claim_space() until allocation context destruction.
Currently we have following call-trace:
ext4_mb_new_blocks()
/* task is already holding ac->alloc_semp */
->ext4_mb_mark_diskspace_used
->vfs_dq_claim_space() /* acquire dqptr_sem here. Possible deadlock */
->ext4_mb_release_context() /* drop ac->alloc_semp here */
Let's move quota claiming to ext4_da_update_reserve_space()
=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.32-rc7 #18
-------------------------------------------------------
write-truncate-/3465 is trying to acquire lock:
(&s->s_dquot.dqptr_sem){++++..}, at: [<
c025e73b>] dquot_claim_space+0x3b/0x1b0
but task is already holding lock:
(&meta_group_info[i]->alloc_sem){++++..}, at: [<
c02ce962>] ext4_mb_load_buddy+0xb2/0x370
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&meta_group_info[i]->alloc_sem){++++..}:
[<
c017d04b>] __lock_acquire+0xd7b/0x1260
[<
c017d5ea>] lock_acquire+0xba/0xd0
[<
c0527191>] down_read+0x51/0x90
[<
c02ce962>] ext4_mb_load_buddy+0xb2/0x370
[<
c02d0c1c>] ext4_mb_free_blocks+0x46c/0x870
[<
c029c9d3>] ext4_free_blocks+0x73/0x130
[<
c02c8cfc>] ext4_ext_truncate+0x76c/0x8d0
[<
c02a8087>] ext4_truncate+0x187/0x5e0
[<
c01e0f7b>] vmtruncate+0x6b/0x70
[<
c022ec02>] inode_setattr+0x62/0x190
[<
c02a2d7a>] ext4_setattr+0x25a/0x370
[<
c022ee81>] notify_change+0x151/0x340
[<
c021349d>] do_truncate+0x6d/0xa0
[<
c0221034>] may_open+0x1d4/0x200
[<
c022412b>] do_filp_open+0x1eb/0x910
[<
c021244d>] do_sys_open+0x6d/0x140
[<
c021258e>] sys_open+0x2e/0x40
[<
c0103100>] sysenter_do_call+0x12/0x32
-> #2 (&ei->i_data_sem){++++..}:
[<
c017d04b>] __lock_acquire+0xd7b/0x1260
[<
c017d5ea>] lock_acquire+0xba/0xd0
[<
c0527191>] down_read+0x51/0x90
[<
c02a5787>] ext4_get_blocks+0x47/0x450
[<
c02a74c1>] ext4_getblk+0x61/0x1d0
[<
c02a7a7f>] ext4_bread+0x1f/0xa0
[<
c02bcddc>] ext4_quota_write+0x12c/0x310
[<
c0262d23>] qtree_write_dquot+0x93/0x120
[<
c0261708>] v2_write_dquot+0x28/0x30
[<
c025d3fb>] dquot_commit+0xab/0xf0
[<
c02be977>] ext4_write_dquot+0x77/0x90
[<
c02be9bf>] ext4_mark_dquot_dirty+0x2f/0x50
[<
c025e321>] dquot_alloc_inode+0x101/0x180
[<
c029fec2>] ext4_new_inode+0x602/0xf00
[<
c02ad789>] ext4_create+0x89/0x150
[<
c0221ff2>] vfs_create+0xa2/0xc0
[<
c02246e7>] do_filp_open+0x7a7/0x910
[<
c021244d>] do_sys_open+0x6d/0x140
[<
c021258e>] sys_open+0x2e/0x40
[<
c0103100>] sysenter_do_call+0x12/0x32
-> #1 (&sb->s_type->i_mutex_key#7/4){+.+...}:
[<
c017d04b>] __lock_acquire+0xd7b/0x1260
[<
c017d5ea>] lock_acquire+0xba/0xd0
[<
c0526505>] mutex_lock_nested+0x65/0x2d0
[<
c0260c9d>] vfs_load_quota_inode+0x4bd/0x5a0
[<
c02610af>] vfs_quota_on_path+0x5f/0x70
[<
c02bc812>] ext4_quota_on+0x112/0x190
[<
c026345a>] sys_quotactl+0x44a/0x8a0
[<
c0103100>] sysenter_do_call+0x12/0x32
-> #0 (&s->s_dquot.dqptr_sem){++++..}:
[<
c017d361>] __lock_acquire+0x1091/0x1260
[<
c017d5ea>] lock_acquire+0xba/0xd0
[<
c0527191>] down_read+0x51/0x90
[<
c025e73b>] dquot_claim_space+0x3b/0x1b0
[<
c02cb95f>] ext4_mb_mark_diskspace_used+0x36f/0x380
[<
c02d210a>] ext4_mb_new_blocks+0x34a/0x530
[<
c02c83fb>] ext4_ext_get_blocks+0x122b/0x13c0
[<
c02a5966>] ext4_get_blocks+0x226/0x450
[<
c02a5ff3>] mpage_da_map_blocks+0xc3/0xaa0
[<
c02a6ed6>] ext4_da_writepages+0x506/0x790
[<
c01de272>] do_writepages+0x22/0x50
[<
c01d766d>] __filemap_fdatawrite_range+0x6d/0x80
[<
c01d7b9b>] filemap_flush+0x2b/0x30
[<
c02a40ac>] ext4_alloc_da_blocks+0x5c/0x60
[<
c029e595>] ext4_release_file+0x75/0xb0
[<
c0216b59>] __fput+0xf9/0x210
[<
c0216c97>] fput+0x27/0x30
[<
c02122dc>] filp_close+0x4c/0x80
[<
c014510e>] put_files_struct+0x6e/0xd0
[<
c01451b7>] exit_files+0x47/0x60
[<
c0146a24>] do_exit+0x144/0x710
[<
c0147028>] do_group_exit+0x38/0xa0
[<
c0159abc>] get_signal_to_deliver+0x2ac/0x410
[<
c0102849>] do_notify_resume+0xb9/0x890
[<
c01032d2>] work_notifysig+0x13/0x21
other info that might help us debug this:
3 locks held by write-truncate-/3465:
#0: (jbd2_handle){+.+...}, at: [<
c02e1f8f>] start_this_handle+0x38f/0x5c0
#1: (&ei->i_data_sem){++++..}, at: [<
c02a57f6>] ext4_get_blocks+0xb6/0x450
#2: (&meta_group_info[i]->alloc_sem){++++..}, at: [<
c02ce962>] ext4_mb_load_buddy+0xb2/0x370
stack backtrace:
Pid: 3465, comm: write-truncate- Not tainted 2.6.32-rc7 #18
Call Trace:
[<
c0524cb3>] ? printk+0x1d/0x22
[<
c017ac9a>] print_circular_bug+0xca/0xd0
[<
c017d361>] __lock_acquire+0x1091/0x1260
[<
c016bca2>] ? sched_clock_local+0xd2/0x170
[<
c0178fd0>] ? trace_hardirqs_off_caller+0x20/0xd0
[<
c017d5ea>] lock_acquire+0xba/0xd0
[<
c025e73b>] ? dquot_claim_space+0x3b/0x1b0
[<
c0527191>] down_read+0x51/0x90
[<
c025e73b>] ? dquot_claim_space+0x3b/0x1b0
[<
c025e73b>] dquot_claim_space+0x3b/0x1b0
[<
c02cb95f>] ext4_mb_mark_diskspace_used+0x36f/0x380
[<
c02d210a>] ext4_mb_new_blocks+0x34a/0x530
[<
c02c601d>] ? ext4_ext_find_extent+0x25d/0x280
[<
c02c83fb>] ext4_ext_get_blocks+0x122b/0x13c0
[<
c016bca2>] ? sched_clock_local+0xd2/0x170
[<
c016be60>] ? sched_clock_cpu+0x120/0x160
[<
c016beef>] ? cpu_clock+0x4f/0x60
[<
c0178fd0>] ? trace_hardirqs_off_caller+0x20/0xd0
[<
c052712c>] ? down_write+0x8c/0xa0
[<
c02a5966>] ext4_get_blocks+0x226/0x450
[<
c016be60>] ? sched_clock_cpu+0x120/0x160
[<
c016beef>] ? cpu_clock+0x4f/0x60
[<
c017908b>] ? trace_hardirqs_off+0xb/0x10
[<
c02a5ff3>] mpage_da_map_blocks+0xc3/0xaa0
[<
c01d69cc>] ? find_get_pages_tag+0x16c/0x180
[<
c01d6860>] ? find_get_pages_tag+0x0/0x180
[<
c02a73bd>] ? __mpage_da_writepage+0x16d/0x1a0
[<
c01dfc4e>] ? pagevec_lookup_tag+0x2e/0x40
[<
c01ddf1b>] ? write_cache_pages+0xdb/0x3d0
[<
c02a7250>] ? __mpage_da_writepage+0x0/0x1a0
[<
c02a6ed6>] ext4_da_writepages+0x506/0x790
[<
c016beef>] ? cpu_clock+0x4f/0x60
[<
c016bca2>] ? sched_clock_local+0xd2/0x170
[<
c016be60>] ? sched_clock_cpu+0x120/0x160
[<
c016be60>] ? sched_clock_cpu+0x120/0x160
[<
c02a69d0>] ? ext4_da_writepages+0x0/0x790
[<
c01de272>] do_writepages+0x22/0x50
[<
c01d766d>] __filemap_fdatawrite_range+0x6d/0x80
[<
c01d7b9b>] filemap_flush+0x2b/0x30
[<
c02a40ac>] ext4_alloc_da_blocks+0x5c/0x60
[<
c029e595>] ext4_release_file+0x75/0xb0
[<
c0216b59>] __fput+0xf9/0x210
[<
c0216c97>] fput+0x27/0x30
[<
c02122dc>] filp_close+0x4c/0x80
[<
c014510e>] put_files_struct+0x6e/0xd0
[<
c01451b7>] exit_files+0x47/0x60
[<
c0146a24>] do_exit+0x144/0x710
[<
c017b163>] ? lock_release_holdtime+0x33/0x210
[<
c0528137>] ? _spin_unlock_irq+0x27/0x30
[<
c0147028>] do_group_exit+0x38/0xa0
[<
c017babb>] ? trace_hardirqs_on+0xb/0x10
[<
c0159abc>] get_signal_to_deliver+0x2ac/0x410
[<
c0102849>] do_notify_resume+0xb9/0x890
[<
c0178fd0>] ? trace_hardirqs_off_caller+0x20/0xd0
[<
c017b163>] ? lock_release_holdtime+0x33/0x210
[<
c0165b50>] ? autoremove_wake_function+0x0/0x50
[<
c017ba54>] ? trace_hardirqs_on_caller+0x134/0x190
[<
c017babb>] ? trace_hardirqs_on+0xb/0x10
[<
c0300ba4>] ? security_file_permission+0x14/0x20
[<
c0215761>] ? vfs_write+0x131/0x190
[<
c0214f50>] ? do_sync_write+0x0/0x120
[<
c0103115>] ? sysenter_do_call+0x27/0x32
[<
c01032d2>] work_notifysig+0x13/0x21
CC: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Jan Kara [Tue, 15 Dec 2009 21:24:36 +0000 (22:24 +0100)]
quota: Fix 64-bit limits setting on 32-bit archs
Fix warnings:
fs/quota/quota_v2.c: In function ‘v2_read_file_info’:
fs/quota/quota_v2.c:123: warning: integer constant is too large for ‘long’ type
fs/quota/quota_v2.c:124: warning: integer constant is too large for ‘long’ type
Reported-by: Jerry Leo <jerryleo860202@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Eric Sandeen [Mon, 14 Dec 2009 19:01:05 +0000 (13:01 -0600)]
ext3: Replace lock/unlock_super() with an explicit lock for resizing
Use a separate lock to protect s_groups_count and the other block
group descriptors which get changed via an on-line resize operation,
so we can stop overloading the use of lock_super().
Port of ext4 commit
32ed5058ce90024efcd811254b4b1de0468099df by
Theodore Ts'o <tytso@mit.edu>.
CC: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Eric Sandeen [Mon, 14 Dec 2009 19:00:30 +0000 (13:00 -0600)]
ext3: Replace lock/unlock_super() with an explicit lock for the orphan list
Use a separate lock to protect the orphan list, so we can stop
overloading the use of lock_super().
Port of ext4 commit
3b9d4ed26680771295d904a6b83e88e620780893
by Theodore Ts'o <tytso@mit.edu>.
CC: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Eric Sandeen [Mon, 14 Dec 2009 18:59:59 +0000 (12:59 -0600)]
ext3: ext3_mark_recovery_complete() doesn't need to use lock_super
The function ext3_mark_recovery_complete() is called from two call
paths: either (a) while mounting the filesystem, in which case there's
no danger of any other CPU calling write_super() until the mount is
completed, and (b) while remounting the filesystem read-write, in
which case the fs core has already locked the superblock. This also
allows us to take out a very vile unlock_super()/lock_super() pair in
ext3_remount().
Port of ext4 commit
a63c9eb2ce6f5028da90f282798232c4f398ceb8 by
Theodore Ts'o <tytso@mit.edu>.
CC: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Eric Sandeen [Mon, 14 Dec 2009 18:59:18 +0000 (12:59 -0600)]
ext3: Remove outdated comment about lock_super()
ext3_fill_super() is no longer called by read_super(), and it is no
longer called with the superblock locked. The
unlock_super()/lock_super() is no longer present, so this comment is
entirely superfluous.
Port of ext4 commit
32ed5058ce90024efcd811254b4b1de0468099df by
Theodore Ts'o <tytso@mit.edu>.
CC: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Dmitry Monakhov [Mon, 14 Dec 2009 12:21:15 +0000 (15:21 +0300)]
quota: Move duplicated code to separate functions
- for(..) { mark_dquot_dirty(); } -> mark_all_dquot_dirty()
- for(..) { dput(); } -> dqput_all()
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Dmitry Monakhov [Mon, 14 Dec 2009 12:21:14 +0000 (15:21 +0300)]
ext4: Convert to generic reserved quota's space management.
This patch also fixes write vs chown race condition.
Acked-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Dmitry Monakhov [Mon, 14 Dec 2009 12:21:13 +0000 (15:21 +0300)]
quota: decouple fs reserved space from quota reservation
Currently inode_reservation is managed by fs itself and this
reservation is transfered on dquot_transfer(). This means what
inode_reservation must always be in sync with
dquot->dq_dqb.dqb_rsvspace. Otherwise dquot_transfer() will result
in incorrect quota(WARN_ON in dquot_claim_reserved_space() will be
triggered)
This is not easy because of complex locking order issues
for example http://bugzilla.kernel.org/show_bug.cgi?id=14739
The patch introduce quota reservation field for each fs-inode
(fs specific inode is used in order to prevent bloating generic
vfs inode). This reservation is managed by quota code internally
similar to i_blocks/i_bytes and may not be always in sync with
internal fs reservation.
Also perform some code rearrangement:
- Unify dquot_reserve_space() and dquot_reserve_space()
- Unify dquot_release_reserved_space() and dquot_free_space()
- Also this patch add missing warning update to release_rsv()
dquot_release_reserved_space() must call flush_warnings() as
dquot_free_space() does.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Dmitry Monakhov [Mon, 14 Dec 2009 12:21:12 +0000 (15:21 +0300)]
Add unlocked version of inode_add_bytes() function
Quota code requires unlocked version of this function. Off course
we can just copy-paste the code, but copy-pasting is always an evil.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Dmitry Monakhov [Wed, 9 Dec 2009 00:05:30 +0000 (03:05 +0300)]
ext3: quota macros cleanup [V2]
Currently all quota block reservation macros contains hardcoded "2"
aka MAXQUOTAS value. This is no good because in some places it is not
obvious to understand what does this digit represent. Let's introduce
new macro with self descriptive name.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Peter Zijlstra [Tue, 22 Dec 2009 14:43:19 +0000 (15:43 +0100)]
sched: Revert 738d2be, simplify set_task_cpu()
Effectively reverts
738d2be4301007f054541c5c4bf7fb6a361c9b3a.
As demonstrated by Eric, we really need to call __set_task_cpu()
early in the fork() path to properly initialize the various task
state -- specifically the cgroup state through set_task_rq().
[ we could probably fix this by explicitly calling
__set_task_cpu() from sched_fork(), but lets try that for the
next cycle and simply revert to the old behaviour for now. ]
Reported-by: Eric Paris <eparis@redhat.com>
Tested-by: Eric Paris <eparis@redhat.com>,
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: efault@gmx.de
LKML-Reference: <
1261492999.4937.36.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Takashi Iwai [Wed, 23 Dec 2009 08:27:51 +0000 (09:27 +0100)]
ALSA: hda - Set mixer name after codec patch
Postpone the mixer name setup after the codec patch since the codec
patch may change the codec name string in itself.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Dave Airlie [Wed, 23 Dec 2009 01:18:33 +0000 (11:18 +1000)]
Merge remote branch 'korg/drm-radeon-next' into drm-linus
* korg/drm-radeon-next:
drm/radeon/kms: add definitions for v4 power tables
drm/radeon/kms: never combine LVDS with another encoder
drm/radeon/kms: Check module arguments to be valid V2
drm/radeon/kms: Avoid crash when trying to cleanup uninitialized structure
drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v4)
drm/radeon/kms: add 3DC compression support
drm/radeon/kms: allow rendering while no colorbuffer is set on r300
drm/radeon/kms: enable memory clock reading on legacy (V2)
drm/radeon/kms: prevent parallel AtomBIOS calls
drm/radeon/kms: set proper default tv standard
drm/radeon/kms: fix legacy rmx
drm/radeon/kms/atom: fill in proper defines for digital setup
Alex Deucher [Sat, 19 Dec 2009 17:45:12 +0000 (12:45 -0500)]
drm/radeon/kms: add definitions for v4 power tables
[airlied: just adding this for completeness to avoid drift between
public atombios.h files]
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 18 Dec 2009 16:28:22 +0000 (11:28 -0500)]
drm/radeon/kms: never combine LVDS with another encoder
When linking multiple encoders to a connector, make sure
to not link LVDS with another connector. Some bioses
have the same i2c line for LVDS and VGA.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Fri, 11 Dec 2009 20:18:34 +0000 (21:18 +0100)]
drm/radeon/kms: Check module arguments to be valid V2
This patch add a function which check module argument to be
valid. On invalid argument it prints a warning and setback
the default value.
V2: Allow 0 for vram limit & agp mode which are the default
value
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Fri, 11 Dec 2009 19:36:19 +0000 (20:36 +0100)]
drm/radeon/kms: Avoid crash when trying to cleanup uninitialized structure
Add boolean to record if some part of the driver are initialized or
not this allow to avoid a crash when trying to cleanup uninitialized
structure members.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Tue, 22 Dec 2009 15:06:49 +0000 (10:06 -0500)]
drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v4)
This fixes LVDS on some mac laptops without a panel edid.
v2 - Set proper mode type flags
v3 - Note that this is not neceesarily the exact panel mode,
but an approximation based on the cvt formula. For these
systems we should ideally read the mode info out of the
registers or add a mode table, but this works and is much
simpler.
v4 - Update comments and debug message.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Marek Olšák [Fri, 18 Dec 2009 23:23:00 +0000 (00:23 +0100)]
drm/radeon/kms: add 3DC compression support
There are 2 formats:
ATI1N: 64 bits per 4x4 block, one-channel format
ATI2N: 128 bits per 4x4 block, two-channel format
Signed-off-by: Dave Airlie <airlied@redhat.com>
Marek Olšák [Thu, 17 Dec 2009 05:02:28 +0000 (06:02 +0100)]
drm/radeon/kms: allow rendering while no colorbuffer is set on r300
Because hardware cannot disable all colorbuffers directly to do depth-only
rendering, a user should:
- disable reading from a colorbuffer in blending
- disable fastfill
- set the color channel mask to 0 to prevent writing to a colorbuffer
Signed-off-by: Dave Airlie <airlied@redhat.com>
Rafał Miłecki [Thu, 17 Dec 2009 12:50:09 +0000 (13:50 +0100)]
drm/radeon/kms: enable memory clock reading on legacy (V2)
V2: detect IGP cards (which don't have own memory)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Rafał Miłecki [Wed, 16 Dec 2009 23:00:46 +0000 (00:00 +0100)]
drm/radeon/kms: prevent parallel AtomBIOS calls
This just adds a mutex around the atombios table execution
so we don't call it from two contexts at once.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 18 Dec 2009 00:00:29 +0000 (19:00 -0500)]
drm/radeon/kms: set proper default tv standard
we were just using 1 before.
reported on irc by soreau
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 17 Dec 2009 06:24:59 +0000 (01:24 -0500)]
drm/radeon/kms: fix legacy rmx
This makes 640x480 on my R100 work again, both
in aspect and centered mode.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 17 Dec 2009 16:22:01 +0000 (11:22 -0500)]
drm/radeon/kms/atom: fill in proper defines for digital setup
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 23 Dec 2009 00:28:24 +0000 (10:28 +1000)]
Merge remote branch 'nouveau/for-airlied' into drm-linus
* nouveau/for-airlied:
drm/nouveau: fix bug causing pinned buffers to lose their NO_EVICT flag
drm/nv50: fix suspend/resume delays without firmware present
drm/nouveau: prevent all channel creation if accel not available
drm/nv50: fix two potential suspend/resume oopses
drm/nv40: implement ctxprog/state generation
drm/nv10: Add the initial graph context and soft methods needed for LMA.
drm/nouveau: Fix up buffer eviction, and evict them to GART, if possible.
drm/nouveau: Add proper error handling to nouveau_card_init
drm/nv04: Fix NV04 set_operation software method.
drm/nouveau: Kill global state in BIOS script interpreter
drm/nouveau: Kill global state in NvShadowBIOS
drm/nouveau: use drm debug levels
drm/i2c/ch7006: Fix load detection false positives right after system init.
drm/nv04-nv40: Fix "conflicting memory types" when saving/restoring VGA fonts.
Marin Mitov [Sun, 20 Dec 2009 07:03:27 +0000 (09:03 +0200)]
drm/kms: silencing a false positive warning.
warning: 'width' may be used uninitialized in this function
drivers/gpu/drm/drm_edid.c
Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Bob Gleitsmann [Mon, 21 Dec 2009 03:52:09 +0000 (13:52 +1000)]
drm/mm: fix logic for selection of best fit block
This is from bug 25728.
[airlied: I'm just forwarding the patch for review, Thomas, ickle?]
Acked-by: Jerome Glisse <jglisse@redhat.com>
Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 22 Dec 2009 15:53:41 +0000 (16:53 +0100)]
drm/vmwgfx: Use TTM handles instead of SIDs as user-space surface handles.
Improve the command verifier to catch all occurences of surface handles,
and translate to SIDs.
This way DMA buffers and 3D surfaces share a common handle space,
which makes it possible for the kms code to differentiate.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 8 Dec 2009 11:59:34 +0000 (12:59 +0100)]
drm/vmwgfx: Return -ERESTARTSYS when interrupted by a signal.
Fixes for TTM API change.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 8 Dec 2009 11:57:51 +0000 (12:57 +0100)]
drm/vmwgfx: Fix unlocked ioctl and add proper access control
This fixes up vmwgfx for the unlocked ioctl code to avoid
doing it in the driver. Also adds ioctl flags.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 20 Dec 2009 06:08:40 +0000 (16:08 +1000)]
drm/radeon: fix build on 64-bit with some compilers.
drivers/gpu/drm/radeon/radeon_test.c:45: undefined reference to `__udivdi3'
Reported-by: Mr. James W. Laferriere <babydr@baby-dragons.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Julia Lawall [Sat, 19 Dec 2009 07:16:33 +0000 (08:16 +0100)]
drivers/gpu: Use kzalloc for allocating only one thing
Use kzalloc rather than kcalloc(1,...)
The use of the allocated memory that looks like an array is &p->relocs[0],
but this should be the same as p->relocs.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
@@
- kcalloc(1,
+ kzalloc(
...)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Andi Kleen [Mon, 21 Dec 2009 01:24:47 +0000 (02:24 +0100)]
DRM: Rename clamp variable
linux/kernel.h has a "clamp" macro, but r300_cmdbuf also uses a variable
with the same name. Right now it doesn't seem to include the header,
but sooner or later someone will. So better rename the variable
now.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Linus Torvalds [Tue, 22 Dec 2009 22:22:36 +0000 (14:22 -0800)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
pata_bf54x: handle portmuxing of pins through GPIO PORTs
Linus Torvalds [Tue, 22 Dec 2009 22:22:05 +0000 (14:22 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM: Runtime PM documentation update
PM / Runtime: Use device type and device class callbacks
PM: Use pm_runtime_put_sync in system resume
PM: Measure device suspend and resume times
PM: Make the initcall_debug style timing for suspend/resume complete
Linus Torvalds [Tue, 22 Dec 2009 22:20:48 +0000 (14:20 -0800)]
Merge git://git./linux/kernel/git/viro/vfs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
jfs: Fix 32bit build warning
Remove obsolete comment in fs.h
Sanitize f_flags helpers
Fix f_flags/f_mode in case of lookup_instantiate_filp() from open(pathname, 3)
anonfd: Allow making anon files read-only
fs/compat_ioctl.c: fix build error when !BLOCK
pohmelfs needs I_LOCK
alloc_file(): simplify handling of mnt_clone_write() errors
Linus Torvalds [Tue, 22 Dec 2009 22:18:56 +0000 (14:18 -0800)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/dvrabel/uwb
* 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb:
MAINTAINERS: update entries for WUSB, UWB and WLP subsystems
Linus Torvalds [Tue, 22 Dec 2009 22:18:13 +0000 (14:18 -0800)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (36 commits)
powerpc/gc/wii: Remove get_irq_desc()
powerpc/gc/wii: hlwd-pic: convert irq_desc.lock to raw_spinlock
powerpc/gamecube/wii: Fix off-by-one error in ugecon/usbgecko_udbg
powerpc/mpic: Fix problem that affinity is not updated
powerpc/mm: Fix stupid bug in subpge protection handling
powerpc/iseries: use DECLARE_COMPLETION_ONSTACK for non-constant completion
powerpc: Fix MSI support on U4 bridge PCIe slot
powerpc: Handle VSX alignment faults correctly in little-endian mode
powerpc/mm: Fix typo of cpumask_clear_cpu()
powerpc/mm: Fix hash_utils_64.c compile errors with DEBUG enabled.
powerpc: Convert BUG() to use unreachable()
powerpc/pseries: Make declarations of cpu_hotplug_driver_lock() ANSI compatible.
powerpc/pseries: Don't panic when H_PROD fails during cpu-online.
powerpc/mm: Fix a WARN_ON() with CONFIG_DEBUG_PAGEALLOC and CONFIG_DEBUG_VM
powerpc/defconfigs: Set HZ=100 on pseries and ppc64 defconfigs
powerpc/defconfigs: Disable token ring in powerpc defconfigs
powerpc/defconfigs: Reduce 64bit vmlinux by making acenic and cramfs modules
powerpc/pseries: Select XICS and PCI_MSI PSERIES
powerpc/85xx: Wrong variable returned on error
powerpc/iseries: Convert to proc_fops
...
Stefani Seibold [Mon, 21 Dec 2009 22:37:33 +0000 (14:37 -0800)]
media video cx23888 driver: ported to new kfifo API
Fix the cx23888 driver to use the new kfifo API. Using kfifo_reset()
may result in a possible race conditions. This patch fixes it by using
a spinlock around the kfifo_reset() function.
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Reviewed-by: Andy Walls <awalls@radix.net>
Acked-by: Andy Walls <awalls@radix.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stefani Seibold [Mon, 21 Dec 2009 22:37:32 +0000 (14:37 -0800)]
kfifo: add record handling functions
Add kfifo_in_rec() - puts some record data into the FIFO
Add kfifo_out_rec() - gets some record data from the FIFO
Add kfifo_from_user_rec() - puts some data from user space into the FIFO
Add kfifo_to_user_rec() - gets data from the FIFO and write it to user space
Add kfifo_peek_rec() - gets the size of the next FIFO record field
Add kfifo_skip_rec() - skip the next fifo out record
Add kfifo_avail_rec() - determinate the number of bytes available in a record FIFO
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stefani Seibold [Mon, 21 Dec 2009 22:37:31 +0000 (14:37 -0800)]
kfifo: add kfifo_skip, kfifo_from_user and kfifo_to_user
Add kfifo_reset_out() for save lockless discard the fifo output
Add kfifo_skip() to skip a number of output bytes
Add kfifo_from_user() to copy user space data into the fifo
Add kfifo_to_user() to copy fifo data to user space
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stefani Seibold [Mon, 21 Dec 2009 22:37:30 +0000 (14:37 -0800)]
kfifo: add DEFINE_KFIFO and friends, add very tiny functions
Add DECLARE_KFIFO - macro to declare a kfifo and the associated buffer inside a struct
Add INIT_KFIFO - Initialize a kfifo declared by DECLARED_KFIFO
Add DEFINE_KFIFO - macro to define and initialize a kfifo as a global or local object
Add kfifo_size() - returns the size of the fifo in bytes
Add kfifo_is_empty() - returns true if the fifo is empty
Add kfifo_is_full() - returns true if the fifo is full
Add kfifo_avail() - returns the number of bytes available in the FIFO
Do some code cleanup
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stefani Seibold [Mon, 21 Dec 2009 22:37:29 +0000 (14:37 -0800)]
kfifo: fix warn_unused_result
Fix the "ignoring return value of '...', declared with attribute
warn_unused_result" compiler warning in several users of the new kfifo
API.
It removes the __must_check attribute from kfifo_in() and
kfifo_in_locked() which must not necessary performed.
Fix the allocation bug in the nozomi driver file, by moving out the
kfifo_alloc from the interrupt handler into the probe function.
Fix the kfifo_out() and kfifo_out_locked() users to handle a unexpected
end of fifo.
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stefani Seibold [Mon, 21 Dec 2009 22:37:28 +0000 (14:37 -0800)]
kfifo: rename kfifo_put... into kfifo_in... and kfifo_get... into kfifo_out...
rename kfifo_put... into kfifo_in... to prevent miss use of old non in
kernel-tree drivers
ditto for kfifo_get... -> kfifo_out...
Improve the prototypes of kfifo_in and kfifo_out to make the kerneldoc
annotations more readable.
Add mini "howto porting to the new API" in kfifo.h
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stefani Seibold [Mon, 21 Dec 2009 22:37:28 +0000 (14:37 -0800)]
kfifo: cleanup namespace
change name of __kfifo_* functions to kfifo_*, because the prefix __kfifo
should be reserved for internal functions only.
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stefani Seibold [Mon, 21 Dec 2009 22:37:27 +0000 (14:37 -0800)]
kfifo: move out spinlock
Move the pointer to the spinlock out of struct kfifo. Most users in
tree do not actually use a spinlock, so the few exceptions now have to
call kfifo_{get,put}_locked, which takes an extra argument to a
spinlock.
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stefani Seibold [Mon, 21 Dec 2009 22:37:26 +0000 (14:37 -0800)]
kfifo: move struct kfifo in place
This is a new generic kernel FIFO implementation.
The current kernel fifo API is not very widely used, because it has to
many constrains. Only 17 files in the current 2.6.31-rc5 used it.
FIFO's are like list's a very basic thing and a kfifo API which handles
the most use case would save a lot of development time and memory
resources.
I think this are the reasons why kfifo is not in use:
- The API is to simple, important functions are missing
- A fifo can be only allocated dynamically
- There is a requirement of a spinlock whether you need it or not
- There is no support for data records inside a fifo
So I decided to extend the kfifo in a more generic way without blowing up
the API to much. The new API has the following benefits:
- Generic usage: For kernel internal use and/or device driver.
- Provide an API for the most use case.
- Slim API: The whole API provides 25 functions.
- Linux style habit.
- DECLARE_KFIFO, DEFINE_KFIFO and INIT_KFIFO Macros
- Direct copy_to_user from the fifo and copy_from_user into the fifo.
- The kfifo itself is an in place member of the using data structure, this save an
indirection access and does not waste the kernel allocator.
- Lockless access: if only one reader and one writer is active on the fifo,
which is the common use case, no additional locking is necessary.
- Remove spinlock - give the user the freedom of choice what kind of locking to use if
one is required.
- Ability to handle records. Three type of records are supported:
- Variable length records between 0-255 bytes, with a record size
field of 1 bytes.
- Variable length records between 0-65535 bytes, with a record size
field of 2 bytes.
- Fixed size records, which no record size field.
- Preserve memory resource.
- Performance!
- Easy to use!
This patch:
Since most users want to have the kfifo as part of another object,
reorganize the code to allow including struct kfifo in another data
structure. This requires changing the kfifo_alloc and kfifo_init
prototypes so that we pass an existing kfifo pointer into them. This
patch changes the implementation and all existing users.
[akpm@linux-foundation.org: fix warning]
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Randy Dunlap [Mon, 21 Dec 2009 22:37:23 +0000 (14:37 -0800)]
mm tracing: cleanup Documentation/trace/events-kmem.txt
Clean up typos/grammos/spellos in events-kmem.txt.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Randy Dunlap [Mon, 21 Dec 2009 22:37:22 +0000 (14:37 -0800)]
lib/string.c: fix kernel-doc warnings
Fix kernel-doc warnings (@arg name) in string.c::skip_spaces().
Warning(lib/string.c:347): No description found for parameter 'str'
Warning(lib/string.c:347): Excess function parameter 's' description in 'skip_spaces'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Tue, 22 Dec 2009 22:10:37 +0000 (14:10 -0800)]
Revert "time: Remove xtime_cache"
This reverts commit
7bc7d637452383d56ba4368d4336b0dde1bb476d, as
requested by John Stultz. Quoting John:
"Petr Titěra reported an issue where he saw odd atime regressions with
2.6.33 where there were a full second worth of nanoseconds in the
nanoseconds field.
He also reviewed the time code and narrowed down the problem: unhandled
overflow of the nanosecond field caused by rounding up the
sub-nanosecond accumulated time.
Details:
* At the end of update_wall_time(), we currently round up the
sub-nanosecond portion of accumulated time when storing it into xtime.
This was added to avoid time inconsistencies caused when the
sub-nanosecond portion was truncated when storing into xtime.
Unfortunately we don't handle the possible second overflow caused by
that rounding.
* Previously the xtime_cache code hid this overflow by normalizing the
xtime value when storing into the xtime_cache.
* We could try to handle the second overflow after the rounding up, but
since this affects the timekeeping's internal state, this would further
complicate the next accumulation cycle, causing small errors in ntp
steering. As much as I'd like to get rid of it, the xtime_cache code is
known to work.
* The correct fix is really to include the sub-nanosecond portion in the
timekeeping accessor function, so we don't need to round up at during
accumulation. This would greatly simplify the accumulation code.
Unfortunately, we can't do this safely until the last three
non-GENERIC_TIME arches (sparc32, arm, cris) are converted (those
patches are in -mm) and we kill off the spots where arches set xtime
directly. This is all 2.6.34 material, so I think reverting the
xtime_cache change is the best approach for now.
Many thanks to Petr for both reporting and finding the issue!"
Reported-by: Petr Titěra <P.Titera@century.cz>
Requested-by: john stultz <johnstul@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Alan Stern [Tue, 22 Dec 2009 19:43:40 +0000 (20:43 +0100)]
PM: Runtime PM documentation update
This patch (as1318) updates the runtime PM documentation, adding a
section discussing the interaction between runtime PM and system sleep.
[rjw: Rebased and made it agree with the other updates better.]
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Rafael J. Wysocki [Tue, 22 Dec 2009 19:43:17 +0000 (20:43 +0100)]
PM / Runtime: Use device type and device class callbacks
The power management of some devices is handled through device types
and device classes rather than through bus types. Since these
devices may also benefit from using the run-time power management
core, extend it so that the device type and device class run-time PM
callbacks can be taken into consideration by it if the bus type
callback is not defined.
Update the run-time PM core documentation to reflect this change.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Alan Cox [Fri, 6 Nov 2009 11:31:06 +0000 (11:31 +0000)]
jfs: Fix 32bit build warning
loff_t is a type that isn't entirely dependant upon 32 v 64bit choice
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Andreas Gruenbacher [Wed, 28 Oct 2009 00:46:33 +0000 (01:46 +0100)]
Remove obsolete comment in fs.h
This question was determined to be a bug which was fixed in
commit
4a3b0a49.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Cc: Jan Blunck <jblunck@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro [Sat, 19 Dec 2009 15:15:07 +0000 (10:15 -0500)]
Sanitize f_flags helpers
* pull ACC_MODE to fs.h; we have several copies all over the place
* nightmarish expression calculating f_mode by f_flags deserves a helper
too (OPEN_FMODE(flags))
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro [Sat, 19 Dec 2009 15:10:39 +0000 (10:10 -0500)]
Fix f_flags/f_mode in case of lookup_instantiate_filp() from open(pathname, 3)
Just set f_flags when shoving struct file into nameidata; don't
postpone that until __dentry_open(). do_filp_open() has correct
value; lookup_instantiate_filp() doesn't - we lose the difference
between O_RDWR and 3 by that point.
We still set .intent.open.flags, so no fs code needs to be changed.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Roland Dreier [Fri, 18 Dec 2009 17:41:24 +0000 (09:41 -0800)]
anonfd: Allow making anon files read-only
It seems a couple places such as arch/ia64/kernel/perfmon.c and
drivers/infiniband/core/uverbs_main.c could use anon_inode_getfile()
instead of a private pseudo-fs + alloc_file(), if only there were a way
to get a read-only file. So provide this by having anon_inode_getfile()
create a read-only file if we pass O_RDONLY in flags.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Arnd Bergmann [Mon, 21 Dec 2009 16:53:53 +0000 (17:53 +0100)]
fs/compat_ioctl.c: fix build error when !BLOCK
No driver uses SG_SET_TRANSFORM any more in Linux, since the ide-scsi
driver was removed in 2.6.29. The compat-ioctl cleanup series moved
the handling for this around, which broke building without CONFIG_BLOCK.
Just remove the code handling it for compat mode.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Evgeniy Polyakov [Fri, 18 Dec 2009 12:40:44 +0000 (15:40 +0300)]
pohmelfs needs I_LOCK
Kill debugging printk in question
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Roland Dreier [Wed, 16 Dec 2009 20:48:44 +0000 (12:48 -0800)]
alloc_file(): simplify handling of mnt_clone_write() errors
When alloc_file() and init_file() were combined, the error handling of
mnt_clone_write() was taken into alloc_file() in a somewhat obfuscated
way. Since we don't use the error code for anything except warning,
we might as well warn directly without an extra variable.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
David Vrabel [Tue, 22 Dec 2009 13:13:28 +0000 (13:13 +0000)]
MAINTAINERS: update entries for WUSB, UWB and WLP subsystems
Update the file patterns for the WUSB, UWB and WLP subsystems and add
netdev@vger as the list for the WLP subsystem.
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Guennadi Liakhovetski [Tue, 22 Dec 2009 08:26:10 +0000 (09:26 +0100)]
ASoC: add missing parameter to mx27vis_hifi_hw_free()
Commit
2ccafed4 added an extra parameter to the DAI .set_pll() method, but
it missed this call in sound/soc/imx/mx27vis_wm8974.c.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Uwe Kleine-König [Wed, 16 Dec 2009 16:10:09 +0000 (17:10 +0100)]
ASoC: sh: FSI:: don't check platform_get_irq's return value against zero
platform_get_irq returns -ENXIO on failure, so !irq was probably
always true. Better use (int)irq <= 0. Note that a return value of
zero is still handled as error even though this could mean irq0.
This is a followup to
305b3228f9ff4d59f49e6d34a7034d44ee8ce2f0 that
changed the return value of platform_get_irq from 0 to -ENXIO on error.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Florian Fainelli [Tue, 22 Dec 2009 00:36:10 +0000 (16:36 -0800)]
ALSA: sound/core/pcm_timer.c: use lib/gcd.c
Make sound/core/pcm_timer.c use lib/gcd.c
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 22 Dec 2009 07:15:01 +0000 (08:15 +0100)]
ALSA: hda - Add MSI blacklist
A machine with AMD CPU with Nvidia board doesn't work with MSI.
Reported-by: Robert J. King <peritus@gurunetwork.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Rafael Avila de Espindola [Tue, 22 Dec 2009 06:59:37 +0000 (07:59 +0100)]
ALSA: hda - Add support for the new 27 inch IMacs
With the attached patch I am able to use the sound on a new IMac 27.
What works:
*) Internal speakers
*) Internal microphone
*) Headphone
I don't have an external mic or a SPDIF device to test the rest.
Signed-off-by: Rafael Avila de Espindola <rafael.espindola@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 22 Dec 2009 06:52:49 +0000 (07:52 +0100)]
ALSA: hda - Fix NULL dereference with enable_beep=0 option
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Sonic Zhang [Tue, 14 Jul 2009 17:39:47 +0000 (13:39 -0400)]
pata_bf54x: handle portmuxing of pins through GPIO PORTs
By default, the PATA pins are routed to the async address lines in which
case, no peripheral muxing needs to be done. However, if the pins get
routed through the GPIO PORTs pins, we need to make sure to request them
so that the muxing is properly set up.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Dominik Brodowski [Sun, 20 Dec 2009 09:50:02 +0000 (10:50 +0100)]
resources: fix call to alignf() in allocate_resource()
The second parameter to alignf() in allocate_resource() must
reflect what new resource is attempted to be allocated, else
functions like pcibios_align_resource() (at least on x86) or
pcmcia_align() can't work correctly.
Commit
1e5ad9679016275d422e36b12a98b0927d76f556 broke this by
setting the "new" resource until we're about to return success.
To keep the resource untouched when allocate_resource() fails,
a "tmp" resource is introduced.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Mon, 21 Dec 2009 18:13:37 +0000 (10:13 -0800)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
pata_cmd64x: fix overclocking of UDMA0-2 modes
Revert "pata_cmd64x: implement serialization as per notes"
Linus Torvalds [Mon, 21 Dec 2009 18:12:25 +0000 (10:12 -0800)]
Merge git://git./linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
bnx2: Fix bnx2_netif_stop() merge error.
gianfar: Fix bit definitions of IMASK_GRSC and IMASK_GTSC
gianfar: Fix stats support
gianfar: Fix a filer bug
bnx2: fixing a timout error due not refreshing TX timers correctly
can/at91: don't check platform_get_irq's return value against zero
mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion
bnx2: reset_task is crashing the kernel. Fixing it.
ipv6: fix an oops when force unload ipv6 module
TI DaVinci EMAC: Fix MDIO bus frequency configuration
e100: Fix broken cbs accounting due to missing memset.
broadcom: bcm54xx_shadow_read() errors ignored in bcm54xx_adjust_rxrefclk()
e1000e: LED settings in EEPROM ignored on 82571 and 82572
netxen: use module parameter correctly
netns: fix net.ipv6.route.gc_min_interval_ms in netns
Bluetooth: Prevent ill-timed autosuspend in USB driver
Bluetooth: Fix L2CAP locking scheme regression
Bluetooth: Ack L2CAP I-frames before retransmit missing packet
Bluetooth: Fix unset of RemoteBusy flag for L2CAP
Bluetooth: Fix PTR_ERR return of wrong pointer in hidp_setup_hid()
Linus Torvalds [Mon, 21 Dec 2009 18:12:00 +0000 (10:12 -0800)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: Fix hotplug hang
sched: Restore printk sanity
Linus Torvalds [Mon, 21 Dec 2009 18:10:23 +0000 (10:10 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (24 commits)
ALSA: sbawe: fix memory detection
ALSA: fix incorrect rounding direction in snd_interval_ratnum()
ALSA: HDA: add powersaving hook for Realtek
ALSA: HDA: remove useless mixers on Aspire 8930G
ALSA: HDA: simplify Aspire 8930G verb array
ALSA: hda: Set Front Mic to input vref 50% for Lenovo 3000 Y410
ALSA: hda/realtek: Remove extra .capsrc_nids initialization for ALC889_INTEL
ALSA: Use kzalloc for allocating only one thing
ALSA: AACI: switch to per-pcm locking
ALSA: AACI: add double-rate support
ALSA: AACI: factor common hw_params logic into aaci_pcm_hw_params
ALSA: AACI: cleanup aaci_pcm_hw_params
ALSA: AACI: simplify codec rate information
ALSA: aaci - Fix a typo
ASoC: wm8974: fix a wrong bit definition
sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
ALSA: hda - Fix quirk for Maxdata obook4-1
ALSA: hda - Fix missing capsrc_nids for ALC88x
ALSA: hda - Make use of beep device found in Dell Vostro 1015n
ALSA: hda - Fixed internal mic initialization for Dell Vostro 1015
...
Takashi Iwai [Mon, 21 Dec 2009 11:05:40 +0000 (12:05 +0100)]
Merge branch 'fix/misc' into for-linus
Takashi Iwai [Mon, 21 Dec 2009 11:05:37 +0000 (12:05 +0100)]
Merge branch 'fix/asoc' into for-linus
Takashi Iwai [Mon, 21 Dec 2009 11:05:31 +0000 (12:05 +0100)]
Merge branch 'fix/hda' into for-linus
Krzysztof Helt [Sun, 20 Dec 2009 19:15:19 +0000 (20:15 +0100)]
ALSA: sbawe: fix memory detection
Memory amount is increased before a successful write-read
sequence is done. Thus, 512 kB of onboard memory is detected
on memoryless cards like SB32.
Move the increasing of memory counter after successful read
is done.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Krzysztof Helt [Sat, 19 Dec 2009 17:31:04 +0000 (18:31 +0100)]
ALSA: fix incorrect rounding direction in snd_interval_ratnum()
The direction of rounding is incorrect in the snd_interval_ratnum()
It was detected with following parameters (sb8 driver playing
8kHz stereo file):
- num is always 1000000
- requested frequency rate is from 7999 to 7999 (single frequency)
The first loop calculates div_down(num, freq->min) which is 125.
Thus, a frequency range's minimum value is 1000000 / 125 = 8000 Hz.
The second loop calculates div_up(num, freq->max) which is 126
The frequency range's maximum value is 1000000 / 126 = 7936 Hz.
The range maximum is lower than the range minimum so the function
fails due to empty result range.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 21 Dec 2009 10:21:15 +0000 (11:21 +0100)]
Merge remote branch 'alsa/fixes' into fix/hda
Hector Martin [Sun, 20 Dec 2009 21:51:31 +0000 (22:51 +0100)]
ALSA: HDA: add powersaving hook for Realtek
The current Realtek code makes no specific provision for turning stuff
off. The codec chip is placed into low-power mode generically, but this
doesn't turn off any external hardware connected to it, in particular
external amplifiers.
This patch creates a hook function that is called by the codec
suspend/resume functions. It ought to disable any external hardware in a
device-specific way. I've implemented a generic ALC889 function that
sets the EAPD pin properly, and used it for the Acer Aspire 8930G which
can benefit from this feature.
On my laptop, this results in ~0.5W extra savings.
Signed-off-by: Hector Martin <hector@marcansoft.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Hector Martin [Sun, 20 Dec 2009 21:51:23 +0000 (22:51 +0100)]
ALSA: HDA: remove useless mixers on Aspire 8930G
This patch removes some extra mixers that do nothing on the Acer Aspire
8930G.
The CD mixer is useless because the SATA DVD/Blu-Ray drive has no analog
audio output, and the Side mixer is useless because we max out at 6ch
anyway.
Signed-off-by: Hector Martin <hector@marcansoft.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Hector Martin [Sun, 20 Dec 2009 21:51:18 +0000 (22:51 +0100)]
ALSA: HDA: simplify Aspire 8930G verb array
This patch just simplifies the 8930G verb array a bit. Just use the
common ALC889 EAPD verb array to make things more consistent. The file
is already huge enough already.
Signed-off-by: Hector Martin <hector@marcansoft.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel T Chen [Sat, 19 Dec 2009 23:19:02 +0000 (18:19 -0500)]
ALSA: hda: Set Front Mic to input vref 50% for Lenovo 3000 Y410
BugLink: https://bugs.launchpad.net/bugs/479373
The OR has verified with hda-verb that the internal microphone needs
VREF50 set for audible capture.
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
J. Bruce Fields [Sun, 20 Dec 2009 15:43:35 +0000 (10:43 -0500)]
nfsd: fix "insecure" export option
A typo in
12045a6ee9908b "nfsd: let "insecure" flag vary by
pseudoflavor" reversed the sense of the "insecure" flag.
Reported-by: Michael Guntsche <mike@it-loops.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>