]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agotimer_list-convert-timer-list-to-be-a-proper-seq_file-v2
Nathan Zimmer [Wed, 20 Feb 2013 02:13:46 +0000 (13:13 +1100)]
timer_list-convert-timer-list-to-be-a-proper-seq_file-v2

v2: Added comments on the iteration.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimer_list-convert-timer-list-to-be-a-proper-seq_file-fix
Andrew Morton [Wed, 20 Feb 2013 02:13:45 +0000 (13:13 +1100)]
timer_list-convert-timer-list-to-be-a-proper-seq_file-fix

whitespace fixlet

Cc: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimer_list: convert timer list to be a proper seq_file
Nathan Zimmer [Wed, 20 Feb 2013 02:13:45 +0000 (13:13 +1100)]
timer_list: convert timer list to be a proper seq_file

When running with 4096 cores attemping to read /proc/timer_list will fail
with an ENOMEM condition.  On a sufficantly large systems the total amount
of data is more then 4mb, so it won't fit into a single buffer.  The
failure can also occur on smaller systems when memory fragmentation is
high as reported by Dave Jones.

Convert /proc/timer_list to a proper seq_file with its own iterator.  This
is a little more complex given that we have to make two passes with two
separate headers.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Reported-by: Dave Jones <davej@redhat.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimer_list: split timer_list_show_tickdevices()
Nathan Zimmer [Wed, 20 Feb 2013 02:13:45 +0000 (13:13 +1100)]
timer_list: split timer_list_show_tickdevices()

Split timer_list_show_tickdevices() out the header and just pull the rest up
to timer_list_show.  Also tweak the location of the whitespace.  This is all
to prep for the fix.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Reported-by: Dave Jones <davej@redhat.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotime: don't inline EXPORT_SYMBOL functions
Greg Kroah-Hartman [Wed, 20 Feb 2013 02:13:44 +0000 (13:13 +1100)]
time: don't inline EXPORT_SYMBOL functions

How is the compiler even handling exported functions that are marked
inline?  Anyway, these shouldn't be inline because of that, so remove that
marking.

Based on a larger patch by Mark Charlebois to get LLVM to build the
kernel.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Mark Charlebois <mcharleb@qualcomm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: hank <pyu@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocyber2000fb: avoid palette corruption at higher clocks
Ondrej Zary [Wed, 20 Feb 2013 02:13:44 +0000 (13:13 +1100)]
cyber2000fb: avoid palette corruption at higher clocks

When 1280x1024@75Hz mode is set, console palette is not set properly -
sometimes the background is white, sometimes yellow and text colors are
also messed up.  This does not happen at 1280x1024@60Hz and below.

It seems that the HW needs some time before setting the palette - maybe
the PLL needs more time to lock at higher speeds.  This patch fixes the
problem but without knowing what register to check for PLL lock(?), the
delay might be excessive.

On Fri, 28 Jan 2011 18:15:37 +0000
Russell King <rmk@arm.linux.org.uk> wrote:

> On Tue, Jan 18, 2011 at 01:14:24PM -0800, Andrew Morton wrote:
> > Russell, I have an (old) note here that this is awaiting an ack from
> > yourself?
>
> Well, I can reproduce this problem on the Netwinders here.  I'm not sure
> that we should delay all mode switches by one second - and any attempt
> to reduce this value does result in the palette not being set correctly.
>
> For 1280x1024-75, the dotclock is 135MHz, which gives a PLL values of
> 0x41 and 0x06.  That's: M=0x41+1, N=0x06+1, P=0x00 (top 2 bits of 0x06)
> -> Q=1
>
>  Fpll = 14.31818MHz * M / N
>  Fout = Fpll / Q
>
> The PLL itself is formed by dividing the 14-ish MHz frequency by N and
> phase comparing the output of the VCO, divided by M, and adjusting the
> VCO until the two correlate.  As VCOs typically tend to have a limited
> range, it's normal to divide the output frequency to produce a greater
> range - and in this case that's done by Q.
>
> For the 800x600-100 copied from /etc/fb.modes, this has a dotclock of
> 67.5MHz, which is exactly half this rate.  The PLL values for this are:
> M=0x41+1, N=0x06+1, P=0x01, giving PLL values of 0x41 and 0x46.
>
> Booting with 800x600-100 does not suffer the problem.  So it's not
> related to PLL lock time.  There's something else going on.
>
> Another experiment I tried was forcing the PLL values to produce 108MHz
> instead of 135MHz.  108MHz is the dotclock for 1280x1024-60.  This too
> doesn't suffer the problem.
>
> I've also tried chosing other delay values.  100ms is too short and
> produces the problem, but 1s works.  1s for a PLL to lock is a hell of
> a time, especially for a PLL operating in the MHz range.
>
> I've tried setting the PLL to a known good freqency, and then switching
> to 135MHz - the problem persists.  It's not like 135MHz is reaching the
> limits - it'll go up to 206MHz.
>
> So, I don't think this has anything to do with PLL locking.  I think
> there's something else going on which isn't immediately obvious - maybe
> bandwidth starvation preventing us from writing properly to the palette?
> As it's a horrible VGA, where you write the same register multiple times
> I wouldn't be surprised if some writes were going missing.
>
> I'll see if I can play around with it some more this evening, but I've
> spent an awful long time on just this issue already this afternoon...
>
> I think further investigation needs to happen on this patch before it's
> acceptable.  Or maybe we should prevent the cyberpro coming up in

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: exynos_dp: move disable_irq() to exynos_dp_suspend()
Ajay Kumar [Wed, 20 Feb 2013 02:13:44 +0000 (13:13 +1100)]
video: exynos_dp: move disable_irq() to exynos_dp_suspend()

disable_irq() should be moved to exynos_dp_suspend(), because enable_irq()
is called at exynos_dp_resume().

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: exynos_dp: add missing of_node_put()
Jingoo Han [Wed, 20 Feb 2013 02:13:43 +0000 (13:13 +1100)]
video: exynos_dp: add missing of_node_put()

of_find_node_by_name() returns a node pointer with refcount incremented,
use of_node_put() on it when done.

of_find_node_by_name() will call of_node_put() against the node pass to
from parameter, thus we also need to call of_node_get(from) before calling
of_find_node_by_name().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: s3c-fb: fix typo in definition of VIDCON1_VSTATUS_FRONTPORCH value
Tomasz Figa [Wed, 20 Feb 2013 02:13:43 +0000 (13:13 +1100)]
video: s3c-fb: fix typo in definition of VIDCON1_VSTATUS_FRONTPORCH value

The correct value for VIDCON1_VSTATUS_FRONTPORCH is 3, not 0.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: s3c-fb: add the bit definitions for CSC EQ709 and EQ601
Jingoo Han [Wed, 20 Feb 2013 02:13:43 +0000 (13:13 +1100)]
video: s3c-fb: add the bit definitions for CSC EQ709 and EQ601

Add the bit definitions for CSC EQ709 and EQ601.  These definitons are
used to control the CSC parameter such as equation 709 and equation 601.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: s3c-fb: remove unnecessary brackets
Jingoo Han [Wed, 20 Feb 2013 02:13:42 +0000 (13:13 +1100)]
video: s3c-fb: remove unnecessary brackets

Remove unnecessary brackets and the duplicated VIDTCON2 definition.

Also, header comment is modified, because EXYNOS series is supported and
<mach/regs-fb.h> is not available.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: s3c-fb: remove duplicated S3C_FB_MAX_WIN
Jingoo Han [Wed, 20 Feb 2013 02:13:42 +0000 (13:13 +1100)]
video: s3c-fb: remove duplicated S3C_FB_MAX_WIN

S3C_FB_MAX_WIN is already defined in 'plat-samsung/include/plat/fb.h'.
So, this definition in 'include/video/samsung_fimd.h' should be removed to
avoid the duplication.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: s3c-fb: use ARCH_ dependancy
Jingoo Han [Wed, 20 Feb 2013 02:13:42 +0000 (13:13 +1100)]
video: s3c-fb: use ARCH_ dependancy

Use ARCH_ dependancy when using s3c-fb.  S3C_DEV_FB, S5P_DEV_FIMD0 cannot
be enabled on EXYNOS5.  So, ARCH_ should be used as dependancy for s3c-fb.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/exynos/exynos_mipi_dsi.c: use devm_* APIs
Sachin Kamat [Wed, 20 Feb 2013 02:13:42 +0000 (13:13 +1100)]
drivers/video/exynos/exynos_mipi_dsi.c: use devm_* APIs

devm_* APIs are device managed and make exit and cleanup code simpler.
While at it also remove some unused labels and fix an error path.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Donghwa Lee <dh09.lee@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/exynos/exynos_mipi_dsi.c: fix an error check condition
Sachin Kamat [Wed, 20 Feb 2013 02:13:41 +0000 (13:13 +1100)]
drivers/video/exynos/exynos_mipi_dsi.c: fix an error check condition

Checking an unsigned variable for negative value returns false.  Hence use
the macro to fix it.

Fixes the following smatch warning:
drivers/video/exynos/exynos_mipi_dsi.c:417 exynos_mipi_dsi_probe() warn:
unsigned 'dsim->irq' is never less than zero.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Donghwa Lee <dh09.lee@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/exynos/s6e8ax0.c: use devm_* APIs in s6e8ax0.c
Sachin Kamat [Wed, 20 Feb 2013 02:13:41 +0000 (13:13 +1100)]
drivers/video/exynos/s6e8ax0.c: use devm_* APIs in s6e8ax0.c

devm_* APIs are device managed and make error handling and code cleanup
simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Donghwa Lee <dh09.lee@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/Kconfig: specify the SoCs that make use of FB_IMX
Fabio Estevam [Wed, 20 Feb 2013 02:13:41 +0000 (13:13 +1100)]
drivers/video/Kconfig: specify the SoCs that make use of FB_IMX

FB_IMX is the framebuffer driver used by MX1, MX21, MX25 and MX27 processors.

Pass this information to the Kconfig text to make it clear.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoARM: mmp: add display and fb support in pxa910 defconfig
Zhou Zhu [Wed, 20 Feb 2013 02:13:40 +0000 (13:13 +1100)]
ARM: mmp: add display and fb support in pxa910 defconfig

Add display and fb support in pxa910 defconfig.
Add tpohvga panel, spi support.
Add logo support.

Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Lisa Du <cldu@marvell.com>
Cc: Guoqing Li <ligq@marvell.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoARM: mmp: enable display in ttc_dkb
Zhou Zhu [Wed, 20 Feb 2013 02:13:40 +0000 (13:13 +1100)]
ARM: mmp: enable display in ttc_dkb

Enable display in ttc_dkb.

Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Lisa Du <cldu@marvell.com>
Cc: Guoqing Li <ligq@marvell.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoARM: mmp: added device for display controller
Zhou Zhu [Wed, 20 Feb 2013 02:13:40 +0000 (13:13 +1100)]
ARM: mmp: added device for display controller

Add device for display controller and fb support

Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Lisa Du <cldu@marvell.com>
Cc: Guoqing Li <ligq@marvell.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: mmpdisp: add spi port in display controller
Zhou Zhu [Wed, 20 Feb 2013 02:13:39 +0000 (13:13 +1100)]
video: mmpdisp: add spi port in display controller

Add spi port support in mmp display controller.  This port is from display
controller and for panel usage.  This driver implemented and registered as
a spi master.

Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Lisa Du <cldu@marvell.com>
Cc: Guoqing Li <ligq@marvell.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: mmp: add tpo hvga panel supported
Lisa Du [Wed, 20 Feb 2013 02:13:39 +0000 (13:13 +1100)]
video: mmp: add tpo hvga panel supported

Add tpo hvga panel support in marvell display framework.  This panel
driver implements modes query and power on/off.

This panel driver gets panel config/ plat power on/off/ connected path
name from machine-info and registered as a spi device.  This panel driver
uses mmp_disp supplied register_panel function to register panel to path
as machine-info defined.

Signed-off-by: Lisa Du <cldu@marvell.com>
Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Guoqing Li <ligq@marvell.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: mmp display controller support
Guoqing Li [Wed, 20 Feb 2013 02:13:39 +0000 (13:13 +1100)]
video: mmp display controller support

Marvell mmp series display controller support in mmpdisp subsystem.  This
driver focus on implementation of hardware operations of path/overlay,
which is defined in mmp display subsystem interface.  This driver
registers all pathes to mmp display framework.

Signed-off-by: Guoqing Li <ligq@marvell.com>
Signed-off-by: Lisa Du <cldu@marvell.com>
Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofb: mmp: include linux/platform_device.h
Arnd Bergmann [Wed, 20 Feb 2013 02:13:38 +0000 (13:13 +1100)]
fb: mmp: include linux/platform_device.h

Patch 16559ae "kgdb: remove #include <linux/serial_8250.h> from kgdb.h"
changes the kgdb.h file so that drivers including it do not implicitly
include linux/platform_device.h. The mmp framebuffer driver is new,
so Greg did not have a chance to fix it up when introducing his change.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Zhou Zhu <zzhu3@marvell.com>
Cc: Lisa Du <cldu@marvell.com>
Cc: Guoqing Li <ligq@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: mmp fb support
Zhou Zhu [Wed, 20 Feb 2013 02:13:38 +0000 (13:13 +1100)]
video: mmp fb support

Add fb support for Marvell mmp display subsystem.  This driver is
configured using "buffer driver mach info".  With configured name of path,
this driver get path using using exported interface of mmp display driver.
Then this driver get overlay using configured id and operates on this
overlay to show buffers on display devices.

Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Signed-off-by: Lisa Du <cldu@marvell.com>
Cc: Guoqing Li <ligq@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: mmp display subsystem
Zhou Zhu [Wed, 20 Feb 2013 02:13:38 +0000 (13:13 +1100)]
video: mmp display subsystem

Add mmp display subsystem to support Marvell MMP display controllers.

This subsystem contains 4 parts:
--fb folder
--core.c
--hw folder
--panel folder

1. fb folder contains implementation of fb.  fb get path and overlay
   from common interface and operates on these structures.

2. core.c provides common interface for a hardware abstraction.  Major
   parts of this interface are:

   a) Path: path is a output device connected to a panel or HDMI TV.  Main
      operations of the path is set/get timing/output color.  fb operates
      output device through path structure.

   b) Ovly: Ovly is a buffer shown on the path.

      Ovly describes frame buffer and its source/destination size, offset,
      input color, buffer address, z-order, and so on.  Each fb device maps
      to one overlay.

3. hw folder contains implementation of hardware operations defined by
   core.c.  It registers paths for fb use.

4. panel folder contains implementation of panels.  It's connected to
   path.  Panel drivers would also regiester panels and linked to path
   when probe.

Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Signed-off-by: Lisa Du <cldu@marvell.com>
Cc: Guoqing Li <ligq@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agogoldfish-framebuffer-driver-fix
Andrew Morton [Wed, 20 Feb 2013 02:13:37 +0000 (13:13 +1100)]
goldfish-framebuffer-driver-fix

fix (silly) sparse warnings

Cc: Alan Cox <alan@linux.intel.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Bruce Beare <bruce.j.beare@intel.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Jun Nakajima <jun.nakajima@intel.com>
Cc: Mike A. Chan <mikechan@google.com>
Cc: Sheng Yang <sheng@linux.intel.com>
Cc: Tom Keel <thomas.keel@intel.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Xiaohui Xin <xiaohui.xin@intel.com>
Cc: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agogoldfish: framebuffer driver
Arve Hjønnevåg [Wed, 20 Feb 2013 02:13:37 +0000 (13:13 +1100)]
goldfish: framebuffer driver

Framebuffer support for the Goldfish emulator.  This takes the Google
emulator and applies the x86 cleanups as well as moving the blank methods
to the usual Linux place and dropping the Android early suspend logic (for
now at least, that can be looked at as Android and upstream converge).
Dropped various oddities like setting MTRRs on a virtual frame buffer
emulation...

With the drivers so far you can now boot a Linux initrd and have fun.

[sheng@linux.intel.com: cleaned up to handle x86]
[thomas.keel@intel.com: ported to 3.4]
[alan@linux.intel.com: cleaned up for style and 3.7, moved blank methods]
Signed-off-by: Mike A. Chan <mikechan@google.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Tom Keel <thomas.keel@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofbcon: clear the logo bitmap from the margin area
Kamal Mostafa [Wed, 20 Feb 2013 02:13:37 +0000 (13:13 +1100)]
fbcon: clear the logo bitmap from the margin area

Explicitly clear_margins when clearing the logo, in case the font dimensions
are non-integral to the framebuffer dimensions.

Signed-off-by: Kamal Mostafa <kamal@whence.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrm/fb-helper: don't sleep for screen unblank when an oops is in progress
Daniel Vetter [Wed, 20 Feb 2013 02:13:37 +0000 (13:13 +1100)]
drm/fb-helper: don't sleep for screen unblank when an oops is in progress

Otherwise the system will burn even brighter and worse, leave the user
wondering what's going on exactly.

Since we already have a panic handler which will (try) to restore the
entire fbdev console mode, we can just bail out.  Inspired by a patch from
Konstantin Khlebnikov.  The callchain leading to this, cut&pasted from
Konstantin's original patch:

callstack:
panic()
bust_spinlocks(1)
unblank_screen()
vc->vc_sw->con_blank()
fbcon_blank()
fb_blank()
info->fbops->fb_blank()
drm_fb_helper_blank()
drm_fb_helper_dpms()
drm_modeset_lock_all()
mutex_lock(&dev->mode_config.mutex)

Note that the entire locking in the fb helper around panic/sysrq and kdbg
is ...  non-existant.  So we have a decent change of blowing up
everything.  But since reworking this ties in with funny concepts like the
fbdev notifier chain or the impressive things which happen around
console_lock while oopsing, I'll leave that as an exercise for braver
souls than me.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Dave Airlie <airlied@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm: use vm_unmapped_area() on powerpc architecture
Michel Lespinasse [Wed, 20 Feb 2013 02:13:36 +0000 (13:13 +1100)]
mm: use vm_unmapped_area() on powerpc architecture

Update the powerpc slice_get_unmapped_area function to make use of
vm_unmapped_area() instead of implementing a brute force search.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm: remove free_area_cache use in powerpc architecture
Michel Lespinasse [Wed, 20 Feb 2013 02:13:36 +0000 (13:13 +1100)]
mm: remove free_area_cache use in powerpc architecture

As all other architectures have been converted to use vm_unmapped_area(),
we are about to retire the free_area_cache.

This change simply removes the use of that cache in
slice_get_unmapped_area(), which will most certainly have a
performance cost. Next one will convert that function to use the
vm_unmapped_area() infrastructure and regain the performance.

Signed-off-by: Michel Lespinasse <walken@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agopcmcia: move unbind/rebind into dev_pm_ops.complete
Christian Lamparter [Wed, 20 Feb 2013 02:13:36 +0000 (13:13 +1100)]
pcmcia: move unbind/rebind into dev_pm_ops.complete

Move the device rebind procedures for cardbus devices from the pm.resume
into the pm.complete callback.

The reason for moving the code is: "[...] The PM code needs to send
suspend and resume messages to every device in the right order, and it
can't do that if new devices are being added at the same time.  [...]"

However the situation really isn't quite that rigid.  In particular,
adding new children during a resume callback shouldn't cause much of
problem because the children don't need to be resumed anyway (since they
were never suspended).  On the other hand, if you do it you will get a
dev_warn() from the PM core, something like 'parent should not be
sleeping'.

Still, it is considered bad form and should be avoided if possible."

(Alan Stern's full comment about the topic can
be found here: <https://lkml.org/lkml/2012/7/10/254>)

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocris: Use "int" for ssize_t to match size_t
Geert Uytterhoeven [Wed, 20 Feb 2013 02:13:35 +0000 (13:13 +1100)]
cris: Use "int" for ssize_t to match size_t

On cris-linux-gcc, __SIZE_TYPE__ expands to "unsigned int", as
gcc-4.6.3-nolibc/cris-linux/lib/gcc/cris-linux/4.6.3/plugin/include/config/cris/linux.h
has

    #define SIZE_TYPE "unsigned int"

Hence __kernel_size_t is also "unsigned int".  But __kernel_ssize_t is
"long", which has a different base type, causing compiler warnings like:

    fs/quota/quota_tree.c:372:4: warning: format '%zd' expects argument of type 'signed size_t', but argument 4 has type 'ssize_t' [-Wformat]

To fix this, __kernel_ssize_t should be changed to "int". Hence cris can
just use the generic 32-bit versions from include/asm-generic/posix_types.h
for all size-related types.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Mikael Starvik <starvik@axis.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomn10300: use for_each_pci_dev to simplify the code
Wei Yongjun [Wed, 20 Feb 2013 02:13:35 +0000 (13:13 +1100)]
mn10300: use for_each_pci_dev to simplify the code

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/md/persistent-data/dm-transaction-manager.c: rename HASH_SIZE
Andrew Morton [Wed, 20 Feb 2013 02:13:35 +0000 (13:13 +1100)]
drivers/md/persistent-data/dm-transaction-manager.c: rename HASH_SIZE

drivers/md/persistent-data/dm-transaction-manager.c:28:1: warning: "HASH_SIZE" redefined
In file included from include/linux/elevator.h:5,
                 from include/linux/blkdev.h:216,
                 from drivers/md/persistent-data/dm-block-manager.h:11,
                 from drivers/md/persistent-data/dm-transaction-manager.h:10,
                 from drivers/md/persistent-data/dm-transaction-manager.c:6:
include/linux/hashtable.h:22:1: warning: this is the location of the previous definition
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agox86: make 'mem=' option to work for efi platform
Wen Congyang [Wed, 20 Feb 2013 02:13:34 +0000 (13:13 +1100)]
x86: make 'mem=' option to work for efi platform

Current mem boot option only can work for non efi environment.  If the
user specifies add_efi_memmap, it cannot work for efi environment.  In the
efi environment, we call e820_add_region() to add the memory map.  So we
can modify __e820_add_region() and the mem boot option can work for efi
environment.

Note: Only E820_RAM is limited, and BOOT_SERVICES_{CODE,DATA} are always
mapped(If its address >= mem_limit, the memory won't be freed in
efi_free_boot_services()).

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Rob Landley <rob@landley.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agopageattr: prevent PSE and GLOABL leftovers to confuse pmd/pte_present and pmd_huge
Andrea Arcangeli [Wed, 20 Feb 2013 02:13:34 +0000 (13:13 +1100)]
pageattr: prevent PSE and GLOABL leftovers to confuse pmd/pte_present and pmd_huge

Without this patch any kernel code that reads kernel memory in non
present kernel pte/pmds (as set by pageattr.c) will crash.

With this kernel code:

static struct page *crash_page;
static unsigned long *crash_address;
[..]
crash_page = alloc_pages(GFP_KERNEL, 9);
crash_address = page_address(crash_page);
if (set_memory_np((unsigned long)crash_address, 1))
printk("set_memory_np failure\n");
[..]

The kernel will crash if inside the "crash tool" one would try to read
the memory at the not present address.

crash> p crash_address
crash_address = $8 = (long unsigned int *) 0xffff88023c000000
crash> rd 0xffff88023c000000
[ *lockup* ]

The lockup happens because _PAGE_GLOBAL and _PAGE_PROTNONE shares the
same bit, and pageattr leaves _PAGE_GLOBAL set on a kernel pte which
is then mistaken as _PAGE_PROTNONE (so pte_present returns true by
mistake and the kernel fault then gets confused and loops).

With THP the same can happen after we taught pmd_present to check
_PAGE_PROTNONE and _PAGE_PSE in commit 027ef6c87853b0a9df5317 ("mm: thp:
fix pmd_present for split_huge_page and PROT_NONE with THP").  THP has the
same problem with _PAGE_GLOBAL as the 4k pages, but it also has a problem
with _PAGE_PSE, which must be cleared too.

After the patch is applied copy_user correctly returns -EFAULT and
doesn't lockup anymore.

crash> p crash_address
crash_address = $9 = (long unsigned int *) 0xffff88023c000000
crash> rd 0xffff88023c000000
rd: read error: kernel virtual address: ffff88023c000000  type: "64-bit KVADDR"

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Shaohua Li <shaohua.li@intel.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoRevert "x86, mm: Make spurious_fault check explicitly check the PRESENT bit"
Andrea Arcangeli [Wed, 20 Feb 2013 02:13:34 +0000 (13:13 +1100)]
Revert "x86, mm: Make spurious_fault check explicitly check the PRESENT bit"

I got a report for a minor regression introduced by commit 027ef6c87853b
("mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP").

So the problem is, pageattr creates kernel pagetables (pte and pmds) that
breaks pte_present/pmd_present and the patch above exposed this invariant
breakage for pmd_present.

The same problem already existed for the pte and pte_present and it was
fixed by commit 660a293ea9be709 ("x86, mm: Make spurious_fault check
explicitly check the PRESENT bit") (if it wasn't for that commit, it
wouldn't even be a regression).  That fix avoids the pagefault to use
pte_present.  I could follow through by stopping using
pmd_present/pmd_huge too.

However I think it's more robust to fix pageattr and to clear the
PSE/GLOBAL bitflags too in addition to the present bitflag.  So the kernel
page fault can keep using the regular pte_present/pmd_present/pmd_huge.

The confusion arises because _PAGE_GLOBAL and _PAGE_PROTNONE are sharing
the same bit, and in the pmd case we pretend _PAGE_PSE to be set only in
present pmds (to facilitate split_huge_page final tlb flush).

This patch:

Revert commit 660a293ea9be709 ("x86, mm: Make spurious_fault check
explicitly check the PRESENT bit").

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Shaohua Li <shaohua.li@intel.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agox86 numa: don't check if node is NUMA_NO_NODE
Wen Congyang [Wed, 20 Feb 2013 02:13:33 +0000 (13:13 +1100)]
x86 numa: don't check if node is NUMA_NO_NODE

If we aren't debugging per_cpu maps, the cpu's node is stored in per_cpu
variable numa_node.  If `node' is NUMA_NO_NODE, it means the caller wants
to clear the cpu's node.  So we should also call set_cpu_numa_node() in
this case.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofs/block_dev.c: page cache wrongly left invalidated after revalidate_disk()
MITSUNARI Shigeo [Wed, 20 Feb 2013 02:13:33 +0000 (13:13 +1100)]
fs/block_dev.c: page cache wrongly left invalidated after revalidate_disk()

We found that bdev->bd_invalidated was left set once revalidate_disk() is
called, which results in page cache flush every time that device is open.

Specifically, we found this problem in MD block device.  Once we resize a
MD device, mdadm --monitor periodically flush all page cache for that
device every 60 or 1000 seconds when it opens the device.

This bug lies since at least 3.2.0 till the latest kernel(3.6.2).
Patch is attached.

The following steps will reproduce the problem.

1. prepair a block device(ex. /dev/sdb).
2. create two partitions.

sudo parted /dev/sdb
mklabel gpt
mkpart primary 0% 50%
mkpart primary 50% 100%

3. create a md device.

sudo mdadm -C /dev/md/hoge -l 1 -n 2 -e 1.2 --assume-clean --auto=md \
 --symlink=no /dev/sdb1 /dev/sdb2

4. create file system and mount it

sudo mkfs.ext3 /dev/md/hoge
sudo mkdir /mnt/test
sudo mount /dev/md/hoge /mnt/test

5. try to resize the device

sudo mdadm -G /dev/md/hoge --size=max

6. create a file to fill file cache.

sudo dd if=/dev/urandom of=/mnt/test/data bs=1M count=10
and verity the current status of file by free command.

7. mdadm monitor will open the md device every 1000 seconds
and you will find all file cache on the device are cleared.

The timing can be reduced by the following steps.

a) kill mdadm and restart it with --delay option
/sbin/mdadm --monitor --delay=30 --pid-file /var/run/mdadm/monitor.pid \
 --daemonise --scan --syslog

or open the md device directly.

sudo dd if=/dev/md/hoge of=/dev/null bs=4096 count=1

Signed-off-by: MITSUNARI Shigeo <herumi@nifty.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoinotify: remove broken mask checks causing unmount to be EINVAL
Jim Somerville [Wed, 20 Feb 2013 02:13:33 +0000 (13:13 +1100)]
inotify: remove broken mask checks causing unmount to be EINVAL

Running the command:

inotifywait -e unmount /mnt/disk

immediately aborts with a -EINVAL return code.  This is however a valid
parameter.  This abort occurs only if unmount is the sole event parameter.
 If other event parameters are supplied, then the unmount event wait will
work.

The problem was introduced by commit 44b350fc23e ("inotify: Fix mask
checks").  In that commit, it states:

The mask checks in inotify_update_existing_watch() and
inotify_new_watch() are useless because inotify_arg_to_mask()
sets FS_IN_IGNORED and FS_EVENT_ON_CHILD bits anyway.

But instead of removing the useless checks, it did this:

        mask = inotify_arg_to_mask(arg);
-       if (unlikely(!mask))
+       if (unlikely(!(mask & IN_ALL_EVENTS)))
                return -EINVAL;

The problem is that IN_ALL_EVENTS doesn't include IN_UNMOUNT, and other
parts of the code keep IN_UNMOUNT separate from IN_ALL_EVENTS.  So the
check should be:

if (unlikely(!(mask & (IN_ALL_EVENTS | IN_UNMOUNT))))

But inotify_arg_to_mask(arg) always sets the IN_UNMOUNT bit in the mask
anyway, so the check is always going to pass and thus should simply be
removed.  Also note that inotify_arg_to_mask completely controls what mask
bits get set from arg, there's no way for invalid bits to get enabled
there.

Lets fix it by simply removing the useless broken checks.

Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: John McCutchan <john@johnmccutchan.com>
Cc: Robert Love <rlove@rlove.org>
Cc: Eric Paris <eparis@parisplace.org>
Cc: <stable@vger.kernel.org> [2.6.37+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocompat: return -EFAULT on error in waitid()
Dan Carpenter [Wed, 20 Feb 2013 02:13:32 +0000 (13:13 +1100)]
compat: return -EFAULT on error in waitid()

The copy_to_user() call returns the number of bytes remaining but we want
to return -EFAULT on error.

Fixes "x32: fix waitid()"

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoproc: avoid extra pde_put() in proc_fill_super()
Maxim Patlasov [Wed, 20 Feb 2013 02:13:32 +0000 (13:13 +1100)]
proc: avoid extra pde_put() in proc_fill_super()

If proc_get_inode() succeeded, but d_make_root() failed, pde_put() for
proc_root will be called twice: the first time due to iput() called from
d_make_root() and the second time directly in the end of
proc_fill_super().

Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobugh-compilerh-introduce-compiletime_assert-build_bug_on_msg-checkpatch-fixes
Andrew Morton [Wed, 20 Feb 2013 02:13:31 +0000 (13:13 +1100)]
bugh-compilerh-introduce-compiletime_assert-build_bug_on_msg-checkpatch-fixes

WARNING: please, no space before tabs
#56: FILE: include/linux/bug.h:45:
+ * ^I^I      error message.$

total: 0 errors, 1 warnings, 88 lines checked

./patches/bugh-compilerh-introduce-compiletime_assert-build_bug_on_msg.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Daniel Santos <daniel.santos@pobox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG
Daniel Santos [Wed, 20 Feb 2013 02:13:31 +0000 (13:13 +1100)]
bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG

Introduce compiletime_assert to compiler.h, which moves the details of how
to break a build and emit an error message for a specific compiler to the
headers where these details should be.  Following in the tradition of the
POSIX assert macro, compiletime_assert creates a build-time error when the
supplied condition is *false*.

Next, we add BUILD_BUG_ON_MSG to bug.h which simply wraps
compiletime_assert, inverting the logic, so that it fails when the
condition is *true*, consistent with the language "build bug on." This
macro allows you to specify the error message you want emitted when the
supplied condition is true.

Finally, we remove all other code from bug.h that mucks with these details
(BUILD_BUG & BUILD_BUG_ON), and have them all call BUILD_BUG_ON_MSG.  This
not only reduces source code bloat, but also prevents the possibility of
code being changed for one macro and not for the other (which was
previously the case for BUILD_BUG and BUILD_BUG_ON).

Since __compiletime_error_fallback is now only used in compiler.h, I'm
considering it a private macro and removing the double negation that's now
extraneous.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocompiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}
Daniel Santos [Wed, 20 Feb 2013 02:13:31 +0000 (13:13 +1100)]
compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

Prior to the introduction of __attribute__((error("msg"))) in gcc 4.3,
creating compile-time errors required a little trickery.  BUILD_BUG{,_ON}
uses this attribute when available to generate compile-time errors, but
also uses the negative-sized array trick for older compilers, resulting in
two error messages in some cases.  The reason it's "some" cases is that as
of gcc 4.4, the negative-sized array will not create an error in some
situations, like inline functions.

This patch replaces the negative-sized array code with the new
__compiletime_error_fallback() macro which expands to the same thing
unless the the error attribute is available, in which case it expands to
do{}while(0), resulting in exactly one compile-time error on all versions
of gcc.

Note that we are not changing the negative-sized array code for the
unoptimized version of BUILD_BUG_ON, since it has the potential to catch
problems that would be disabled in later versions of gcc were
__compiletime_error_fallback used.  The reason is that that an unoptimized
build can't always remove calls to an error-attributed function call (like
we are using) that should effectively become dead code if it were
optimized.  However, using a negative-sized array with a similar value
will not result in an false-positive (error).  The only caveat being that
it will also fail to catch valid conditions, which we should be expecting
in an unoptimized build anyway.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobug.h: Make BUILD_BUG_ON generate compile-time error
Daniel Santos [Wed, 20 Feb 2013 02:13:30 +0000 (13:13 +1100)]
bug.h: Make BUILD_BUG_ON generate compile-time error

Negative sized arrays wont create a compile-time error in some cases
starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced
the error function attribute that will.  This patch modifies BUILD_BUG_ON
to behave like BUILD_BUG already does, using the error function attribute
so that you don't have to build the entire kernel to discover that you
have a problem, and then enjoy trying to track it down from a link-time
error.

Also, we are only including asm/bug.h and then expecting that
linux/compiler.h will eventually be included to define __linktime_error
(used in BUILD_BUG_ON).  This patch includes it directly for clarity and
to avoid the possibility of changes in <arch>/*/include/asm/bug.h being
changed or not including linux/compiler.h for some reason.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobugh-prevent-double-evaulation-of-in-build_bug_on-fix
Andrew Morton [Wed, 20 Feb 2013 02:13:30 +0000 (13:13 +1100)]
bugh-prevent-double-evaulation-of-in-build_bug_on-fix

tweak code layout

Cc: Daniel Santos <daniel.santos@pobox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobug.h: Prevent double evaulation of in BUILD_BUG_ON
Daniel Santos [Wed, 20 Feb 2013 02:13:30 +0000 (13:13 +1100)]
bug.h: Prevent double evaulation of in BUILD_BUG_ON

When calling BUILD_BUG_ON in an optimized build using gcc 4.3 and later,
the condition will be evaulated twice, possibily with side-effects.  This
patch eliminates that error.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobug.h: Fix BUILD_BUG_ON macro in __CHECKER__
Daniel Santos [Wed, 20 Feb 2013 02:13:30 +0000 (13:13 +1100)]
bug.h: Fix BUILD_BUG_ON macro in __CHECKER__

When __CHECKER__ is defined, we disable all of the BUILD_BUG.* macros.
However, both BUILD_BUG_ON_NOT_POWER_OF_2 and BUILD_BUG_ON was evaluating
to nothing in this case, and we want (0) since this is a function-like
macro that will be followed by a semicolon.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocompiler{,-gcc4}.h, bug.h: Remove duplicate macros
Daniel Santos [Wed, 20 Feb 2013 02:13:29 +0000 (13:13 +1100)]
compiler{,-gcc4}.h, bug.h: Remove duplicate macros

__linktime_error() does the same thing as __compiletime_error() and is
only used in bug.h.  Since the macro defines a function attribute that
will cause a failure at compile-time (not link-time), it makes more sense
to keep __compiletime_error(), which is also neatly mated with
__compiletime_warning().

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocompiler-gcc{3,4}.h: Use GCC_VERSION macro
Daniel Santos [Wed, 20 Feb 2013 02:13:29 +0000 (13:13 +1100)]
compiler-gcc{3,4}.h: Use GCC_VERSION macro

Using GCC_VERSION reduces complexity, is easier to read and is GCC's
recommended mechanism for doing version checks.  (Just don't ask me why
they didn't define it in the first place.) This also makes it easy to
merge compiler-gcc{,3,4}.h should somebody want to.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocompiler-gcc.h: Add gcc-recommended GCC_VERSION macro
Daniel Santos [Wed, 20 Feb 2013 02:13:29 +0000 (13:13 +1100)]
compiler-gcc.h: Add gcc-recommended GCC_VERSION macro

Throughout compiler*.h, many version checks are made.  These can be
simplified by using the macro that gcc's documentation recommends.
However, my primary reason for adding this is that I need bug-check macros
that are enabled at certain gcc versions and it's cleaner to use this
macro than the tradition method:

if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ => 2)

If you add patch level, it gets this ugly:

if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 2 || \
   __GNUC_MINOR__ == 2 __GNUC_PATCHLEVEL__ >= 1))

As opposed to:

if GCC_VERSION >= 40201

While having separate headers for gcc 3 & 4 eliminates some of this
verbosity, they can still be cleaned up by this.

See also:
http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocompiler-gcc4.h: Reorder macros based upon gcc ver
Daniel Santos [Wed, 20 Feb 2013 02:13:28 +0000 (13:13 +1100)]
compiler-gcc4.h: Reorder macros based upon gcc ver

This helps to keep the file from getting confusing, removes one duplicate
version check and should encourage future editors to put new macros where
they belong.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoMerge branch 'akpm-current/current'
Stephen Rothwell [Wed, 20 Feb 2013 05:51:32 +0000 (16:51 +1100)]
Merge branch 'akpm-current/current'

11 years agoMerge remote-tracking branch 'modem_shm/remoteproc-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:41:16 +0000 (16:41 +1100)]
Merge remote-tracking branch 'modem_shm/remoteproc-next'

11 years agoMerge remote-tracking branch 'lzo-update/lzo-update'
Stephen Rothwell [Wed, 20 Feb 2013 05:39:28 +0000 (16:39 +1100)]
Merge remote-tracking branch 'lzo-update/lzo-update'

11 years agoMerge remote-tracking branch 'clk/clk-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:37:50 +0000 (16:37 +1100)]
Merge remote-tracking branch 'clk/clk-next'

Conflicts:
include/asm-generic/vmlinux.lds.h

11 years agoMerge remote-tracking branch 'signal/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:30:49 +0000 (16:30 +1100)]
Merge remote-tracking branch 'signal/for-next'

Conflicts:
arch/mips/kernel/linux32.c
arch/mips/kernel/process.c
arch/mips/kernel/scall64-o32.S
arch/mips/kernel/signal.c
arch/mips/kernel/signal32.c
arch/mips/kernel/signal_n32.c
arch/mips/kernel/syscall.c
arch/powerpc/Kconfig
arch/s390/Kconfig
arch/x86/Kconfig

11 years agoMerge remote-tracking branch 'ktest/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:29:16 +0000 (16:29 +1100)]
Merge remote-tracking branch 'ktest/for-next'

11 years agoMerge remote-tracking branch 'userns/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:27:27 +0000 (16:27 +1100)]
Merge remote-tracking branch 'userns/for-next'

Conflicts:
net/sunrpc/svcauth_unix.c

11 years agoMerge remote-tracking branch 'dma-buf/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:25:53 +0000 (16:25 +1100)]
Merge remote-tracking branch 'dma-buf/for-next'

11 years agoMerge remote-tracking branch 'pwm/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:24:24 +0000 (16:24 +1100)]
Merge remote-tracking branch 'pwm/for-next'

11 years agoMerge remote-tracking branch 'dma-mapping/dma-mapping-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:22:54 +0000 (16:22 +1100)]
Merge remote-tracking branch 'dma-mapping/dma-mapping-next'

11 years agoMerge remote-tracking branch 'tegra/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:22:51 +0000 (16:22 +1100)]
Merge remote-tracking branch 'tegra/for-next'

11 years agoMerge remote-tracking branch 'samsung/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:21:16 +0000 (16:21 +1100)]
Merge remote-tracking branch 'samsung/for-next'

11 years agoMerge remote-tracking branch 'renesas/next'
Stephen Rothwell [Wed, 20 Feb 2013 05:19:39 +0000 (16:19 +1100)]
Merge remote-tracking branch 'renesas/next'

11 years agoMerge remote-tracking branch 'ixp4xx/next'
Stephen Rothwell [Wed, 20 Feb 2013 05:19:30 +0000 (16:19 +1100)]
Merge remote-tracking branch 'ixp4xx/next'

11 years agoMerge remote-tracking branch 'ep93xx/ep93xx-for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:19:27 +0000 (16:19 +1100)]
Merge remote-tracking branch 'ep93xx/ep93xx-for-next'

11 years agoMerge remote-tracking branch 'cortex/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:17:55 +0000 (16:17 +1100)]
Merge remote-tracking branch 'cortex/for-next'

Conflicts:
arch/arm/include/asm/cputype.h

11 years agoMerge remote-tracking branch 'arm-soc/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:10:13 +0000 (16:10 +1100)]
Merge remote-tracking branch 'arm-soc/for-next'

Conflicts:
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-zoom-peripherals.c
arch/arm/mach-s3c64xx/dma.c
arch/arm/mach-shmobile/setup-r8a7740.c
arch/arm/mach-shmobile/setup-sh73a0.c
arch/arm/mach-spear13xx/spear1340.c
arch/arm/mach-spear3xx/spear3xx.c
arch/arm/mach-spear6xx/spear6xx.c
arch/arm/mach-zynq/common.c
drivers/clk/Makefile
drivers/clocksource/Kconfig
drivers/clocksource/Makefile
drivers/crypto/omap-sham.c
drivers/input/keyboard/tegra-kbc.c
drivers/irqchip/Makefile
drivers/mfd/db8500-prcmu.c
drivers/mmc/card/block.c
drivers/mmc/core/core.c
drivers/mmc/core/sdio.c
drivers/mmc/host/sdhci-bcm2835.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-pxav3.c
drivers/mmc/host/sh_mmcif.c
drivers/pinctrl/pinctrl-nomadik.c
include/linux/mmc/host.h

11 years agoMerge remote-tracking branch 'gpio-lw/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:05:41 +0000 (16:05 +1100)]
Merge remote-tracking branch 'gpio-lw/for-next'

11 years agoMerge remote-tracking branch 'gpio/gpio/next'
Stephen Rothwell [Wed, 20 Feb 2013 05:04:00 +0000 (16:04 +1100)]
Merge remote-tracking branch 'gpio/gpio/next'

11 years agoMerge remote-tracking branch 'irqdomain/irqdomain/next'
Stephen Rothwell [Wed, 20 Feb 2013 05:02:31 +0000 (16:02 +1100)]
Merge remote-tracking branch 'irqdomain/irqdomain/next'

11 years agoMerge remote-tracking branch 'vhost/linux-next'
Stephen Rothwell [Wed, 20 Feb 2013 05:00:51 +0000 (16:00 +1100)]
Merge remote-tracking branch 'vhost/linux-next'

Conflicts:
drivers/vhost/Makefile

11 years agoMerge remote-tracking branch 'pinctrl/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:47:49 +0000 (15:47 +1100)]
Merge remote-tracking branch 'pinctrl/for-next'

Conflicts:
drivers/gpio/Kconfig
drivers/pinctrl/pinctrl-nomadik.c
include/linux/mfd/abx500/ab8500.h

11 years agoMerge remote-tracking branch 'writeback/writeback-for-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:45:03 +0000 (15:45 +1100)]
Merge remote-tracking branch 'writeback/writeback-for-next'

11 years agoMerge remote-tracking branch 'char-misc/char-misc-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:43:27 +0000 (15:43 +1100)]
Merge remote-tracking branch 'char-misc/char-misc-next'

Conflicts:
drivers/char/pcmcia/synclink_cs.c
drivers/ipack/devices/ipoctal.c
drivers/mfd/wm5102-tables.c
include/linux/mfd/arizona/pdata.h

11 years agoMerge remote-tracking branch 'staging/staging-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:39:42 +0000 (15:39 +1100)]
Merge remote-tracking branch 'staging/staging-next'

Conflicts:
drivers/staging/et131x/et131x.c

11 years agoMerge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:38:04 +0000 (15:38 +1100)]
Merge remote-tracking branch 'usb/usb-next'

Conflicts:
drivers/usb/gadget/Kconfig
drivers/usb/host/ehci-vt8500.c
drivers/usb/musb/omap2430.c
drivers/usb/phy/omap-usb2.c

11 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:32:35 +0000 (15:32 +1100)]
Merge remote-tracking branch 'tty/tty-next'

Conflicts:
drivers/i2c/busses/Kconfig
drivers/lguest/Kconfig
drivers/net/can/Kconfig
drivers/net/wan/Kconfig

11 years agoMerge remote-tracking branch 'driver-core/driver-core-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:25:06 +0000 (15:25 +1100)]
Merge remote-tracking branch 'driver-core/driver-core-next'

Conflicts:
drivers/acpi/Kconfig
drivers/dma/dw_dmac.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/iommu/tegra-smmu.c
drivers/net/ethernet/8390/Kconfig
drivers/net/ethernet/fujitsu/Kconfig
drivers/net/ethernet/i825xx/Kconfig
drivers/net/ethernet/intel/Kconfig
drivers/net/ethernet/racal/Kconfig
drivers/net/ethernet/seeq/Kconfig
drivers/net/wan/Kconfig
drivers/net/wireless/rtlwifi/Kconfig
drivers/spi/Kconfig
drivers/spi/spi-s3c64xx.c
drivers/vhost/Kconfig
drivers/vhost/Kconfig.tcm
net/wanrouter/Kconfig

11 years agoMerge remote-tracking branch 'leds/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:19:29 +0000 (15:19 +1100)]
Merge remote-tracking branch 'leds/for-next'

11 years agoMerge remote-tracking branch 'regmap/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:17:53 +0000 (15:17 +1100)]
Merge remote-tracking branch 'regmap/for-next'

11 years agoMerge remote-tracking branch 'drivers-x86/linux-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:16:16 +0000 (15:16 +1100)]
Merge remote-tracking branch 'drivers-x86/linux-next'

Conflicts:
drivers/platform/x86/apple-gmux.c
drivers/platform/x86/compal-laptop.c
drivers/platform/x86/fujitsu-tablet.c
drivers/platform/x86/ideapad-laptop.c
drivers/platform/x86/intel_oaktrail.c
drivers/platform/x86/toshiba_acpi.c

11 years agoMerge remote-tracking branch 'workqueues/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:08:52 +0000 (15:08 +1100)]
Merge remote-tracking branch 'workqueues/for-next'

11 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Wed, 20 Feb 2013 04:02:20 +0000 (15:02 +1100)]
Merge remote-tracking branch 'xen-two/linux-next'

11 years agoMerge remote-tracking branch 'kvm-ppc/kvm-ppc-next'
Stephen Rothwell [Wed, 20 Feb 2013 03:59:34 +0000 (14:59 +1100)]
Merge remote-tracking branch 'kvm-ppc/kvm-ppc-next'

11 years agoMerge remote-tracking branch 'kvm/linux-next'
Stephen Rothwell [Wed, 20 Feb 2013 03:57:55 +0000 (14:57 +1100)]
Merge remote-tracking branch 'kvm/linux-next'

Conflicts:
arch/s390/include/asm/irq.h
arch/s390/kernel/irq.c
arch/x86/include/asm/vmx.h
include/uapi/linux/kvm.h

11 years agoMerge remote-tracking branch 'ftrace/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 03:51:29 +0000 (14:51 +1100)]
Merge remote-tracking branch 'ftrace/for-next'

11 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Wed, 20 Feb 2013 03:43:53 +0000 (14:43 +1100)]
Merge remote-tracking branch 'tip/auto-latest'

Conflicts:
arch/powerpc/configs/pasemi_defconfig
arch/s390/Kconfig
kernel/timeconst.pl

11 years agoMerge remote-tracking branch 'spi/spi/next'
Stephen Rothwell [Wed, 20 Feb 2013 03:41:07 +0000 (14:41 +1100)]
Merge remote-tracking branch 'spi/spi/next'

Conflicts:
drivers/spi/spi-s3c64xx.c

11 years agoMerge remote-tracking branch 'devicetree/devicetree/next'
Stephen Rothwell [Wed, 20 Feb 2013 03:38:17 +0000 (14:38 +1100)]
Merge remote-tracking branch 'devicetree/devicetree/next'

11 years agoMerge remote-tracking branch 'edac-amd/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 03:36:48 +0000 (14:36 +1100)]
Merge remote-tracking branch 'edac-amd/for-next'

11 years agoMerge remote-tracking branch 'edac/linux_next'
Stephen Rothwell [Wed, 20 Feb 2013 03:35:18 +0000 (14:35 +1100)]
Merge remote-tracking branch 'edac/linux_next'

11 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Wed, 20 Feb 2013 03:28:05 +0000 (14:28 +1100)]
Merge remote-tracking branch 'trivial/for-next'

Conflicts:
arch/mips/cavium-octeon/executive/cvmx-helper-util.c
arch/mips/include/asm/octeon/cvmx-helper-util.h

11 years agoMerge remote-tracking branch 'vfio/next'
Stephen Rothwell [Wed, 20 Feb 2013 03:26:28 +0000 (14:26 +1100)]
Merge remote-tracking branch 'vfio/next'

11 years agoMerge remote-tracking branch 'iommu/next'
Stephen Rothwell [Wed, 20 Feb 2013 03:24:57 +0000 (14:24 +1100)]
Merge remote-tracking branch 'iommu/next'

Conflicts:
arch/arm/mach-exynos/mach-exynos5-dt.c

11 years agoMerge remote-tracking branch 'watchdog/master'
Stephen Rothwell [Wed, 20 Feb 2013 03:23:20 +0000 (14:23 +1100)]
Merge remote-tracking branch 'watchdog/master'

Conflicts:
drivers/watchdog/Kconfig
drivers/watchdog/Makefile