]> Pileus Git - ~andy/linux/log
~andy/linux
14 years agospi: controller driver for Designware SPI core
Feng Tang [Mon, 14 Dec 2009 22:20:22 +0000 (14:20 -0800)]
spi: controller driver for Designware SPI core

Driver for the Designware SPI core, it supports multipul interfaces like
PCI/APB etc.  User can use "dw_apb_ssi_db.pdf" from Synopsys as HW
datasheet.

[randy.dunlap@oracle.com: fix build]
[akpm@linux-foundation.org: build fix]
Signed-off-by: Feng Tang <feng.tang@intel.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agospidev: add proper section markers
Mike Frysinger [Mon, 14 Dec 2009 22:20:22 +0000 (14:20 -0800)]
spidev: add proper section markers

The driver already uses __devexit_p() in the structure, but looks like
actual __dev{init,exit} markings were forgotten.

The spidev_spi driver also needs renaming to include a "_driver" suffix to
avoid section mismatch warnings.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agospidev: use DECLARE_BITMAP instead of declaring the array
Thadeu Lima de Souza Cascardo [Mon, 14 Dec 2009 22:20:23 +0000 (14:20 -0800)]
spidev: use DECLARE_BITMAP instead of declaring the array

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agoMerge branch 'for-33' of git://repo.or.cz/linux-kbuild
Linus Torvalds [Thu, 17 Dec 2009 15:23:42 +0000 (07:23 -0800)]
Merge branch 'for-33' of git://repo.or.cz/linux-kbuild

* 'for-33' of git://repo.or.cz/linux-kbuild: (29 commits)
  net: fix for utsrelease.h moving to generated
  gen_init_cpio: fixed fwrite warning
  kbuild: fix make clean after mismerge
  kbuild: generate modules.builtin
  genksyms: properly consider  EXPORT_UNUSED_SYMBOL{,_GPL}()
  score: add asm/asm-offsets.h wrapper
  unifdef: update to upstream revision 1.190
  kbuild: specify absolute paths for cscope
  kbuild: create include/generated in silentoldconfig
  scripts/package: deb-pkg: use fakeroot if available
  scripts/package: add KBUILD_PKG_ROOTCMD variable
  scripts/package: tar-pkg: use tar --owner=root
  Kbuild: clean up marker
  net: add net_tstamp.h to headers_install
  kbuild: move utsrelease.h to include/generated
  kbuild: move autoconf.h to include/generated
  drop explicit include of autoconf.h
  kbuild: move compile.h to include/generated
  kbuild: drop include/asm
  kbuild: do not check for include/asm-$ARCH
  ...

Fixed non-conflicting clean merge of modpost.c as per comments from
Stephen Rothwell (modpost.c had grown an include of linux/autoconf.h
that needed to be changed to generated/autoconf.h)

14 years agoRevert "fbdev: atafb - add palette register check"
Geert Uytterhoeven [Thu, 17 Dec 2009 13:15:09 +0000 (14:15 +0100)]
Revert "fbdev: atafb - add palette register check"

This reverts commit 8546e3ce6e37c359979b69862442f94e0ef0e03b, as it's a
partial duplicate of commit 2f390380ca69e1617cdddb12d8da94f0a9f4319d
("fbdev: add palette register check to several drivers").

The former went in first through the m68k tree, the latter through Andrew
Morton.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agox86/ptrace: make genregs[32]_get/set more robust
Linus Torvalds [Thu, 17 Dec 2009 15:04:56 +0000 (07:04 -0800)]
x86/ptrace: make genregs[32]_get/set more robust

The loop condition is fragile: we compare an unsigned value to zero, and
then decrement it by something larger than one in the loop.  All the
callers should be passing in appropriately aligned buffer lengths, but
it's better to just not rely on it, and have some appropriate defensive
loop limits.

Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agox86: Don't use POSIX character classes in gen-insn-attr-x86.awk
Roland Dreier [Thu, 17 Dec 2009 01:39:48 +0000 (17:39 -0800)]
x86: Don't use POSIX character classes in gen-insn-attr-x86.awk

Not all awk implementations (including the default awk in Ubuntu 9.10)
support POSIX character classes.  Since x86-opcode-map.txt is plain
ASCII, we can just use explicit ranges for lower case, alphabetic, and
alphanumeric characters instead.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
LKML-Reference: <adabphy750b.fsf@roland-alpha.cisco.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMakefile: set LC_CTYPE, LC_COLLATE, LC_NUMERIC to C
H. Peter Anvin [Thu, 17 Dec 2009 14:56:11 +0000 (06:56 -0800)]
Makefile: set LC_CTYPE, LC_COLLATE, LC_NUMERIC to C

There are a number of common Unix constructs like character ranges in
grep/sed/awk which don't work as expected with LC_COLLATE set to other
than C.  Similarly, set LC_CTYPE and LC_NUMERIC to C to avoid other
nasty surprises.

In order to make sure these actually take effect we also have to
clear LC_ALL.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Acked-by: Michal Marek <mmarek@sues.cz>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Acked-by: Roland Dreier <rdreier@cisco.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <4B2A1761.4070904@suse.cz>

14 years agosched: Fix broken assertion
Peter Zijlstra [Thu, 17 Dec 2009 12:16:31 +0000 (13:16 +0100)]
sched: Fix broken assertion

There's a preemption race in the set_task_cpu() debug check in
that when we get preempted after setting task->state we'd still
be on the rq proper, but fail the test.

Check for preempted tasks, since those are always on the RQ.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20091217121830.137155561@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Assert task state bits at build time
Peter Zijlstra [Thu, 17 Dec 2009 12:16:30 +0000 (13:16 +0100)]
sched: Assert task state bits at build time

Since everybody is lazy and prone to forgetting things, make the
compiler help us a bit.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20091217121830.060186433@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Update task_state_arraypwith new states
Peter Zijlstra [Thu, 17 Dec 2009 12:16:29 +0000 (13:16 +0100)]
sched: Update task_state_arraypwith new states

Neglected because its hidden... (who reads comments anyway)

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20091217121829.970166036@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Add missing state chars to TASK_STATE_TO_CHAR_STR
Peter Zijlstra [Thu, 17 Dec 2009 12:16:28 +0000 (13:16 +0100)]
sched: Add missing state chars to TASK_STATE_TO_CHAR_STR

We grew 3 new task states since the last time someone touched
it.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20091217121829.892737686@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Move TASK_STATE_TO_CHAR_STR near the TASK_state bits
Peter Zijlstra [Thu, 17 Dec 2009 12:16:27 +0000 (13:16 +0100)]
sched: Move TASK_STATE_TO_CHAR_STR near the TASK_state bits

So that we don't keep forgetting about it.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20091217121829.815779372@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf events: Dont report side-band events on each cpu for per-task-per-cpu events
Peter Zijlstra [Thu, 17 Dec 2009 12:16:32 +0000 (13:16 +0100)]
perf events: Dont report side-band events on each cpu for per-task-per-cpu events

Acme noticed that his FORK/MMAP numbers were inflated by about
the same factor as his cpu-count.

This led to the discovery of a few more sites that need to
respect the event->cpu filter.

Reported-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20091217121830.215333434@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agobacklight: mbp_nvidia_bl - add two more MacBookPro variants
Daniel Ritz [Tue, 1 Dec 2009 23:41:31 +0000 (00:41 +0100)]
backlight: mbp_nvidia_bl - add two more MacBookPro variants

This adds the MacBookPro 5,3 and 5,4 to the DMI tables.

Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: Pass device through notify callback in the pwm driver
Ben Dooks [Tue, 10 Nov 2009 17:20:40 +0000 (17:20 +0000)]
backlight: Pass device through notify callback in the pwm driver

Add the device to the notify callback's arguments in the PWM backlight
driver. This brings the notify callback into line with the other
callbacks defined by this driver.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Simtec Linux Team <linux@simtec.co.uk>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: leds-pwm: Set led_classdev max_brightness
Lars-Peter Clausen [Fri, 27 Nov 2009 05:17:38 +0000 (06:17 +0100)]
leds: leds-pwm: Set led_classdev max_brightness

Currently the driver leds-pwm doesn't set max_brightness for the led device
although it's platform data proides a maximum brightness. Instead it stores its
own private driver struct. The max_brightness defaults to 255 for led device if
it has not been set.
As a result any leds-pwm device with a different maximum brightness will show
incorrect behavior, as it is posible to either set a longer then period duty
time or not be able to switch the led to full brightness.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: leds-lp3944.h - remove unneeded includes
Antonio Ospite [Sun, 29 Nov 2009 12:12:21 +0000 (13:12 +0100)]
leds: leds-lp3944.h - remove unneeded includes

These were needed in the first version of the driver because we used to expose
workqueue and led class details in the header file, now we don't.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: use default-on trigger for Cobalt Qube
Florian Fainelli [Thu, 26 Nov 2009 18:41:02 +0000 (19:41 +0100)]
leds: use default-on trigger for Cobalt Qube

This patch changes the default trigger from "ide-disk"
to "default-on". Users updating from kernels not having this
LED driver will prefer having the same LED behavior as they
used to.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: drivers/leds/leds-ss4200.c: fix return statement
akpm@linux-foundation.org [Sat, 14 Nov 2009 03:56:37 +0000 (19:56 -0800)]
leds: drivers/leds/leds-ss4200.c: fix return statement

drivers/leds/leds-ss4200.c: In function 'ich7_lpc_probe':
drivers/leds/leds-ss4200.c:353: warning: 'return' with no value, in function returning non-void

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: leds-pca9532.h- indent with tabs, not spaces
Antonio Ospite [Sat, 28 Nov 2009 11:55:51 +0000 (12:55 +0100)]
leds: leds-pca9532.h- indent with tabs, not spaces

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: Add LED class driver for regulator driven LEDs.
Antonio Ospite [Mon, 7 Dec 2009 14:08:13 +0000 (15:08 +0100)]
leds: Add LED class driver for regulator driven LEDs.

This driver provides an interface for controlling LEDs (or vibrators)
connected to PMICs for which there is a regulator framework driver.

This driver can be used, for instance, to control vibrator on all Motorola EZX
phones using the pcap-regulator driver services.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: PTR_ERR return of wrong pointer in cr_backlight_probe()
Roel Kluin [Mon, 7 Dec 2009 13:35:32 +0000 (14:35 +0100)]
backlight: PTR_ERR return of wrong pointer in cr_backlight_probe()

Return the PTR_ERR of the correct pointer.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: leds-cobalt-qube.c: use resource_size()
H Hartley Sweeten [Fri, 11 Dec 2009 21:50:58 +0000 (16:50 -0500)]
leds: leds-cobalt-qube.c: use resource_size()

Use resource_size() for ioremap.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: leds-cobalt-raq.c - use resource_size()
H Hartley Sweeten [Fri, 11 Dec 2009 23:13:40 +0000 (18:13 -0500)]
leds: leds-cobalt-raq.c - use resource_size()

Use resource_size() for ioremap.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoscore: include asm-generic/param.h in asm/delay.h.
Chen Liqin [Thu, 17 Dec 2009 10:31:23 +0000 (18:31 +0800)]
score: include asm-generic/param.h in asm/delay.h.

Signed-off-by: Cui Bixiong <bixiong@sunnorth.com.cn>
Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
14 years agoscore: fixed pfn_valid define.
Chen Liqin [Wed, 18 Nov 2009 05:28:13 +0000 (13:28 +0800)]
score: fixed pfn_valid define.

Signed-off-by: Cui Bixiong <bixiong@sunnorth.com.cn>
Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
modified:   arch/score/include/asm/page.h
modified:   arch/score/kernel/setup.c
modified:   arch/score/mm/init.c

14 years agoscore: add flush_dcahce_page and PG_dcache_dirty define
Chen Liqin [Wed, 18 Nov 2009 05:22:33 +0000 (13:22 +0800)]
score: add flush_dcahce_page and PG_dcache_dirty define

Signed-off-by: Cui Bixiong <bixiong@sunnorth.com.cn>
Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
modified:   arch/score/include/asm/cacheflush.h
modified:   arch/score/mm/cache.c

14 years agoregulator: wm831x_reg_read() failure unnoticed in wm831x_aldo_get_mode()
Roel Kluin [Tue, 15 Dec 2009 19:07:31 +0000 (20:07 +0100)]
regulator: wm831x_reg_read() failure unnoticed in wm831x_aldo_get_mode()

ret should be signed to notice a failure in wm831x_reg_read().

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agotwl-regulator: Fix reg_disable functionality for 4030 and 6030
Juha Keski-Saari [Wed, 16 Dec 2009 13:28:00 +0000 (15:28 +0200)]
twl-regulator: Fix reg_disable functionality for 4030 and 6030

This change makes sure all regulator group assignments are cleared on
disable call

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agotwl-regulator: Add turnon delay to reg_enable
Juha Keski-Saari [Wed, 16 Dec 2009 12:55:26 +0000 (14:55 +0200)]
twl-regulator: Add turnon delay to reg_enable

This change implements a basic turnon delay in the regulator enable function
to make it less probable that reg_enable returns before the regulator
output is at target level

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agotwl-regulator: Restore REMAP configuration in regulator probe
Juha Keski-Saari [Wed, 16 Dec 2009 13:27:58 +0000 (15:27 +0200)]
twl-regulator: Restore REMAP configuration in regulator probe

This change ensures the regulator REMAP register configuration is in a known
state so state transitions will function as intended regardless of
possible bootloader effects on it

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agotwl-regulator: Add turnon-delay and REMAP config to twlreg_info struct
Juha Keski-Saari [Wed, 16 Dec 2009 12:49:52 +0000 (14:49 +0200)]
twl-regulator: Add turnon-delay and REMAP config to twlreg_info struct

This change includes regulator turnon delay values and the REMAP reset
configuration to the twlreg_info struct, since they are basic attributes
of every TWL regulator

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agotwl-regulator: Define critical regulators as always_on
Juha Keski-Saari [Wed, 16 Dec 2009 13:27:56 +0000 (15:27 +0200)]
twl-regulator: Define critical regulators as always_on

Defines VIO, VDD1, VDD2, VPLL1 and VINT* regulators as always_on by default
since they are critical to TWL and its master's functionality and should
be on in all cases where RegFW is used

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agotwl-regulator: Add all twl4030 regulators to twlreg_info
Juha Keski-Saari [Wed, 16 Dec 2009 13:27:55 +0000 (15:27 +0200)]
twl-regulator: Add all twl4030 regulators to twlreg_info

Define all twl4030 regulators in the twlreg_info table, along with
appropriate VSEL tables for adjustable regulators

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: mc13783-regulator: correct the probing time.
Alberto Panizzo [Mon, 14 Dec 2009 17:53:35 +0000 (18:53 +0100)]
regulator: mc13783-regulator: correct the probing time.

When the mc13783-regulator driver is built in kernel, probing it during
the regulator subsystem initialisation result in a fault.

That is because regulator subsystem is planned to be initialised very early
in the boot process, before the mfd subsystem initialisation.

The mc12783-regulator probing process need to access to the mc13783-core
functionality to read/write mc13783 registers and so must be called after
the mc13783-core driver initialisation.

The way to do this is to let the kernel probe the mc13783-regulator driver when
mc13783-core register his regulator subdevice.

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Fix unbalanced disables/enables in regulator_bulk_{enable,disable} error...
Lars-Peter Clausen [Tue, 15 Dec 2009 13:30:01 +0000 (14:30 +0100)]
regulator: Fix unbalanced disables/enables in regulator_bulk_{enable,disable} error path

Currently it is possible for regulator_bulk_{enable,disable} operations to
generate unbalanced regulator_{disable,enable} calls in its error path.
In case of an error only those regulators of the bulk operation which actually
had been enabled/disabled should get their original state restored.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: core.c: Small coding style cleanup (indentation fixup)
Stefan Roese [Fri, 27 Nov 2009 14:56:34 +0000 (15:56 +0100)]
regulator: core.c: Small coding style cleanup (indentation fixup)

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agodrivers/regulator: use PTR_ERR to get error code
Julia Lawall [Sat, 21 Nov 2009 21:18:44 +0000 (22:18 +0100)]
drivers/regulator: use PTR_ERR to get error code

IS_ERR returns only 1 or 0.  The callsite of setup_regulators expects a
negative integer in an error case.  Thus, PTR_ERR has to be used to extract
it.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E,E1;
@@

*E = IS_ERR(...)
 ... when != E = E1
*return E;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: consumer.h - fix build when consumer.h is #included first.
Liam Girdwood [Wed, 11 Nov 2009 14:16:10 +0000 (14:16 +0000)]
regulator: consumer.h - fix build when consumer.h is #included first.

consumer.h requires device.h for stand alone build.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator/mc13783: various cleanups
Uwe Kleine-König [Tue, 10 Nov 2009 08:18:07 +0000 (09:18 +0100)]
regulator/mc13783: various cleanups

- define needed registers and bits in the driver
- properly namespace functions and structs
- fix locking as required by patch
  "mfd/mc13783: near complete rewrite"
- use platform_data as provided by "mfd/mc13783: near complete rewrite"
  instead of accessing struct mc13783
- struct mc13783_regulator_priv.desc is (and was) unused and so can go
  away
- use cpp magic to initialize mc13783_regulators
- bring MODULE_LICENSE in sync with actual copyright
- minor style fixes

This allows not including mc13783-private.h which I intend to remove
soon.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Acked-by: Mark Brown <broonie@opensoruce.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator/mc13783: rename source file to match other drivers
Uwe Kleine-König [Tue, 10 Nov 2009 08:18:06 +0000 (09:18 +0100)]
regulator/mc13783: rename source file to match other drivers

One annoying thing about the old name was that the module was just
called mc13783 which caused wrong expectations (at least for me).

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Acked-by: Mark Brown <broonie@opensoruce.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoFix some AB3100 regulator issues
Linus Walleij [Wed, 28 Oct 2009 16:30:15 +0000 (17:30 +0100)]
Fix some AB3100 regulator issues

This patch will remove surplus register writes on shut down of
LDO D (this magic was not needed), remove an unnecessary (!) error
check and really unregister the regulators when the module is
unloaded.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: keep index within bounds in da9034_get_ldo12_voltage()
Roel Kluin [Mon, 26 Oct 2009 11:37:11 +0000 (12:37 +0100)]
regulator: keep index within bounds in da9034_get_ldo12_voltage()

If selector equals ARRAY_SIZE(da9034_ldo12_data), that is one too
large already.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Ensure val is initialised in 88pm8607 choose_voltage()
Mark Brown [Thu, 22 Oct 2009 15:31:35 +0000 (16:31 +0100)]
regulator: Ensure val is initialised in 88pm8607 choose_voltage()

If we fall through it means that we hit an unknown regulator/chip
combination so set -ENOENT as an explicit flag (the return code
is only used internally).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Remove duplicate consts from ab3100
Mark Brown [Thu, 22 Oct 2009 15:31:34 +0000 (16:31 +0100)]
regulator: Remove duplicate consts from ab3100

'static const int const' means the same thing as 'static const int'
and sparse complains about this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Handle regulators without suspend mode configuration
Mark Brown [Thu, 22 Oct 2009 15:31:33 +0000 (16:31 +0100)]
regulator: Handle regulators without suspend mode configuration

Since some regulators in the system may not support suspend mode
configuration we need to allow some regulators to have a missing
suspend mode configuration. Do this by requiring that disabled
regulators are explicitly flagged and then skip over regulators
that have no state specified.

Try to avoid surprises by warning the if we could set the state
but no configuration is provided.  This also ensures that an all
zeros configuration generates a warning rather than silently
disabling the regulator.

Reported-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Factor out regulator name pretty printing
Mark Brown [Thu, 22 Oct 2009 15:31:32 +0000 (16:31 +0100)]
regulator: Factor out regulator name pretty printing

Some of the regulator API functions have code to allow the machine
constraints to override the device supplied name for the regulator
in the constraints in order to help tie logging to supplies on the
board and disambiguate when there is more than one regulator chip
in the system. Factor this code out into a new rdev_get_name()
function and use it throughout the regulator API so that we always
use the same name.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Display actual settings with constraints
Mark Brown [Thu, 22 Oct 2009 15:31:31 +0000 (16:31 +0100)]
regulator: Display actual settings with constraints

When voltage or current constraints are either missing or specify
a range display the actual setting along with the constraints if
we can. This can aid debugging of configuration problems.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Also lift apply_uV into machine_constraints_voltage()
Mark Brown [Thu, 22 Oct 2009 15:31:30 +0000 (16:31 +0100)]
regulator: Also lift apply_uV into machine_constraints_voltage()

It makes sense to do all the voltage configuration in the one split
out function.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Factor out voltage constraint setup
Mark Brown [Mon, 19 Oct 2009 14:53:50 +0000 (15:53 +0100)]
regulator: Factor out voltage constraint setup

This allows constraints to take effect on regulators that support
voltage setting but for which the board does not specify a voltage
range (for example, because it is fixed correctly at system startup).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Report error codes for bulk operations
Mark Brown [Tue, 13 Oct 2009 12:06:49 +0000 (13:06 +0100)]
regulator: Report error codes for bulk operations

If we're going to log an error we may as well log what the error
code that we're failing on is.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: add 88PM8607 PMIC driver
Haojian Zhuang [Thu, 8 Oct 2009 06:03:57 +0000 (02:03 -0400)]
regulator: add 88PM8607 PMIC driver

Hi Liam,

Since Samuel merged a new version of mfd 88pm8607 driver, I format a
new patch on regulator 88pm8607. I paste the new patch in mail. Please
help to review again. And I also attach the mfd driver in mail.

From: Haojian Zhuang <haojian.zhuang@marvell.com>
Date: Thu, 8 Oct 2009 09:36:53 -0400
Subject: [PATCH] regulator: Add 88PM8607 PMIC driver

This patch adds regulator drivers for Marvell 88PM8607 PMIC.
This controller contains 3 DVC and 14 LDO regulators. This controller
uses I2C interface.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: Implement WM831x BuckWise DC-DC convertor DVS support
Mark Brown [Tue, 22 Sep 2009 15:47:11 +0000 (08:47 -0700)]
regulator: Implement WM831x BuckWise DC-DC convertor DVS support

The BuckWise DC-DC convertors in WM831x devices support switching to
a second output voltage using the logic level on one of the device
pins. This is intended to allow rapid voltage switching for uses like
cpufreq, replacing the I2C or SPI write used to configure the voltage
of the regulator with a much faster GPIO status change.

This is implemented by keeping the DVS voltage configured as the
maximum voltage permitted for the regulator. If a request is made
for the maximum voltage then the GPIO is used to switch to the DVS
voltage, otherwise the normal ON voltage is updated and used. This
follows the idiom used by most cpufreq drivers, which drop the
minimum voltage as the core frequency is dropped but use a constant
maximum - raising the voltage should normally be fast, but lowering
it may be slower.

Configuration of the DVS MFP on the device should be done externally,
for example via OTP.

Support is present in the hardware for monitoring the status of the
transition using a second GPIO. This is not currently implemented
but platform data is provided for it - the driver currently assumes
that the device will be configured to transition immediately - but
platform data is provided to reduce merge issues once it is.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agoregulator: add driver for MAX8660/8661
Wolfram Sang [Fri, 25 Sep 2009 07:39:26 +0000 (09:39 +0200)]
regulator: add driver for MAX8660/8661

Tested with a MX25-based custom board.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
14 years agodio: fix use-after-free
Al Viro [Thu, 17 Dec 2009 09:52:13 +0000 (04:52 -0500)]
dio: fix use-after-free

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
14 years agoperf events, x86/stacktrace: Fix performance/softlockup by providing a special frame...
Frederic Weisbecker [Thu, 17 Dec 2009 04:40:34 +0000 (05:40 +0100)]
perf events, x86/stacktrace: Fix performance/softlockup by providing a special frame pointer-only stack walker

It's just wasteful for stacktrace users like perf to walk
through every entries on the stack whereas these only accept
reliable ones, ie: that the frame pointer validates.

Since perf requires pure reliable stacktraces, it needs a stack
walker based on frame pointers-only to optimize the stacktrace
processing.

This might solve some near-lockup scenarios that can be triggered
by call-graph tracing timer events.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1261024834-5336-2-git-send-regression-fweisbec@gmail.com>
[ v2: fix for modular builds and small detail tidyup ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMerge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
Russell King [Thu, 17 Dec 2009 09:34:26 +0000 (09:34 +0000)]
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6

14 years agoperf events, x86/stacktrace: Make stack walking optional
Frederic Weisbecker [Thu, 17 Dec 2009 04:40:33 +0000 (05:40 +0100)]
perf events, x86/stacktrace: Make stack walking optional

The current print_context_stack helper that does the stack
walking job is good for usual stacktraces as it walks through
all the stack and reports even addresses that look unreliable,
which is nice when we don't have frame pointers for example.

But we have users like perf that only require reliable
stacktraces, and those may want a more adapted stack walker, so
lets make this function a callback in stacktrace_ops that users
can tune for their needs.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1261024834-5336-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf events: Remove unused perf_counter.h header file
Robert P. J. Day [Wed, 16 Dec 2009 15:09:45 +0000 (10:09 -0500)]
perf events: Remove unused perf_counter.h header file

Since nothing includes the <linux/perf_counter.h> file and it's
also not exported to user space, remove it.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <alpine.LFD.2.00.0912161007430.8198@localhost>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Teach might_sleep() about preemptible RCU
Frederic Weisbecker [Wed, 16 Dec 2009 19:21:05 +0000 (20:21 +0100)]
sched: Teach might_sleep() about preemptible RCU

In practice, it is harmless to voluntarily sleep in a
rcu_read_lock() section if we are running under preempt rcu, but
it is illegal if we build a kernel running non-preemptable rcu.

Currently, might_sleep() doesn't notice sleepable operations
under rcu_read_lock() sections if we are running under
preemptable rcu because preempt_count() is left untouched after
rcu_read_lock() in this case. But we want developers who test
their changes under such config to notice the "sleeping while
atomic" issues.

So we add rcu_read_lock_nesting to prempt_count() in
might_sleep() checks.

[ v2: Handle rcu-tiny ]
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1260991265-8451-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf probe: Check new event name
Masami Hiramatsu [Wed, 16 Dec 2009 22:24:15 +0000 (17:24 -0500)]
perf probe: Check new event name

Check new event name is same syntax as a C symbol in perf command.
In other words, checking the name is as like as other tracepoint
events.

This can prevent user to create an event with useless name (e.g.
foo|bar, foo*bar).

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20091216222415.14459.71383.stgit@dhcp-100-2-132.bos.redhat.com>
[ v2: minor cleanups ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agokprobe-tracer: Check new event/group name
Masami Hiramatsu [Wed, 16 Dec 2009 22:24:08 +0000 (17:24 -0500)]
kprobe-tracer: Check new event/group name

Check new event/group name is same syntax as a C symbol. In other
words, checking the name is as like as other tracepoint events.

This can prevent user to create an event with useless name (e.g.
foo|bar, foo*bar).

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20091216222408.14459.68790.stgit@dhcp-100-2-132.bos.redhat.com>
[ v2: minor cleanups ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf probe: Check whether debugfs path is correct
Masami Hiramatsu [Wed, 16 Dec 2009 22:24:00 +0000 (17:24 -0500)]
perf probe: Check whether debugfs path is correct

Check whether the debugfs path is correct before executing
a command, because perf-probe depends on debugfs.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20091216222400.14459.48162.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf probe: Fix libdwarf include path for Debian
Masami Hiramatsu [Wed, 16 Dec 2009 22:16:19 +0000 (17:16 -0500)]
perf probe: Fix libdwarf include path for Debian

Fix libdwarf include path to fit debian-like systems too.

Borislav Petkov reported:

> even after installing libdwarf-dev on my debian box here,
> make in tools/perf/ still complains that it cannot find libdwarf:
>
> Makefile:491: No libdwarf.h found or old libdwarf.h found, disables dwarf
> support. Please install libdwarf-dev/libdwarf-devel >= 20081231
>
> The problem is that the include path on debian is not
> /usr/include/libdwarf/ but simply /usr/include because the debian
> package libdwarf-dev puts the headers straight into
> /usr/include.

This patch adds -I/usr/include/libdwarf to BASIC_CFLAGS
and fix probe-finder.h to include just libdwarf.h/dwarf.h.

This patch also adds a workaround for the undefined _MIPS_SZLONG
bug in libdwarf.h.

Reported-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Gabor Gombas <gombasg@sztaki.hu>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20091216221618.13816.83296.stgit@dhcp-100-2-132.bos.redhat.com>
[ v2: small stylistic fixlets to probe-finder.h ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Make warning less noisy
Ingo Molnar [Thu, 17 Dec 2009 05:05:49 +0000 (06:05 +0100)]
sched: Make warning less noisy

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <20091216170517.807938893@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMIPS: Lasat: Fix botched changes to sysctl code.
Ralf Baechle [Thu, 17 Dec 2009 01:57:37 +0000 (01:57 +0000)]
MIPS: Lasat: Fix botched changes to sysctl code.

Commit 163931922220e4cb5effd5af1e105038c2f0ab7a "sysctl mips/lasat: Remove
dead binary sysctl support" obviously wasn't test built ...

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoRTC: rtc-cmos.c: Fix warning on MIPS
Wu Zhangjin [Thu, 5 Nov 2009 01:21:54 +0000 (09:21 +0800)]
RTC: rtc-cmos.c: Fix warning on MIPS

This patch fixes the following warning with RTC_LIB on MIPS:

drivers/rtc/rtc-cmos.c:697:2: warning: #warning Assuming 128 bytes of
RTC+NVRAM address space, not 64 bytes.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Arnaud Patard <apatard@mandriva.com>
Cc: linux-mips@linux-mips.org
Cc: rtc-linux@googlegroups.com
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Patchwork: http://patchwork.linux-mips.org/patch/570/
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Cleanup random differences beween lmo and Linus' kernel.
Ralf Baechle [Thu, 17 Dec 2009 01:57:36 +0000 (01:57 +0000)]
MIPS: Cleanup random differences beween lmo and Linus' kernel.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: No longer hardwire CONFIG_EMBEDDED to y
Martin Michlmayr [Thu, 19 Nov 2009 16:46:32 +0000 (16:46 +0000)]
MIPS: No longer hardwire CONFIG_EMBEDDED to y

There's no reason for MIPS to select EMBEDDED.  In fact, EMBEDDED makes
MIPS more awkward to deal with because it makes it different to the
majority of architectures for no good reason.

[Ralf: Historically disabling EMBEDDED had hid essential options for many
 MIPS platforms such as serial console and forced crap like VGA support
 or power managment enabled for platforms where those don't make any sense.

 The name of the option is also _very_ missleading so many users don't
 select it even where is was required for a functioning kernel.]

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/663/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Fix and enhance built-in kernel command line
Dmitri Vorobiev [Sat, 21 Nov 2009 20:34:41 +0000 (22:34 +0200)]
MIPS: Fix and enhance built-in kernel command line

Currently, MIPS kernels silently overwrite kernel command-line parameters
hardcoded in CONFIG_CMDLINE by the ones received from firmware.  Therefore,
using firmware remains the only reliable method to transfer the
command-line parameters, which is not always desirable or convenient, and
the CONFIG_CMDLINE option is thereby effectively rendered useless.

This patch fixes the problem described above and introduces a more flexible
scheme of handling the kernel command line, in a manner identical to what is
currently used for x86.  The default behavior, i.e. when CONFIG_CMDLINE_BOOL
is not defined, retains the existing semantics, and firmware command-line
arguments override the hardcoded ones.

[Ralf: I fixed up all the defconfig files so the stay unaffected by this
change.]

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/689/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: eXcite: Remove platform.
Ralf Baechle [Thu, 17 Dec 2009 01:57:35 +0000 (01:57 +0000)]
MIPS: eXcite: Remove platform.

The platform has never been fully merged

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Thomas Koeller <thomas.koeller@baslerweb.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mtd@lists.infradead.org
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
14 years agoMIPS: Loongson: Cleanups of serial port support
Wu Zhangjin [Sat, 28 Nov 2009 06:21:50 +0000 (14:21 +0800)]
MIPS: Loongson: Cleanups of serial port support

This patchs uses a loongson_uart_base variable instead of the
uart_base[] array and adds a new kernel option to avoid to compile
uart_base.c all the time, which will save a little bit of memory for us.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
http://patchwork.linux-mips.org/patch/727/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Lemote 2F: Suspend CS5536 MFGPT Timer
Wu Zhangjin [Tue, 24 Nov 2009 13:48:36 +0000 (21:48 +0800)]
MIPS: Lemote 2F: Suspend CS5536 MFGPT Timer

Before putting the Loongson 2F into wait mode, suspend the MFGPT Timer and
after wake-up resume it.  This may save some power.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/706/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Excite: move iodev_remove to .devexit.text
Uwe Kleine-König [Tue, 24 Nov 2009 21:07:01 +0000 (22:07 +0100)]
MIPS: Excite: move iodev_remove to .devexit.text

The function iodev_remove is used only wrapped by __devexit_p so define
it using __devexit.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Ming Lei <tom.leiming@gmail.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/710/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Lasat: Convert to proc_fops / seq_file
Alexey Dobriyan [Fri, 27 Nov 2009 06:55:03 +0000 (09:55 +0300)]
MIPS: Lasat: Convert to proc_fops / seq_file

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/725/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Cleanup signal code initialization
Ralf Baechle [Tue, 24 Nov 2009 19:35:41 +0000 (19:35 +0000)]
MIPS: Cleanup signal code initialization

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/709/

14 years agoMIPS: Modularize COP2 handling
Ralf Baechle [Tue, 24 Nov 2009 01:24:58 +0000 (01:24 +0000)]
MIPS: Modularize COP2 handling

Away with the daemons of ifdef; get ready for future COP2 users.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Patchwork: http://patchwork.linux-mips.org/patch/708/

14 years agoMIPS: Move EARLY_PRINTK to Kconfig.debug
Ralf Baechle [Thu, 17 Dec 2009 01:57:30 +0000 (01:57 +0000)]
MIPS: Move EARLY_PRINTK to Kconfig.debug

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Yeeloong 2F: Cleanup reset logic using the new ec_write function
Wu Zhangjin [Sat, 21 Nov 2009 11:05:25 +0000 (19:05 +0800)]
MIPS: Yeeloong 2F: Cleanup reset logic using the new ec_write function

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/683/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Yeeloong 2F: Add LID open event as the wakeup event
Wu Zhangjin [Sat, 21 Nov 2009 11:05:24 +0000 (19:05 +0800)]
MIPS: Yeeloong 2F: Add LID open event as the wakeup event

Yeeloong 2F netbook has an KB3310B embedded controller to manage the LID
action.  When the LID is closed or opened a SCI interrupt is sent out and
the corresponding event is saved to an EC register for later query.

Allow the LID open interrupt to wake the processor from wait mode if it is
in the suspend mode.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/685/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Yeeloong 2F: Add basic EC operations
Wu Zhangjin [Sat, 21 Nov 2009 11:05:23 +0000 (19:05 +0800)]
MIPS: Yeeloong 2F: Add basic EC operations

YeeLoong2F has a KB3310b embedded controller. Add basic operations for
future related drivers and board support.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/684/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Move several variables from .bss to .init.data
Dmitri Vorobiev [Mon, 23 Nov 2009 11:53:37 +0000 (13:53 +0200)]
MIPS: Move several variables from .bss to .init.data

Several static uninitialized variables are used in the scope of __init
functions but are themselves not marked as __initdata.  This patch is to put
those variables to where they belong and to reduce the memory footprint a
little bit.

Also, a couple of lines with spaces instead of tabs were fixed.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/698/
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Make function graph tracer work with -mmcount-ra-address
Wu Zhangjin [Fri, 20 Nov 2009 12:34:38 +0000 (20:34 +0800)]
MIPS: Tracing: Make function graph tracer work with -mmcount-ra-address

That thread "MIPS: Add option to pass return address location to
_mcount" from "David Daney <ddaney@caviumnetworks.com>" have added a new
option -mmcount-ra-address to gcc(4.5) for MIPS to transfer the location
of the return address to _mcount.

Benefit from this new feature, function graph tracer on MIPS will be
easier and safer to hijack the return address of the kernel function,
which will save some overhead and make the whole thing more reliable.

In this patch, at first, try to enable the option -mmcount-ra-address in
arch/mips/Makefile with cc-option, if gcc support it, it will be
enabled, otherwise, no side effect.

and then, we need to support this new option of gcc 4.5 and also support
the old gcc versions.

with _mcount in the old gcc versions, it's not easy to get the location
of return address(tracing: add function graph tracer support for MIPS),
   so, we do it in a C function: ftrace_get_parent_addr(ftrace.c), but
   with -mmcount-ra-address, only several instructions need to get what
   we want, so, I put into asm(mcount.S). and also, as the $12(t0) is
   used by -mmcount-ra-address for transferring the localtion of return
   address to _mcount, we need to save it into the stack and restore it
   when enabled dynamic function tracer, 'Cause we have called
   "ftrace_call" before "ftrace_graph_caller", which may destroy
   $12(t0).

(Thanks to David for providing that -mcount-ra-address and giving the
 idea of KBUILD_MCOUNT_RA_ADDRESS, both of them have made the whole
 thing more beautiful!)

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/681/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Reserve $12(t0) for mcount-ra-address of gcc 4.5
Wu Zhangjin [Fri, 20 Nov 2009 12:34:37 +0000 (20:34 +0800)]
MIPS: Tracing: Reserve $12(t0) for mcount-ra-address of gcc 4.5

A new option -mmcount-ra-address for gcc 4.5 have been sent by David
Daney <ddaney@caviumnetworks.com> in the thread "MIPS: Add option to
pass return address location to _mcount", which help to record the
location of the return address(ra) for the function graph tracer of MIPS
to hijack the return address easier and safer. that option used the
$12(t0) register by default, so, we reserve it for it, and use t1,t2,t3
instead of t0,t1,t2.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/680/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Make ftrace for MIPS work without -fno-omit-frame-pointer
Wu Zhangjin [Fri, 20 Nov 2009 12:34:36 +0000 (20:34 +0800)]
MIPS: Tracing: Make ftrace for MIPS work without -fno-omit-frame-pointer

When remove the -fno-omit-frame-pointer, gcc will not save the frame
pointer for us, we need to save one ourselves.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/679/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Add dynamic function graph tracer for MIPS
Wu Zhangjin [Fri, 20 Nov 2009 12:34:35 +0000 (20:34 +0800)]
MIPS: Tracing: Add dynamic function graph tracer for MIPS

This patch make function graph tracer work with dynamic function tracer.

To share the source code of dynamic function tracer(MCOUNT_SAVE_REGS),
and avoid restoring the whole saved registers, we need to restore the ra
register from the stack.

(NOTE: This not work with 32bit! need to ensure why!)

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/678/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Add function graph tracer support for MIPS
Wu Zhangjin [Fri, 20 Nov 2009 12:34:34 +0000 (20:34 +0800)]
MIPS: Tracing: Add function graph tracer support for MIPS

The implementation of function graph tracer for MIPS is a little
different from X86.

in MIPS, gcc(with -pg) only transfer the caller's return address(at) and
the _mcount's return address(ra) to us.

For the kernel part without -mlong-calls:

move at, ra
jal _mcount

For the module part with -mlong-calls:

lui v1, hi16bit_of_mcount
addiu v1, v1, low16bit_of_mcount
move at, ra
jal _mcount

Without -mlong-calls,

if the function is a leaf, it will not save the return address(ra):

ffffffff80101298 <au1k_wait>:
ffffffff80101298:       67bdfff0        daddiu  sp,sp,-16
ffffffff8010129c:       ffbe0008        sd      s8,8(sp)
ffffffff801012a0:       03a0f02d        move    s8,sp
ffffffff801012a4:       03e0082d        move    at,ra
ffffffff801012a8:       0c042930        jal     ffffffff8010a4c0 <_mcount>
ffffffff801012ac:       00020021        nop

so, we can hijack it directly in _mcount, but if the function is non-leaf, the
return address is saved in the stack.

ffffffff80133030 <copy_process>:
ffffffff80133030:       67bdff50        daddiu  sp,sp,-176
ffffffff80133034:       ffbe00a0        sd      s8,160(sp)
ffffffff80133038:       03a0f02d        move    s8,sp
ffffffff8013303c:       ffbf00a8        sd      ra,168(sp)
ffffffff80133040:       ffb70098        sd      s7,152(sp)
ffffffff80133044:       ffb60090        sd      s6,144(sp)
ffffffff80133048:       ffb50088        sd      s5,136(sp)
ffffffff8013304c:       ffb40080        sd      s4,128(sp)
ffffffff80133050:       ffb30078        sd      s3,120(sp)
ffffffff80133054:       ffb20070        sd      s2,112(sp)
ffffffff80133058:       ffb10068        sd      s1,104(sp)
ffffffff8013305c:       ffb00060        sd      s0,96(sp)
ffffffff80133060:       03e0082d        move    at,ra
ffffffff80133064:       0c042930        jal     ffffffff8010a4c0 <_mcount>
ffffffff80133068:       00020021        nop

but we can not get the exact stack address(which saved ra) directly in
_mcount, we need to search the content of at register in the stack space
or search the "s{d,w} ra, offset(sp)" instruction in the text. 'Cause we
can not prove there is only a match in the stack space, so, we search
the text instead.

as we can see, if the first instruction above "move at, ra" is not a
store instruction, there should be a leaf function, so we hijack the at
register directly via putting &return_to_handler into it, otherwise, we
search the "s{d,w} ra, offset(sp)" instruction to get the stack offset,
and then the stack address. we use the above copy_process() as an
example, we at last find "ffbf00a8", 0xa8 is the stack offset, we plus
it with s8(fp), that is the stack address, we hijack the content via
writing the &return_to_handler in.

If with -mlong-calls, since there are two more instructions above "move
at, ra", so, we can move the pointer to the position above "lui v1,
hi16bit_of_mcount".

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/677/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Add IRQENTRY_EXIT section for MIPS
Wu Zhangjin [Fri, 20 Nov 2009 12:34:33 +0000 (20:34 +0800)]
MIPS: Tracing: Add IRQENTRY_EXIT section for MIPS

This patch add a new section for MIPS to record the block of the hardirq
handling for function graph tracer(print_graph_irq) via adding the
__irq_entry annotation to the the entrypoints of the hardirqs(the block
with irq_enter()...irq_exit()).

Thanks goes to Steven & Frederic Weisbecker for their feedbacks.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
Patchwork: http://patchwork.linux-mips.org/patch/676/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Add dynamic function tracer support
Wu Zhangjin [Fri, 20 Nov 2009 12:34:32 +0000 (20:34 +0800)]
MIPS: Tracing: Add dynamic function tracer support

With dynamic function tracer, by default, _mcount is defined as an
"empty" function, it returns directly without any more action . When
enabling it in user-space, it will jump to a real tracing
function(ftrace_caller), and do the real job for us.

Differ from the static function tracer, dynamic function tracer provides
two functions ftrace_make_call()/ftrace_make_nop() to enable/disable the
tracing of some indicated kernel functions(set_ftrace_filter).

In the -v4 version, the implementation of this support is basically the same as
X86 version does: _mcount is implemented as an empty function and ftrace_caller
is implemented as a real tracing function respectively.

But in this version, to support module tracing with the help of
-mlong-calls in arch/mips/Makefile:

MODFLAGS += -mlong-calls.

The stuff becomes a little more complex. We need to cope with two
different type of calling to _mcount.

For the kernel part, the calling to _mcount(result of "objdump -hdr
vmlinux"). is like this:

108:   03e0082d        move    at,ra
10c:   0c000000        jal     0 <fpcsr_pending>
                        10c: R_MIPS_26  _mcount
                        10c: R_MIPS_NONE        *ABS*
                        10c: R_MIPS_NONE        *ABS*
110:   00020021        nop

For the module with -mlong-calls, it looks like this:

c: 3c030000  lui v1,0x0
c: R_MIPS_HI16 _mcount
c: R_MIPS_NONE *ABS*
c: R_MIPS_NONE *ABS*
10: 64630000  daddiu v1,v1,0
10: R_MIPS_LO16 _mcount
10: R_MIPS_NONE *ABS*
10: R_MIPS_NONE *ABS*
14: 03e0082d  move at,ra
18: 0060f809  jalr v1

In the kernel version, there is only one "_mcount" string for every
kernel function, so, we just need to match this one in mcount_regex of
scripts/recordmcount.pl, but in the module version, we need to choose
one of the two to match. Herein, I choose the first one with
"R_MIPS_HI16 _mcount".

and In the kernel verion, without module tracing support, we just need
to replace "jal _mcount" by "jal ftrace_caller" to do real tracing, and
filter the tracing of some kernel functions via replacing it by a nop
instruction.

but as we have described before, the instruction "jal ftrace_caller" only left
32bit length for the address of ftrace_caller, it will fail when calling from
the module space. so, herein, we must replace something else.

the basic idea is loading the address of ftrace_caller to v1 via changing these
two instructions:

lui v1,0x0
addiu v1,v1,0

If we want to enable the tracing, we need to replace the above instructions to:

lui v1, HI_16BIT_ftrace_caller
addiu v1, v1, LOW_16BIT_ftrace_caller

If we want to stop the tracing of the indicated kernel functions, we
just need to replace the "jalr v1" to a nop instruction. but we need to
replace two instructions and encode the above two instructions
oursevles.

Is there a simpler solution? Yes! Here it is, in this version, we put _mcount
and ftrace_caller together, which means the address of _mcount and
ftrace_caller is the same:

_mcount:
ftrace_caller:
j ftrace_stub
 nop

...(do real tracing here)...

ftrace_stub:
jr ra
 move ra, at

By default, the kernel functions call _mcount, and then jump to ftrace_stub and
return. and when we want to do real tracing, we just need to remove that "j
ftrace_stub", and it will run through the two "nop" instructions and then do
the real tracing job.

what about filtering job? we just need to do this:

 lui v1, hi_16bit_of_mcount        <--> b 1f (0x10000004)
 addiu v1, v1, low_16bit_of_mcount
 move at, ra
 jalr v1
 nop
       1f: (rec->ip + 12)

In linux-mips64, there will be some local symbols, whose name are
prefixed by $L, which need to be filtered. thanks goes to Steven for
writing the mips64-specific function_regex.

In a conclusion, with RISC, things becomes easier with such a "stupid"
trick, RISC is something like K.I.S.S, and also, there are lots of
"simple" tricks in the whole ftrace support, thanks goes to Steven and
the other folks for providing such a wonderful tracing framework!

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/675/
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Add an endian argument to scripts/recordmcount.pl
Wu Zhangjin [Fri, 20 Nov 2009 12:34:31 +0000 (20:34 +0800)]
MIPS: Tracing: Add an endian argument to scripts/recordmcount.pl

MIPS and some other architectures need this argument to handle
big/little endian respectively.

Signed-off-by: Wu Zhangjin <wuzj@lemote.com>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/674/
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Enable HAVE_FUNCTION_TRACE_MCOUNT_TEST for MIPS
Wu Zhangjin [Fri, 20 Nov 2009 12:34:30 +0000 (20:34 +0800)]
MIPS: Tracing: Enable HAVE_FUNCTION_TRACE_MCOUNT_TEST for MIPS

There is an exisiting common ftrace_test_stop_func() in
kernel/trace/ftrace.c, which is used to check the global variable
ftrace_trace_stop to determine whether stop the function tracing.

This patch implepment the MIPS specific one to speedup the procedure.

Thanks goes to Zhang Le for Cleaning it up.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/673/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Tracing: Add static function tracer support for MIPS
Wu Zhangjin [Fri, 20 Nov 2009 12:34:29 +0000 (20:34 +0800)]
MIPS: Tracing: Add static function tracer support for MIPS

If -pg of gcc is enabled with CONFIG_FUNCTION_TRACER=y. a calling to
_mcount will be inserted into each kernel function. so, there is a
possibility to trace the kernel functions in _mcount.

This patch add the MIPS specific _mcount support for static function
tracing. by default, ftrace_trace_function is initialized as
ftrace_stub(an empty function), so, the default _mcount will introduce
very little overhead. after enabling ftrace in user-space, it will jump
to a real tracing function and do static function tracing for us.

and -ffunction-sections is incompatible with -pg, so, disable it when
ftracer is enabled.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/672/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Fixup last users of irq_chip->typename
Thomas Gleixner [Tue, 17 Nov 2009 22:51:03 +0000 (22:51 +0000)]
MIPS: Fixup last users of irq_chip->typename

The typename member of struct irq_chip was kept for migration purposes
and is obsolete since more than 2 years. Fix up the leftovers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Patchwork: http://patchwork.linux-mips.org/patch/661/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Loongson 2F: Add CPU frequency scaling support
Wu Zhangjin [Mon, 16 Nov 2009 17:32:59 +0000 (01:32 +0800)]
MIPS: Loongson 2F: Add CPU frequency scaling support

Loongson 2F supports CPU clock scaling. When put it into wait mode by
setting the frequency as ZERO it will stay in this mode until an external
interrupt wakes the CPU again.

To enable clock scaling support, an external timer of a known stable rate
is required.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cpufreq@vger.kernel.org,
Cc: Dave Jones <davej@redhat.com>,
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
Cc: yanh@lemote.com
Cc: huhb@lemote.com,
Patchwork: http://patchwork.linux-mips.org/patch/660/
Patchwork: http://patchwork.linux-mips.org/patch/751/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Add basic CPUFreq options.
Wu Zhangjin [Mon, 16 Nov 2009 17:32:58 +0000 (01:32 +0800)]
MIPS: Add basic CPUFreq options.

This patch adds basic options for MIPS CPUFreq support.

Since the cp0 timer's frequency is based on the processor clockrate it can
not be used with CPUFReq; an additional external timer is required.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cpufreq@vger.kernel.org,
Cc: Dave Jones <davej@redhat.com>,
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
Cc: yanh@lemote.com
Cc: huhb@lemote.com,
Patchwork: http://patchwork.linux-mips.org/patch/659/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Lemote 2F: Add cs5536 MFGPT timer support
Wu Zhangjin [Mon, 16 Nov 2009 17:32:57 +0000 (01:32 +0800)]
MIPS: Lemote 2F: Add cs5536 MFGPT timer support

CPUFreq support for Loongson 2F requires an external timer.

Because the frequency of the MIPS Timer is related to the CPU frequency
which itself is variable another timer of constant frequency is required.

Export the mfgpt0 counter disable / enable operations for the coming
suspend support to suspend / resume the timer.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cpufreq@vger.kernel.org,
Cc: Dave Jones <davej@redhat.com>,
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
Cc: yanh@lemote.com
Cc: huhb@lemote.com,
Patchwork: http://patchwork.linux-mips.org/patch/658/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Lemote 2F: Add Lynloong support
Wu Zhangjin [Mon, 16 Nov 2009 16:58:15 +0000 (00:58 +0800)]
MIPS: Lemote 2F: Add Lynloong support

Add a new machtype and kernel options for the Lynloong.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/657/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: Lemote 2F: Add NAS support
Wu Zhangjin [Mon, 16 Nov 2009 16:58:14 +0000 (00:58 +0800)]
MIPS: Lemote 2F: Add NAS support

Kernel support for this machine is almost the same as Fuloong 2F; the only
difference is that it uses the serial port provided by Loongson 2F processor
as Yeeloong 2F does.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/656/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoMIPS: PowerTV: Base files for Cisco PowerTV platform
David VomLehn [Mon, 31 Aug 2009 00:15:11 +0000 (17:15 -0700)]
MIPS: PowerTV: Base files for Cisco PowerTV platform

Add the Cisco Powertv cable settop box to the MIPS tree. This platform is
based on a MIPS 24Kc processor with various devices integrated on the same
ASIC. There are multiple models of this box, with differing configuration
but the same kernel runs across the product line.

Signed-off-by: David VomLehn <dvomlehn@cisco.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/132/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>