Commit Graph

34420 Commits

Author SHA1 Message Date
刘基
2485cf1949 Revert "path mpu code"
This reverts commit b6d1a303ec.
2011-08-10 16:32:19 +08:00
liuji
b6d1a303ec path mpu code 2011-08-10 15:07:02 +08:00
liuji
1495c38333 mod/add: add mpu support 2011-08-09 00:53:25 +08:00
lby
ac25059a5d modify mtk23d.c 2011-08-09 14:10:02 +08:00
黄涛
b877bcb0ec rk29: include/linux/regulator/consumer.h: fix warning: no return statement in function returning non-void 2011-07-25 17:03:22 +08:00
Thomas Gleixner
b7ad2a012a clockevents: Use u32 for mult and shift factors
The mult and shift factors of clock events differ in their data type
from those of clock sources for no reason. u32 is sufficient for
both. shift is always <= 32 and mult is limited to 2^32-1 to avoid
64bit multiplication overflows in the conversion.

Preparatory patch for a generic mult/shift factor calculation
function.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Cc: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <20091111134229.725664788@linutronix.de>
2011-07-25 09:29:10 +08:00
黄涛
5675bfaadd Revert "rk29: add hr_msleep/hr_msleep_interruptible/usleep"
This reverts commit c4c6281fd7.
2011-07-22 16:40:22 +08:00
黄涛
c4c6281fd7 rk29: add hr_msleep/hr_msleep_interruptible/usleep 2011-07-22 16:20:36 +08:00
Patrick Pannuto
18464b0b75 timer: Added usleep_range timer
usleep_range is a finer precision implementations of msleep
and is designed to be a drop-in replacement for udelay where
a precise sleep / busy-wait is unnecessary.

Since an easy interface to hrtimers could lead to an undesired
proliferation of interrupts, we provide only a "range" API,
forcing the caller to think about an acceptable tolerance on
both ends and hopefully avoiding introducing another interrupt.

INTRO

As discussed here ( http://lkml.org/lkml/2007/8/3/250 ), msleep(1) is not
precise enough for many drivers (yes, sleep precision is an unfair notion,
but consistently sleeping for ~an order of magnitude greater than requested
is worth fixing). This patch adds a usleep API so that udelay does not have
to be used. Obviously not every udelay can be replaced (those in atomic
contexts or being used for simple bitbanging come to mind), but there are
many, many examples of

mydriver_write(...)
/* Wait for hardware to latch */
udelay(100)

in various drivers where a busy-wait loop is neither beneficial nor
necessary, but msleep simply does not provide enough precision and people
are using a busy-wait loop instead.

CONCERNS FROM THE RFC

Why is udelay a problem / necessary? Most callers of udelay are in device/
driver initialization code, which is serial...

	As I see it, there is only benefit to sleeping over a delay; the
	notion of "refactoring" areas that use udelay was presented, but
	I see usleep as the refactoring. Consider i2c, if the bus is busy,
	you need to wait a bit (say 100us) before trying again, your
	current options are:

		* udelay(100)
		* msleep(1) <-- As noted above, actually as high as ~20ms
				on some platforms, so not really an option
		* Manually set up an hrtimer to try again in 100us (which
		  is what usleep does anyway...)

	People choose the udelay route because it is EASY; we need to
	provide a better easy route.

	Device / driver / boot code is *currently* serial, but every few
	months someone makes noise about parallelizing boot, and IMHO, a
	little forward-thinking now is one less thing to worry about
	if/when that ever happens

udelay's could be preempted

	Sure, but if udelay plans on looping 1000 times, and it gets
	preempted on loop 200, whenever it's scheduled again, it is
	going to do the next 800 loops.

Is the interruptible case needed?

	Probably not, but I see usleep as a very logical parallel to msleep,
	so it made sense to include the "full" API. Processors are getting
	faster (albeit not as quickly as they are becoming more parallel),
	so if someone wanted to be interruptible for a few usecs, why not
	let them? If this is a contentious point, I'm happy to remove it.

OTHER THOUGHTS

I believe there is also value in exposing the usleep_range option; it gives
the scheduler a lot more flexibility and allows the programmer to express
his intent much more clearly; it's something I would hope future driver
writers will take advantage of.

To get the results in the NUMBERS section below, I literally s/udelay/usleep
the kernel tree; I had to go in and undo the changes to the USB drivers, but
everything else booted successfully; I find that extremely telling in and
of itself -- many people are using a delay API where a sleep will suit them
just fine.

SOME ATTEMPTS AT NUMBERS

It turns out that calculating quantifiable benefit on this is challenging,
so instead I will simply present the current state of things, and I hope
this to be sufficient:

How many udelay calls are there in 2.6.35-rc5?

	udealy(ARG) >=	| COUNT
	1000		| 319
	500		| 414
	100		| 1146
	20		| 1832

I am working on Android, so that is my focus for this. The following table
is a modified usleep that simply printk's the amount of time requested to
sleep; these tests were run on a kernel with udelay >= 20 --> usleep

"boot" is power-on to lock screen
"power collapse" is when the power button is pushed and the device suspends
"resume" is when the power button is pushed and the lock screen is displayed
         (no touchscreen events or anything, just turning on the display)
"use device" is from the unlock swipe to clicking around a bit; there is no
	sd card in this phone, so fail loading music, video, camera

	ACTION		| TOTAL NUMBER OF USLEEP CALLS	| NET TIME (us)
	boot		| 22				| 1250
	power-collapse	| 9				| 1200
	resume		| 5				| 500
	use device	| 59				| 7700

The most interesting category to me is the "use device" field; 7700us of
busy-wait time that could be put towards better responsiveness, or at the
least less power usage.

Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
Cc: apw@canonical.com
Cc: corbet@lwn.net
Cc: arjan@linux.intel.com
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-07-22 16:20:35 +08:00
kfx
6631c31b41 update hdmi driver 2011-07-21 09:29:37 +08:00
杨云
be8970a989 Merge branch 'develop' of /home/rockchip/kernel into develop 2011-07-20 09:56:48 +08:00
Albin Tonnerre
3a3ba0241a lib: add support for LZO-compressed kernels
This patch series adds generic support for creating and extracting
LZO-compressed kernel images, as well as support for using such images on
the x86 and ARM architectures, and support for creating and using
LZO-compressed initrd and initramfs images.

Russell King said:

: Testing on a Cortex A9 model:
: - lzo decompressor is 65% of the time gzip takes to decompress a kernel
: - lzo kernel is 9% larger than a gzip kernel
:
: which I'm happy to say confirms your figures when comparing the two.
:
: However, when comparing your new gzip code to the old gzip code:
: - new is 99% of the size of the old code
: - new takes 42% of the time to decompress than the old code
:
: What this means is that for a proper comparison, the results get even better:
: - lzo is 7.5% larger than the old gzip'd kernel image
: - lzo takes 28% of the time that the old gzip code took
:
: So the expense seems definitely worth the effort.  The only reason I
: can think of ever using gzip would be if you needed the additional
: compression (eg, because you have limited flash to store the image.)
:
: I would argue that the default for ARM should therefore be LZO.

This patch:

The lzo compressor is worse than gzip at compression, but faster at
extraction.  Here are some figures for an ARM board I'm working on:

Uncompressed size: 3.24Mo
gzip  1.61Mo 0.72s
lzo   1.75Mo 0.48s

So for a compression ratio that is still relatively close to gzip, it's
much faster to extract, at least in that case.

This part contains:
 - Makefile routine to support lzo compression
 - Fixes to the existing lzo compressor so that it can be used in
   compressed kernels
 - wrapper around the existing lzo1x_decompress, as it only extracts one
   block at a time, while we need to extract a whole file here
 - config dialog for kernel compression

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Tested-by: Wu Zhangjin <wuzhangjin@gmail.com>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Russell King <rmk@arm.linux.org.uk>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-19 16:51:28 +08:00
xbw
35d7b36352 Integrae the XBW-version of SDMMC-drver into RK29SDK, and the xbw-version is set to default 2011-07-17 20:41:08 -07:00
黄涛
e6197bdf81 Revert "Merge branch 'hdmi' into develop"
This reverts commit 57a857b574, reversing
changes made to 5a152bcf02.
2011-07-18 09:59:10 +08:00
yzq
76fe1d903a fix hdmi bug : wake up , the hdmi screen probabilistic flash of white 2011-07-17 15:35:56 +08:00
lbt
380233809e mmc: wifi sdio card ignore pm notify. otherwise wifi may work abnormally when resume from suspend. 2011-07-05 14:42:31 +08:00
黄涛
2caa51d22a Merge remote-tracking branch 'linux-2.6.32.y/master' into develop
Merge Linux 2.6.32.42
Conflicts:
	Makefile
	drivers/net/wireless/iwlwifi/iwl-5000.c
	drivers/net/wireless/p54/p54usb.c
2011-06-28 09:47:32 +08:00
Thomas Gleixner
8ff753b4ac genirq: Add IRQF_FORCE_RESUME
commit dc5f219e88 upstream.

Xen needs to reenable interrupts which are marked IRQF_NO_SUSPEND in the
resume path. Add a flag to force the reenabling in the resume code.

Tested-and-acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-23 15:24:09 -07:00
James Bottomley
255e15a4a5 pata_cm64x: fix boot crash on parisc
commit 9281b16caa upstream.

The old IDE cmd64x checks the status of the CNTRL register to see if
the ports are enabled before probing them.  pata_cmd64x doesn't do
this, which causes a HPMC on parisc when it tries to poke at the
secondary port because apparently the BAR isn't wired up (and a
non-responding piece of memory causes a HPMC).

Fix this by porting the CNTRL register port detection logic from IDE
cmd64x.  In addition, following converns from Alan Cox, add a check to
see if a mobility electronics bridge is the immediate parent and forgo
the check if it is (prevents problems on hotplug controllers).

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-23 15:24:08 -07:00
Milton Miller
ff3af58772 seqlock: Don't smp_rmb in seqlock reader spin loop
commit 5db1256a51 upstream.

Move the smp_rmb after cpu_relax loop in read_seqlock and add
ACCESS_ONCE to make sure the test and return are consistent.

A multi-threaded core in the lab didn't like the update
from 2.6.35 to 2.6.36, to the point it would hang during
boot when multiple threads were active.  Bisection showed
af5ab277de (clockevents:
Remove the per cpu tick skew) as the culprit and it is
supported with stack traces showing xtime_lock waits including
tick_do_update_jiffies64 and/or update_vsyscall.

Experimentation showed the combination of cpu_relax and smp_rmb
was significantly slowing the progress of other threads sharing
the core, and this patch is effective in avoiding the hang.

A theory is the rmb is affecting the whole core while the
cpu_relax is causing a resource rebalance flush, together they
cause an interfernce cadance that is unbroken when the seqlock
reader has interrupts disabled.

At first I was confused why the refactor in
3c22cd5709 (kernel: optimise
seqlock) didn't affect this patch application, but after some
study that affected seqcount not seqlock. The new seqcount was
not factored back into the seqlock.  I defer that the future.

While the removal of the timer interrupt offset created
contention for the xtime lock while a cpu does the
additonal work to update the system clock, the seqlock
implementation with the tight rmb spin loop goes back much
further, and is just waiting for the right trigger.

Signed-off-by: Milton Miller <miltonm@bga.com>
Cc: <linuxppc-dev@lists.ozlabs.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Anton Blanchard <anton@samba.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Link: http://lkml.kernel.org/r/%3Cseqlock-rmb%40mdm.bga.com%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-23 15:24:02 -07:00
kfx
fbb46ea6d6 update adc driver: interrupt add spin_lock 2011-06-20 10:06:28 +08:00
邱建斌
86061d367c rk29_phonesdk: add headset hook key device 2011-06-17 16:12:21 +08:00
黄涛
7cd3739f32 Merge remote-tracking branch 'linux-2.6.32.y/master' into develop
Merge Linux 2.6.32.41
Conflicts:
	Makefile
	drivers/mmc/core/core.c
	drivers/net/wireless/ath/ath9k/ath9k.h
	drivers/net/wireless/ath/ath9k/hw.c
	drivers/net/wireless/ath/ath9k/main.c
	drivers/net/wireless/ath/regd_common.h
	drivers/net/wireless/b43/dma.c
	drivers/net/wireless/b43/dma.h
	drivers/net/wireless/b43/sdio.c
	drivers/net/wireless/hostap/hostap_cs.c
	drivers/net/wireless/iwlwifi/iwl-5000.c
	drivers/net/wireless/iwlwifi/iwl-agn.c
	drivers/net/wireless/iwlwifi/iwl-helpers.h
	drivers/net/wireless/iwlwifi/iwl-tx.c
	drivers/net/wireless/libertas/cmd.c
	drivers/net/wireless/p54/p54pci.c
	drivers/net/wireless/p54/p54usb.c
	drivers/net/wireless/p54/txrx.c
	drivers/net/wireless/rt2x00/rt2400pci.c
	drivers/net/wireless/rt2x00/rt2500pci.c
	drivers/net/wireless/rt2x00/rt2500usb.c
	drivers/net/wireless/rt2x00/rt2800usb.c
	drivers/net/wireless/rt2x00/rt2x00.h
	drivers/net/wireless/rt2x00/rt2x00dev.c
	drivers/net/wireless/rt2x00/rt2x00queue.c
	drivers/net/wireless/rt2x00/rt61pci.c
	drivers/net/wireless/rt2x00/rt73usb.c
	drivers/usb/serial/option.c
	mm/shmem.c
2011-06-16 11:56:59 +08:00
root
9495dd7a4f A22:change power off to restart if charging 2011-06-14 17:55:47 +08:00
xsf@rock-chips.com
85cc82635a A22 and phonesdk: make wm831x enter sleep in suspend, change vdd voltage to 1.0V 2011-06-14 15:22:04 +08:00
kfx
cd1871b8eb update i2c driver: support gpio i2c 2011-06-06 17:02:32 +08:00
linjh
c71cce9858 phonepad: add lcd hsd07pfw1; tp d70_l3188a 2011-06-02 12:28:56 +08:00
ddl
3249d1ba78 camera: add support mt9t111 and fix gc0309 display error in a22 project 2011-05-26 10:52:55 +08:00
root
850722c442 1. return -1 if read voltage error before reporting battery's event;
2. change to use delay workqueue to wait spi resume;
3. delete flush(dws) operation from spi resume function to avoid spi error while system resume;
4. delete suspend_noirq function from wm831x_on.c to avoid reading spi before spim resume;
5. add touchscreen delay to 200us to avoid i2c error;
2011-05-24 09:11:45 +08:00
赵子初
d6f984c589 TCL-PHONE-PAD:add mu509 2011-05-24 09:55:08 +08:00
root
7569e53e5c add wm831x restart support 2011-05-17 21:54:52 +08:00
kfx
a5663a2a61 update hdmi dirver: unregister err and update i2c driver:support direct mode 2011-05-14 16:58:22 +08:00
kfx
da0057e226 update hdmi driver: support 480p 2011-05-12 16:35:39 +08:00
kfx
7b76455518 update hdmi driver: backlight control 2011-05-11 17:03:31 +08:00
Eric Dumazet
6019f38379 af_unix: limit recursion level
commit 25888e3031 upstream.

Its easy to eat all kernel memory and trigger NMI watchdog, using an
exploit program that queues unix sockets on top of others.

lkml ref : http://lkml.org/lkml/2010/11/25/8

This mechanism is used in applications, one choice we have is to have a
recursion limit.

Other limits might be needed as well (if we queue other types of files),
since the passfd mechanism is currently limited by socket receive queue
sizes only.

Add a recursion_level to unix socket, allowing up to 4 levels.

Each time we send an unix socket through sendfd mechanism, we copy its
recursion level (plus one) to receiver. This recursion level is cleared
when socket receive queue is emptied.

Reported-by: Марк Коренберг <socketpair@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Adjust for 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-09 15:55:36 -07:00
Maxim Levitsky
28e4bf4a8b mmc: fix all hangs related to mmc/sd card insert/removal during suspend/resume
commit 4c2ef25fe0 upstream.

If you don't use CONFIG_MMC_UNSAFE_RESUME, as soon as you attempt to
suspend, the card will be removed, therefore this patch doesn't change the
behavior of this option.

However the removal will be done by pm notifier, which runs while
userspace is still not frozen and thus can freely use del_gendisk, without
the risk of deadlock which would happen otherwise.

Card detect workqueue is now disabled while userspace is frozen, Therefore
if you do use CONFIG_MMC_UNSAFE_RESUME, and remove the card during
suspend, the removal will be detected as soon as userspace is unfrozen,
again at the moment it is safe to call del_gendisk.

Tested with and without CONFIG_MMC_UNSAFE_RESUME with suspend and hibernate.

[akpm@linux-foundation.org: clean up function prototype]
[akpm@linux-foundation.org: fix CONFIG_PM-n linkage, small cleanups]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Adjust for 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-09 15:55:31 -07:00
Gertjan van Wingerde
2b5f7f9487 mac80211: Add define for TX headroom reserved by mac80211 itself.
commit d24deb2580 upstream.

Add a definition of the amount of TX headroom reserved by mac80211 itself
for its own purposes. Also add BUILD_BUG_ON to validate the value.
This define can then be used by drivers to request additional TX headroom
in the most efficient manner.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Adjust context for 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-09 15:55:22 -07:00
kfx
3b403975b5 update hdmi driver 2011-05-06 09:23:14 +08:00
ddl
d2aa735713 camera: add support ov2640 sensor 2011-05-04 16:35:03 +08:00
kfx
3901afba10 add new hdmi driver and update sdmmc driver 2011-05-04 11:27:54 +08:00
phc
aaf6c7aab7 RK29 Mobile SDK:update mtk23d to sync with RK2818-project 2011-05-03 17:14:25 +08:00
邱建斌
281a958bde rk29_phone: wm8994 volume pdata fix 2011-05-03 16:07:15 +08:00
ddl
fc19f8e979 camera: fix ov7675/sid130B sensor macro error 2011-04-28 10:08:38 +08:00
ddl
751f546cce camera : add support gc2005/hi253/hi704/nt99250 sensor driver 2011-04-27 22:16:28 +08:00
ddl
3d0097d2fc camera:add support gc0309 and sid130B sensor driver 2011-04-27 21:14:29 +08:00
ddl
e65eceaf0d camera: add support siv120b sensor driver 2011-04-27 15:22:57 +08:00
ddl
7a0dfe623f camera: add support gc0308 sensor driver 2011-04-27 14:42:47 +08:00
ddl
bd060f1a21 camera: add support gt2005 sensor driver 2011-04-27 12:04:06 +08:00
ddl
86360328a8 camera: add support mt9d113 which is from zhong yong wang 2011-04-26 21:43:58 +08:00
phc
3d91347adc RKMobileSDK:add reset ioctl for 23d 2011-04-25 17:19:26 +08:00