pandora-kernel.git
14 years agoAudit: dereferencing krule as if it were an audit_watch
Eric Paris [Thu, 11 Jun 2009 18:31:34 +0000 (14:31 -0400)]
Audit: dereferencing krule as if it were an audit_watch

audit_update_watch() runs all of the rules for a given watch and duplicates
them, attaches a new watch to them, and then when it finishes that process
and has called free on all of the old rules (ok maybe still inside the rcu
grace period) it proceeds to use the last element from list_for_each_entry_safe()
as if it were a krule rather than being the audit_watch which was anchoring
the list to output a message about audit rules changing.

This patch unfies the audit message from two different places into a helper
function and calls it from the correct location in audit_update_rules().  We
will now get an audit message about the config changing for each rule (with
each rules filterkey) rather than the previous garbage.

Signed-off-by: Eric Paris <eparis@redhat.com>
14 years agoAudit: better estimation of execve record length
Eric Paris [Thu, 11 Jun 2009 18:31:34 +0000 (14:31 -0400)]
Audit: better estimation of execve record length

The audit execve record splitting code estimates the length of the message
generated.  But it forgot to include the "" that wrap each string in its
estimation.  This means that execve messages with lots of tiny (1-2 byte)
arguments could still cause records greater than 8k to be emitted.  Simply
fix the estimate.

Signed-off-by: Eric Paris <eparis@redhat.com>
14 years agoAudit: fix audit watch use after free
Eric Paris [Thu, 11 Jun 2009 18:31:33 +0000 (14:31 -0400)]
Audit: fix audit watch use after free

When an audit watch is added to a parent the temporary watch inside the
original krule from userspace is freed.  Yet the original watch is used after
the real watch was created in audit_add_rules()

Signed-off-by: Eric Paris <eparis@redhat.com>
14 years agoACPI: video: DMI workaround broken Acer 7720 BIOS enabling display brightness
Zhang Rui [Mon, 22 Jun 2009 03:31:18 +0000 (11:31 +0800)]
ACPI: video: DMI workaround broken Acer 7720 BIOS enabling display brightness

http://bugzilla.kernel.org/show_bug.cgi?id=13121

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoACPI: run ACPI device hot removal in kacpi_hotplug_wq
Zhang Rui [Mon, 22 Jun 2009 03:31:16 +0000 (11:31 +0800)]
ACPI: run ACPI device hot removal in kacpi_hotplug_wq

Now that new interface is available,
convert to using it rather than creating a new kernel thread.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoACPI: Add the reference count to avoid unloading ACPI video bus twice
Zhao Yakui [Tue, 16 Jun 2009 03:23:13 +0000 (11:23 +0800)]
ACPI: Add the reference count to avoid unloading ACPI video bus twice

Sometimes both acpi video and i915 driver are compiled as modules.
And there exists the strict dependency between the two drivers.
The acpi video bus will be unloaded in course of unloading the i915 driver.
If we unload the acpi video driver, then the kernel oops will be triggered.

Add the reference count to avoid unloading the ACPI video bus twice.
The reference count should be checked before unregistering the acpi video bus.
If the reference count is already zero, it won't unregister it again.
And after the acpi video bus is already unregistered, the reference count
will be set to zero.

http://bugzilla.kernel.org/show_bug.cgi?id=13396

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoACPI: DMI to disable Vista compatibility on some Sony laptops
Zhang Rui [Mon, 22 Jun 2009 03:31:17 +0000 (11:31 +0800)]
ACPI: DMI to disable Vista compatibility on some Sony laptops

Linux claims Vista compatibility to the BIOS for a number of
reasons, but this brings hard lockup on some Sony laptops.

Disable Vista compatibility via DMI for these laptops unless
we can figure out what Vista is doing for this platform.
http://bugzilla.kernel.org/show_bug.cgi?id=12904

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoACPI: fix a deadlock in hotplug case
Zhang Rui [Tue, 23 Jun 2009 02:20:29 +0000 (10:20 +0800)]
ACPI: fix a deadlock in hotplug case

we used to run the hotplug code in keventd_wq.
But when hot removing the ACPI battery device,
power_supply_unregister invokes flush_scheduled_work.
This causes a deadlock. i.e
1. When dock is unplugged, all the hotplug code is run on kevent_wq.
2. the hotplug code removes all the child devices of dock device.
3. removing the child device may invoke flush_scheduled_work
4. flush_scheduled_work waits until all the work on kevent_wq to be
   finished, while this will never be true because the hotplug code
   is running on keventd_wq...

Introduce a new workqueue for hotplug in this patch.
http://bugzilla.kernel.org/show_bug.cgi?id=13533

Tested-by: Paul Martin <pm@debian.org>
Tested-by: Vojtech Gondzala <vojtech.gondzala@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoShow the physical device node of backlight class device.
Zhang Rui [Mon, 22 Jun 2009 03:31:14 +0000 (11:31 +0800)]
Show the physical device node of backlight class device.

Create symbol link from backlight class device to ACPI video device.

More and more laptops are shipped with multiple ACPI
video devices, while we export only one of them to userspace.

With this patch applied, we can know which ACPI video device
is used by "cat /sys/class/backlight/acpi_video0/device/path".

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoMerge git://git.infradead.org/iommu-2.6
Linus Torvalds [Wed, 24 Jun 2009 02:49:24 +0000 (19:49 -0700)]
Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6:
  Intel-IOMMU, intr-remap: source-id checking
  Intel-IOMMU, intr-remap: set the whole 128bits of irte when modify/free it
  IOMMU Identity Mapping Support (drivers/pci/intel_iommu.c)

14 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec...
Linus Torvalds [Wed, 24 Jun 2009 02:36:02 +0000 (19:36 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jlbec/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
  ocfs2/trivial: Wrap ocfs2_sysfile_cluster_lock_key within define.
  ocfs2: Add lockdep annotations
  vfs: Set special lockdep map for dirs only if not set by fs
  ocfs2: Disable orphan scanning for local and hard-ro mounts
  ocfs2: Do not initialize lvb in ocfs2_orphan_scan_lock_res_init()
  ocfs2: Stop orphan scan as early as possible during umount
  ocfs2: Fix ocfs2_osb_dump()
  ocfs2: Pin journal head before accessing jh->b_committed_data
  ocfs2: Update atime in splice read if necessary.
  ocfs2: Provide the ocfs2_dlm_lvb_valid() stack API.

14 years agoMerge branch 'next-i2c' of git://aeryn.fluff.org.uk/bjdooks/linux
Linus Torvalds [Wed, 24 Jun 2009 02:35:42 +0000 (19:35 -0700)]
Merge branch 'next-i2c' of git://aeryn.fluff.org.uk/bjdooks/linux

* 'next-i2c' of git://aeryn.fluff.org.uk/bjdooks/linux:
  i2c: driver for the Synopsys DesignWare I2C controller

14 years agoqla3xxx: Don't sleep while holding lock.
Ron Mercer [Tue, 23 Jun 2009 09:00:02 +0000 (09:00 +0000)]
qla3xxx: Don't sleep while holding lock.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqla3xxx: Give the PHY time to come out of reset.
Ron Mercer [Tue, 23 Jun 2009 09:00:01 +0000 (09:00 +0000)]
qla3xxx: Give the PHY time to come out of reset.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4 routing: Ensure that route cache entries are usable and reclaimable with caching...
Neil Horman [Mon, 22 Jun 2009 10:18:53 +0000 (10:18 +0000)]
ipv4 routing: Ensure that route cache entries are usable and reclaimable with caching is off

When route caching is disabled (rt_caching returns false), We still use route
cache entries that are created and passed into rt_intern_hash once.  These
routes need to be made usable for the one call path that holds a reference to
them, and they need to be reclaimed when they're finished with their use.  To be
made usable, they need to be associated with a neighbor table entry (which they
currently are not), otherwise iproute_finish2 just discards the packet, since we
don't know which L2 peer to send the packet to.  To do this binding, we need to
follow the path a bit higher up in rt_intern_hash, which calls
arp_bind_neighbour, but not assign the route entry to the hash table.
Currently, if caching is off, we simply assign the route to the rp pointer and
are reutrn success.  This patch associates us with a neighbor entry first.

Secondly, we need to make sure that any single use routes like this are known to
the garbage collector when caching is off.  If caching is off, and we try to
hash in a route, it will leak when its refcount reaches zero.  To avoid this,
this patch calls rt_free on the route cache entry passed into rt_intern_hash.
This places us on the gc list for the route cache garbage collector, so that
when its refcount reaches zero, it will be reclaimed (Thanks to Alexey for this
suggestion).

I've tested this on a local system here, and with these patches in place, I'm
able to maintain routed connectivity to remote systems, even if I set
/proc/sys/net/ipv4/rt_cache_rebuild_count to -1, which forces rt_caching to
return false.

Signed-off-by: Neil Horman <nhorman@redhat.com>
Reported-by: Jarek Poplawski <jarkao2@gmail.com>
Reported-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Move rx skb_orphan call to where needed
Herbert Xu [Mon, 22 Jun 2009 02:25:25 +0000 (02:25 +0000)]
net: Move rx skb_orphan call to where needed

In order to get the tun driver to account packets, we need to be
able to receive packets with destructors set.  To be on the safe
side, I added an skb_orphan call for all protocols by default since
some of them (IP in particular) cannot handle receiving packets
destructors properly.

Now it seems that at least one protocol (CAN) expects to be able
to pass skb->sk through the rx path without getting clobbered.

So this patch attempts to fix this properly by moving the skb_orphan
call to where it's actually needed.  In particular, I've added it
to skb_set_owner_[rw] which is what most users of skb->destructor
call.

This is actually an improvement for tun too since it means that
we only give back the amount charged to the socket when the skb
is passed to another socket that will also be charged accordingly.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Oliver Hartkopp <olver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoi2c: driver for the Synopsys DesignWare I2C controller
Baruch Siach [Mon, 22 Jun 2009 13:36:29 +0000 (16:36 +0300)]
i2c: driver for the Synopsys DesignWare I2C controller

The i2c Linux driver for the DesignWare i2c block of Synopsys, which is meant
for AMBA Peripheral Bus. This i2c block is used on SoC chips like the ARM9
based PVG610.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoIntel-IOMMU, intr-remap: source-id checking
Weidong Han [Fri, 22 May 2009 16:41:15 +0000 (00:41 +0800)]
Intel-IOMMU, intr-remap: source-id checking

To support domain-isolation usages, the platform hardware must be
capable of uniquely identifying the requestor (source-id) for each
interrupt message. Without source-id checking for interrupt remapping
, a rouge guest/VM with assigned devices can launch interrupt attacks
to bring down anothe guest/VM or the VMM itself.

This patch adds source-id checking for interrupt remapping, and then
really isolates interrupts for guests/VMs with assigned devices.

Because PCI subsystem is not initialized yet when set up IOAPIC
entries, use read_pci_config_byte to access PCI config space directly.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoIntel-IOMMU, intr-remap: set the whole 128bits of irte when modify/free it
Weidong Han [Fri, 22 May 2009 16:41:14 +0000 (00:41 +0800)]
Intel-IOMMU, intr-remap: set the whole 128bits of irte when modify/free it

Interrupt remapping table entry is 128bits. Currently, it only sets low
64bits of irte in modify_irte and free_irte. This ignores high 64bits
setting of irte, that means source-id setting will be ignored. This patch
sets the whole 128bits of irte when modify/free it. Following source-id
checking patch depends on this.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoIOMMU Identity Mapping Support (drivers/pci/intel_iommu.c)
Fenghua Yu [Fri, 19 Jun 2009 20:47:29 +0000 (13:47 -0700)]
IOMMU Identity Mapping Support (drivers/pci/intel_iommu.c)

Identity mapping for IOMMU defines a single domain to 1:1 map all PCI
devices to all usable memory.

This reduces map/unmap overhead in DMA API's and improve IOMMU
performance. On 10Gb network cards, Netperf shows no performance
degradation compared to non-IOMMU performance.

This method may lose some of DMA remapping benefits like isolation.

The patch sets up identity mapping for all PCI devices to all usable
memory. In the DMA API, there is no overhead to maintain page tables,
invalidate iotlb, flush cache etc.

32 bit DMA devices don't use identity mapping domain, in order to access
memory beyond 4GiB.

When kernel option iommu=pt, pass through is first tried. If pass
through succeeds, IOMMU goes to pass through. If pass through is not
supported in hw or fail for whatever reason, IOMMU goes to identity
mapping.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agonvidiafb: fix boot-time printk string
Mikael Pettersson [Tue, 23 Jun 2009 19:37:07 +0000 (12:37 -0700)]
nvidiafb: fix boot-time printk string

On bootup nvidiafb prints the following on my Apple G5:

nvidiafb: CRTC 1appears to have a CRT attached

There should be a space between the '1' and the 'appears'.  Add it.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoh8/300: fix incorrect "select" directives in arch/h8300/Kconfig.cpu.
Robert P. J. Day [Tue, 23 Jun 2009 19:37:06 +0000 (12:37 -0700)]
h8/300: fix incorrect "select" directives in arch/h8300/Kconfig.cpu.

Fix the incorrect "select" directives by dropping the "CONFIG_"
prefixes, and correcting the typo "H8S2768" to "H8S2678".

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Acked-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomm: fix handling of pagesets for downed cpus
Dimitri Sivanich [Tue, 23 Jun 2009 19:37:04 +0000 (12:37 -0700)]
mm: fix handling of pagesets for downed cpus

After downing/upping a cpu, an attempt to set
/proc/sys/vm/percpu_pagelist_fraction results in an oops in
percpu_pagelist_fraction_sysctl_handler().

If a processor is downed then we need to set the pageset pointer back to
the boot pageset.

Updates of the high water marks should not access pagesets of unpopulated
zones (those pointer go to the boot pagesets which would be no longer
functional if their size would be increased beyond zero).

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agormap: fixup page_referenced() for nommu systems
Mike Frysinger [Tue, 23 Jun 2009 19:37:01 +0000 (12:37 -0700)]
rmap: fixup page_referenced() for nommu systems

After the recent changes that went into mm/vmscan.c to overhaul stuff, we
ended up with these warnings on no-mmu systems:

  mm/vmscan.c: In function `shrink_page_list':
  mm/vmscan.c:580: warning: unused variable `vm_flags'
  mm/vmscan.c: In function `shrink_active_list':
  mm/vmscan.c:1294: warning: `vm_flags' may be used uninitialized in this function
  mm/vmscan.c:1242: note: `vm_flags' was declared here

This is because the no-mmu function defines page_referenced() to work on
the first argument only (the page).  It does not clear the vm_flags given
to it because for no-mmu systems, they never actually get utilized.  Since
that is no longer strictly true, we need to set vm_flags to 0 like
everyone else so gcc can do proper dead code elimination without annoying
us with unused warnings.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: David Howells <dhowells@redhat.com>
Acked-by: David McCullough <davidm@snapgear.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomm: pass mm to grab_swap_token
Hugh Dickins [Tue, 23 Jun 2009 19:36:58 +0000 (12:36 -0700)]
mm: pass mm to grab_swap_token

If a kthread happens to use get_user_pages() on an mm (as KSM does),
there's a chance that it will end up trying to read in a swap page, then
oops in grab_swap_token() because the kthread has no mm: GUP passes down
the right mm, so grab_swap_token() ought to be using it.

We have not identified a stronger case than KSM's daemon (not yet in
mainline), but the issue must have come up before, since RHEL has included
a fix for this for years (though a different fix, they just back out of
grab_swap_token if current->mm is unset: which is what we first proposed,
but using the right mm here seems more correct).

Reported-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
Linus Torvalds [Tue, 23 Jun 2009 18:52:16 +0000 (11:52 -0700)]
Merge git://git./linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Fix up HAVE_PERF_COUNTERS typo.
  sh: Fix up more dma-mapping fallout.
  sh: SH7786 SMP support.
  sh: Wire up the uncached fixmap on sh64 as well.
  sh: Use local TLB flush in set_pte_phys().
  sh: Provide cpu_idle_wait() to fix up cpuidle/SMP build.

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Tue, 23 Jun 2009 18:36:01 +0000 (11:36 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  RDMA: Add __init/__exit macros to addr.c and cma.c
  IB/ehca: Bump version number
  mlx4_core: Fix dma_sync_single_for_cpu() with matching for_device() calls
  IB/mthca: Replace dma_sync_single() use with proper functions
  RDMA/nes: Fix FIN state handling under error conditions
  RDMA/nes: Fix max_qp_init_rd_atom returned from query device
  IB/ehca: Ensure that guid_entry index is not negative
  IB/ehca: Tolerate dynamic memory operations before driver load

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Linus Torvalds [Tue, 23 Jun 2009 18:35:37 +0000 (11:35 -0700)]
Merge git://git./linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (38 commits)
  fusion: mptsas, fix lock imbalance
  [SCSI] scsi_transport_fc: replace BUS_ID_SIZE by fixed count
  sd, sr: fix Driver 'sd' needs updating message
  scsi_transport_iscsi: return -EOVERFLOW for Too many iscsi targets
  fc_transport: Selective return value from BSG timeout function
  fc_transport: The softirq_done function registration for BSG request
  sym53c8xx: ratelimit parity errors
  explain the hidden scsi_wait_scan Kconfig variable
  ibmvfc: Fix endless PRLI loop in discovery
  ibmvfc: Process async events before command responses
  libfc: Add runtime debugging with debug_logging module parameter
  libfcoe: Add runtime debugging with module param debug_logging
  fcoe: Add runtime debug logging with module parameter debug_logging
  scsi_debug: Add support for physical block exponent and alignment
  cnic: add NETDEV_1000 and NETDEVICES to Kconfig select
  cnic: Fix __symbol_get() build error.
  Revert "[SCSI] cnic: fix error: implicit declaration of function ‘__symbol_get’"
  ipr: differentiate pci-x and pci-e based adapters
  ipr: add test for MSI interrupt support
  scsi_transport_spi: Blacklist Ultrium-3 tape for IU transfers
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm...
Linus Torvalds [Tue, 23 Jun 2009 18:34:24 +0000 (11:34 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/arnd/asm-generic

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  asm-generic: add dummy pgprot_noncached()
  lib/checksum.c: fix endianess bug
  asm-generic: hook up new system calls
  asm-generic: list Arnd as asm-generic maintainer
  asm-generic: drop HARDIRQ_BITS definition from hardirq.h
  asm-generic: uaccess: fix up local access_ok() usage
  asm-generic: uaccess: add missing access_ok() check to strnlen_user()

14 years agoMerge branch 'kmemleak' of git://linux-arm.org/linux-2.6
Linus Torvalds [Tue, 23 Jun 2009 18:25:04 +0000 (11:25 -0700)]
Merge branch 'kmemleak' of git://linux-arm.org/linux-2.6

* 'kmemleak' of git://linux-arm.org/linux-2.6:
  kmemleak: Do not force the slab debugging Kconfig options
  kmemleak: use pr_fmt

14 years agomm: don't rely on flags coincidence
Hugh Dickins [Tue, 23 Jun 2009 12:52:49 +0000 (13:52 +0100)]
mm: don't rely on flags coincidence

Indeed FOLL_WRITE matches FAULT_FLAG_WRITE, matches GUP_FLAGS_WRITE,
and it's tempting to devise a set of Grand Unified Paging flags;
but not today.  So until then, let's rely upon the compiler to spot
the coincidence, "rather than have that subtle dependency and a
comment for it" - as you remarked in another context yesterday.

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agohugetlb: fault flags instead of write_access
Hugh Dickins [Tue, 23 Jun 2009 12:49:05 +0000 (13:49 +0100)]
hugetlb: fault flags instead of write_access

handle_mm_fault() is now passing fault flags rather than write_access
down to hugetlb_fault(), so better recognize that in hugetlb_fault(),
and in hugetlb_no_page().

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'for-linus' of git://www.jni.nu/cris
Linus Torvalds [Tue, 23 Jun 2009 17:47:01 +0000 (10:47 -0700)]
Merge branch 'for-linus' of git://www.jni.nu/cris

* 'for-linus' of git://www.jni.nu/cris:
  CRISv10: remove redundant tests on unsigned
  CRISv32: irq.c - Move end brace outside #endif
  CRISv32: Fix potential null reference in cryptocop driver.
  CRISv32: Add arch optimized strcmp.
  CRIS: assignment/is equal confusion

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Tue, 23 Jun 2009 17:45:39 +0000 (10:45 -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 - Make jack-plug notification selectable
  ALSA: ctxfi - Add PM support
  sound: seq_midi_event: fix decoding of (N)RPN events
  ALSA: hda - Add digital-mic support to ALC262 auto model
  ALSA: hda - Fix check of input source type for realtek codecs
  ALSA: hda - Add quirk for Sony VAIO Z21MN
  ALSA: hda - Get back Input Source for ALC262 toshiba-s06 model
  ALSA: hda - Fix unsigned comparison in patch_sigmatel.c
  ALSA: via82xx: add option to disable 500ms delay in snd_via82xx_codec_wait
  sound: fix check for return value in snd_pcm_hw_refine
  ALSA: ctxfi - Allow unknown PCI SSIDs
  ASoC: Blackfin: update the bf5xx_i2s_resume parameters
  ASoC: Blackfin: keep better track of SPORT configuration state

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
Linus Torvalds [Tue, 23 Jun 2009 17:41:17 +0000 (10:41 -0700)]
Merge git://git./linux/kernel/git/wim/linux-2.6-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] wdt_pci.c: remove #ifdef CONFIG_WDT_501_PCI
  [WATCHDOG] hpwdt: Add NMI priority option
  [WATCHDOG] OMAP fixes: enable clock in probe, trigger timer reload
  [WATCHDOG] add bcm47xx watchdog driver
  [WATCHDOG] Freescale STMP: watchdog driver
  [WATCHDOG] twl4030 watchdog driver
  [WATCHDOG] U300 COH 901 327 watchdog driver
  [WATCHDOG] Add pnx833x_wdt

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Tue, 23 Jun 2009 17:40:19 +0000 (10:40 -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: (62 commits)
  V4L/DVB (12131): BUGFIX: An incorrect Carrier Recovery Loop optimization table was being
  V4L/DVB (12130): Fix a redundant compiler warning
  V4L/DVB (12003): v4l2: Move bounding code outside I2C ifdef block
  V4L/DVB (11913): cx231xx: TRY_FMT should not actually set anything
  V4L/DVB (11912): em28xx: Use v4l bounding/alignment function
  V4L/DVB (11911): cx231xx: Use v4l bounding/alignment function
  V4L/DVB (11910): mt9: Use v4l bounding/alignment function
  V4L/DVB (11909): cx23885: Use v4l bounding/alignment function
  V4L/DVB (11908): w8968cf: Use v4l bounding/alignment function
  V4L/DVB (11907): cx88: Use v4l bounding/alignment function
  V4L/DVB (11906): saa7134: Use v4l bounding/alignment function
  V4L/DVB (11905): vivi: Use v4l bounding/alignment function
  V4L/DVB (11904): zoran: Use v4l bounding/alignment functiob
  V4L/DVB (11903): sh_mobile_ceu_camera: Use v4l bounding/alignment function
  V4L/DVB (11902): pxa-camera: Use v4l bounding/alignment function
  V4L/DVB (11901): v4l2: Create helper function for bounding and aligning images
  V4L/DVB (12128): v4l2: update framework documentation.
  V4L/DVB (12125): v4l2: add new s_config subdev ops and v4l2_i2c_new_subdev_cfg/board calls
  V4L/DVB (12122): pvrusb2: De-obfuscate code which handles routing schemes
  V4L/DVB (12121): pvrusb2: Improve handling of routing schemes
  ...

14 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Tue, 23 Jun 2009 17:39:36 +0000 (10:39 -0700)]
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:
  libata: don't set IORDY for reset
  sata_fsl: Add power mgmt support
  [libata] PATA driver for CF interface on AT91SAM9260 SoC
  [libata] beautify module parameters

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
Linus Torvalds [Tue, 23 Jun 2009 17:39:00 +0000 (10:39 -0700)]
Merge git://git./linux/kernel/git/davem/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
  ide cmd64x: Remove serialize setting.
  ide: Take over as maintainer.

14 years agoMerge branches 'ehca', 'misc', 'mlx4', 'mthca' and 'nes' into for-linus
Roland Dreier [Tue, 23 Jun 2009 17:38:47 +0000 (10:38 -0700)]
Merge branches 'ehca', 'misc', 'mlx4', 'mthca' and 'nes' into for-linus

14 years agoRDMA: Add __init/__exit macros to addr.c and cma.c
Peter Huewe [Tue, 23 Jun 2009 17:38:42 +0000 (10:38 -0700)]
RDMA: Add __init/__exit macros to addr.c and cma.c

Add __init and __exit annotations to the module_init/module_exit
functions from drivers/infiniband/core/addr.c and cma.c.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoIB/ehca: Bump version number
Alexander Schmidt [Tue, 23 Jun 2009 17:30:04 +0000 (10:30 -0700)]
IB/ehca: Bump version number

Increment version number for DMEM toleration.

Signed-off-by: Alexander Schmidt <alexs@linux.vnet.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agomm: fix incorrect page removal from LRU
KAMEZAWA Hiroyuki [Mon, 22 Jun 2009 23:57:55 +0000 (08:57 +0900)]
mm: fix incorrect page removal from LRU

The isolated page is "cursor_page" not "page".

This could cause LRU list corruption under memory pressure, caught by
CONFIG_DEBUG_LIST.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Tested-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosh: Fix up HAVE_PERF_COUNTERS typo.
Paul Mundt [Tue, 23 Jun 2009 16:41:05 +0000 (01:41 +0900)]
sh: Fix up HAVE_PERF_COUNTERS typo.

That's HAVE_PERF_COUNTERS not HAVE_PERF_COUNTER. This was right
initially but I seem to have screwed it up while re-typing it out
by hand on another machine when I checked it in. Hmph.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agokmemleak: Do not force the slab debugging Kconfig options
Catalin Marinas [Tue, 23 Jun 2009 13:40:27 +0000 (14:40 +0100)]
kmemleak: Do not force the slab debugging Kconfig options

Selecting DEBUG_SLAB or SLUB_DEBUG by the KMEMLEAK menu entry may cause
issues with other dependencies (KMEMCHECK). These configuration options
aren't strictly needed by kmemleak but they may increase the chances of
finding leaks. This patch also updates the KMEMLEAK config entry help
text.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
14 years agokmemleak: use pr_fmt
Joe Perches [Tue, 23 Jun 2009 13:40:26 +0000 (14:40 +0100)]
kmemleak: use pr_fmt

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
14 years agoasm-generic: add dummy pgprot_noncached()
Paul Mundt [Tue, 23 Jun 2009 11:51:19 +0000 (13:51 +0200)]
asm-generic: add dummy pgprot_noncached()

Most architectures now provide a pgprot_noncached(), the
remaining ones can simply use an dummy default implementation,
except for cris and xtensa, which should override the
default appropriately.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Magnus Damm <magnus.damm@gmail.com>
14 years agoipv6: Use correct data types for ICMPv6 type and code
Brian Haley [Tue, 23 Jun 2009 11:31:07 +0000 (04:31 -0700)]
ipv6: Use correct data types for ICMPv6 type and code

Change all the code that deals directly with ICMPv6 type and code
values to use u8 instead of a signed int as that's the actual data
type.

Signed-off-by: Brian Haley <brian.haley@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: let KS8842 driver depend on HAS_IOMEM
Heiko Carstens [Mon, 22 Jun 2009 21:32:18 +0000 (21:32 +0000)]
net: let KS8842 driver depend on HAS_IOMEM

Fixes this compile error on s390:

  CC      drivers/net/ks8842.o
drivers/net/ks8842.c: In function 'ks8842_select_bank':
drivers/net/ks8842.c:124: error: implicit declaration of function 'iowrite16'
drivers/net/ks8842.c: In function 'ks8842_write8':
drivers/net/ks8842.c:131: error: implicit declaration of function 'iowrite8'

Cc: Richard Rojfors <richard.rojfors.ext@mocean-labs.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: let SJA1000 driver depend on HAS_IOMEM
Heiko Carstens [Mon, 22 Jun 2009 21:31:20 +0000 (21:31 +0000)]
can: let SJA1000 driver depend on HAS_IOMEM

Fixes this compile error on s390:

drivers/net/can/sja1000/sja1000_platform.c: In function 'sp_read_reg':
drivers/net/can/sja1000/sja1000_platform.c:42: error: implicit declaration of function 'ioread8'
drivers/net/can/sja1000/sja1000_platform.c: In function 'sp_write_reg':
drivers/net/can/sja1000/sja1000_platform.c:47: error: implicit declaration of function 'iowrite8'
drivers/net/can/sja1000/sja1000_platform.c: In function 'sp_probe':
drivers/net/can/sja1000/sja1000_platform.c:79: error: implicit declaration of function 'ioremap_nocache'

Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix firmware init handshake
Dhananjay Phadke [Mon, 22 Jun 2009 20:26:21 +0000 (20:26 +0000)]
netxen: fix firmware init handshake

Make sure all functions run firmware init handshake.

If PCI function 0 fails to initialize firmware, mark the
state failed so that other functions on the same board
bail out quickly instead of waiting 30s for firmware
handshake.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix build with without CONFIG_PM
Dhananjay Phadke [Mon, 22 Jun 2009 20:26:20 +0000 (20:26 +0000)]
netxen: fix build with without CONFIG_PM

wrap pci suspend() and resume() with CONFIG_PM check.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosh: Fix up more dma-mapping fallout.
Paul Mundt [Tue, 23 Jun 2009 08:36:23 +0000 (17:36 +0900)]
sh: Fix up more dma-mapping fallout.

commit dbe6f1869188b6e04e38aa861dd198befb08bcd7
("dma-mapping: mark dma_sync_single and dma_sync_sg as deprecated"
conveniently broke every single SH build.

In the future it would be great if people could at least bother
figuring out how to use grep.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: SH7786 SMP support.
Paul Mundt [Fri, 19 Jun 2009 07:00:00 +0000 (16:00 +0900)]
sh: SH7786 SMP support.

SH7786 is roughly identical to SH-X3 proto SMP, though there are only 2
CPUs. This just wraps in to the existing SH-X3 SMP code with some minor
changes for SH7786, including wiring up the IPIs properly, enabling
IRQ_PER_CPU, and so forth.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Wire up the uncached fixmap on sh64 as well.
Paul Mundt [Fri, 19 Jun 2009 06:39:47 +0000 (15:39 +0900)]
sh: Wire up the uncached fixmap on sh64 as well.

Now that sh64 also can use the uncached section, wire up the fixmap for
it as well.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Use local TLB flush in set_pte_phys().
Paul Mundt [Fri, 19 Jun 2009 06:37:11 +0000 (15:37 +0900)]
sh: Use local TLB flush in set_pte_phys().

set_pte_phys() presently uses the global flush_tlb_one(), which locks on
SMP trying to do the IPI. As we have not even initialized the other CPUs
at this point, switch to the local_ variant so the flush happens on the
boot CPU.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Provide cpu_idle_wait() to fix up cpuidle/SMP build.
Paul Mundt [Fri, 19 Jun 2009 05:40:51 +0000 (14:40 +0900)]
sh: Provide cpu_idle_wait() to fix up cpuidle/SMP build.

Crib the x86 cpu_idle_wait() implementation and shove it in with the
idle code, subsequently enabling ARCH_HAS_CPU_IDLE_WAIT.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoCRISv10: remove redundant tests on unsigned
Roel Kluin [Tue, 23 Jun 2009 08:04:14 +0000 (10:04 +0200)]
CRISv10: remove redundant tests on unsigned

Since dmanr is unsigned, negatives are wrapped and caught by the other test.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
14 years ago[WATCHDOG] wdt_pci.c: remove #ifdef CONFIG_WDT_501_PCI
Wim Van Sebroeck [Fri, 19 Jun 2009 09:32:57 +0000 (09:32 +0000)]
[WATCHDOG] wdt_pci.c: remove #ifdef CONFIG_WDT_501_PCI

Change the wdt_pci.c watchdog driver so that the code is the same for
both the PCI-WDT500 as the PCI-WDT501 card. The selection of the card
is now being done via the module parameter: 'type' instead of the
config option CONFIG_WDT_501_PCI.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
14 years ago[WATCHDOG] hpwdt: Add NMI priority option
Tom Mingarelli [Thu, 18 Jun 2009 23:28:57 +0000 (23:28 +0000)]
[WATCHDOG] hpwdt: Add NMI priority option

Add a priority option so that the user can choose if we do the NMI
first or last.

Signed-off-by: Thomas Mingarelli <thomas.mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
14 years ago[WATCHDOG] OMAP fixes: enable clock in probe, trigger timer reload
Ulrik Bech Hald [Fri, 12 Jun 2009 21:18:32 +0000 (16:18 -0500)]
[WATCHDOG] OMAP fixes: enable clock in probe, trigger timer reload

This patch contains two fixes:

1)In omap_wdt_probe() the watchdog is reset and disabled. This
requires register access and the clks needs to be enabled temporarily

2)In omap_wdt_open() the timer register needs to be reloaded
to trigger a new timer value (the default of 60s)

Tested on OMAP34xx platform (Zoom1)

Reviewed-by: Kevin Hilman <khilman@ti.deeprootsystems.com>
Signed-off-by: Ulrik Bech Hald <ubh@ti.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
14 years agoV4L/DVB (12131): BUGFIX: An incorrect Carrier Recovery Loop optimization table was...
Manu Abraham [Thu, 18 Jun 2009 07:50:53 +0000 (04:50 -0300)]
V4L/DVB (12131): BUGFIX: An incorrect Carrier Recovery Loop optimization table was being

loaded for a given chip version. This would cause the optimization in
tuning not to be applied and thus a failed expectation, in tuning speed
increment. The patch swaps the tables in use. It also fixes a possible
one in a million condition where state->dev_ver implies an older Cut
(Cut < 2.0, eventhough the driver doesn't attach to any Cut older than
2.0) or even negative (due to a bad I2C bus master driver) for the card
combination.

Thanks to Mauro Carvalho Chehab <mchehab@infradead.org> for pointing
out the issue at large.

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12130): Fix a redundant compiler warning
Manu Abraham [Wed, 17 Jun 2009 19:48:17 +0000 (16:48 -0300)]
V4L/DVB (12130): Fix a redundant compiler warning

drivers/media/dvb/frontends/stv090x.c: In function ‘stv090x_optimize_carloop_short’:
drivers/media/dvb/frontends/stv090x.c:2677: warning: ‘short_crl’ may be used uninitialized in this function

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12003): v4l2: Move bounding code outside I2C ifdef block
Trent Piepho [Fri, 12 Jun 2009 19:31:29 +0000 (16:31 -0300)]
V4L/DVB (12003): v4l2: Move bounding code outside I2C ifdef block

On Fri, 12 Jun 2009, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Move v4l_bound_align_image() outside of an #ifdef CONFIG_I2C block
> so that it is always built.  Fixes a build error:

clamp_align() should be moved as well, since it's only used by
v4l_bound_align_image().  I'm attaching an alternate version that fixes
this.  Labeled the endif too.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11913): cx231xx: TRY_FMT should not actually set anything
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11913): cx231xx: TRY_FMT should not actually set anything

In the TRY_FMT handler the function get_scale() is called to find what the
scaler hardware will produce for a requested size.

The problem is that get_scale(struct cx231xx *dev, ..., unsigned int *vscale,
unsigned int *hscale) saves the calculated scale values into both the
pointer arguments and into dev's hscale and vscale fields.  TRY_FMT shouldn't
actually change anything in the device state.

The code to in get_scale() that writes to dev->[hv]scale can just be
deleted.  In all cases when dev's fields should be modified, get_scale()
was called with get_scale(dev, ..., &dev->hscale, &dev->vscale), so dev was
getting updated anyway.

This didn't actually cause a problem because nothing ever actually made use
of the hscale and vscale fields.  I changed cx231xx_resolution_set() to use
those fields rather than re-calculate them with a call to get_scale().

Updating [hv]scale in cx231xx_resolution_set() isn't necessary because
every call of cx231xx_resolution_set() was already preceded by a call to
get_scale() or setting the [hv]scale fields, so they will be always be
up-to-date w.r.t. width and height.

Removing the call to get_scale() from cx231xx_resolution_set() allowed
making get_scale() a static function, which is a good thing for something
with such a short name.  There is already another function with the same
name in the em28xx driver, but that one is static.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11912): em28xx: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11912): em28xx: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

It appears that the em2800 can only scale by 50% or 100%, i.e. the only
heights supported might be 240 and 480.  In that case the old code would
set any height other than 240 to 480.  Request 240 get 240, but request 239
and then you get 480.  Change it to round to the nearest supported value.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11911): cx231xx: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11911): cx231xx: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

Cc: Srinivasa Deevi <srinivasa.deevi@conexant.com>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11910): mt9: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11910): mt9: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11909): cx23885: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11909): cx23885: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11908): w8968cf: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11908): w8968cf: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

The existing code was casting pointers to u32 and to unsigned int into
pointers to u16.  This could mess up if someone passed in an image size
greater than 65,535 and on big-endian platforms it won't work at all.

The existing bounding code would shrink an image if it was too big, but
returned ERANGE if it was too small.  The code will not shrink or expand as
necessary.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11907): cx88: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11907): cx88: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11906): saa7134: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11906): saa7134: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11905): vivi: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11905): vivi: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11904): zoran: Use v4l bounding/alignment functiob
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11904): zoran: Use v4l bounding/alignment functiob

The v4l function has a better algorithm for aligning image size.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11903): sh_mobile_ceu_camera: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11903): sh_mobile_ceu_camera: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11902): pxa-camera: Use v4l bounding/alignment function
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11902): pxa-camera: Use v4l bounding/alignment function

The v4l function has a better algorithm for aligning image size.

For instance the old code would change 159x243 into 156x240 to meet the
alignment requirements.  The new function will use 160x243, which is a lot
closer to what was asked for originally.

Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (11901): v4l2: Create helper function for bounding and aligning images
Trent Piepho [Sun, 31 May 2009 00:45:46 +0000 (21:45 -0300)]
V4L/DVB (11901): v4l2: Create helper function for bounding and aligning images

Most hardware has limits on minimum and maximum image dimensions and also
requirements about alignment.  For example, image width must be even or a
multiple of four.  Some hardware has requirements that the total image size
(width * height) be a multiple of some power of two.

v4l_bound_align_image() will enforce min and max width and height, power of
two alignment on width and height, and power of two alignment on total
image size.

It uses an efficient algorithm that will try to find the "closest" image
size that meets the requirements.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12128): v4l2: update framework documentation.
Hans Verkuil [Tue, 9 Jun 2009 20:29:29 +0000 (17:29 -0300)]
V4L/DVB (12128): v4l2: update framework documentation.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12125): v4l2: add new s_config subdev ops and v4l2_i2c_new_subdev_cfg/board...
Hans Verkuil [Tue, 9 Jun 2009 20:12:33 +0000 (17:12 -0300)]
V4L/DVB (12125): v4l2: add new s_config subdev ops and v4l2_i2c_new_subdev_cfg/board calls

Add a new s_config core ops call: this is called with the irq and platform
data to be used to initialize the subdev.

Added new v4l2_i2c_new_subdev_cfg and v4l2_i2c_new_subdev_board calls
that allows you to pass these new arguments.

The existing v4l2_i2c_new_subdev functions were modified to also call
s_config.

In the future the existing v4l2_i2c_new_subdev functions will be replaced
by a single v4l2_i2c_new_subdev function similar to v4l2_i2c_new_subdev_cfg
but without the irq and platform_data arguments.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12122): pvrusb2: De-obfuscate code which handles routing schemes
Mike Isely [Sat, 20 Jun 2009 17:57:24 +0000 (14:57 -0300)]
V4L/DVB (12122): pvrusb2: De-obfuscate code which handles routing schemes

This change does not change any outward behavior; it merely chops down
some large if-conditions with embedded assignments into something a
little more maintainable for others (I of course never had a problem
with this...).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12121): pvrusb2: Improve handling of routing schemes
Mike Isely [Sat, 20 Jun 2009 17:55:31 +0000 (14:55 -0300)]
V4L/DVB (12121): pvrusb2: Improve handling of routing schemes

The pvrusb2 driver has a concept of "routing scheme" which defines
which physical inputs should be connected based on application's
choice of logical input.  The correct "routing scheme" depends on the
specific device since different devices might wire up their muxes

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12120): pvrusb2: Change initial default frequency setting
Mike Isely [Sat, 20 Jun 2009 17:51:29 +0000 (14:51 -0300)]
V4L/DVB (12120): pvrusb2: Change initial default frequency setting

Change default frequency to be US Broadcast channel 3 - with the
transition to d igital the previous value has now become useless.
This change is PURELY to help with my testing (I need to set some kind
of default so it might as well be some thing usable).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12119): pvrusb2: Re-fix hardware scaling on video standard change
Mike Isely [Sat, 20 Jun 2009 17:50:14 +0000 (14:50 -0300)]
V4L/DVB (12119): pvrusb2: Re-fix hardware scaling on video standard change

The cx25840 module's VBI initialization logic uses the current video
standard as part of its internal algorithm.  This therefore means that
we probably need to make sure that the correct video standard has been
set before initializing VBI.  (Normally we would not care about VBI,
but as described in an earlier changeset, VBI must be initialized
correctly on the cx25840 in order for the chip's hardware scaler to
operate correctly.)

It's kind of messy to force the video standard to be set before
initializing VBI (mainly because we can't know what the app really
wants that early in the initialization process).  So this patch does
the next best thing: VBI is re-initialized after any point where the
video standard has been set.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12118): pvrusb2: Fix hardware scaling when used with cx25840
Mike Isely [Sat, 20 Jun 2009 17:45:52 +0000 (14:45 -0300)]
V4L/DVB (12118): pvrusb2: Fix hardware scaling when used with cx25840

The cx25840 module requires that its VBI initialization entry point be
called in order for hardware-scaled video capture to work properly -
even if we don't care about VBI.  Making this behavior even more
subtle is that if the capture resolution is set to 720x480 - which is
the default that the pvrusb2 driver sets up - then the cx25840
bypasses the hardware scaler.  Therefore this problem does not
manifest itself until some other resolution, e.g. 640x480, is tried.
MythTV typically defaults to 640x480 or 480x480, which means that
things break whenever the driver is used with MythTV.

This all has been known for a while (since at least Nov 2006), but
recent changes in the pvrusb2 driver (specifically in regards to
sub-device support) caused this to break again.  VBI initialization
must happen *after* the chip's firmware is loaded, not before.  With
this fix, 24xxx devices work correctly again.

A related fix that is part of this changeset is that now we
re-initialize VBI any time after we issue a reset to the cx25840
driver.  Issuing a chip reset erases the state that the VBI setup
previously did.  Until the HVR-1950 came along this subtlety went
unnoticed, because the pvrusb2 driver previously never issued such a
reset.  But with the HVR-1950 we have to do that reset in order to
correctly transition from digital back to analog mode - and since the
HVR-1950 always starts in digital mode (required for the DVB side to
initialize correctly) then this device has never had a chance to work
correctly in analog mode!  Analog capture on the HVR-1950 has been
broken this *ENTIRE* time.  I had missed it until now because I've
usually been testing at the default 720x480 resolution which does not
require scaling...  What fun.  By re-initializing VBI after a cx25840
chip reset, correct behavior is restored.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12116): cx23885: ensure correct IF freq is used on HVR1200 & HVR1700
Michael Krufky [Thu, 21 May 2009 15:49:28 +0000 (12:49 -0300)]
V4L/DVB (12116): cx23885: ensure correct IF freq is used on HVR1200 & HVR1700

Ensure that we're programming the tda18271 tuner with the correct
IF frequencies to match the programming of the TDA10048 DVB-T demod
for the HVR1200 and HVR1700 products.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12115): tda10048: add missing entry to pll_tab for 3.8 MHz IF
Michael Krufky [Fri, 19 Jun 2009 19:21:37 +0000 (16:21 -0300)]
V4L/DVB (12115): tda10048: add missing entry to pll_tab for 3.8 MHz IF

Thanks for Terry Wu for pointing out the missing entry.

Cc: Terry Wu <terrywu2009@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12112): cx231xx: fix uninitialized variable.
Hans Verkuil [Sat, 20 Jun 2009 12:21:37 +0000 (09:21 -0300)]
V4L/DVB (12112): cx231xx: fix uninitialized variable.

The variable 'rc' could be used uninitialized in the cx231xx_capture_start
function. Sri informed me that it should be initialized to -1.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12111): tcm825x: remove incorrect __exit_p wrapper
Hans Verkuil [Sat, 20 Jun 2009 12:18:34 +0000 (09:18 -0300)]
V4L/DVB (12111): tcm825x: remove incorrect __exit_p wrapper

tcm825x_remove is not necessarily called on module exit, it can also be
called when the i2c_adapter is removed. While the i2c adapter might never
be removed on an embedded system, in practice this sensor driver can also
be used in e.g. a USB webcam where this is a perfectly acceptable thing
to do.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12109): radio-tea5764: fix incorrect rxsubchans value
Hans Verkuil [Sat, 20 Jun 2009 09:29:12 +0000 (06:29 -0300)]
V4L/DVB (12109): radio-tea5764: fix incorrect rxsubchans value

rxsubchans was only set when stereo was detected, otherwise it was
left to 0 instead of setting it to mono.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12108): v4l2-i2c-drv.h: add comment describing when not to use this header.
Hans Verkuil [Sun, 14 Jun 2009 10:12:11 +0000 (07:12 -0300)]
V4L/DVB (12108): v4l2-i2c-drv.h: add comment describing when not to use this header.

Make it very clear that this header should not be used for i2c drivers that
do not need to be compiled for pre-2.6.26 kernels.

As soon as the minimum supported kernel in the v4l-dvb repository becomes
2.6.26 or up, then this header should be removed entirely.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12107): smscoreapi: fix compile warning
Hans Verkuil [Sun, 14 Jun 2009 09:47:35 +0000 (06:47 -0300)]
V4L/DVB (12107): smscoreapi: fix compile warning

gcc 4.3.1 generates this warning:

v4l/smscoreapi.c: In function 'smscore_gpio_configure':
v4l/smscoreapi.c:1481: warning: 'GroupNum' may be used uninitialized in this function
v4l/smscoreapi.c:1480: warning: 'TranslatedPinNum' may be used uninitialized in this function

While in practice this will not happen, it is something that the compiler
can't determine. Initializing these two local variables to 0 suppresses
this warning.

Cc: Udi Atar <udi.linuxtv@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12104): ivtv/cx18: fix regression: class controls are no longer seen
Hans Verkuil [Sun, 14 Jun 2009 08:20:21 +0000 (05:20 -0300)]
V4L/DVB (12104): ivtv/cx18: fix regression: class controls are no longer seen

A previous change (v4l2-common: remove v4l2_ctrl_query_fill_std) broke
the handling of class controls in VIDIOC_QUERYCTRL. The MPEG class control
was broken for all drivers that use the cx2341x module and the USER class
control was broken for ivtv and cx18.

This change adds back proper class control support.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12102): em28xx: add Remote control support for EVGA inDtube
Devin Heitmueller [Sun, 21 Jun 2009 00:34:42 +0000 (21:34 -0300)]
V4L/DVB (12102): em28xx: add Remote control support for EVGA inDtube

Add an IR profile for the EVGA inDtube remote control (which is an NEC type
remote)

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12101): em28xx: add support for EVGA inDtube
Devin Heitmueller [Fri, 19 Jun 2009 03:33:54 +0000 (00:33 -0300)]
V4L/DVB (12101): em28xx: add support for EVGA inDtube

Add support for the EVGA inDtube.  Both ATSC and analog side validated as
fully functional.

Thanks to Jake Crimmins from EVGA for providing the correct GPIO info.
Thanks to Alan Hagge for doing all the device testing.
Thanks to Greg Williamson for providing hardware for testing.

Cc: Jake Crimmins <jcrimmins@evga.com>
Cc: Alan Hagge <ahagge@gmail.com>
Cc: Greg Williamson <cheeseboy16@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12100): em28xx: make sure the analog GPIOs are set if we used a card hint
Devin Heitmueller [Fri, 19 Jun 2009 03:20:28 +0000 (00:20 -0300)]
V4L/DVB (12100): em28xx: make sure the analog GPIOs are set if we used a card hint

In cases where the board had a default USB ID, we would not indentify the
board until after the call to em28xx_set_mode().  As a result, for those
boards the analog GPIOs were not being set before probing the i2c bus for
devices (the probe would occur with the GPIOs being all high).

Make a call to em28xx_set_mode() so that the GPIOs are set properly before
probing the i2c bus for devices.

This problem was detected with the EVGA inDtube, where the tvp5150 is not
powered on unless GPIO1 is pulled low.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12098): Create table for customize stv0900 ts registers.
Igor M. Liplianin [Fri, 19 Jun 2009 08:45:23 +0000 (05:45 -0300)]
V4L/DVB (12098): Create table for customize stv0900 ts registers.

Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12097): Implement reading uncorrected blocks for stv0900
Abylay Ospan [Mon, 8 Jun 2009 07:31:26 +0000 (04:31 -0300)]
V4L/DVB (12097): Implement reading uncorrected blocks for stv0900

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12096): Bug fix: stv0900 register read must using i2c in one transaction
Abylay Ospan [Sun, 14 Jun 2009 17:10:05 +0000 (14:10 -0300)]
V4L/DVB (12096): Bug fix: stv0900 register read must using i2c in one transaction

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12095): Change lnbh24 configure bits for NetUP card.
Igor M. Liplianin [Sun, 14 Jun 2009 16:17:15 +0000 (13:17 -0300)]
V4L/DVB (12095): Change lnbh24 configure bits for NetUP card.

Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12093): gspca_sonixj: Name saturation control saturation, not color
Hans de Goede [Thu, 18 Jun 2009 17:31:36 +0000 (14:31 -0300)]
V4L/DVB (12093): gspca_sonixj: Name saturation control saturation, not color

Name saturation control saturation, not color and make the default
less saturated (the old default was overdoing it).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB (12092): gspca_sonixj + ov7630: invert vflip control instead of changing...
Hans de Goede [Thu, 18 Jun 2009 17:29:20 +0000 (14:29 -0300)]
V4L/DVB (12092): gspca_sonixj + ov7630: invert vflip control instead of changing default

gspca_sonixj + ov7630 had the default value for flip enabled, as otherwise
the picture is upside down. It is better to instead invert the meaning
of the control in the set function, and have the default be no vflip,
as one would expect vflip enabled to be upside down.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>