firefly-linux-kernel-4.4.55.git
12 years agodrm/radeon: SI tiling fixes for display
Alex Deucher [Thu, 14 Jun 2012 19:58:25 +0000 (15:58 -0400)]
drm/radeon: SI tiling fixes for display

- Use the correct union for getting the tiling info
- Properly init the PIPE_CONFIG field for SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoNFS: Force the legacy idmapper to be single threaded
Bryan Schumaker [Wed, 20 Jun 2012 18:35:28 +0000 (14:35 -0400)]
NFS: Force the legacy idmapper to be single threaded

It was initially coded under the assumption that there would only be one
request at a time, so use a lock to enforce this requirement..

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
CC: stable@vger.kernel.org [3.4+]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
12 years agoMerge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
Linus Torvalds [Wed, 20 Jun 2012 16:42:09 +0000 (09:42 -0700)]
Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm

Pull ARM fixes from Russell King:
 "This includes three MMCI changes - one to fix up the wrong version of
  the DT support patch which was merged, and two to make deferred
  probing work.  It also includes a fix to the OMAP SPI driver which is
  causing a boot time warning.

  The remainder are very minor ARM fixes."

* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
  SPI: fix over-eager devm_xxx() conversion
  ARM: 7427/1: mmc: mmci: Defer probe() in case of yet uninitialized GPIOs
  ARM: 7426/1: mmc: mmci: Remove wrong error handling of gpio 0
  ARM: 7425/1: extable: ensure fixup entries are 4-byte aligned
  ARM: 7421/1: bpf_jit: BPF_S_ANC_ALU_XOR_X support
  ARM: 7423/1: kprobes: run t32_simulate_ldr_literal() without insn slot
  ARM: 7422/1: mmc: mmci: Allocate platform memory during Device Tree boot

12 years agoMerge tag 'pinctrl-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Wed, 20 Jun 2012 16:41:21 +0000 (09:41 -0700)]
Merge tag 'pinctrl-fixes' of git://git./linux/kernel/git/linusw/linux-pinctrl

Pull two pinctrl fixes from Linus Walleij:
 - Fixed a 2-line compile error for MXS
 - A pure documentation fix for Nomadik

* tag 'pinctrl-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl/nomadik: document Alt-C glitch
  pinctrl: mxs: Use kfree to fix build error

12 years agoASoC: dmaengine-pcm: Add support for querying stream position from DMA driver
Lars-Peter Clausen [Mon, 11 Jun 2012 18:11:42 +0000 (20:11 +0200)]
ASoC: dmaengine-pcm: Add support for querying stream position from DMA driver

Currently the sound dmaengine pcm helper functions implement the pcm_pointer
callback by trying to count the number of elapsed periods. This is done by
advancing the stream position in the dmaengine callback by one period.
Unfortunately there is no guarantee that the callback will be called for each
elapsed period. It may be possible that under high system load it is only called
once for multiple elapsed periods. This patch addresses the issue by
implementing support for querying the current stream position directly from the
dmaengine driver. Since not all dmaengine drivers support reporting the stream
position yet the old period counting implementation is kept for now.

Furthermore the new mechanism allows to report the stream position with a
sub-period granularity, given that the dmaengine driver supports this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: dmaengine-pcm: Rename and deprecate snd_dmaengine_pcm_pointer
Lars-Peter Clausen [Mon, 11 Jun 2012 18:11:41 +0000 (20:11 +0200)]
ASoC: dmaengine-pcm: Rename and deprecate snd_dmaengine_pcm_pointer

Currently the sound dmaengine pcm helper functions implement the pcm_pointer
callback by trying to count the number of elapsed periods. This is done by
advancing the stream position in the dmaengine callback by one period.
Unfortunately there is no guarantee that the callback will be called for each
elapsed period. It may be possible that under high system load it is only called
once for multiple elapsed periods. This patch renames the current implementation
and documents its shortcomings and that it should not be used anymore in new
drivers.

The next patch will introduce a new snd_dmaengine_pcm_pointer which will be
implemented based on querying the current stream position from the dma device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by Vinod Koul <vinod.koul@linux.intel.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agodmaengine: Add wrapper for device_tx_status callback
Lars-Peter Clausen [Mon, 11 Jun 2012 18:11:40 +0000 (20:11 +0200)]
dmaengine: Add wrapper for device_tx_status callback

This patch adds a small inline wrapper for the devivce_tx_status callback of a
dma device. This makes the source code of users of this function a bit more
compact and a bit more legible.

E.g.:
-status = chan->device->device_tx_status(chan, cookie, &state)
+status = dmaengine_tx_status(chan, cookie, &state)

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoARM: OMAP: Fix Beagleboard DVI reset gpio
Russ Dill [Wed, 9 May 2012 22:15:03 +0000 (15:15 -0700)]
ARM: OMAP: Fix Beagleboard DVI reset gpio

Commit e813a55eb9c9bc6c8039fb16332cf43402125b30 ("OMAP: board-files:
remove custom PD GPIO handling for DVI output") moved TFP410 chip's
powerdown-gpio handling from the board files to the tfp410 driver. One
gpio_request_one(powerdown-gpio, ...) was mistakenly left unremoved in
the Beagle board file. This causes the tfp410 driver to fail to request
the gpio on Beagle, causing the driver to fail and thus the DVI output
doesn't work.

This patch removes several boot errors from board-omap3beagle.c:

 - gpio_request: gpio--22 (DVI reset) status -22
 - Unable to get DVI reset GPIO

There is a combination of leftover code and revision confusion.
Additionally, xM support is currently a hack.

For original Beagleboard this removes the double initialization of GPIO
170, properly configures it as an output, and wraps the initialization
in an if block so that xM does not attempt to request it.

For Beagleboard xM it removes reference to GPIO 129 which was part
of rev A1 and A2 designs, but never functioned. It then properly assigns
beagle_dvi_device.reset_gpio in beagle_twl_gpio_setup and removes the
hack of initializing it high. Additionally, it uses
gpio_set_value_cansleep since this GPIO is connected through i2c.

Unfortunately, there is no way to tell the difference between xM A2 and
A3. However, GPIO 129 does not function on rev A1 and A2, and the TWL
GPIO used on A3 and beyond is not used on rev A1 and A2, there are no
problems created by this fix.

Tested on Beagleboard-xM Rev C1 and Beagleboard Rev B4.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoarm/dts: OMAP2: Fix interrupt controller binding
Jon Hunter [Wed, 13 Jun 2012 00:40:46 +0000 (19:40 -0500)]
arm/dts: OMAP2: Fix interrupt controller binding

When booting with device-tree on an OMAP2420H4, the kernel is hanging when
initialising the interrupts and following kernel dumps is seen ...

[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: at arch/arm/mach-omap2/irq.c:271 omap_intc_of_init+0x50/0xb4()
[    0.000000] unable to get intc registers
[    0.000000] Modules linked in:
[    0.000000] [<c001befc>] (unwind_backtrace+0x0/0xf4) from [<c0040c34>] (warn_slowpath_common+0x4c/0x64)
[    0.000000] [<c0040c34>] (warn_slowpath_common+0x4c/0x64) from [<c0040ce0>] (warn_slowpath_fmt+0x30/0x40)
[    0.000000] [<c0040ce0>] (warn_slowpath_fmt+0x30/0x40) from [<c066b8a4>] (omap_intc_of_init+0x50/0xb4)
[    0.000000] [<c066b8a4>] (omap_intc_of_init+0x50/0xb4) from [<c0688b70>] (of_irq_init+0x144/0x288)
[    0.000000] [<c0688b70>] (of_irq_init+0x144/0x288) from [<c0663294>] (init_IRQ+0x14/0x1c)
[    0.000000] [<c0663294>] (init_IRQ+0x14/0x1c) from [<c06607fc>] (start_kernel+0x198/0x304)
[    0.000000] [<c06607fc>] (start_kernel+0x198/0x304) from [<80008044>] (0x80008044)
[    0.000000] ---[ end trace 1b75b31a2719ed1c ]---
[    0.000000] of_irq_init: children remain, but no parents

The OMAP2 interrupt controller binding is missing the number of interrupts and
interrupt controller register address. Adding these fixes the problem.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0
Tony Lindgren [Wed, 20 Jun 2012 14:18:15 +0000 (07:18 -0700)]
ARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0

Here's one more gpio_to_irq conversion that we missed
earlier. Tested with n800 in gadget mode using USB_ETH.

Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2+: Fix MUSB ifdefs for platform init code
Tony Lindgren [Wed, 20 Jun 2012 14:18:15 +0000 (07:18 -0700)]
ARM: OMAP2+: Fix MUSB ifdefs for platform init code

Commit 62285963 (usb: musb: drop a gigantic amount of ifdeferry)
got rid of a bunch of ifdefs in the MUSB code. Looks like the
platform init code is still using these dropped defines though,
which in many cases results the board defaulting always to host
mode.

Currently the situation is that USB_MUSB_HDRC is the main
Kconfig option with additional USB_GADGET_MUSB_HDRC so only
these two should be used to select between host and OTG mode.

Fix the situation for omaps. The following users should fix the
platform init code in a similar way:

Dropped Kconfig option          Current users

USB_MUSB_OTG                    blackfin, davinci, not in Kconfigs
USB_MUSB_PERIPHERAL             davinci, not in Kconfigs
USB_MUSB_HOST                   davinci, not in Kconfigs
USB_MUSB_HDRC_HCD               blackfin, not in Kconfigs
USB_MUSB_OTG                    blackfin, not in Kconfigs

Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: linux-usb@vger.kernel.org
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agolibceph: flush msgr queue during mon_client shutdown
Sage Weil [Mon, 11 Jun 2012 03:43:56 +0000 (20:43 -0700)]
libceph: flush msgr queue during mon_client shutdown

We need to flush the msgr workqueue during mon_client shutdown to
ensure that any work affecting our embedded ceph_connection is
finished so that we can be safely destroyed.

Previously, we were flushing the work queue after osd_client
shutdown and before mon_client shutdown to ensure that any osd
connection refs to authorizers are flushed.  Remove the redundant
flush, and document in the comment that the mon_client flush is
needed to cover that case as well.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
(cherry picked from commit f3dea7edd3d449fe7a6d402c1ce56a294b985261)

12 years agorbd: Clear ceph_msg->bio_iter for retransmitted message
Yan, Zheng [Thu, 7 Jun 2012 00:35:55 +0000 (19:35 -0500)]
rbd: Clear ceph_msg->bio_iter for retransmitted message

The bug can cause NULL pointer dereference in write_partial_msg_pages

Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
Reviewed-by: Alex Elder <elder@inktank.com>
(cherry picked from commit 43643528cce60ca184fe8197efa8e8da7c89a037)

12 years agolibceph: use con get/put ops from osd_client
Sage Weil [Fri, 1 Jun 2012 03:22:18 +0000 (20:22 -0700)]
libceph: use con get/put ops from osd_client

There were a few direct calls to ceph_con_{get,put}() instead of the con
ops from osd_client.c.  This is a bug since those ops aren't defined to
be ceph_con_get/put.

This breaks refcounting on the ceph_osd structs that contain the
ceph_connections, and could lead to all manner of strangeness.

The purpose of the ->get and ->put methods in a ceph connection are
to allow the connection to indicate it has a reference to something
external to the messaging system, *not* to indicate something
external has a reference to the connection.

[elder@inktank.com: added that last sentence]

Signed-off-by: Sage Weil <sage@newdream.net>
Reviewed-by: Alex Elder <elder@inktank.com>
(cherry picked from commit 0d47766f14211a73eaf54cab234db134ece79f49)

12 years agolibceph: osd_client: don't drop reply reference too early
Alex Elder [Mon, 4 Jun 2012 19:43:32 +0000 (14:43 -0500)]
libceph: osd_client: don't drop reply reference too early

In ceph_osdc_release_request(), a reference to the r_reply message
is dropped.  But just after that, that same message is revoked if it
was in use to receive an incoming reply.  Reorder these so we are
sure we hold a reference until we're actually done with the message.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit ab8cb34a4b2f60281a4b18b1f1ad23bc2313d91b)

12 years agoceph: check PG_Private flag before accessing page->private
Yan, Zheng [Mon, 28 May 2012 06:44:30 +0000 (14:44 +0800)]
ceph: check PG_Private flag before accessing page->private

I got lots of NULL pointer dereference Oops when compiling kernel on ceph.
The bug is because the kernel page migration routine replaces some pages
in the page cache with new pages, these new pages' private can be non-zero.

Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 28c0254ede13ab575d2df5c6585ed3d4817c3e6b)

12 years agoMerge branch 'tip/perf/urgent-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Wed, 20 Jun 2012 12:26:58 +0000 (14:26 +0200)]
Merge branch 'tip/perf/urgent-2' of git://git./linux/kernel/git/rostedt/linux-trace into perf/urgent

12 years agoASoC: add i2s dai driver for bf6xx soc
Scott Jiang [Wed, 20 Jun 2012 21:00:31 +0000 (17:00 -0400)]
ASoC: add i2s dai driver for bf6xx soc

This driver enables i2s mode support on blackfin bf6xx platform.
We reuse bf5xx-i2s-pcm.c as its i2s pcm driver because it's the same
for both bf5xx and bf6xx soc.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: add sport driver for bf6xx soc
Scott Jiang [Wed, 20 Jun 2012 21:00:30 +0000 (17:00 -0400)]
ASoC: add sport driver for bf6xx soc

The SPORT(Serial Port) module on bf6xx soc has a totally different ip
comparing to bf5xx soc. An individual SPORT module consists of two
independently configurable SPORT halves with identical functionality.
Each SPORT half can be configured for either transmitter or receiver.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoMerge tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Wed, 20 Jun 2012 06:37:19 +0000 (23:37 -0700)]
Merge tag 'sound-3.5' of git://git./linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Most of changes are fairly small and driver-specific.

  A remaining regression fix for USB-audio sync pipe check, a fix for
  HD-audio power-up sequence, fixes for ASoC pxa-ssp compile issues, and
  bunch of ASoC codec and trivial fix patches."

* tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: 6fire: use NULL instead of 0 for pointer assignment
  ALSA: hda - Handle open while transitioning to D3.
  ALSA: snd-usb: make snd_usb_substream_capture_trigger static
  ALSA: snd-usb: fix sync pipe check
  ASoC: tegra+wm8903: turn of mic detect when card is removed
  ASoC: wm8996: Mark the CODEC as cache only when powering off on boot
  ASoC: wm8996: Move reset before the initial regulator disable
  ASoC: wm8996: Remove spurious regulator_bulk_free()
  ASoC: wm8904: Fix cache only management
  ASoC: wm8904: Fix GPIO and MICBIAS initialisation for regmap conversion
  ASoC: fix pxa-ssp compiling issue under mach-mmp
  ARM: MMP: add pxa910-ssp into ssp_id_table

12 years agoRDMA/cma: QP type check on received REQs should be AND not OR
Sean Hefty [Thu, 14 Jun 2012 20:49:09 +0000 (20:49 +0000)]
RDMA/cma: QP type check on received REQs should be AND not OR

Change || check to the intended && when checking the QP type in a
received connection request against the listening endpoint.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoNFS: Initialise commit_info.rpc_out when !defined(CONFIG_NFS_V4)
Trond Myklebust [Tue, 19 Jun 2012 22:38:56 +0000 (18:38 -0400)]
NFS: Initialise commit_info.rpc_out when !defined(CONFIG_NFS_V4)

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Fred Isaman <iisaman@netapp.com>
12 years agoNFS: Fix a refcounting issue in O_DIRECT
Trond Myklebust [Tue, 19 Jun 2012 17:39:14 +0000 (13:39 -0400)]
NFS: Fix a refcounting issue in O_DIRECT

In nfs_direct_write_reschedule(), the requests from nfs_scan_commit_list
have a refcount of 2, whereas the operations in
nfs_direct_write_completion_ops expect them to have a refcount of 1.

This patch adds a call to release the extra references.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Fred Isaman <iisaman@netapp.com>
12 years agoMerge tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Linus Torvalds [Tue, 19 Jun 2012 19:35:44 +0000 (12:35 -0700)]
Merge tag 'regulator-3.5' of git://git./linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "One small bug fix, plus a rename of all the ST Ericsson regulators in
  the device tree since all the device trees had been written with
  different names and some infelicities in the test proceedures meant
  that the device tree code had apparently never actually been run
  against the upstream device tree."

* tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Change db8500-prcmu match names to reflect Device Tree
  regulator: Change ab8500 match names to reflect Device Tree
  regulator: Fix the s5m8767a problem of the division by null

12 years agoNFSv4.1: Fix a race in set_pnfs_layoutdriver
Trond Myklebust [Fri, 15 Jun 2012 17:02:58 +0000 (13:02 -0400)]
NFSv4.1: Fix a race in set_pnfs_layoutdriver

The call to try_module_get() dereferences ld_type outside the
spin locks, which means that it may be pointing to garbage if
a module unload was in progress.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
12 years agoKVM: PPC: Book3S HV: Drop locks around call to kvmppc_pin_guest_page
Paul Mackerras [Fri, 1 Jun 2012 10:20:24 +0000 (20:20 +1000)]
KVM: PPC: Book3S HV: Drop locks around call to kvmppc_pin_guest_page

At the moment we call kvmppc_pin_guest_page() in kvmppc_update_vpa()
with two spinlocks held: the vcore lock and the vcpu->vpa_update_lock.
This is not good, since kvmppc_pin_guest_page() calls down_read() and
get_user_pages_fast(), both of which can sleep.  This bug was introduced
in 2e25aa5f ("KVM: PPC: Book3S HV: Make virtual processor area
registration more robust").

This arranges to drop those spinlocks before calling
kvmppc_pin_guest_page() and re-take them afterwards.  Dropping the
vcore lock in kvmppc_run_core() means we have to set the vcore_state
field to VCORE_RUNNING before we drop the lock, so that other vcpus
won't try to run this vcore.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoASoC: wm5100: Remove stubs of ASoC-level register map code
Mark Brown [Mon, 18 Jun 2012 20:09:04 +0000 (21:09 +0100)]
ASoC: wm5100: Remove stubs of ASoC-level register map code

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoARM: tegra: make tegra_cpu_reset_handler_enable() __init
Stephen Warren [Mon, 18 Jun 2012 21:01:50 +0000 (15:01 -0600)]
ARM: tegra: make tegra_cpu_reset_handler_enable() __init

This solves a section mismatch warning. I hadn't noticed this before,
because my compiler was inlining tegra_cpu_reset_handler_enable() inside
tegra_cpu_reset_handler_init(), which is already __init, but I switched
compilers and it stopped doing that.

Cc: <stable@kernel.org> # v3.4
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agoextcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()
Axel Lin [Sat, 16 Jun 2012 13:25:11 +0000 (21:25 +0800)]
extcon: max8997: Add missing kfree for info->edev in max8997_muic_remove()

extcon_dev_unregister(info->edev) doest not free info->edev, we need to call
kfree(info->edev) here.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoextcon: Set platform drvdata in gpio_extcon_probe() and fix irq leak
Axel Lin [Sat, 16 Jun 2012 03:55:18 +0000 (11:55 +0800)]
extcon: Set platform drvdata in gpio_extcon_probe() and fix irq leak

Add missing platform_set_drvdata() in gpio_extcon_probe(), otherwise calling
platform_get_drvdata in gpio_extcon_remove() returns NULL.

Also add missing free_irq call in gpio_extcon_remove().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoextcon: Fix wrong index in max8997_extcon_cable[]
Axel Lin [Sat, 16 Jun 2012 03:36:08 +0000 (11:36 +0800)]
extcon: Fix wrong index in max8997_extcon_cable[]

Currently, the index of "Dock-desk" and "Dock-card" are the same.
Thus the latter one overrides the first one.
Then we have problem when calling extcon_find_cable_index() because
edev->supported_cable[7] only matches "Dock-card".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agokmsg - kmsg_dump() fix CONFIG_PRINTK=n compilation
Kay Sievers [Mon, 18 Jun 2012 22:32:57 +0000 (00:32 +0200)]
kmsg - kmsg_dump() fix CONFIG_PRINTK=n compilation

Signed-off-by: Kay Sievers <kay@vrfy.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Reported-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agocgroups: Account for CSS_DEACT_BIAS in __css_put
Salman Qazi [Thu, 14 Jun 2012 21:55:30 +0000 (14:55 -0700)]
cgroups: Account for CSS_DEACT_BIAS in __css_put

When we fixed the race between atomic_dec and css_refcnt, we missed
the fact that css_refcnt internally subtracts CSS_DEACT_BIAS to get
the actual reference count.  This can potentially cause a refcount leak
if __css_put races with cgroup_clear_css_refs.

Signed-off-by: Salman Qazi <sqazi@google.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac
Linus Torvalds [Mon, 18 Jun 2012 20:34:25 +0000 (13:34 -0700)]
Merge git://git./linux/kernel/git/mchehab/linux-edac

Pull EDAC fixes from Mauro Carvalho Chehab.

* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac:
  edac: Do alignment logic properly in edac_align_ptr()
  mpc85xx_edac: fix error: too few arguments to function 'edac_mc_alloc'
  edac: fix the error about memory type detection on SandyBridge
  edac: avoid mce decoding crash after edac driver unloaded

12 years agoMerge branch 'v9fs-devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
Linus Torvalds [Mon, 18 Jun 2012 19:21:25 +0000 (12:21 -0700)]
Merge branch 'v9fs-devel' of git://git./linux/kernel/git/ericvh/v9fs

Pull a 9p bugfix from Eric Van Hensbergen.

* 'v9fs-devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  9p: BUG before corrupting memory

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Mon, 18 Jun 2012 19:20:36 +0000 (12:20 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

Pull a crypto fix from Herbert Xu:
 "This push fixes another bug in the atmel-rng that made it produce
  completely useless output."

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  hwrng: atmel-rng - fix data valid check

12 years agoMerge tag 'mmc-fixes-for-3.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 18 Jun 2012 18:53:34 +0000 (11:53 -0700)]
Merge tag 'mmc-fixes-for-3.5-rc4' of git://git./linux/kernel/git/cjb/mmc

Pull MMC fixes from Chris Ball:
 - atmel-mci: Fixes for NULL timer and DMA burst/chunk size
 - dw_mmc: Fix DMA ordering, clkdiv calculation, NULL host->data
 - mxs_mmc: Compile fix for CONFIG_OF=y && CONFIG_PM=n
 - omap: Fix NULL deref in mmc_omap_remove_slot(), reg_shift initialization
 - sdhci-s3c: Fix boot regression by adding IRQF_ONESHOT flag
 - Small fixes to core/sd, core/sdio, sdhci

* tag 'mmc-fixes-for-3.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: mxs-mmc: Move of_match_table out of CONFIG_PM
  mmc: sdhci-s3c: pass IRQF ONESHOT to request threaded irq
  mmc: core: return an error on suspend if mmc_deselect_cards fails
  mmc: omap: Fix broken reg_shift initialization
  mmc: omap: Fix NULL pointer dereference if mmc_omap_new_slot() fails
  mmc: omap: Fix a section warning regression
  mmc: dw_mmc: correct the calculation for CLKDIV
  mmc: dw_mmc: fix incorrect setting of host->data of NULL
  mmc: dw_mmc: fix the IDMAC sw reset
  mmc: dw_mmc: fix the transmission handling in IDMAC
  mmc: sdio: fix setting card data bus width as 4-bit
  mmc: atmel-mci: fix burst/chunk size modification
  mmc: atmel-mci: fix data timeout issue
  mmc: sdhci: Use DBG() instead of pr_warning() on large timeout

12 years agoMerge tag 'rproc-fixes-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 18 Jun 2012 18:52:25 +0000 (11:52 -0700)]
Merge tag 'rproc-fixes-for-3.5' of git://git./linux/kernel/git/ohad/remoteproc

Pull remoteproc fixes from Ohad Ben-Cohen:
 "A few relatively-small remoteproc fixes for 3.5: two error path fixes,
  and one -Wformat warning fix."

* tag 'rproc-fixes-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
  remoteproc/omap: fix dev_err typo
  remoteproc: fix missing fault indication in error-path
  remoteproc: fix print format warnings

12 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
Linus Torvalds [Mon, 18 Jun 2012 18:51:10 +0000 (11:51 -0700)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/jdelvare/staging

Pull hwmon subsystem fixes from Jean Delvare.

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (coretemp) Drop needless initialization
  hwmon: (coretemp) Document TjMax for 3rd generation i5/i7 processors
  hwmon: (coretemp) Improve support for TjMax detection on Atom CPUs
  hwmon: (coretemp) Add support for Atom D2000 and N2000 series CPU models
  hwmon: (coretemp) Improve support of recent Atom CPU models

12 years agobug.h: Fix up powerpc build regression.
Paul Mundt [Mon, 18 Jun 2012 04:54:17 +0000 (13:54 +0900)]
bug.h: Fix up powerpc build regression.

The asm-generic/bug.h __ASSEMBLY__ guarding is completely bogus, which
tripped up the powerpc build when the kernel.h include was added:

In file included from include/asm-generic/bug.h:5:0,
 from arch/powerpc/include/asm/bug.h:127,
 from arch/powerpc/kernel/head_64.S:31:
include/linux/kernel.h:44:0: warning: "ALIGN" redefined [enabled by default]
include/linux/linkage.h:57:0: note: this is the location of the previous definition
include/linux/sysinfo.h: Assembler messages:
include/linux/sysinfo.h:7: Error: Unrecognized opcode: `struct'
include/linux/sysinfo.h:8: Error: Unrecognized opcode: `__kernel_long_t'

Moving the __ASSEMBLY__ guard up and stashing the kernel.h include under
it fixes this up, as well as covering the case the original fix was
attempting to handle.

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMakefile: fix up CROSS_COMPILE and READABLE_ASM interaction.
Paul Mundt [Mon, 18 Jun 2012 04:48:08 +0000 (13:48 +0900)]
Makefile: fix up CROSS_COMPILE and READABLE_ASM interaction.

When the READABLE_ASM cc-option tests were added they were done so prior
to the arch Makefile include, resulting in cc-option being run on the
host cc instead of the factoring in the cross prefix set up by the
architecture.

This bumps the include back up so that cc-option actually runs on the
compiler that we're building with.

Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agohwmon: (emc2103) Fix use of an uninitilized variable in error case
Guenter Roeck [Sat, 2 Jun 2012 17:16:32 +0000 (10:16 -0700)]
hwmon: (emc2103) Fix use of an uninitilized variable in error case

Fix:

emc2103.c: In function set_pwm_enable:
emc2103.c:463:12: warning: conf_reg may be used uninitialized in this function

by checking the return value from read_u8_from_i2c(). This fixes a real problem,
as conf_reg is really uninitialized if read_u8_from_i2c returns an error.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (applesmc) Limit key length in warning messages
Henrik Rydberg [Thu, 7 Jun 2012 08:54:29 +0000 (04:54 -0400)]
hwmon: (applesmc) Limit key length in warning messages

Key lookups may call read_smc() with a fixed-length key string,
and if the lookup fails, trailing stack content may appear in the
kernel log. Fixed with this patch.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 years agoftrace: Make all inline tags also include notrace
Steven Rostedt [Thu, 14 Jun 2012 14:54:28 +0000 (10:54 -0400)]
ftrace: Make all inline tags also include notrace

Commit 5963e317b1e9d2a ("ftrace/x86: Do not change stacks in DEBUG when
calling lockdep") prevented lockdep calls from the int3 breakpoint handler
from reseting the stack if a function that was called was in the process
of being converted for tracing and had a breakpoint on it. The idea is,
before calling the lockdep code, do a load_idt() to the special IDT that
kept the breakpoint stack from reseting. This worked well as a quick fix
for this kernel release, until a certain config caused a lockup in the
function tracer start up tests.

Investigating it, I found that the load_idt that was used to prevent
the int3 from changing stacks was itself being traced!

Even though the config had CONFIG_OPTIMIZE_INLINING disabled, and
all 'inline' tags were set to always inline, there were still cases that
it did not inline! This was caused by CONFIG_PARAVIRT_GUEST, where it
would add a pointer to the native_load_idt() which made that function
to be traced.

Commit 45959ee7aa645815a ("ftrace: Do not function trace inlined functions")
only touched the 'inline' tags when CONFIG_OPMITIZE_INLINING was enabled.
PARAVIRT_GUEST shows that this was not enough and we need to also
mark always_inline with notrace as well.

Reported-by: Fengguang Wu <wfg@linux.intel.com>
Tested-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
12 years agoNFSv4.1: Fix umount when filelayout DS is also the MDS
Trond Myklebust [Thu, 14 Jun 2012 17:08:38 +0000 (13:08 -0400)]
NFSv4.1: Fix umount when filelayout DS is also the MDS

Currently there is a 'chicken and egg' issue when the DS is also the mounted
MDS. The nfs_match_client() reference from nfs4_set_ds_client bumps the
cl_count, the nfs_client is not freed at umount, and nfs4_deviceid_purge_client
is not called to dereference the MDS usage of a deviceid which holds a
reference to the DS nfs_client.  The result is the umount program returns,
but the nfs_client is not freed, and the cl_session hearbeat continues.

The MDS (and all other nfs mounts) lose their last nfs_client reference in
nfs_free_server when the last nfs_server (fsid) is umounted.
The file layout DS lose their last nfs_client reference in destroy_ds
when the last deviceid referencing the data server is put and destroy_ds is
called. This is triggered by a call to nfs4_deviceid_purge_client which
removes references to a pNFS deviceid used by an MDS mount.

The fix is to track how many pnfs enabled filesystems are mounted from
this server, and then to purge the device id cache once that count reaches
zero.

Reported-by: Jorge Mora <Jorge.Mora@netapp.com>
Reported-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
12 years agoSPI: fix over-eager devm_xxx() conversion
Russell King [Mon, 18 Jun 2012 10:27:04 +0000 (11:27 +0100)]
SPI: fix over-eager devm_xxx() conversion

1a77b127ae (OMAP : SPI : use devm_* functions) converted the SPI
device controller state to use devm_kzalloc().  Unfortunately, this
is used against an unbound struct device, which results in the
following when the device is bound to its driver:

------------[ cut here ]------------
WARNING: at /home/rmk/git/linux-rmk/drivers/base/dd.c:257 driver_probe_device+0x78/0x21c()
Modules linked in:
Backtrace:
[<c0017d0c>] (dump_backtrace+0x0/0x10c) from [<c033e208>] (dump_stack+0x18/0x1c) r7:00000000 r6:c01ff28c r5:c040050c r4:00000101
[<c033e1f0>] (dump_stack+0x0/0x1c) from [<c00337ec>] (warn_slowpath_common+0x58/0x70)
[<c0033794>] (warn_slowpath_common+0x0/0x70) from [<c0033828>] (warn_slowpath_null+0x24/0x2c)
[<c0033804>] (warn_slowpath_null+0x0/0x2c) from [<c01ff28c>] (driver_probe_device+0x78/0x21c)
[<c01ff214>] (driver_probe_device+0x0/0x21c) from [<c01ff49c>] (__driver_attach+0x6c/0x90)
[<c01ff430>] (__driver_attach+0x0/0x90) from [<c01fda70>] (bus_for_each_dev+0x58/0x98)
[<c01fda18>] (bus_for_each_dev+0x0/0x98) from [<c01ff0f4>] (driver_attach+0x20/0x28)
[<c01ff0d4>] (driver_attach+0x0/0x28) from [<c01fe2f4>] (bus_add_driver+0xb4/0x230)
[<c01fe240>] (bus_add_driver+0x0/0x230) from [<c01ffb24>] (driver_register+0xac/0x138)
[<c01ffa78>] (driver_register+0x0/0x138) from [<c0215d4c>] (spi_register_driver+0x4c/0x60)
[<c0215d00>] (spi_register_driver+0x0/0x60) from [<c045414c>] (ks8851_init+0x14/0x1c)
[<c0454138>] (ks8851_init+0x0/0x1c) from [<c0008770>] (do_one_initcall+0x9c/0x164)
[<c00086d4>] (do_one_initcall+0x0/0x164) from [<c0436410>] (kernel_init+0x128/0x210)
[<c04362e8>] (kernel_init+0x0/0x210) from [<c0038754>] (do_exit+0x0/0x72c)
---[ end trace 4dcda79f5e89dd84 ]---
ks8851 spi1.0: message enable is 0
ks8851 spi1.0: eth0: revision 0, MAC 08:00:28:01:4d:c6, IRQ 194, has EEPROM

Fix this by partially reverting the original commit.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoperf: Use css_tryget() to avoid propping up css refcount
Salman Qazi [Thu, 14 Jun 2012 22:31:09 +0000 (15:31 -0700)]
perf: Use css_tryget() to avoid propping up css refcount

An rmdir pushes css's ref count to zero.  However, if the associated
directory is open at the time, the dentry ref count is non-zero.  If
the fd for this directory is then passed into perf_event_open, it
does a css_get().  This bounces the ref count back up from zero.  This
is a problem by itself.  But what makes it turn into a crash is the
fact that we end up doing an extra dput, since we perform a dput
when css_put sees the ref count go down to zero.

css_tryget() does not fall into that trap. So, we use that instead.

Reproduction test-case for the bug:

 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <linux/unistd.h>
 #include <linux/perf_event.h>
 #include <string.h>
 #include <errno.h>
 #include <stdio.h>

 #define PERF_FLAG_PID_CGROUP    (1U << 2)

 int perf_event_open(struct perf_event_attr *hw_event_uptr,
                     pid_t pid, int cpu, int group_fd, unsigned long flags) {
         return syscall(__NR_perf_event_open,hw_event_uptr, pid, cpu,
                 group_fd, flags);
 }

 /*
  * Directly poke at the perf_event bug, since it's proving hard to repro
  * depending on where in the kernel tree.  what moved?
  */
 int main(int argc, char **argv)
 {
        int fd;
        struct perf_event_attr attr;
        memset(&attr, 0, sizeof(attr));
        attr.exclude_kernel = 1;
        attr.size = sizeof(attr);
        mkdir("/dev/cgroup/perf_event/blah", 0777);
        fd = open("/dev/cgroup/perf_event/blah", O_RDONLY);
        perror("open");
        rmdir("/dev/cgroup/perf_event/blah");
        sleep(2);
        perf_event_open(&attr, fd, 0, -1,  PERF_FLAG_PID_CGROUP);
        perror("perf_event_open");
        close(fd);
        return 0;
 }

Signed-off-by: Salman Qazi <sqazi@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/20120614223108.1025.2503.stgit@dungbeetle.mtv.corp.google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
12 years agoALSA: 6fire: use NULL instead of 0 for pointer assignment
Daniel Mack [Sat, 16 Jun 2012 14:58:36 +0000 (16:58 +0200)]
ALSA: 6fire: use NULL instead of 0 for pointer assignment

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Torsten Schenk <torsten.schenk@zoho.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Handle open while transitioning to D3.
Dylan Reid [Sat, 16 Jun 2012 02:36:23 +0000 (19:36 -0700)]
ALSA: hda - Handle open while transitioning to D3.

This addresses an issue encountered when a pcm is opened while
transitioning to low power state (codec->power_on == 1 &&
codec->power_transition == -1).  Add snd_pcm_power_up_d3wait to
hda_codec.  This function is used to power up from azx_open as opposed
to snd_hda_power_up used from codec_exec_verb. When powering up from
azx_open, wait for pending power downs to complete, avoiding the power
up continuing in parallel with the power down on the work queue.

The specific issue seen was with the CS4210 codec, it powers off the ADC
and DAC nid in its suspend handler.  If it is re-opened before the
~100ms power down process completes, the ADC and DAC nid are initialized
while powered down and audio is lost until another suspend/resume cycle.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: snd-usb: make snd_usb_substream_capture_trigger static
Daniel Mack [Sat, 16 Jun 2012 14:58:04 +0000 (16:58 +0200)]
ALSA: snd-usb: make snd_usb_substream_capture_trigger static

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: snd-usb: fix sync pipe check
Daniel Mack [Sun, 17 Jun 2012 11:44:27 +0000 (13:44 +0200)]
ALSA: snd-usb: fix sync pipe check

Fix a bogus sanity check for sync pipe in pcm.c. This flaw was
introduced during the streaming logic refactorization.

While at it, improve the error messages that are generated in such cases.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: <ben@b1c1l1.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge tag 'asoc-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound...
Takashi Iwai [Mon, 18 Jun 2012 06:36:00 +0000 (08:36 +0200)]
Merge tag 'asoc-3.5' of git://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for 3.5

All driver specific and fairly small.  The pxa-ssp changes are larger
than I'd like but they're build failures and are pretty clear to
inspection.

12 years agoMerge branch 'hfsplus'
Linus Torvalds [Sun, 17 Jun 2012 21:40:35 +0000 (14:40 -0700)]
Merge branch 'hfsplus'

Merge hfsplus fixes from Christoph Hellwig:
 "Two small hfsplus fixes:

   - a one liner regression fix for large volume handling from Janne
     Kalliomäki.
   - a fixup for the boot image blessing feature to make it work with
     the fake "hardlinks" in hfsplus from Matthew Garrett."

* branch 'hfsplus':
  hfsplus: fix bless ioctl when used with hardlinks
  hfsplus: fix overflow in sector calculations in hfsplus_submit_bio

12 years agohfsplus: fix bless ioctl when used with hardlinks
Matthew Garrett [Sun, 17 Jun 2012 21:05:25 +0000 (17:05 -0400)]
hfsplus: fix bless ioctl when used with hardlinks

HFS+ doesn't really implement hard links - instead, hardlinks are indicated
by a magic file type which refers to an indirect node in a hidden
directory. The spec indicates that stat() should return the inode number
of the indirect node, but it turns out that this doesn't satisfy the
firmware when it's looking for a bootloader - it wants the catalog ID of
the hardlink file instead. Fix up this case.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agohfsplus: fix overflow in sector calculations in hfsplus_submit_bio
Janne Kalliomäki [Sun, 17 Jun 2012 21:05:24 +0000 (17:05 -0400)]
hfsplus: fix overflow in sector calculations in hfsplus_submit_bio

The variable io_size was unsigned int, which caused the wrong sector number
to be calculated after aligning it. This then caused mount to fail with big
volumes, as backup volume header information was searched from a
wrong sector.

Signed-off-by: Janne Kalliomäki <janne@tuxera.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoARM: 7427/1: mmc: mmci: Defer probe() in case of yet uninitialized GPIOs
Roland Stigge [Sun, 17 Jun 2012 20:14:27 +0000 (21:14 +0100)]
ARM: 7427/1: mmc: mmci: Defer probe() in case of yet uninitialized GPIOs

If the GPIOs used by the MMCI driver are not registered yet when the driver is
probe()d, they can't be used. This happens if the mmci driver is probed before
the respective GPIO controller (e.g. on the LPC32xx EA3250 board, the PCA9532
GPIO controller would be initialized via DT after mmci). Therefore, we defer
mmci in this case.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7426/1: mmc: mmci: Remove wrong error handling of gpio 0
Roland Stigge [Sun, 17 Jun 2012 20:13:34 +0000 (21:13 +0100)]
ARM: 7426/1: mmc: mmci: Remove wrong error handling of gpio 0

Zero is a valid GPIO and shouldn't be handled as an error return code from
of_get_named_gpio(). It was a leftover from old code before getting
pdata->gpio_*() was modified.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoASoC: Ux500: unlock on an error path
Dan Carpenter [Sat, 16 Jun 2012 13:19:27 +0000 (16:19 +0300)]
ASoC: Ux500: unlock on an error path

There is a missing mutex_unlock() here.  The cleanup path also has more
debug output.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: Ux500: Add machine-driver
Ola Lilja [Tue, 12 Jun 2012 06:50:08 +0000 (08:50 +0200)]
ASoC: Ux500: Add machine-driver

Add machine-driver for ST-Ericsson U8500 platform, including
support for the AB8500-codec.

Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoARM: OMAP: PM: Lock clocks list while generating summary
Todd Poynor [Sun, 17 Jun 2012 17:57:50 +0000 (11:57 -0600)]
ARM: OMAP: PM: Lock clocks list while generating summary

Commit a53025724052b2b1edbc982a4a248784638f563d (OMAP: Add debugfs
node to show the summary of all clocks) introduced clock summary,
however, we are interested in seeing snapshot of the clock state, not
in dynamically changing clock configurations as the data provided by
clock summary will then be useless for debugging configuration
issues. So, hold the common lock when dumping the clock summary.

Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
[nm@ti.com: added commit message]
Signed-off-by: Nishanth Menon <nm@ti.com>
[paul@pwsan.com: minor edits to commit message]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
12 years agoARM: iconnect: Remove include of removed linux/spi/orion_spi.h
Andrew Lunn [Fri, 8 Jun 2012 09:36:45 +0000 (11:36 +0200)]
ARM: iconnect: Remove include of removed linux/spi/orion_spi.h

v3.5-rc1 fails to build when DT and iconnect is enabled because of
this now none existant include file.

Also remove the other two SPI include files, which are not needed
with the move to DT.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agopinctrl/nomadik: document Alt-C glitch
Linus Walleij [Tue, 22 May 2012 09:46:45 +0000 (11:46 +0200)]
pinctrl/nomadik: document Alt-C glitch

This documentation comment existed in an earlier patch set for
GPIO consolidation, so I'm saving it for maintainability of the
code.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agopinctrl: mxs: Use kfree to fix build error
Fabio Estevam [Wed, 13 Jun 2012 17:06:07 +0000 (14:06 -0300)]
pinctrl: mxs: Use kfree to fix build error

commit 0bf7481 (pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails)
introduced the following build error:

drivers/pinctrl/pinctrl-mxs.c:140:3: error: implicit declaration of function 'free'

Use kfree function instead.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agoregulator: Change db8500-prcmu match names to reflect Device Tree
Lee Jones [Wed, 30 May 2012 04:47:27 +0000 (12:47 +0800)]
regulator: Change db8500-prcmu match names to reflect Device Tree

The 'name' field in 'struct of_regulator_match' expects to match with
its corresponding regulator device node in the Device Tree. This patch
renames each of the regulators in the db8500-prcum regulator driver so
this is true.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoregulator: Change ab8500 match names to reflect Device Tree
Lee Jones [Wed, 30 May 2012 04:47:26 +0000 (12:47 +0800)]
regulator: Change ab8500 match names to reflect Device Tree

The 'name' field in 'struct of_regulator_match' expects to match with
its corresponding regulator device node in the Device Tree. This patch
renames each of the regulators in the ab8500 regulator driver so this
is true.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoregulator: Fix the s5m8767a problem of the division by null
Sangbeom Kim [Wed, 13 Jun 2012 08:27:16 +0000 (17:27 +0900)]
regulator: Fix the s5m8767a problem of the division by null

If ramp_delay is 0, delay value can be divided by zero.
This patch can fix the problem.

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agohwmon: (coretemp) Drop needless initialization
Jean Delvare [Sun, 17 Jun 2012 16:05:06 +0000 (18:05 +0200)]
hwmon: (coretemp) Drop needless initialization

The value is overridden a few lines later.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: (coretemp) Document TjMax for 3rd generation i5/i7 processors
Guenter Roeck [Sun, 17 Jun 2012 16:05:06 +0000 (18:05 +0200)]
hwmon: (coretemp) Document TjMax for 3rd generation i5/i7 processors

Tjmax values from Intel datasheets.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (coretemp) Improve support for TjMax detection on Atom CPUs
Guenter Roeck [Sun, 17 Jun 2012 16:05:05 +0000 (18:05 +0200)]
hwmon: (coretemp) Improve support for TjMax detection on Atom CPUs

Atom CPUs don't have a register to retrieve TjMax. Detection so far was
incomplete. Use the X86 model ID to improve it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (coretemp) Add support for Atom D2000 and N2000 series CPU models
Guenter Roeck [Sun, 17 Jun 2012 16:05:05 +0000 (18:05 +0200)]
hwmon: (coretemp) Add support for Atom D2000 and N2000 series CPU models

Document the Atom series D2000 and N2000 (Cedar Trail) as being supported.
List and set TjMax for those series.

Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (coretemp) Improve support of recent Atom CPU models
Jean Delvare [Sun, 17 Jun 2012 16:05:05 +0000 (18:05 +0200)]
hwmon: (coretemp) Improve support of recent Atom CPU models

Document the new Atom series (Tunnel Creek and Medfield) as being
supported, and list TjMax for the Atom E600 series.

Also enable the Atom tjmax heuristic for these Atom CPU models.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
12 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sun, 17 Jun 2012 08:44:41 +0000 (01:44 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Radeon is most of the work, one regression, one BUG fix in the new
  prime code, some fixes to init code to make streamout not lock up the
  hardware, and just some code to enable users to test HDMI audio on
  later hw (its off by default).

  Intel adds edp edid caching for some strange Dell Vostros that black
  screen on startup if keep reading their EDID, and a fix for a DP
  regression.

  Otherwise fix for via/sis and one to stop udl binding to multiple
  non-video usb."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/i915: cache the EDID for eDP panels
  Revert "drm/i915/dp: Use auxch precharge value of 5 everywhere"
  drm/i915: eDP aux needs vdd
  drm/i915: don't enumerate HDMID if an eDP panel is already active on the port
  drm/radeon: add support for STRMOUT_BASE_UPDATE on 7xx
  drm/radeon: add some additional 6xx/7xx/EG register init
  drm/radeon: enable HDMI on DCE5 (AKA NI excluding Aruba)
  drm sis: initialize object_idr
  drm via: initialize object_idr
  drm/radeon/prime: reserve/unreserve around pin
  drm/radeon: fix regression in dynpm due to multi-ring rework
  vga_switcheroo.h: fix pci_dev warning
  drm/udl: only bind to the video devices on the hub.

12 years agoremoteproc/omap: fix dev_err typo
Ohad Ben-Cohen [Mon, 21 May 2012 13:31:12 +0000 (16:31 +0300)]
remoteproc/omap: fix dev_err typo

For some reason one of the dev_err invocations is using a wrong
device so fix that.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Cc: stable@vger.kernel.org
12 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sun, 17 Jun 2012 07:20:47 +0000 (00:20 -0700)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "A bit larger set than usual, unfortunately -- I've been sitting on
  them longer than I meant to so it's really more like 2 -rc pull
  requests in one, volume-wise.

  Nearly everything is fixes for fallout from the merge window, or other
  fixes for bugs.  The one exception is the highbank L2-enablement
  patch, but it was contained enough that I picked it up anyway:

   - i.MX fixes, mostly for clock and pinctrl changes
   - OMAP fixes, mostly PM-related
   - A patch to enable L2 on highbank
   - A couple of fixes for PXA, Kirkwood, Versatile"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (30 commits)
  ARM: Kirkwood: Fix clk problems modular ethernet driver
  arm: versatile: fix and enable PCI I/O space
  ARM: highbank: Add smc calls to enable/disable the L2
  ARM i.MX imx21ads: Fix overlapping static i/o mappings
  ARM: imx6: exit coherency when shutting down a cpu
  ARM: mx51: Add pinctrl_provide_dummies()
  ARM: mx31: Add pinctrl_provide_dummies()
  ARM: OMAP2+: Fix compile for CONFIG_TIDSPBRIDGE platform init code
  ARM: OMAP3: Fix omap3_l3_block_irq warning when CONFIG_BUG is not set
  ARM: OMAP: Fix MMC_OMAP build when only MMC_OMAP_HS is selected
  OMAP2+: UART: Add mechanism to probe uart pins and configure rx wakeup
  ARM: mmp: fix missing cascade_irq in irq handler
  ARM: dts: update memory size on brownstone
  ARM i.MX27 Visstrim M10: fix gpio handling.
  ARM i.MX53: Fix PLL4 base address
  ARM i.MX pllv2: make round_rate accurate
  ARM i.MX pllv2: use standard register set unconditionally
  ARM: OMAP: Fix lis3lv02d accelerometer to use gpio_to_irq
  ARM: imx: only call l2x0_init if it's available
  ARM: imx: only specify i2c device type once
  ...

12 years agoARM: Kirkwood: Fix clk problems modular ethernet driver
Andrew Lunn [Wed, 13 Jun 2012 12:52:45 +0000 (14:52 +0200)]
ARM: Kirkwood: Fix clk problems modular ethernet driver

When the ethernet driver was built as a module, it would lock the
machine when loaded. At boot the ethernet clks are unused, so get
turned off.  Later, when the module is loaded, the probe function
would access the hardware before the clock was restarted, and the
machine would lock. It has also been determined that when the clk is
turned off, the interface forgets its MAC address, which for most
systems, is set by the boot loader.

When the machine setup file creates a platform device for the
interface, prepare and enable the clock for the interface. This will
ensure it is not turned off. However, if the setup file only
instantiates one platform device, the other will have its clk
disabled, thus maybe saving a little power.

Report-by: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agoarm: versatile: fix and enable PCI I/O space
Arnd Bergmann [Mon, 11 Jun 2012 14:03:58 +0000 (09:03 -0500)]
arm: versatile: fix and enable PCI I/O space

With commit 4d5fc58dbe34b (ARM: remove bunch of now unused
mach/io.h files), the I/O space setup was completely broken on
versatile. This patch fixes that and prepares for further
I/O space clean-up.

I/O space handling on the versatile platform is currently
broken in multiple ways. Most importantly, the ports do
not get mapped into the virtual address space at all.

Also, there is some amount of confusion between PCI I/O
space and other statically mapped MMIO registers in the
platform code:

* The __io_address() macro that is used to access the
  platform register maps to the same __io macro that gets
  used for I/O space.

* The IO_SPACE_LIMIT is set to a value that is much larger
  than the total available space.

* The I/O resource of the PCI bus is set to the physical
  address of the mapping, which is way outside of the
  actual I/O space limit as well as the address range that
  gets decoded by traditional PCI cards.

* No attempt is made to stay outside of the ISA port range
  that some device drivers try access.

* No resource gets requested as a child of ioport_resource,
  but an IORESOURCE_IO type mapping gets requested
  as a child of iomem_resource.

This patch attempts to correct all of the above. This makes
it possible to use virtio-pci based virtual devices as well
as actual PCI cards including those with legacy ISA port
ranges like VGA.

Some of the issues seem to be duplicated on other platforms.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[rob: update to 3.5-rc2 and io.h cleanup related changes]
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Tested-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agoMerge branch 'fixes' of git://github.com/hzhuang1/linux into fixes
Olof Johansson [Sun, 17 Jun 2012 01:36:52 +0000 (18:36 -0700)]
Merge branch 'fixes' of git://github.com/hzhuang1/linux into fixes

* 'fixes' of git://github.com/hzhuang1/linux:
  ARM: mmp: fix missing cascade_irq in irq handler
  ARM: dts: update memory size on brownstone

12 years agoLinux 3.5-rc3
Linus Torvalds [Sun, 17 Jun 2012 00:25:17 +0000 (17:25 -0700)]
Linux 3.5-rc3

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
Linus Torvalds [Sun, 17 Jun 2012 00:01:41 +0000 (17:01 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs compile warning fixes from Chris Mason.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: cast devid to unsigned long long for printk %llu
  Btrfs: init old_generation in get_old_root

12 years agoMerge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux...
Linus Torvalds [Sun, 17 Jun 2012 00:00:15 +0000 (17:00 -0700)]
Merge branch 'stable' of git://git./linux/kernel/git/cmetcalf/linux-tile

Pull arch/tile update from Chris Metcalf:
 "This one-line bug fix unbreaks glibc robust mutexes (among other
  things no doubt), from code merged in during the 3.5 merge window but
  which we had been running internally at Tilera for almost a year."

* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  tile: fix bug in get_user() for 4-byte values

12 years agoMerge tag 'fbdev-fixes-for-3.5-1' of git://github.com/schandinat/linux-2.6
Linus Torvalds [Sat, 16 Jun 2012 23:59:05 +0000 (16:59 -0700)]
Merge tag 'fbdev-fixes-for-3.5-1' of git://github.com/schandinat/linux-2.6

Pull fbdev fixes from Florian Tobias Schandinat:

 - two fixes for s3c-fb by Jingoo Han (including a fix for a potential
   division by zero)

 - a couple of randconfig fixes by Arnd Bergmann

 - a cleanup for bfin_adv7393fb by Emil Goode

* tag 'fbdev-fixes-for-3.5-1' of git://github.com/schandinat/linux-2.6:
  video: s3c-fb: fix possible division by zero in s3c_fb_calc_pixclk
  video: s3c-fb: clear SHADOWCON register when clearing hardware window registers
  drivers/tosa: driver needs I2C and SPI to compile
  drivers/savagefb: use mdelay instead of udelay
  video/console: automatically select a font
  video/ili9320: do not mark exported functions __devexit
  drivers/video: use correct __devexit_p annotation
  video: bfin_adv7393fb: Convert to kstrtouint_from_user

12 years agotile: fix bug in get_user() for 4-byte values
Chris Metcalf [Sat, 16 Jun 2012 20:53:06 +0000 (16:53 -0400)]
tile: fix bug in get_user() for 4-byte values

The definition of 32-bit values in the 64-bit tilegx architecture is that
they should be sign-extended regardless of whether they are considered
signed or unsigned by the compiler.  Accordingly, we need to use an
"ld4s" rather than "ld4u" to load and sign-extend for get_user().

This fixes glibc bug 14238 (see http://sourceware.org/bugzilla),
introduced during the 3.5 merge window.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
12 years agoprintk: return -EINVAL if the message len is bigger than the buf size
Yuanhan Liu [Sat, 16 Jun 2012 04:40:55 +0000 (12:40 +0800)]
printk: return -EINVAL if the message len is bigger than the buf size

Just like what devkmsg_read() does, return -EINVAL if the message len is
bigger than the buf size, or it will trigger a segfault error.

Acked-by: Kay Sievers <kay@vrfy.org>
Acked-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoprintk: use mutex lock to stop syslog_seq from going wild
Yuanhan Liu [Sat, 16 Jun 2012 13:21:51 +0000 (21:21 +0800)]
printk: use mutex lock to stop syslog_seq from going wild

Although syslog_seq and log_next_seq stuff are protected by logbuf_lock
spin log, it's not enough. Say we have two processes A and B, and let
syslog_seq = N, while log_next_seq = N + 1, and the two processes both
come to syslog_print at almost the same time. And No matter which
process get the spin lock first, it will increase syslog_seq by one,
then release spin lock; thus later, another process increase syslog_seq
by one again. In this case, syslog_seq is bigger than syslog_next_seq.
And latter, it would make:
   wait_event_interruptiable(log_wait, syslog != log_next_seq)
don't wait any more even there is no new write comes. Thus it introduce
a infinite loop reading.

I can easily see this kind of issue by the following steps:
  # cat /proc/kmsg # at meantime, I don't kill rsyslog
                   # So they are the two processes.
  # xinit          # I added drm.debug=6 in the kernel parameter line,
                   # so that it will produce lots of message and let that
                   # issue happen

It's 100% reproducable on my side. And my disk will be filled up by
/var/log/messages in a quite short time.

So, introduce a mutex_lock to stop syslog_seq from going wild just like
what devkmsg_read() does. It does fix this issue as expected.

v2: use mutex_lock_interruptiable() instead (comments from Kay)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-By: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoARM: 7425/1: extable: ensure fixup entries are 4-byte aligned
Will Deacon [Fri, 15 Jun 2012 15:49:58 +0000 (16:49 +0100)]
ARM: 7425/1: extable: ensure fixup entries are 4-byte aligned

Fixup entries in the kernel exception tables should be 4-byte aligned
since we return directly to them when handling a faulting instruction in
the kernel.

This patch adds the missing align directives to the fixup entries.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoMerge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel...
Dave Airlie [Sat, 16 Jun 2012 13:45:17 +0000 (14:45 +0100)]
Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes

* 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: cache the EDID for eDP panels
  Revert "drm/i915/dp: Use auxch precharge value of 5 everywhere"
  drm/i915: eDP aux needs vdd
  drm/i915: don't enumerate HDMID if an eDP panel is already active on the port

12 years agodrm/i915: cache the EDID for eDP panels
Jesse Barnes [Thu, 14 Jun 2012 19:28:33 +0000 (15:28 -0400)]
drm/i915: cache the EDID for eDP panels

They aren't going anywhere, and probing on DDC can cause the panel to
blank briefly, so read them up front and cache them for later queries.

v2: fix potential NULL derefs in intel_dp_get_edid_modes and
    intel_dp_get_edid (Jani)
    copy full EDID length, including extension blocks (Takashi)
    free EDID on teardown (Takashi)
v3: malloc a new EDID buffer that's big enough for the memcpy (Chris)
v4: change handling of NULL EDIDs, just preserve the NULL behavior
    across detects and mode list fetches rather than trying to re-fetch
    the EDID (Chris)
v5: be glad that Chris is around to remind me to hit C-x C-s before
    committing.

References: https://bugs.freedesktop.org/show_bug.cgi?id=46856
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agoRevert "drm/i915/dp: Use auxch precharge value of 5 everywhere"
Daniel Vetter [Thu, 14 Jun 2012 20:15:00 +0000 (22:15 +0200)]
Revert "drm/i915/dp: Use auxch precharge value of 5 everywhere"

This reverts commit 092945e11c5b84f66dd08f0b87fb729715d377bc.

This commit prevents a DP screen from properly training the link.
Oddly enough it works, once the machine has been warm-booted with an
older kernel.

According to DP docs this _should_ have been the right precharge time.
Also, the commit that originally introduces this was just general snb
DP enabling and didn't mention any specific reason for this special
value. Whatever, trust the reporter that this makes things worse and
let's just revert it.

v2: Less spelling fail.

Cc: Adam Jackson <ajax@redhat.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reported-by: "Wouter M. Koolen" <W.M.Koolen-Wijkstra@cwi.nl>
Buglink: https://lkml.org/lkml/2012/6/14/301
Cc: stable@vger.kernel.org (only for 3.4)
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agodrm/i915: eDP aux needs vdd
Daniel Vetter [Tue, 12 Jun 2012 11:20:47 +0000 (13:20 +0200)]
drm/i915: eDP aux needs vdd

The new oui probe has been missing these.

This issue has been introduce in

commit 0d198328538276c4459ef5de081e68ae60e6c4c2
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon May 14 16:05:47 2012 -0400

    drm/i915/dp: Probe branch/sink OUIs

v2: Do the eDP vdd dance of simply not probing the OUI on eDP panels
as suggested by Chris Wilson.

v3: Fix up the error path fail - I suck.

Cc: Adam Jackson <ajax@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50808
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Bugreport: http://permalink.gmane.org/gmane.comp.video.dri.devel/69695
Tested-by: Yang Guang <guang.a.yang@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agodrm/i915: don't enumerate HDMID if an eDP panel is already active on the port
Jesse Barnes [Mon, 11 Jun 2012 18:39:56 +0000 (14:39 -0400)]
drm/i915: don't enumerate HDMID if an eDP panel is already active on the port

This prevents the HDMI detect functions from poking at an eDP
connected panel, which can lead to trouble.

[danvet: Note that we have some other reports of DP vs. HDMI fighting,
but the general case is a much bigger fish to fry.]

References: https://bugs.freedesktop.org/show_bug.cgi?id=42278
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agodrm/radeon: add support for STRMOUT_BASE_UPDATE on 7xx
Alex Deucher [Thu, 14 Jun 2012 20:06:37 +0000 (22:06 +0200)]
drm/radeon: add support for STRMOUT_BASE_UPDATE on 7xx

Required for streamout.  Bump drm minor.

Marek v2: fix pkt->count check

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: add some additional 6xx/7xx/EG register init
Alex Deucher [Thu, 14 Jun 2012 20:06:36 +0000 (22:06 +0200)]
drm/radeon: add some additional 6xx/7xx/EG register init

- SMX_SAR_CTL0 needs to be programmed correctly to prevent
problems with memory exports in certain cases.
- VC_ENHANCE needs to be initialized on 6xx/7xx.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: enable HDMI on DCE5 (AKA NI excluding Aruba)
Rafał Miłecki [Mon, 11 Jun 2012 10:34:01 +0000 (12:34 +0200)]
drm/radeon: enable HDMI on DCE5 (AKA NI excluding Aruba)

After recent changes HDMI code is ready to be enabled on DCE5. This
patch just changes conditions to execute already present code on DCE5.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Christian König <christian.koenig@amd.com>
Tested-by: Andre Heider <a.heider@gmail.com>
Tested-by: Zoltán Böszörményi <zboszor@pr.hu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm sis: initialize object_idr
Márton Németh [Mon, 11 Jun 2012 17:09:25 +0000 (19:09 +0200)]
drm sis: initialize object_idr

The filed object_idr of struct drm_sis_private was introduced with
commit http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=6de8a748881f1cd9d795454da2b6db616d5ca3d7 .

The idr_init(&dev->object_name_idr) is called instead of
idr_init(&dev_priv->object_idr) by mistake, leaving object_idr
uninitialized. Correct this.

This patch was not tested because of lack of hardware.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm via: initialize object_idr
Márton Németh [Sun, 10 Jun 2012 21:39:55 +0000 (23:39 +0200)]
drm via: initialize object_idr

The field obejct_idr of struct drm_via_private was introduced with the
commit http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=77ee8f3825054f23b17e9c8f728f061defd86cdc .
In that patch idr_init(&dev->object_name_idr) was called instead of
idr_init(&dev_priv->object_idr) by mistake, leaving the dev_priv->object_idr
uninitialized. To be more exact, the object_idr buffer is filled with zeros
because of kzalloc(), but the dev_priv->object_idr.lock spinlock can cause
system freeze at lib/idr.c:move_to_free_list() when spin_lock_irqsave()
is called on this spinlock.

The patch was tested on Clevo D4J, model D410J laptop, on the following
hardware, without AGP kernel module loaded:

  # lspci -s 01:00.0 -n
  01:00.0 0300: 1106:3108 (rev 01)
  # lspci -s 01:00.0 -v
  01:00.0 VGA compatible controller: VIA Technologies, Inc. K8M800/K8N800/K8N800A [S3 UniChrome Pro] (rev 01) (prog-if 00 [VGA controller])
          Subsystem: CLEVO/KAPOK Computer Device 4702
          Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 16
          Memory at f0000000 (32-bit, prefetchable) [size=64M]
          Memory at d1000000 (32-bit, non-prefetchable) [size=16M]
          Expansion ROM at <unassigned> [disabled]
          Capabilities: [60] Power Management version 2
          Capabilities: [70] AGP version 3.0

Signed-off-by: Márton Németh <nm127@freemail.hu>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/prime: reserve/unreserve around pin
Dave Airlie [Tue, 12 Jun 2012 15:10:39 +0000 (16:10 +0100)]
drm/radeon/prime: reserve/unreserve around pin

I finally got to test this code a bit more and hit the ttm
no reserved assert, so add the reservations around the pinning.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: fix regression in dynpm due to multi-ring rework
Alex Deucher [Thu, 14 Jun 2012 19:54:57 +0000 (15:54 -0400)]
drm/radeon: fix regression in dynpm due to multi-ring rework

Not all asics have all rings, so make sure the ring is ready
before attempting to check it in the dynpm work handler.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=43367

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agovga_switcheroo.h: fix pci_dev warning
Randy Dunlap [Fri, 15 Jun 2012 19:46:17 +0000 (12:46 -0700)]
vga_switcheroo.h: fix pci_dev warning

Fix warnings on some architectures/configs (not on x86):

include/linux/vga_switcheroo.h:28:30: warning: 'struct pci_dev' declared inside parameter list [enabled by default]
include/linux/vga_switcheroo.h:28:30: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Takashi Iwai <tiwai@suse.de>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/udl: only bind to the video devices on the hub.
Dave Airlie [Sat, 16 Jun 2012 06:41:28 +0000 (07:41 +0100)]
drm/udl: only bind to the video devices on the hub.

This is ported from udlfb.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=832188
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoswap: fix shmem swapping when more than 8 areas
Hugh Dickins [Sat, 16 Jun 2012 00:55:50 +0000 (17:55 -0700)]
swap: fix shmem swapping when more than 8 areas

Minchan Kim reports that when a system has many swap areas, and tmpfs
swaps out to the ninth or more, shmem_getpage_gfp()'s attempts to read
back the page cannot locate it, and the read fails with -ENOMEM.

Whoops.  Yes, I blindly followed read_swap_header()'s pte_to_swp_entry(
swp_entry_to_pte()) technique for determining maximum usable swap
offset, without stopping to realize that that actually depends upon the
pte swap encoding shifting swap offset to the higher bits and truncating
it there.  Whereas our radix_tree swap encoding leaves offset in the
lower bits: it's swap "type" (that is, index of swap area) that was
truncated.

Fix it by reducing the SWP_TYPE_SHIFT() in swapops.h, and removing the
broken radix_to_swp_entry(swp_to_radix_entry()) from read_swap_header().

This does not reduce the usable size of a swap area any further, it
leaves it as claimed when making the original commit: no change from 3.0
on x86_64, nor on i386 without PAE; but 3.0's 512GB is reduced to 128GB
per swapfile on i386 with PAE.  It's not a change I would have risked
five years ago, but with x86_64 supported for ten years, I believe it's
appropriate now.

Hmm, and what if some architecture implements its swap pte with offset
encoded below type? That would equally break the maximum usable swap
offset check.  Happily, they all follow the same tradition of encoding
offset above type, but I'll prepare a check on that for next.

Reported-and-Reviewed-and-Tested-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: stable@vger.kernel.org [3.1, 3.2, 3.3, 3.4]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>