tools/power turbostat: fix un-intended affinity of forked program

Linux 3.4 included a modification to turbostat to
lower cross-call overhead by using scheduler affinity:

15aaa34654831e98dd76f7738b6c7f5d05a66430
(tools turbostat: reduce measurement overhead due to IPIs)

In the use-case where turbostat forks a child program,
that change had the un-intended side-effect of binding
the child to the last cpu in the system.

This change removed the binding before forking the child.

This is a back-port of a fix already included in turbostat v2.

Signed-off-by: Len Brown <len.brown@intel.com>
tools/power turbostat: fix IVB support

Initial IVB support went into turbostat in Linux-3.1:
553575f1ae048aa44682b46b3c51929a0b3ad337
(tools turbostat: recognize and run properly on IVB)

However, when running on IVB, turbostat would fail
to report the new couters added with SNB, c7, pc2 and pc7.
So in scenarios where these counters are non-zero on IVB,
turbostat would report erroneous residencey results.

In particular c7 time would be added to c1 time,
since c1 time is calculated as "that which is left over".

Also, turbostat reports MHz capabilities when passed
the "-v" option, and it would incorrectly report 133MHz
bclk instead of 100MHz bclk for IVB, which would inflate
GHz reported with that option.

This patch is a backport of a fix already included in turbostat v2.

Signed-off-by: Len Brown <len.brown@intel.com>
drivers: acpi: Fix dependency for ACPI_HOTPLUG_CPU

Fix the following build warning:

warning: (ACPI_HOTPLUG_CPU) selects ACPI_CONTAINER which has unmet direct dependencies (ACPI && EXPERIMENTAL)

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Len Brown <len.brown@intel.com>
gpio/samsung: fix the typo 'exynos5_xxx' instead of 'exonys5_xxx'

Should be 'exynos5_xxx' instead of 'exonys5_xxx'.

It happened at the commit 30b842889eea ("Merge tag 'soc2' of
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc")
during v3.5 merge window.

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
[ My bad  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ACPI: fix acpi_bus.h build warnings when ACPI is not enabled

introduced in Linux-3.5-rc1 by
66886d6f8c9bcdee3d7fce5796dcffd6b4bc0b48
(ACPI: Add stubs for (un)register_acpi_bus_type)

Fix header file warnings when CONFIG_ACPI is not enabled:

include/acpi/acpi_bus.h:443:42: warning: 'struct acpi_bus_type' declared inside parameter list
include/acpi/acpi_bus.h:443:42: warning: its scope is only this definition or declaration, which is probably not
include/acpi/acpi_bus.h:444:44: warning: 'struct acpi_bus_type' declared inside parameter list

Signed-off-by: Len Brown <len.brown@intel.com>
Merge branch 'upstream' into bugfix-video

Update bugfix-video branch to 2.5-rc1
so I don't have to again resolve the
conflict in these patches vs. upstream.

Conflicts:
	drivers/gpu/drm/gma500/psb_drv.c

	text conflict: add comment vs delete neighboring line

	keep just this:
	/* igd_opregion_init(&dev_priv->opregion_dev); */
	/* acpi_video_register(); */

Signed-off-by: Len Brown <len.brown@intel.com>
Merge branches 'bugfix-battery', 'bugfix-misc', 'bugfix-rafael', 'bugfix-turbostat', 'bugfix-video' and 'workaround-pss' into release

bug fixes

Signed-off-by: Len Brown <len.brown@intel.com>
RDMA/cxgb4: Fix crash when peer address is 0.0.0.0

When using rping -c -a 0.0.0.0 with iw_cxgb4, the system crashes when
rdma_connect() is called.  ip_dev_find() will return NULL, but pdev is
accessed anyway.

Checking that pdev is NULL and returning -ENODEV prevents the system
from crashing.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
ARM: dma-mapping: remove unconditional dependency on CMA

CMA has been enabled unconditionally on all ARMv6+ systems to solve the
long standing issue of double kernel mappings for all dma coherent
buffers. This however created a dependency on CONFIG_EXPERIMENTAL for
the whole ARM architecture what should be really avoided. This patch
removes this dependency and lets one use old, well-tested dma-mapping
implementation also on ARMv6+ systems without the need to use
EXPERIMENTAL stuff.

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
IB/mlx4: Fix EQ deallocation in legacy mode

Commit e605b743f33d ("IB/mlx4: Increase the number of vectors (EQs)
available for ULPs") didn't handle correctly the case where there
aren't enough MSI-X vectors to increase the number of EQs, so only the
legacy EQs are allocated.  This results in an attempt to memset() to
zero the EQ table which was never allocated and a kernel crash.

Fix this by checking in the teardown flow if the table of EQs was ever
allocated.  Also remove some unneeded setting to zero of the EQ
related fields in struct mlx4_ib_dev.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
pinctrl: sirf: mark of_device_id match table as __devinitconst

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
pinctrl: fix a minor harmless typo

The way the for_each_maps() macro is currently used, using "i" instead of
"_i_" works and is harmless. Still, this is a bug, that can trigger any
time, if the code around that macro changes. Better fix it now.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
OMAPDSS: fix build when DEBUG_FS or DSS_DEBUG_SUPPORT disabled

If CONFIG_DEBUG_FS or CONFIG_OMAP2_DSS_DEBUG_SUPPORT is disabled, the
build fails:

drivers/video/omap2/dss/core.c:197:50: error: static declaration of
'dss_debugfs_create_file' follows non-static declaration
drivers/video/omap2/dss/dss.h:166:5: note: previous declaration of
'dss_debugfs_create_file' was here

This patch fixes the dummy dss_debugfs_create_file() so that the driver
builds.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: Taal: fix compilation warning

This patch fixes a warning:

drivers/video/omap2/displays/panel-taal.c: In function
‘taal_num_errors_show’:
drivers/video/omap2/displays/panel-taal.c:529: warning: ‘errors’ may be
used uninitialized in this function

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: fix bogus WARN_ON in dss_runtime_put()

pm_runtime_put_sync() in dss_runtime_put() returns -EBUSY when any child
of dss is still enabled. This happens, for example, when a display
output is enabled and one dumps the clocks via debugfs. This causes
dss_runtime_get & put to be called.

While I couldn't find anything about this in the documentation and it
wasn't immediately clear from runtime_pm code, it looks to me that
pm_runtime_put_sync() returns -EBUSY to inform that things went fine,
but the device could not be turned off as there are still child devices
that are enabled. This is not a problem.

This patch skips the WARN_ON if pm_runtime_put_sync() returns -EBUSY.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Merge branch 'for_3.5/fixes/pm' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into fixes
Merge branch 'for_3.5/cleanup/am3xxx-cpu-is-leftovers' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into fixes
ARM: OMAP: Fix lis3lv02d accelerometer to use gpio_to_irq

Commit 3b511201 (ARM: OMAP: rx51: Platform support for lis3lv02d accelerometer)
added support for lis3lv02d accelerometer.

The patch was still using OMAP_GPIO_IRQ which no longer exists.

Fix it by using gpio_to_irq().

Signed-off-by: Tony Lindgren <tony@atomide.com>
regulator: palmas: Fix wrong kfree calls

The devm_kzalloc function eliminates the need for manual resource releasing
and simplify error handling. Resources allocated by devm_* are freed
automatically on driver detach.

Thus adding kfree calls here will introduce double free bug.

The memory of desc array and the pointers to the rdev[] are allocated by
devm_kzalloc call for struct palmas_pmic.

struct palmas_pmic {
        struct palmas *palmas;
        struct device *dev;
        struct regulator_desc desc[PALMAS_NUM_REGS];
        struct regulator_dev *rdev[PALMAS_NUM_REGS];
        struct mutex mutex;

        int smps123;
        int smps457;

        int range[PALMAS_REG_SMPS10];
};

Which means we should not call kfree for pmic->rdev and pmic->desc.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
regulator: anatop: Use correct __devexit_p annotation

__devexit functions are discarded when CONFIG_HOTPLUG
is not set, so the symbol needs to be referenced carefully.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>