linux-2.6
14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Mon, 27 Jul 2009 19:17:29 +0000 (12:17 -0700)] 
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 - Fix mute control with some ALC262 models
  ALSA: snd_usb_caiaq: add support for Audio2DJ
  ALSA: pcm - Fix hwptr buffer-size overlap bug
  ALSA: pcm - Fix warnings in debug loggings
  ALSA: pcm - Add logging of hwptr updates and interrupt updates
  ASoC: tlv320aic3x: Enable PLL when not bypassed
  ALSA: hda - Restore GPIO1 properly at resume with AD1984A
  ALSA: ctxfi - Fix uninitialized error checks
  ALSA: hda - Use snprintf() to be safer
  ALSA: usb-audio - Volume control quirk for QuickCam E 3500
  ALSA: pcm - Fix regressions with VMware

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Mon, 27 Jul 2009 19:16:57 +0000 (12:16 -0700)] 
Merge branch 'for_linus' of git://git./linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (34 commits)
  V4L/DVB (12303): cx23885: check pointers before dereferencing in dprintk macro
  V4L/DVB (12302): cx23885-417: fix broken IOCTL handling
  V4L/DVB (12300): bttv: fix regression: tvaudio must be loaded before tuner
  V4L/DVB (12291): b2c2: fix frontends compiled into kernel
  V4L/DVB (12286): sn9c20x: reorder includes to be like other drivers
  V4L/DVB (12284): gspca - jpeg subdrivers: Check the result of kmalloc(jpeg header).
  V4L/DVB (12283): gspca - sn9c20x: New subdriver for sn9c201 and sn9c202 bridges.
  V4L/DVB (12282): gspca - main: Support for vidioc_g_chip_ident and vidioc_g/s_register.
  V4L/DVB (12269): af9013: auto-detect parameters in case of garbage given by app
  V4L/DVB (12267): gspca - sonixj: Bad sensor init of non ov76xx sensors.
  V4L/DVB (12265): em28xx: fix tuning problem in HVR-900 (R1)
  V4L/DVB (12263): em28xx: set demod profile for Pinnacle Hybrid Pro 320e
  V4L/DVB (12262): em28xx: Make sure the tuner is initialized if generic empia USB id was used
  V4L/DVB (12261): em28xx: set GPIO properly for Pinnacle Hybrid Pro analog support
  V4L/DVB (12260): em28xx: make support work for the Pinnacle Hybrid Pro (eb1a:2881)
  V4L/DVB (12258): em28xx: fix typo in mt352 init sequence for Terratec Cinergy T XS USB
  V4L/DVB (12257): em28xx: make tuning work for Terratec Cinergy T XS USB (mt352 variant)
  V4L/DVB (12245): em28xx: add support for mt9m001 webcams
  V4L/DVB (12244): em28xx: adjust vinmode/vinctl based on the stream input format
  V4L/DVB (12243): em28xx: allow specifying sensor xtal frequency
  ...

14 years agoMerge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Mon, 27 Jul 2009 19:16:38 +0000 (12:16 -0700)] 
Merge branch 'for-linus' of git://git390.marist.edu/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
  [S390] zcrypt: fix scheduling of hrtimer ap_poll_timer
  [S390] vdso: clock_gettime of CLOCK_THREAD_CPUTIME_ID with noexec=on
  [S390] vdso: fix per cpu area allocation
  [S390] hibernation: fix register corruption on machine checks
  [S390] hibernation: fix lowcore handling

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
Linus Torvalds [Mon, 27 Jul 2009 19:16:21 +0000 (12:16 -0700)] 
Merge git://git./linux/kernel/git/agk/linux-2.6-dm

* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
  dm table: pass correct dev area size to device_area_is_valid
  dm: remove queue next_ordered workaround for barriers
  dm raid1: wake kmirrord when requeueing delayed bios after remote recovery

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
Linus Torvalds [Mon, 27 Jul 2009 19:15:56 +0000 (12:15 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  jfs: Fix early release of acl in jfs_get_acl

14 years agoupdate the comment in kthread_stop()
Oleg Nesterov [Fri, 19 Jun 2009 00:51:13 +0000 (02:51 +0200)] 
update the comment in kthread_stop()

Commit 63706172f332fd3f6e7458ebfb35fa6de9c21dc5 ("kthreads: rework
kthread_stop()") removed the limitation that the thread function mysr
not call do_exit() itself, but forgot to update the comment.

Since that commit it is OK to use kthread_stop() even if kthread can
exit itself.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomodule: use MODULE_SYMBOL_PREFIX with module_layout
Mike Frysinger [Thu, 23 Jul 2009 14:12:08 +0000 (23:42 +0930)] 
module: use MODULE_SYMBOL_PREFIX with module_layout

The check_modstruct_version() needs to look up the symbol "module_layout"
in the kernel, but it does so literally and not by a C identifier.  The
trouble is that it does not include a symbol prefix for those ports that
need it (like the Blackfin and H8300 port).  So make sure we tack on the
MODULE_SYMBOL_PREFIX define to the front of it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Mon, 27 Jul 2009 19:12:10 +0000 (12:12 -0700)] 
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:
  jbd: fix race between write_metadata_buffer and get_write_access
  ext3: Get rid of extenddisksize parameter of ext3_get_blocks_handle()
  jbd: Fix a race between checkpointing code and journal_get_write_access()
  ext3: Fix truncation of symlinks after failed write
  jbd: Fail to load a journal if it is too short

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Mon, 27 Jul 2009 19:11:43 +0000 (12:11 -0700)] 
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] fix sparse warning
  cifs: fix sb->s_maxbytes so that it casts properly to a signed value
  cifs: disable serverino if server doesn't support it

14 years agomm: Pass virtual address to [__]p{te,ud,md}_free_tlb()
Benjamin Herrenschmidt [Wed, 22 Jul 2009 05:44:28 +0000 (15:44 +1000)] 
mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()

mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()

Upcoming paches to support the new 64-bit "BookE" powerpc architecture
will need to have the virtual address corresponding to PTE page when
freeing it, due to the way the HW table walker works.

Basically, the TLB can be loaded with "large" pages that cover the whole
virtual space (well, sort-of, half of it actually) represented by a PTE
page, and which contain an "indirect" bit indicating that this TLB entry
RPN points to an array of PTEs from which the TLB can then create direct
entries. Thus, in order to invalidate those when PTE pages are deleted,
we need the virtual address to pass to tlbilx or tlbivax instructions.

The old trick of sticking it somewhere in the PTE page struct page sucks
too much, the address is almost readily available in all call sites and
almost everybody implemets these as macros, so we may as well add the
argument everywhere. I added it to the pmd and pud variants for consistency.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: David Howells <dhowells@redhat.com> [MN10300 & FRV]
Acked-by: Nick Piggin <npiggin@suse.de>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocnic: Fix ISCSI_KEVENT_IF_DOWN message handling.
Michael Chan [Mon, 27 Jul 2009 18:25:58 +0000 (11:25 -0700)] 
cnic: Fix ISCSI_KEVENT_IF_DOWN message handling.

When a net device goes down or when the bnx2i driver is unloaded,
the code was not generating the ISCSI_KEVENT_IF_DOWN message
properly and this could cause the userspace driver to crash.

This is fixed by sending the message properly in the shutdown path.
cnic_uio_stop() is also added to send the message when bnx2i is
unregistering.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoBtrfs: change how we unpin extents
Josef Bacik [Mon, 27 Jul 2009 17:57:01 +0000 (13:57 -0400)] 
Btrfs: change how we unpin extents

We are racy with async block caching and unpinning extents.  This patch makes
things much less complicated by only unpinning the extent if the block group is
cached.  We check the block_group->cached var under the block_group->lock spin
lock.  If it is set to BTRFS_CACHE_FINISHED then we update the pinned counters,
and unpin the extent and add the free space back.  If it is not set to this, we
start the caching of the block group so the next time we unpin extents we can
unpin the extent.  This keeps us from racing with the async caching threads,
lets us kill the fs wide async thread counter, and keeps us from having to set
DELALLOC bits for every extent we hit if there are caching kthreads going.

One thing that needed to be changed was btrfs_free_super_mirror_extents.  Now
instead of just looking for LOCKED extents, we also look for DIRTY extents,
since we could have left some extents pinned in the previous transaction that
will never get freed now that we are unmounting, which would cause us to leak
memory.  So btrfs_free_super_mirror_extents has been changed to
btrfs_free_pinned_extents, and it will clear the extents locked for the super
mirror, and any remaining pinned extents that may be present.  Thank you,

Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Correct redundant test in add_inode_ref
Julia Lawall [Mon, 27 Jul 2009 17:57:00 +0000 (13:57 -0400)] 
Btrfs: Correct redundant test in add_inode_ref

dir has already been tested.  It seems that this test should be on the
recently returned value inode.

A simplified version of the semantic match that finds this problem is as
follows: (http://www.emn.fr/x-info/coccinelle/)

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agonet: irda: init spinlock after memcpy
Deepak Saxena [Mon, 27 Jul 2009 17:49:44 +0000 (10:49 -0700)] 
net: irda: init spinlock after memcpy

irttp_dup() copies a tsap_cb struct, but does not initialize the
spinlock in the new structure, which confuses lockdep.

Signed-off-by: Deepak Saxena <dsaxena@mvista.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoamd64_edac: read the right F2 maskoffset reg
Wan Wei [Mon, 27 Jul 2009 12:34:15 +0000 (14:34 +0200)] 
amd64_edac: read the right F2 maskoffset reg

Signed-off-by: Wan Wei <onewayforever@gmail.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
14 years agomicroblaze: Makefile cleanup
Sam Ravnborg [Fri, 24 Jul 2009 07:04:49 +0000 (09:04 +0200)] 
microblaze: Makefile cleanup

Reviewed the Makefile on request by Michal and this is the resulting changes.

o Use ':=' for assignmnet so we do not re-evaluate for each use
o Use $(shell echo xxx) to remove ""
o Replaced CFLAGS_KERNEL with KBUILD_CFLAGS
  The settings are equally relevant for modules and the linked kernel
o Dropped LDFLAGS_BLOB - it is no longer used
o Refactored assignmnets to libs-y and core-y
o Use MMU for the MMU specific extension. "MMUEXT" was hurting my eyes
  and I did not wanted it spread to m68k

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Typo fix for cpu param inconsistency
Michal Simek [Fri, 24 Jul 2009 06:11:23 +0000 (08:11 +0200)] 
microblaze: Typo fix for cpu param inconsistency

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Add support for R_MICROBLAZE_64_NONE
Michal Simek [Thu, 23 Jul 2009 06:24:47 +0000 (08:24 +0200)] 
microblaze: Add support for R_MICROBLAZE_64_NONE

For example reiserfs use this relocation type.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Get module loading working
John Williams [Thu, 23 Jul 2009 04:56:49 +0000 (14:56 +1000)] 
microblaze: Get module loading working

New reloc type R_MICROBLAZE_32_PCREL_LO requires a null handler (no work to do).

Remove legacy hack for broken linker pre gcc-4.1.1, that required us to extract
an offset from the code, add it to the addend, then rewrite the instruction.

Fixup the invalid reloc type error output.

Boot tested with the xilinx_emaclite ethernet driver.

Signed-off-by: John Williams <john.williams@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: remove sys_ipc
Arnd Bergmann [Thu, 18 Jun 2009 17:55:35 +0000 (19:55 +0200)] 
microblaze: remove sys_ipc

The ipc system call is now unused in microblaze,
as the system call table points directly to the
indidual system calls for IPC.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Support unaligned address for put/get_user macros
Michal Simek [Tue, 21 Jul 2009 10:48:01 +0000 (12:48 +0200)] 
microblaze: Support unaligned address for put/get_user macros

This patch add support for cases where load/store instruction
in put/get_user macro gets unaligned pointer to data and this
address is not valid. I prevent all cases which can failed.
I had to disable first stage of unaligned handler which is used
only for noMMU kernel and the whole work is done when interrupt
is enabled.
You have enable HW support for detect unaligned access in Microblaze.

This patch fixed three LTP tests:
getpeername01, getsockname01, socketpair01

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Detect new Microblaze 7.20 versions
Michal Simek [Tue, 21 Jul 2009 10:47:04 +0000 (12:47 +0200)] 
microblaze: Detect new Microblaze 7.20 versions

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Fix do_page_fault for no context
Michal Simek [Thu, 16 Jul 2009 14:00:49 +0000 (16:00 +0200)] 
microblaze: Fix do_page_fault for no context

Calling fixup when we are in kernel mode. This
prevent fault for copy_to/from_user. This fault
was find thanks to writev01/03/04 LTP tests.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Add _PAGE_FILE macros to pgtable.h
Michal Simek [Wed, 15 Jul 2009 11:39:35 +0000 (13:39 +0200)] 
microblaze: Add _PAGE_FILE macros to pgtable.h

We need to define _PAGE_FILE macro and change pte
functions. Microblaze use the same MMU as PowerPC
that's why we define _PAGE_FILE in the same style.
This change fixed remap_file_pages01 LTP test.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Fix put_user macro for 64bits arguments
Michal Simek [Mon, 13 Jul 2009 14:46:54 +0000 (16:46 +0200)] 
microblaze: Fix put_user macro for 64bits arguments

For 64bits arguments gcc caused that put_user macro
works with wrong value because of optimalization.
Adding volatile caused that gcc not optimized it.

It is possible to use (as Blackfin do) two put_user
macros with 32bits arguments but there is one more
instruction which is due to duplication zero return
value which is called put_user_asm macro.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Clear print messages for DTB passing via r7
Michal Simek [Mon, 22 Jun 2009 10:31:55 +0000 (12:31 +0200)] 
microblaze: Clear print messages for DTB passing via r7

It is necessary to zeroed r7 when r7 points to bad
dtb - this caused that we have correct messages
about compiled-in dtb or passing via r7

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Not to clear r7 after copying DTB to kernel
Michal Simek [Mon, 22 Jun 2009 08:55:40 +0000 (10:55 +0200)] 
microblaze: Not to clear r7 after copying DTB to kernel

I can't clear r7 because if I do it I lose information
where DTB come from.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Add messages about FDT blob
Michal Simek [Mon, 22 Jun 2009 08:28:40 +0000 (10:28 +0200)] 
microblaze: Add messages about FDT blob

Print accurate message about place where FDT blob is.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Final support for statically linked DTB
John Williams [Mon, 22 Jun 2009 04:02:09 +0000 (14:02 +1000)] 
microblaze: Final support for statically linked DTB

If r7 is zero at kernel boot, or does not point to a valid DTB, then
we fall back to a DTB (assumed to be) linked statically in the kernel, instead
of blindly copying bogus cruft into the kernel DTB memory region

Signed-off-by: John Williams <john.williams@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: remove duplicated #include
Huang Weiyi [Sat, 11 Jul 2009 01:32:08 +0000 (09:32 +0800)] 
microblaze: remove duplicated #include

Remove duplicated #include('s) in
  arch/microblaze/include/asm/io.h

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Define tlb_flush macro
Michal Simek [Thu, 9 Jul 2009 09:33:39 +0000 (11:33 +0200)] 
microblaze: Define tlb_flush macro

This fix remove bug which we had till now in all
Microblaze MMU code. Primary tested on mmap01 LTP test.
We forget to flush invalid tlb which were changed - we
used them and there were wrong old data which wasn't correct.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agoixgbe: fix for 82599 errata marking UDP checksum errors
Don Skidmore [Thu, 23 Jul 2009 18:00:39 +0000 (18:00 +0000)] 
ixgbe: fix for 82599 errata marking UDP checksum errors

There is an 82599 errata that UDP frames with a zero checksum are
incorrectly marked as checksum invalid by the hardware.  This was
leading to misleading hw_csum_rx_error counts. This patch adds a
test around this counter increase for this condition.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: WakeOnLan fix for the 8168
françois romieu [Fri, 24 Jul 2009 12:34:19 +0000 (12:34 +0000)] 
r8169: WakeOnLan fix for the 8168

More stuff for http://bugzilla.kernel.org/show_bug.cgi?id=9512

Some 8168 are unable to WoL when receiving is not enabled (plain
old 8169 do not seem to care).

It is not exactly pretty to leave the receiver enabled but we
should now enable DMA late enough for it to be safe. Some late
stage boot failure due to pxe and friends may benefit from the
delayed enabling of bus-mastering as well.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Jaromír Cápík <tavvva@volny.cz>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
14 years agonetxen: reset ring consumer during cleanup
Dhananjay Phadke [Mon, 27 Jul 2009 03:17:21 +0000 (20:17 -0700)] 
netxen: reset ring consumer during cleanup

Reset consumer of status rings to 0 when cleaning
up sw resources. Status rings are not deleted
during suspend since they have napi objects.

This ensures correct rx processing across suspen-resume.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/bridge: use kobject_put to release kobject in br_add_if error path
Xiaotian Feng [Thu, 23 Jul 2009 23:06:32 +0000 (23:06 +0000)] 
net/bridge: use kobject_put to release kobject in br_add_if error path

kobject_init_and_add will alloc memory for kobj->name, so in br_add_if
error path, simply use kobject_del will not free memory for kobj->name.
Fix by using kobject_put instead, kobject_put will internally calls
kobject_del and frees memory for kobj->name.

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosmc91x.h: add config for Nomadik evaluation kit
Alessandro Rubini [Wed, 22 Jul 2009 12:49:08 +0000 (12:49 +0000)] 
smc91x.h: add config for Nomadik evaluation kit

Signed-off-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Andrea Gallo <andrea.gallo@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoNET: ROSE: Don't use static buffer.
Ralf Baechle [Mon, 27 Jul 2009 02:11:14 +0000 (19:11 -0700)] 
NET: ROSE: Don't use static buffer.

The use of a static buffer in rose2asc() to return its result is not
threadproof and can result in corruption if multiple threads are trying
to use one of the procfs files based on rose2asc().

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoeepro: Read buffer overflow
Roel Kluin [Mon, 27 Jul 2009 01:53:17 +0000 (18:53 -0700)] 
eepro: Read buffer overflow

io[i] is read before the bounds check on i, order should be reversed

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotokenring: Read buffer overflow
roel kluin [Sat, 25 Jul 2009 12:38:33 +0000 (12:38 +0000)] 
tokenring: Read buffer overflow

io[i] is read before the bounds check on i, order should be reversed

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoat1700: Read buffer overflow
roel kluin [Sat, 25 Jul 2009 12:01:50 +0000 (12:01 +0000)] 
at1700: Read buffer overflow

loop bound looks to be wrong, for an array of length 8

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agofealnx: Write outside array bounds
roel kluin [Sat, 25 Jul 2009 07:41:12 +0000 (07:41 +0000)] 
fealnx: Write outside array bounds

phy_idx is checked to be < 4, but np->phys[] is 2 elements long

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'fix/usb-audio' into for-linus
Takashi Iwai [Sun, 26 Jul 2009 09:07:08 +0000 (11:07 +0200)] 
Merge branch 'fix/usb-audio' into for-linus

* fix/usb-audio:
  ALSA: usb-audio - Volume control quirk for QuickCam E 3500

14 years agoMerge branch 'fix/pcm-hwptr' into for-linus
Takashi Iwai [Sun, 26 Jul 2009 09:07:07 +0000 (11:07 +0200)] 
Merge branch 'fix/pcm-hwptr' into for-linus

* fix/pcm-hwptr:
  ALSA: pcm - Fix hwptr buffer-size overlap bug
  ALSA: pcm - Fix warnings in debug loggings
  ALSA: pcm - Add logging of hwptr updates and interrupt updates
  ALSA: pcm - Fix regressions with VMware

14 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Sun, 26 Jul 2009 09:07:06 +0000 (11:07 +0200)] 
Merge branch 'fix/hda' into for-linus

* fix/hda:
  ALSA: hda - Fix mute control with some ALC262 models
  ALSA: hda - Restore GPIO1 properly at resume with AD1984A
  ALSA: hda - Use snprintf() to be safer

14 years agoMerge branch 'fix/ctxfi' into for-linus
Takashi Iwai [Sun, 26 Jul 2009 09:07:05 +0000 (11:07 +0200)] 
Merge branch 'fix/ctxfi' into for-linus

* fix/ctxfi:
  ALSA: ctxfi - Fix uninitialized error checks

14 years agoMerge branch 'fix/caiaq' into for-linus
Takashi Iwai [Sun, 26 Jul 2009 09:07:04 +0000 (11:07 +0200)] 
Merge branch 'fix/caiaq' into for-linus

* fix/caiaq:
  ALSA: snd_usb_caiaq: add support for Audio2DJ

14 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Sun, 26 Jul 2009 09:07:03 +0000 (11:07 +0200)] 
Merge branch 'fix/asoc' into for-linus

* fix/asoc:
  ASoC: tlv320aic3x: Enable PLL when not bypassed

14 years agoBtrfs: find smallest available device extent during chunk allocation
Chris Mason [Fri, 24 Jul 2009 20:41:41 +0000 (16:41 -0400)] 
Btrfs: find smallest available device extent during chunk allocation

Allocating new block group is easy when the disk has plenty of space.
But things get difficult as the disk fills up, especially if
the FS has been run through btrfs-vol -b.  The balance operation
is likely to make the total bytes available on the device greater
than the largest extent we'll actually be able to allocate.

But the device extent allocation code incorrectly assumes that a device
with 5G free will be able to allocate a 5G extent.  It isn't normally a
problem because device extents don't get freed unless btrfs-vol -b
is run.

This fixes the device extent allocator to remember the largest free
extent it can find, and then uses that value as a fallback.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: clear all space_info->full after removing a block group
Chris Mason [Fri, 24 Jul 2009 20:30:55 +0000 (16:30 -0400)] 
Btrfs: clear all space_info->full after removing a block group

Btrfs allocates individual extents from block groups, and each
block group has a specific type.  It may hold metadata, data
mirrored or striped etc.

When we balance space (btrfs-vol -b) or remove a drive (btrfs-vol -r)
we free block groups.  Once a block group is freed, the space it was
using on the device may be available for use by new block groups.

btrfs_remove_block_group was clearing the flag that said
'our devices are full, don't even try to allocate new block groups',
but it was only clearing that flag for a specific type of block group.

This commit clears the full flag for all of the types of block groups,
making it much more likely that we'll be able to balance space when
the drive is close to full.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: make flushoncommit mount option correctly wait on ordered_extents
Sage Weil [Fri, 24 Jul 2009 17:17:44 +0000 (13:17 -0400)] 
Btrfs: make flushoncommit mount option correctly wait on ordered_extents

The commit_transaction call to wait_ordered_extents when snap_pending
passes nocow_only=1 to process only NOCOW or PREALLOC extents.  This isn't
correct for the 'flushoncommit' mode, as it skips extents we just started
IO on in start_delalloc_inodes.

So, in the flushoncommit case, wait on all ordered extents.  Otherwise,
only pass the nocow_only flag to wait_ordered_extents if snap_pending.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoV4L/DVB (12303): cx23885: check pointers before dereferencing in dprintk macro
Michael Krufky [Sun, 19 Jul 2009 20:55:35 +0000 (17:55 -0300)] 
V4L/DVB (12303): cx23885: check pointers before dereferencing in dprintk macro

When enabling debug with v4l_debug set to 2 or greater, the driver
OOPS's on startup.  Checks dev pointer before dereferencing, in
order to prevent this OOPS.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12302): cx23885-417: fix broken IOCTL handling
Michael Krufky [Sun, 19 Jul 2009 21:19:18 +0000 (18:19 -0300)] 
V4L/DVB (12302): cx23885-417: fix broken IOCTL handling

IOCTLS will never get handled if we dont connect
video_ioctl2 to mpeg_fops.ioctl

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12300): bttv: fix regression: tvaudio must be loaded before tuner
Hans Verkuil [Mon, 20 Jul 2009 11:14:17 +0000 (08:14 -0300)] 
V4L/DVB (12300): bttv: fix regression: tvaudio must be loaded before tuner

Both tvaudio and the tuner share i2c address 0x42. The tvaudio module can
check whether it really is a tda9840, but the tuner can't. So the tvaudio
module must be loaded before the tuner module. This was also the case for
2.6.29, but the order was swapped in 2.6.30.

Thanks to Krzysztof Grygiencz for reporting and testing this.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12291): b2c2: fix frontends compiled into kernel
Trent Piepho [Thu, 11 Jun 2009 22:31:22 +0000 (19:31 -0300)] 
V4L/DVB (12291): b2c2: fix frontends compiled into kernel

A recent patch didn't take into account that frontends can be compiled into
the kernel.  Or that frontends compiled as modules can't be used by the
b2c2 driver if it is not a module itself.

Some frontends require multiple drivers, e.g. a demod driver and a tuner
driver.  The code for the frontend support was getting added if the demod
driver was available.  Change this to also require any needed tuner or SEC
drivers as well.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12286): sn9c20x: reorder includes to be like other drivers
Mauro Carvalho Chehab [Sun, 19 Jul 2009 21:03:23 +0000 (18:03 -0300)] 
V4L/DVB (12286): sn9c20x: reorder includes to be like other drivers

This is not just pure cosmetic, since the order affects the out-of-tree
module build at the -hg development tree.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12284): gspca - jpeg subdrivers: Check the result of kmalloc(jpeg header).
Julia Lawall [Sun, 19 Jul 2009 10:09:32 +0000 (07:09 -0300)] 
V4L/DVB (12284): gspca - jpeg subdrivers: Check the result of kmalloc(jpeg header).

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12283): gspca - sn9c20x: New subdriver for sn9c201 and sn9c202 bridges.
Brian Johnson [Sun, 19 Jul 2009 08:52:58 +0000 (05:52 -0300)] 
V4L/DVB (12283): gspca - sn9c20x: New subdriver for sn9c201 and sn9c202 bridges.

Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12282): gspca - main: Support for vidioc_g_chip_ident and vidioc_g/s_register.
Brian Johnson [Sun, 19 Jul 2009 08:29:20 +0000 (05:29 -0300)] 
V4L/DVB (12282): gspca - main: Support for vidioc_g_chip_ident and vidioc_g/s_register.

Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12269): af9013: auto-detect parameters in case of garbage given by app
Antti Palosaari [Fri, 10 Jul 2009 23:03:43 +0000 (20:03 -0300)] 
V4L/DVB (12269): af9013: auto-detect parameters in case of garbage given by app

Request demodulator auto-detect transmission parameters in case of
garbage parameters provided by application for compatibility.
That's needed at least for MPlayer compatibility currently.

Thanks to Jelle de Jong for reporting issue and providing SSH access to
Devin for debugging.

Thanks to Devin Heitmueller for hard debug work he did to find that bug.

Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Jelle de Jong <jelledejong@powercraft.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12267): gspca - sonixj: Bad sensor init of non ov76xx sensors.
Jean-Francois Moine [Wed, 8 Jul 2009 08:21:50 +0000 (05:21 -0300)] 
V4L/DVB (12267): gspca - sonixj: Bad sensor init of non ov76xx sensors.

The bug was introduced when adding the light frequency control

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12265): em28xx: fix tuning problem in HVR-900 (R1)
Devin Heitmueller [Sun, 12 Jul 2009 20:05:02 +0000 (17:05 -0300)] 
V4L/DVB (12265): em28xx: fix tuning problem in HVR-900 (R1)

When the change was introduced in the zl10353 for the i2c gate behavior, this
broke the HVR-900 which was not behind a gate.  Use a version of the zl10353
config profile that indicates the tuner is not behind such a gate.

Without this patch the first tune succeeds, but subsequent tuning attempts
will fail.

The change also renames the terratec zl10353 profile I wrote to be more
generic, since it is shared by the non-terratec device.

Thanks to Michael Krufky for providing a HVR-900 and DVB-T environment to test
with.

Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12263): em28xx: set demod profile for Pinnacle Hybrid Pro 320e
Devin Heitmueller [Wed, 15 Jul 2009 03:37:22 +0000 (00:37 -0300)] 
V4L/DVB (12263): em28xx: set demod profile for Pinnacle Hybrid Pro 320e

The Pinnacle Hybrid Pro 320e was missing a demod config for the xc3028, which
is required for digital tuning to work properly.  Add the missing profile.

Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment.

Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12262): em28xx: Make sure the tuner is initialized if generic empia USB...
Devin Heitmueller [Wed, 15 Jul 2009 03:35:47 +0000 (00:35 -0300)] 
V4L/DVB (12262): em28xx: Make sure the tuner is initialized if generic empia USB id was used

In cases where the device has a generic Empia USB ID, the call in the
precard setup phase did not set the tuner GPIO.  As a result, the tuner may
not be taken out of reset before attempting initialization in the analog
driver.

This problem was not seen before with the EVGA inDtube, since that particular
board has the analog GPIO setup to include taking the tuner out of reset.

Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment for the Pinnacle 320e.

Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12261): em28xx: set GPIO properly for Pinnacle Hybrid Pro analog support
Devin Heitmueller [Thu, 9 Jul 2009 01:18:15 +0000 (22:18 -0300)] 
V4L/DVB (12261): em28xx: set GPIO properly for Pinnacle Hybrid Pro analog support

Set the GPIO properly for the analog side of the Pinnacle Hybrid Pro, or else
the emp202 doesn't get detected properly.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12260): em28xx: make support work for the Pinnacle Hybrid Pro (eb1a:2881)
Devin Heitmueller [Thu, 9 Jul 2009 00:51:35 +0000 (21:51 -0300)] 
V4L/DVB (12260): em28xx: make support work for the Pinnacle Hybrid Pro (eb1a:2881)

Setup the GPIOs properly and enable support for the DVB side of the Pinnacle
Hybrid Pro USB stick.

Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment.

Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12258): em28xx: fix typo in mt352 init sequence for Terratec Cinergy T XS USB
Devin Heitmueller [Sun, 12 Jul 2009 21:44:19 +0000 (18:44 -0300)] 
V4L/DVB (12258): em28xx: fix typo in mt352 init sequence for Terratec Cinergy T XS USB

Andy walls pointed out that we were passing 0x5d to the TUNER_GO register,
instead of 0x01.  Set the register properly (note the code did still work with
the incorrect value, so this does not address a regression).

Thanks to Andy Walls for noticing the issue.

Cc: Andy Walls <awalls@radix.net>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12257): em28xx: make tuning work for Terratec Cinergy T XS USB (mt352 variant)
Devin Heitmueller [Sun, 12 Jul 2009 20:51:12 +0000 (17:51 -0300)] 
V4L/DVB (12257): em28xx: make tuning work for Terratec Cinergy T XS USB (mt352 variant)

The Terratec Cinergy T XS USB can have either a zl10353 or an mt352.  Add
support for the MT352 variant.

Thanks to Jelle de Jong for providing a unit to test/debug with.

Cc: Jelle de Jong <jelledejong@powercraft.nl>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12245): em28xx: add support for mt9m001 webcams
Mauro Carvalho Chehab [Wed, 15 Jul 2009 00:08:22 +0000 (21:08 -0300)] 
V4L/DVB (12245): em28xx: add support for mt9m001 webcams

Thanks to Wally <wally@voosen.eu> for bringing the issue and helping
with the tests.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12244): em28xx: adjust vinmode/vinctl based on the stream input format
Mauro Carvalho Chehab [Tue, 14 Jul 2009 15:33:25 +0000 (12:33 -0300)] 
V4L/DVB (12244): em28xx: adjust vinmode/vinctl based on the stream input format

Depending on the video input format, vinmode/vinctl needs adjustments.
For TV, this is not relevant, since the supported decoders output data
at the same format. However, webcam sensors may have different formats,
so, this needs to be adjusted based on the device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12243): em28xx: allow specifying sensor xtal frequency
Mauro Carvalho Chehab [Tue, 14 Jul 2009 06:18:39 +0000 (03:18 -0300)] 
V4L/DVB (12243): em28xx: allow specifying sensor xtal frequency

In order to properly estimate fps, mt9v011 sensor driver needs to know
what is the used frequency on the sensor cristal. Adds the proper fields
and initialization code for specifying the cristal frequency.

Also, based on experimentation, it was noticed that the Silvercrest is
outputing data at 7 fps. This means that it should be using a 6.3 MHz
cristal. This information needs to be double checked later, by opening
the device. Anyway, by using this value for xtal, at least now we have
the correct fps report.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12242): mt9v011: implement core->s_config to allow adjusting xtal frequency
Mauro Carvalho Chehab [Tue, 14 Jul 2009 06:14:21 +0000 (03:14 -0300)] 
V4L/DVB (12242): mt9v011: implement core->s_config to allow adjusting xtal frequency

Since frames per second is a function of cristal frequency, and this is
device-specific, add a function that allows adjusting it, via
subdev->core->s_config callback.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12241): mt9v011: Fix vstart
Mauro Carvalho Chehab [Tue, 14 Jul 2009 05:39:19 +0000 (02:39 -0300)] 
V4L/DVB (12241): mt9v011: Fix vstart

vstart calculus were wrong. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12240): mt9v011: add a function to calculate frames per second rate
Mauro Carvalho Chehab [Tue, 14 Jul 2009 05:38:18 +0000 (02:38 -0300)] 
V4L/DVB (12240): mt9v011: add a function to calculate frames per second rate

It is possible to adjust the fps rate by changing some register values.
This is function of the connected Xtal at the camera sensor, being a 27
MHz cristal needed, in order to support 640x480 at 30 fps.

For now, it will only calculate the values for fps. Later patches may
introduce V4L2 ioctls, to allow frequency rate adjustments.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12239): em28xx: fix webcam scaling
Mauro Carvalho Chehab [Mon, 13 Jul 2009 23:15:02 +0000 (20:15 -0300)] 
V4L/DVB (12239): em28xx: fix webcam scaling

While trying to fix an mt9v001 webcam, I noticed that HSCALE/VSCALE do
work with em28xx + webcam. The issue is that the scaling setup depends
on the number of visible rows/cols of the input image.

With mt9v011 (Silvercrest), the resolution is 640x480. So, the scaling
is different from a normal TV image (720x480 on NTSC). This were causing
a wrong scaling and a previous patch disabled scaling.

As each sensor have their different resolution setting, the xres/yres
should be adjusted accordingly with the input sensor.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12238): em28xx: call sensor detection code for all webcam entries
Mauro Carvalho Chehab [Mon, 13 Jul 2009 04:28:21 +0000 (01:28 -0300)] 
V4L/DVB (12238): em28xx: call sensor detection code for all webcam entries

With the previous approach, autodetection were working only for the two
generic entries (em275x and em2820 unknown ones). So, if someone would
try to force probing an specific device, the code would not properly run
the autodetection code.

With the new approach, the sensor autodetection will be run not only for
the two generic entries, but also do webcam specific ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12237): mt9v011: implement VIDIOC_QUERYCTRL
Mauro Carvalho Chehab [Mon, 13 Jul 2009 04:03:37 +0000 (01:03 -0300)] 
V4L/DVB (12237): mt9v011: implement VIDIOC_QUERYCTRL

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12236): em28xx: stop abusing of board->decoder for sensor information
Mauro Carvalho Chehab [Sun, 12 Jul 2009 14:04:15 +0000 (11:04 -0300)] 
V4L/DVB (12236): em28xx: stop abusing of board->decoder for sensor information

Instead of using em28xx board decoder field for storing sensor information,
let's use instead a separate field for it.

Also, as sensors are currently autodetected, there's no need of having
it at the boards description. So, move it to the main em28xx struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12235): em28xx: detects sensors also with the generic em2750/2750 entry
Mauro Carvalho Chehab [Sun, 12 Jul 2009 13:56:21 +0000 (10:56 -0300)] 
V4L/DVB (12235): em28xx: detects sensors also with the generic em2750/2750 entry

Webcams in general don't have eeprom. So, the sensor hint code should be
called to properly detect what sensor is inside.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12234): em28xx-cards: use is_webcam flag for devices that are known to be...
Mauro Carvalho Chehab [Sun, 12 Jul 2009 13:26:36 +0000 (10:26 -0300)] 
V4L/DVB (12234): em28xx-cards: use is_webcam flag for devices that are known to be webcams

By having the webcam devices marked as such, it will help the em28xx
driver to do the right thing on those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12233): em28xx: rename is_27xx to is_webcam
Mauro Carvalho Chehab [Sun, 12 Jul 2009 13:23:23 +0000 (10:23 -0300)] 
V4L/DVB (12233): em28xx: rename is_27xx to is_webcam

Just renames the flag, to use a clearer name. Later patches will use
this flag to properly set some drivers behaviors for webcams.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12224): gspca - m5602-s5k4aa: Remove erroneous register writes
Erik Andrén [Wed, 8 Jul 2009 17:47:16 +0000 (14:47 -0300)] 
V4L/DVB (12224): gspca - m5602-s5k4aa: Remove erroneous register writes

A couple of erroneous register writes snuck in that made the image go haywire. Remove these.
Many thanks to Grégory Lardière for finding this out

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12223): gspca - stv06xx-hdcs: Correct the pixelformat
Erik Andrén [Wed, 1 Jul 2009 05:56:44 +0000 (02:56 -0300)] 
V4L/DVB (12223): gspca - stv06xx-hdcs: Correct the pixelformat

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12222): gspca - stv06xx-hdcs: Fix sensor sequence bug
Erik Andrén [Wed, 24 Jun 2009 07:30:56 +0000 (04:30 -0300)] 
V4L/DVB (12222): gspca - stv06xx-hdcs: Fix sensor sequence bug

All hdcs registers use bit 0 as a read/write flag and needs to be shifted one bit to the left. This wasn't accounted for when doing a sequence of writes.

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12221): gspca - stv06xx-hdcs: Actually update the sensor state
Erik Andrén [Tue, 23 Jun 2009 15:22:48 +0000 (12:22 -0300)] 
V4L/DVB (12221): gspca - stv06xx-hdcs: Actually update the sensor state

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoBtrfs: Avoid delayed reference update looping
Yan Zheng [Fri, 24 Jul 2009 16:42:46 +0000 (12:42 -0400)] 
Btrfs: Avoid delayed reference update looping

btrfs_split_leaf and btrfs_del_items can end up in a loop
where one is constantly spliting a given leaf and the other
is constantly merging it back with the adjacent nodes.

There is a better fix for this, but in the interest of something
small, this patch just changes btrfs_del_items back to balancing less
often.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Fix ordering of key field checks in btrfs_previous_item
Yan Zheng [Fri, 24 Jul 2009 15:06:53 +0000 (11:06 -0400)] 
Btrfs: Fix ordering of key field checks in btrfs_previous_item

Check objectid of item before checking the item type, otherwise we may return
zero for a key that is actually too low.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: find_free_dev_extent doesn't handle holes at the start of the device
Yan Zheng [Fri, 24 Jul 2009 15:06:53 +0000 (11:06 -0400)] 
Btrfs: find_free_dev_extent doesn't handle holes at the start of the device

find_free_dev_extent does not properly handle the case where
the device is not complete free, and there is a free extent
at the beginning of the device.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Remove code duplication in comp_keys
Diego Calleja [Fri, 24 Jul 2009 15:06:52 +0000 (11:06 -0400)] 
Btrfs: Remove code duplication in comp_keys

comp_keys is duplicating what is done in btrfs_comp_cpu_keys, so just
call it.

Signed-off-by: Diego Calleja <diegocg@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoALSA: hda - Fix mute control with some ALC262 models
Takashi Iwai [Fri, 24 Jul 2009 14:51:47 +0000 (16:51 +0200)] 
ALSA: hda - Fix mute control with some ALC262 models

The master mute switch is wrongly implemented as checking the pointer
instead of its value, thus it can be never muted.  This patch fixes
the issue.

Reference: Novell bnc#404873
https://bugzilla.novell.com/show_bug.cgi?id=404873

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
14 years agoBtrfs: async block group caching
Josef Bacik [Tue, 14 Jul 2009 01:29:25 +0000 (21:29 -0400)] 
Btrfs: async block group caching

This patch moves the caching of the block group off to a kthread in order to
allow people to allocate sooner.  Instead of blocking up behind the caching
mutex, we instead kick of the caching kthread, and then attempt to make an
allocation.  If we cannot, we wait on the block groups caching waitqueue, which
the caching kthread will wake the waiting threads up everytime it finds 2 meg
worth of space, and then again when its finished caching.  This is how I tested
the speedup from this

mkfs the disk
mount the disk
fill the disk up with fs_mark
unmount the disk
mount the disk
time touch /mnt/foo

Without my changes this took 11 seconds on my box, with these changes it now
takes 1 second.

Another change thats been put in place is we lock the super mirror's in the
pinned extent map in order to keep us from adding that stuff as free space when
caching the block group.  This doesn't really change anything else as far as the
pinned extent map is concerned, since for actual pinned extents we use
EXTENT_DIRTY, but it does mean that when we unmount we have to go in and unlock
those extents to keep from leaking memory.

I've also added a check where when we are reading block groups from disk, if the
amount of space used == the size of the block group, we go ahead and mark the
block group as cached.  This drastically reduces the amount of time it takes to
cache the block groups.  Using the same test as above, except doing a dd to a
file and then unmounting, it used to take 33 seconds to umount, now it takes 3
seconds.

This version uses the commit_root in the caching kthread, and then keeps track
of how many async caching threads are running at any given time so if one of the
async threads is still running as we cross transactions we can wait until its
finished before handling the pinned extents.  Thank you,

Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: use hybrid extents+bitmap rb tree for free space
Josef Bacik [Tue, 14 Jul 2009 01:29:25 +0000 (21:29 -0400)] 
Btrfs: use hybrid extents+bitmap rb tree for free space

Currently btrfs has a problem where it can use a ridiculous amount of RAM simply
tracking free space.  As free space gets fragmented, we end up with thousands of
entries on an rb-tree per block group, which usually spans 1 gig of area.  Since
we currently don't ever flush free space cache back to disk this gets to be a
bit unweildly on large fs's with lots of fragmentation.

This patch solves this problem by using PAGE_SIZE bitmaps for parts of the free
space cache.  Initially we calculate a threshold of extent entries we can
handle, which is however many extent entries we can cram into 16k of ram.  The
maximum amount of RAM that should ever be used to track 1 gigabyte of diskspace
will be 32k of RAM, which scales much better than we did before.

Once we pass the extent threshold, we start adding bitmaps and using those
instead for tracking the free space.  This patch also makes it so that any free
space thats less than 4 * sectorsize we go ahead and put into a bitmap.  This is
nice since we try and allocate out of the front of a block group, so if the
front of a block group is heavily fragmented and then has a huge chunk of free
space at the end, we go ahead and add the fragmented areas to bitmaps and use a
normal extent entry to track the big chunk at the back of the block group.

I've also taken the opportunity to revamp how we search for free space.
Previously we indexed free space via an offset indexed rb tree and a bytes
indexed rb tree.  I've dropped the bytes indexed rb tree and use only the offset
indexed rb tree.  This cuts the number of tree operations we were doing
previously down by half, and gives us a little bit of a better allocation
pattern since we will always start from a specific offset and search forward
from there, instead of searching for the size we need and try and get it as
close as possible to the offset we want.

I've given this a healthy amount of testing pre-new format stuff, as well as
post-new format stuff.  I've booted up my fedora box which is installed on btrfs
with this patch and ran with it for a few days without issues.  I've not seen
any performance regressions in any of my tests.

Since the last patch Yan Zheng fixed a problem where we could have overlapping
entries, so updating their offset inline would cause problems.  Thanks,

Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years ago[S390] zcrypt: fix scheduling of hrtimer ap_poll_timer
Felix Beck [Fri, 24 Jul 2009 10:39:53 +0000 (12:39 +0200)] 
[S390] zcrypt: fix scheduling of hrtimer ap_poll_timer

Every time a request is enqueued or there is some work outstanding
from the ap_tasklet, the ap_poll_timer is scheduled again.
Unfortunately it was permanently called. It looked as if it was
started in the past and thus imediately expired.
This has been changed. First it is checked if the hrtimer is already
expired. Then the expiring time is forwarded and the timer restarted.

Signed-off-by: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] vdso: clock_gettime of CLOCK_THREAD_CPUTIME_ID with noexec=on
Martin Schwidefsky [Fri, 24 Jul 2009 10:39:52 +0000 (12:39 +0200)] 
[S390] vdso: clock_gettime of CLOCK_THREAD_CPUTIME_ID with noexec=on

The combination of noexec=on and a clock_gettime call with clock id
CLOCK_THREAD_CPUTIME_ID is broken. The vdso code switches to the
access register mode to get access to the per-cpu data structure to
execute the magic ectg instruction. After the ectg instruction the
code always switches back to the primary mode but for noexec=on the
correct mode is the secondary mode. The effect of the bug is that the
user space program looses the access to all mappings without PROT_EXEC,
e.g. the stack. The problem is fixed by restoring the mode that has
been active before the switch to the access register mode.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] vdso: fix per cpu area allocation
Heiko Carstens [Fri, 24 Jul 2009 10:39:51 +0000 (12:39 +0200)] 
[S390] vdso: fix per cpu area allocation

vdso per cpu area allocation in smp_prepare_cpus() happens with GFP_KERNEL
but irqs disabled. Triggers this one:

Badness at kernel/lockdep.c:2280
Modules linked in:
CPU: 0 Not tainted 2.6.30 #2
Process swapper (pid: 1, task: 000000003fe88000, ksp: 000000003fe87eb8)
Krnl PSW : 0400c00180000000 0000000000083360 (lockdep_trace_alloc+0xec/0xf8)
[...]
Call Trace:
([<00000000000832b6>] lockdep_trace_alloc+0x42/0xf8)
 [<00000000000b1880>] __alloc_pages_internal+0x3e8/0x5c4
 [<00000000000b1b4a>] __get_free_pages+0x3a/0xb0
 [<0000000000026546>] vdso_alloc_per_cpu+0x6a/0x18c
 [<00000000005eff82>] smp_prepare_cpus+0x322/0x594
 [<00000000005e8232>] kernel_init+0x76/0x398
 [<000000000001bb1e>] kernel_thread_starter+0x6/0xc
 [<000000000001bb18>] kernel_thread_starter+0x0/0xc

Fix this by moving the allocation out of the irqs disabled section.

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] hibernation: fix register corruption on machine checks
Heiko Carstens [Fri, 24 Jul 2009 10:39:50 +0000 (12:39 +0200)] 
[S390] hibernation: fix register corruption on machine checks

swsusp_arch_suspend() actually saves all cpu register contents on
hibernation.
Machine checks must be disabled since swsusp_arch_suspend() stores
register contents to their lowcore save areas. That's the same
place where register contents on machine checks would be saved.
To avoid register corruption disable machine checks.
We must also disable machine checks in the new psw mask for
program checks, since swsusp_arch_suspend() may generate program
checks.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] hibernation: fix lowcore handling
Heiko Carstens [Fri, 24 Jul 2009 10:39:49 +0000 (12:39 +0200)] 
[S390] hibernation: fix lowcore handling

Our swsusp_arch_suspend() backend implementation disables prefixing
by setting the contents of the prefix register to 0.
However afterwards common code functions are called which might
access percpu data structures.
Since the lowcore contains e.g. the percpu base pointer this isn't
a good idea. So fix this by copying the hibernating cpu's lowcore to
absolute address zero.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years agox86: geode: Mark mfgpt irq IRQF_TIMER to prevent resume failure
Thomas Gleixner [Fri, 24 Jul 2009 06:34:59 +0000 (08:34 +0200)] 
x86: geode: Mark mfgpt irq IRQF_TIMER to prevent resume failure

Timer interrupts are excluded from being disabled during suspend. The
clock events code manages the disabling of clock events on its own
because the timer interrupt needs to be functional before the resume
code reenables the device interrupts.

The mfgpt timer request its interrupt without setting the IRQF_TIMER
flag so suspend_device_irqs() disables it as well which results in a
fatal resume failure.

Adding IRQF_TIMER to the interupt flags when requesting the mrgpt
timer interrupt solves the problem.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Cc: Andres Salomon <dilinger@debian.org>
Cc: stable@kernel.org
14 years agodm table: pass correct dev area size to device_area_is_valid
Mike Snitzer [Thu, 23 Jul 2009 19:30:42 +0000 (20:30 +0100)] 
dm table: pass correct dev area size to device_area_is_valid

Incorrect device area lengths are being passed to device_area_is_valid().

The regression appeared in 2.6.31-rc1 through commit
754c5fc7ebb417b23601a6222a6005cc2e7f2913.

With the dm-stripe target, the size of the target (ti->len) was used
instead of the stripe_width (ti->len/#stripes).  An example of a
consequent incorrect error message is:

  device-mapper: table: 254:0: sdb too small for target

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
14 years agodm: remove queue next_ordered workaround for barriers
Mike Snitzer [Thu, 23 Jul 2009 19:30:40 +0000 (20:30 +0100)] 
dm: remove queue next_ordered workaround for barriers

This patch removes DM's bio-based vs request-based conditional setting
of next_ordered.  For bio-based DM the next_ordered check is no longer a
concern (as that check is now in the __make_request path).  For
request-based DM the default of QUEUE_ORDERED_NONE is now appropriate.

bio-based DM was changed to work-around the previously misplaced
next_ordered check with this commit:
99360b4c18f7675b50d283301d46d755affe75fd

request-based DM does not yet support barriers but reacted to the above
bio-based DM change with this commit:
5d67aa2366ccb8257d103d0b43df855605c3c086

The above changes are no longer needed given Neil Brown's recent fix to
put the next_ordered check in the __make_request path:
db64f680ba4b5c56c4be59f0698000df89ff0281

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: NeilBrown <neilb@suse.de>
Acked-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
14 years agodm raid1: wake kmirrord when requeueing delayed bios after remote recovery
Mikulas Patocka [Thu, 23 Jul 2009 19:30:37 +0000 (20:30 +0100)] 
dm raid1: wake kmirrord when requeueing delayed bios after remote recovery

The recent commit 7513c2a761d69d2a93f17146b3563527d3618ba0 (dm raid1:
add is_remote_recovering hook for clusters) changed do_writes() to
update the ms->writes list but forgot to wake up kmirrord to process it.

The rule is that when anything is being added on ms->reads, ms->writes
or ms->failures and the list was empty before we must call
wakeup_mirrord (for immediate processing) or delayed_wake (for delayed
processing).  Otherwise the bios could sit on the list indefinitely.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
CC: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>