Commit graph

311720 commits

Author SHA1 Message Date
Peter Meerwald 7695afdeb4 iio staging: fix tsl2x7x file mode
just drop execute permission

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:29:29 -07:00
Peter Meerwald 0941b9307e iio staging: fix typos in tsl*: register
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:29:28 -07:00
Lars-Peter Clausen ae3805c3ae staging:iio:adc:ad799x: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:10 -07:00
Lars-Peter Clausen cc4dd03a6a staging:iio:adc:ad7887: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:10 -07:00
Lars-Peter Clausen 82796edca9 staging:iio:adc:ad7793: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:10 -07:00
Lars-Peter Clausen 74ed964931 staging:iio:adc:ad7606: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:10 -07:00
Lars-Peter Clausen 397b85dd86 staging:iio:adc:ad7476: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:10 -07:00
Lars-Peter Clausen d045b9d21b staging:iio:adc:ad7298: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

The previous code was not passing the temperature channel to iio_buffer_register
since the temperature channel can not be used in buffered mode. With the new
helper functions it is not possible to do this, instead the scan index for the
temperature channel is set to -1 which will cause iio_buffer_register to ignore
the channel. (Also While we are at it also assign the symbolic constant instead
of the raw value to the channel address for the temperature channel).

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:09 -07:00
Lars-Peter Clausen a648232dc5 staging:iio:adc:ad7192: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:09 -07:00
Lars-Peter Clausen 90032e4e9c iio:adc:at91: Use new triggered buffer setup helper
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:09 -07:00
Lars-Peter Clausen 23f2d735a9 iio: Add helper function for initializing triggered buffers
Add a helper function for executing the common tasks which are usually involved
in setting up a simple software ringbuffer. It will allocate the buffer,
allocate the pollfunc and register the buffer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:09 -07:00
Lars-Peter Clausen f5b81ddd12 iio: iio_buffer_register: Skip channels with negative scan index
It is not always the case that all channels can be used in buffered mode. This
patch allows channels, which can not be used in buffered mode, to set their scan
index to a negative number, which will cause iio_buffer_register to ignore the
channel.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:09 -07:00
Justin P. Mattock 493b67b73c staging: slicoss: Fix a typo.
The below patch fixes a typo found while reading through staging/slicoss

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:23:52 -07:00
Justin P. Mattock 1351acce4f staging: serqt_usb2: Fix some typos.
Fixes some typos that was found while reading through staging/serqt_usb2

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:23:52 -07:00
Miguel Gómez 1918570388 Staging: xgifb: Replace pr_* with dev_* when possible.
Replace pr_* calls with dev_* ones when the device structure is available.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:20:21 -07:00
Miguel Gómez e054102b9f Staging: xgifb: Fix sparse warnings.
Add include files with function definitions to avoid sparse warnings.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:20:21 -07:00
Miguel Gómez 448810662a Staging: xgifb: Remove printk usage.
Replace meaninful printks with pr_debug and remove useless ones.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:20:21 -07:00
Miguel Gómez 47cee13d1d Staging: xgifb: Remove XGIFAIL() macro and its calls.
XGIFAIL() prints a message and returns a value, but it's used only in one
place. Better remove it and replace the call with the macro content.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:20:20 -07:00
Miguel Gómez 96cd1f8b41 Staging: xgifb: define real dumpVGAReg() content only in DEBUG mode.
Define real content of dumpVGAReg() only in debug mode. Remove old condition.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:20:20 -07:00
Miguel Gómez d56b4c3dff Staging: xgifb: remove DPRINTK() macro and replace it with pr_debug.
Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:20:20 -07:00
Miguel Gómez 67c0bf7ac7 Staging: xgifb: remove DEBUGPRN() macro and its uses.
Remove DEBUGPRN() macro which is defined as empty.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:20:20 -07:00
Miguel Gómez 560e8788eb Staging: xgifb: reformat module parameter descriptions.
Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:20:20 -07:00
H Hartley Sweeten d4a7dc8528 staging: comedi: comedi_subdevice 'io_bits' should be an unsigned int
The 'io_bits' variable in the comedi_subdevice struct is a bitmask of
the input/output configuration of the the subdevice. It should be an
unsigned int to correctly represent this.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess: <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:17:47 -07:00
H Hartley Sweeten a2714e3e42 staging: comedi: fix return value for insn_bits functions
The comedi_subdevice 'insn_bits' functions return the number of data
elements used to perform the command. Most of the insn_bits functions
return an open coded '2' to indicate this. The same value is available
as 'insn->n'. Return that instead to better indicate what the return
means.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:17:10 -07:00
H Hartley Sweeten 520706607b staging: comedi: remove unneeded sanity check in insn_bits functions
The comedi core does the sanity check to make sure that the data length
the INSN_BITS instruction is 2. There is no need for the drivers to do
this check. Remove all the sanity checks in the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:16:11 -07:00
Ian Abbott 60ff461067 staging: comedi: usbduxsigma: use attach_usb() hook
Change the usbduxsigma driver to use the new attach_usb() hook in struct
comedi_driver to auto-configure probed USB devices after the firmware is
loaded.

Move the release of the driver's static 'start_stop_sem' semaphore in
usbduxsigma_attach() to occur a bit later for convenience, otherwise the
new usbduxsigma_attach_common() would need to be split in two.  I don't
think the slight delay in releasing the semaphore matters too much; it's
only used in the USB probe and disconnect functions and when attaching
and detaching comedi devices.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:14:22 -07:00
Ian Abbott f7d4d3bc0c staging: comedi: vmk80xx: use attach_usb() hook
Change the vmv80xx driver to use the new attach_usb() hook in struct
comedi_driver to auto-configure probed USB devices after the firmware is
loaded.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:14:21 -07:00
Ian Abbott 185f9aa7df staging: comedi: usbduxfast: use attach_usb() hook
Change the usbduxfast driver to use the new attach_usb() hook in struct
comedi_driver to auto-configure probed USB devices after the firmware is
loaded.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:13:06 -07:00
Ian Abbott f41ad6675f staging: comedi: change device used in dev_...() calls
A previous set of patches by Ravishankar Karkala Mallikarjunayya
replaced a load of printk() calls with dev_info(), dev_err(), etc.
Unfortunately, these used the 'struct device *hw_dev' member of 'struct
comedi_device') as the first parameter of these dev_...() calls, but
that pointer is usually NULL, so the kernel log messages come out a bit
wrong (they contain the phrase "(NULL device *)").

Use the 'struct device *class_dev' member of 'struct comedi_device'
instead for these dev_...() calls.  It will be non-NULL and somewhat
meaningful to users.  It's also consistent with those comedi drivers
that already use the class_dev member in their dev_...() calls.

Some of the messages included the format "comedi%d" with the minor
device number used for the "%d".  This is now redundant as it will be
the same as the dev_name() part of the kernel log message produced by
the dev_...() calls.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:13:06 -07:00
Christopher Brannon 4ea418b8b2 Staging: speakup: fix an improperly-declared variable.
A local static variable was declared as a pointer to a string
constant.  We're assigning to the underlying memory, so it
needs to be an array instead.

Signed-off-by: Christopher Brannon <chris@the-brannons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:13:06 -07:00
Stephen Warren 6355f25ed9 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>
2012-06-18 16:42:57 -07:00
Axel Lin 96c9f05b39 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>
2012-06-18 16:30:42 -07:00
Axel Lin 3f1dc550b0 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>
2012-06-18 16:30:42 -07:00
Axel Lin 155cb06c89 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>
2012-06-18 16:30:42 -07:00
Kay Sievers 246f6f2ff2 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>
2012-06-18 15:55:21 -07:00
Salman Qazi 8e3bbf42c6 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>
2012-06-18 15:38:02 -07:00
Linus Torvalds 02edf6abe0 Merge git://git.kernel.org/pub/scm/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
2012-06-18 13:34:25 -07:00
Linus Torvalds 67f5d06d73 Merge branch 'v9fs-devel' of git://git.kernel.org/pub/scm/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
2012-06-18 12:21:25 -07:00
Linus Torvalds 48d4e137ea Merge git://git.kernel.org/pub/scm/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
2012-06-18 12:20:36 -07:00
Linus Torvalds 9023a4093d MMC fixes for 3.5-rc4:
- 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
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJP3iO/AAoJEHNBYZ7TNxYMm2YQAJCfvLk5a9N+3QUcWPOeJngs
 yb+JFmGb4rOajrfVQu47d5hcWkC3ovySIxrHJbpNUyTVTttsxwL3agRJUsdh3zvx
 s3XFvzXBIH0CXD889SyX3i09IIqQ3gRhk185O2b7x+5IlVfgMv6XRjZGvRDCWXVH
 elSwLUbL0M/wgEa5rsXceNiuz9ok4p19LsRzOIP1AEijLKweUuyzJl9P0CIICG9x
 ZqvWCDmDKc6APHlx4zAhAP+yOSUEHDASe22lfZYoyOhqDhJ8iyqFsW8zYVj/Y1j/
 E3BnhNaNJsBrDncYCzw8r3xRE7Dzvl24rc0CqmVuHJ2PgldDv8i7CjtccZ6/C/Fg
 Qou68g6/kM48CuEavu8xNoM4jLgHDes3UILvSZ1Tp5VxYhnQfQTovppUvO4vfDFi
 5JXeIH9nq9f9xxc3Qs6/6ZrqNqw7gjtBDmN804Ptr0VzP9Ax7CMRTsnmVwlUlQdH
 Vxhr+lyZkEGoMF48r/DnieFZAVLtYUkGczOK4cPVFZ0n2eAu/IlvRhbC/+w3ym3F
 DRt9/4kwXJkrKnXSNSuYL2UHnenJxVZoqt+zqMZhH8FzJd8quqt8nf3BAyGeFxav
 ZdbTG+Bb61BZF10suWk8O0nV6piyQPw1jJwdlw18ujtt5Lgpu1Dvn6jSV/cnvaMa
 oAV9cgk3PL7OFpDg3ESM
 =x1JZ
 -----END PGP SIGNATURE-----

Merge tag 'mmc-fixes-for-3.5-rc4' of git://git.kernel.org/pub/scm/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
2012-06-18 11:53:34 -07:00
Linus Torvalds 1bea57f5f3 A few relatively-small remoteproc fixes for 3.5: two error path fixes,
and one -Wformat warning fix.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJP3cUtAAoJELLolMlTRIoMVSUP/2K+/6SSiZUy15BsWpQI7v0i
 Neh4g8HwGQ9dgST261WOFuqdYIK1dQcB2nCjTyoT2k+VqrYYtswzNBSquGADjiVR
 YgUwh1ebGeQh/NBqzaGjrWfLJzgnrMkZxVwgLtm179TkdbhrupwtL9WIUOuNuUTO
 /3Ov33Nxv1u6KkzwKJMVcS3CKO+4EsQSvDoie+fWhaxsp0j+2h37FpxLaMdprDBC
 eyJQnhncqffGzG3joUhKbzed4sO8igBjNH6fHTiZ+jiIzzZ2XrzbIHBY5Bgiw1lI
 +Fd318vT0BvsUfiog6Oq8Bmcgs7qOGJEErBKB9MUHsYIRInCoPlkdr6e9Z98Ouvr
 LyPtZen4Az31vYpN1t6EM9EnQyoTDQ9NzYMs22WTNp2SLoqELtA+x0kWwMLn3NFw
 RlWfUlKXAu8AprViK9Nt2OcjcPCKqJXyUGGpZUd7berT7kMNx74XET30qNWwpVbf
 QVwb43RnauFwByoqDa4Ly8xdYV3sC3kjRnl9X+RdAzEZgXmLJd1QGN39/B7YcKO9
 b1q92jBIdDcaK+/DVuastnzER6zcsa1QiOp7m/S3YSbLhcEd/qpvXgS0fZVmicEu
 NjlWXeOFCVSVesdGiOqjUfC1TVRk0S/0qZiciw1JKUpYhrGaBwMPeGartAZadzqn
 8SvQysOKeV+88iEFklZb
 =Zm/p
 -----END PGP SIGNATURE-----

Merge tag 'rproc-fixes-for-3.5' of git://git.kernel.org/pub/scm/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
2012-06-18 11:52:25 -07:00
Linus Torvalds 4005af65c9 Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/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
2012-06-18 11:51:10 -07:00
Paul Mundt 2603efa31a 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>
2012-06-18 11:10:59 -07:00
Paul Mundt a1f42beb8e 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>
2012-06-18 11:10:58 -07:00
Guenter Roeck 2355375efd 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>
2012-06-18 08:48:00 -07:00
Henrik Rydberg ac852edb47 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>
2012-06-18 08:48:00 -07:00
Steven Rostedt 93b3cca1cc ftrace: Make all inline tags also include notrace
Commit 5963e317b1 ("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 45959ee7aa ("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>
2012-06-18 09:47:00 -04:00
Trond Myklebust 2a4c8994ee 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>
2012-06-18 08:45:16 -04:00
Russell King 10aa5a35e3 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>
2012-06-18 11:27:04 +01:00
Salman Qazi 9c5da09d26 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>
2012-06-18 11:45:57 +02:00