]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
15 years agoOMAP3: PM: Emu_pwrdm is switched off by hardware even when sdti is in use v2.6.28-omap1
Jouni Hogander [Fri, 9 Jan 2009 07:52:33 +0000 (09:52 +0200)]
OMAP3: PM: Emu_pwrdm is switched off by hardware even when sdti is in use

Using sdti doesn't keep emu_pwrdm on if hardware supervised pwrdm
transitions are used. This causes sdti stop to work when power
management is initialized and hardware supervised pwrdm control is
enabled. This patch disables hardware supervised pwrdm control for
emu_pwrdm. Now emu_pwrdm is switched off on boot by software when it
is not used.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoSDTI: Fix sdti to use right clocks from clockfw
Jouni Hogander [Fri, 9 Jan 2009 07:52:32 +0000 (09:52 +0200)]
SDTI: Fix sdti to use right clocks from clockfw

SDTI uses pclk and pclkx2 instead of emu_per_alwon_ck. This patch
fixes sdti to use those clocks.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: OMAP3: Mask interrupts when disabling interrupts
김규원 [Tue, 6 Jan 2009 02:59:42 +0000 (11:59 +0900)]
ARM: OMAP3: Mask interrupts when disabling interrupts

By Ingo Molnar, interrupts are not masked by default.
(refer to 76d2160147f43f982dfe881404cfde9fd0a9da21)

But if interrupts are not masked, the processor can wake up while in
Suspend-to-RAM state by an external interrupt. For example, if an
OMAP3 board is connected to Host PC by USB and entered to Suspend-to-RAM
state, it wake up automatically by M_IRQ_92. The disable_irq() function
can't disable the interrupt in H/W level, So I modified
arch/arm/mach-omap2/irq.c

Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2: gptimer min_delta_ns corrected
Aaro Koskinen [Fri, 2 Jan 2009 15:07:16 +0000 (17:07 +0200)]
OMAP2: gptimer min_delta_ns corrected

When 32 kHz timer is used the min_delta_ns should be initialized so
that it reflects the timer programming cost. A write to the timer
device will be usually posted, but it takes roughly 3 cycles before
it is effective. If the timer is reprogrammed before that, the CPU
will stall until the previous write completes. This was pointed out by
Richard Woodruff.

Since the lower bound for min_delta_ns is 1000, the change is visible
only with tick rates less than 3 MHz.

Also note that the old value is incorrect for 32 kHz also due to
a rounding error, and it can cause the timer queue to hang (due to
clockevent code trying to program the timer with zero ticks).

Signed-off-by: Aaro Koskinen <Aaro.Koskinen@nokia.com>
Reviewed-by: Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: OMAP3: Enable writing to XCCR and RCCR McBSP registers for OMAP 2430/34xx
Lopez Cruz, Misael [Fri, 19 Dec 2008 02:53:12 +0000 (20:53 -0600)]
ARM: OMAP3: Enable writing to XCCR and RCCR McBSP registers for OMAP 2430/34xx

This patch enables writing to McBSP Transmit Configuration Control
Register (XCCR) and Receive Configuration Control Register (RCCR)
for 2430/34xx platforms. It also adds XCCR, RCCR entries in McBSP
register configuration structure and bit definitions for both
registers.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 McBSP: add temporary clockdomain fix for McBSP virtual clocks
Paul Walmsley [Thu, 8 Jan 2009 15:28:59 +0000 (08:28 -0700)]
OMAP2/3 McBSP: add temporary clockdomain fix for McBSP virtual clocks

The McBSP driver uses virtual clocks to handle enabling and disabling
its hardware clocks.  These virtual clocks have no associated
clockdomain. After commit 60b8b431e47d8c5b8c02a2e4fa9af388aae20790,
this prevents the McBSP clocks from registering correctly.
Resolve this for the short term by using virt_opp_clkdm for these clocks.
These McBSP virtual clocks should be removed, but such a fix would require
significant changes to the McBSP drivers that would require testing on
OMAP1, 2, and 3 platforms.

Tested on 2430SDP and 3430SDP GP ES2.1.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoNAND support for OMAP3 EVM
Josh Karabin [Tue, 6 Jan 2009 23:17:44 +0000 (18:17 -0500)]
NAND support for OMAP3 EVM

This patch adds support for detecting NAND flash on OMAP3 EVM boards.
It clones similar code from the 3430 SDP board files.

Signed-off-by: Josh Karabin <gkarabin@vocollect.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoi2c: i2c-omap: Fix standard and fast mode prescalers
Eero Nurkkala [Wed, 26 Nov 2008 13:44:15 +0000 (15:44 +0200)]
i2c: i2c-omap: Fix standard and fast mode prescalers

The prescalers for 100 kHz and 400 kHz mode
are wrong for omap 3430 and omap 2430. The
internal clock is the fclock divided by the
prescaler. The PSC is an 8 bit field in
omap3430 and omap2430. Moreover, the scll and
sclh values should be adjusted properly.
Having the correct prescaler is important in
the process of getting a finite i2c clock. In
addition, the prescaler is used in the process
of activating the correct noise filter and thus,
lets more error resilient i2c communications.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoi2c: i2c-omap: Fix BUFSTAT_REG reading
Eero Nurkkala [Tue, 25 Nov 2008 11:03:46 +0000 (13:03 +0200)]
i2c: i2c-omap: Fix BUFSTAT_REG reading

The number of bytes to be received is read from wrong
place with all OMAPs with highspeed I2C support,
which involves a FIFO and BUFSTAT_REG. It is the 6
bits starting from the bit 8 in the BUFSTAT_REG
that indicate this amount of bytes to be read.
Moreover, only the 6 LSB:s are relevant for the
TXSTAT field.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP: DMA: Fix CCR programming for request line > 63
Anand Gadiyar [Mon, 10 Nov 2008 11:08:17 +0000 (16:38 +0530)]
OMAP: DMA: Fix CCR programming for request line > 63

Bug in existing code causes synchro control to be set +32 if request
line greater than 63 is used.

Reported by Wenbiao Wang

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
+++ linux-omap-2.6/arch/arm/plat-omap/dma.c 2009-01-08 14:44:46.000000000 +0200
@@ -279,10 +279,7 @@ void omap_set_dma_transfer_params(int lc

  val = dma_read(CCR(lch));
  val &= ~(3 << 19);
- if (dma_trigger > 63)
- val |= 1 << 20;
- if (dma_trigger > 31)
- val |= 1 << 19;
+ val |= ((dma_trigger & ~(0x1f)) << 14);

  val &= ~(0x1f);
  val |= (dma_trigger & 0x1f);
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoDon't mask rtc-twl4030 alarm interrupts on shutdown
matti.halme@nokia.com [Wed, 7 Jan 2009 07:10:07 +0000 (09:10 +0200)]
Don't mask rtc-twl4030 alarm interrupts on shutdown

A triggering RTC alarm should be able to power on a device that has been
powered off. This patch enables that on twl4030 by not masking the alarm
interrupt at shutdown.

Signed-off-by: Matti Halme <matti.halme@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoDefault MUX configuration added - GPIO140-143, GPIO0 and GPIO9
Manikandan Pillai [Tue, 16 Dec 2008 05:31:23 +0000 (11:01 +0530)]
Default MUX configuration added - GPIO140-143, GPIO0 and GPIO9

Default MUX configurations for GPIO on OMAP3 EVM boards are added.
Fixed for "_UP" naming convention for GPIOs comment.

Signed-off-by: Manikandan Pillai <mani.pillai@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoFix compile for serial init if CONFIG_PM is not selected
Tony Lindgren [Thu, 8 Jan 2009 09:39:00 +0000 (11:39 +0200)]
Fix compile for serial init if CONFIG_PM is not selected

This patch should be merged into the "MAP3: PM: UART: disable clocks
when idle" patch for omap-pm-upstream.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP3: PM: Ensure modem is reset during PRCM init
Kevin Hilman [Wed, 26 Nov 2008 05:46:55 +0000 (21:46 -0800)]
OMAP3: PM: Ensure modem is reset during PRCM init

Rogue bootloaders may enable the modem and thus keep the
D2D power- and clock-domains from going into retention.
Reset modem on boot to be sure it is in known state.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP3: PM: Force IVA2 into idle during bootup
Kevin Hilman [Tue, 25 Nov 2008 19:48:24 +0000 (11:48 -0800)]
OMAP3: PM: Force IVA2 into idle during bootup

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoPM: OMAP3: Make sure clk_disable_unused() order is correct
Tero Kristo [Wed, 12 Nov 2008 09:42:10 +0000 (11:42 +0200)]
PM: OMAP3: Make sure clk_disable_unused() order is correct

Current implementation will disable clocks in the order defined in clock34xx.h,
at least DPLL4_M2X2 will hang in certain cases (and prevent retention / off)
if clocks are not disabled in correct order. This patch makes sure the parent
clocks will be active when disabling a clock.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP: UART: Add sysfs interface for adjusting UART sleep timeout
Jouni Hogander [Tue, 9 Dec 2008 11:36:50 +0000 (13:36 +0200)]
OMAP: UART: Add sysfs interface for adjusting UART sleep timeout

This patch makes it possible to change uart sleep timeout. New sysfs
entry is added (/sys/devices/platform/serial8250.0/sleep_timeout)

Also default timeout is increased to 5 second to make serial console
more usable.

Original patch was written by Tero Kristo some time ago.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP3: PM: UART save/restore support for OFF-mode
Kevin Hilman [Mon, 3 Nov 2008 19:30:29 +0000 (11:30 -0800)]
OMAP3: PM: UART save/restore support for OFF-mode

If OFF-mode is enabled, each enabled UART will save its
context whenever clocks are disabled and restore it when
clocks are re-enabled.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP3: PM: UART: disable clocks when idle
Kevin Hilman [Mon, 8 Dec 2008 17:38:14 +0000 (09:38 -0800)]
OMAP3: PM: UART: disable clocks when idle

This patch allows the UART clocks to be disabled when the OMAP UARTs
are inactive, thus permitting the chip to hit retention in idle.
After the timeout of an activity timer, each UART is allowed to
disable its clocks so the system can enter retention.  The activity
timer is (re)activated on any UART interrupt, UART wake event or any
IO pad wakeup.  The actual disable of the UART clocks is done in the
'prepare_idle' hook called from the OMAP idle loop.

While the activity timer is active, the smart-idle mode of the UART is
also disabled.  This is due to a "feature" of the UART module that
after a UART wakeup, the smart-idle mode may be entered before the
UART has communicated the interrupt, or upon TX, an idle mode may be
entered before the TX FIFOs are emptied.

Upon suspend, the 'prepare_suspend' hook cancels any pending activity
timers and allows the clocks to be disabled.

To enable the clock-disabling feature of this patch, do

  # echo 1 > /sys/power/clocks_off_while_idle

Special thanks to Tero Kristo for the initial ideas and first versions
of UART idle support, and to Jouni Hogander for extra testing and
bugfixes.

Tested on OMAP3 (Beagle, custom HW) and OMAP2 (n810)

Cc: Tero Kristo <tero.kristo@nokia.com>
Cc: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
Kevin Hilman [Fri, 31 Oct 2008 18:08:42 +0000 (11:08 -0700)]
OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP3: PM: enable gptimer12 as a wakeup source
Kevin Hilman [Tue, 16 Dec 2008 18:15:23 +0000 (10:15 -0800)]
OMAP3: PM: enable gptimer12 as a wakeup source

GPT12 is in the WKUP powerdomain and can be useful as the system timer
and thus a wakeup source for sleep while idle.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP: dmtimer: enable all timers to be wakeup events
Kevin Hilman [Tue, 16 Dec 2008 18:12:34 +0000 (10:12 -0800)]
OMAP: dmtimer: enable all timers to be wakeup events

All GP timers on OMAP2/3 can be wakeup events.  The wakeup status is
cleared in the PRCM interrupt handler.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP: move GP timer selection alongside other timer options
Kevin Hilman [Tue, 16 Dec 2008 17:06:35 +0000 (09:06 -0800)]
OMAP: move GP timer selection alongside other timer options

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agoOMAP3 SmartReflex: get rid of custom clocks
Paul Walmsley [Wed, 7 Jan 2009 15:23:46 +0000 (17:23 +0200)]
OMAP3 SmartReflex: get rid of custom clocks

smartreflex.c defines some custom clocks that don't have clockdomains
associated with them, which is now disallowed.  The custom clocks are
not actually needed, so remove them.  This patch should not cause any
functional change.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: don't tinker with hardirqs when they are supposed to be disabled
Paul Walmsley [Wed, 7 Jan 2009 15:23:46 +0000 (17:23 +0200)]
OMAP2/3 clock: don't tinker with hardirqs when they are supposed to be disabled

Clock rate change code executes inside a spinlock with hardirqs
disabled.  The only code that should be messing around with the
hardirq state should be the plat-omap/clock.c code.  In the
omap2_reprogram_dpllcore() case, this probably just wastes cycles, but
in the omap3_core_dpll_m2_set_rate() case, this is a nasty bug.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: omap2_clk_enable(): fix logic
Paul Walmsley [Wed, 7 Jan 2009 15:23:46 +0000 (17:23 +0200)]
OMAP2/3 clock: omap2_clk_enable(): fix logic

Rearrange the parent clock enable status check code so it actually makes
sense.  No functional change.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: omap2_clk_enable(): fix usecount decrement bug
Paul Walmsley [Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)]
OMAP2/3 clock: omap2_clk_enable(): fix usecount decrement bug

If _omap2_clk_enable() fails, the clock's usecount must be decremented by
one no matter whether the clock has a parent or not.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: omap2_clk_enable(): fix bugs in clockdomain handling
Paul Walmsley [Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)]
OMAP2/3 clock: omap2_clk_enable(): fix bugs in clockdomain handling

omap2_clk_enable() should enable a clock's clockdomain before
attempting to enable its parent clock's clockdomain.  Similarly, in
the unlikely event that the parent clock enable fails, the clockdomain
should be disabled.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: omap2_clk_enable(): refactor usecount check
Paul Walmsley [Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)]
OMAP2/3 clock: omap2_clk_enable(): refactor usecount check

Clean up omap2_clk_enable() by moving most of the function body out of
the usecount check.  Should result in no functional change.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: every clock must have a clkdm
Paul Walmsley [Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)]
OMAP2/3 clock: every clock must have a clkdm

Every OMAP2/3 clock must now have an assigned clockdomain, so we can
remove the checks from clk_enable()/clk_disable().  Instead, verify
that the clockdomain is present only at clock init time via the
arch_clock clk_register() hook.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: add OMAP chip family-specific clk_register() option
Paul Walmsley [Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)]
OMAP clock: add OMAP chip family-specific clk_register() option

Provide a mechanism for OMAP chip family (e.g., OMAP1, 2, 3) clock
code to define a clk_register function via struct clk_functions.  This
is currently only used for OMAP2/3, to handle clock->clockdomain
registration.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: drop clk_get_usecount()
Paul Walmsley [Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)]
OMAP clock: drop clk_get_usecount()

This function is race-prone and mistakenly conveys the impression to
drivers that it is part of the clock interface.  Get rid of it: core
code that absolutely needs this can just check clk->usecount.  Drivers
should not use it at all.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: convert remaining MPU barriers into OCP barriers
Paul Walmsley [Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)]
OMAP2/3 clock: convert remaining MPU barriers into OCP barriers

Several parts of the OMAP2/3 clock code use wmb() to try to ensure
that the hardware write completes before continuing.  This approach is
problematic: wmb() only ensures that the write leaves the ARM.  It
does not ensure that the write actually reaches the endpoint device.
The endpoint device in this case - either the PRM, CM, or SCM - is
three interconnects away from the ARM - and the final interconnect is
low-speed.  And the OCP interconnects will post the write, and who
knows how long that will take to complete.  So the wmb() is not what
we want.  Worse, the wmb() is indiscriminate; it causes the ARM to
flush any other unrelated buffered writes and wait for the local
interconnect to acknowledge them - potentially very expensive.

Fix this by converting the wmb()s into readbacks of the same PRM/CM/SCM
register.  Since the PRM/CM/SCM devices use a single OCP thread, this
will cause the MPU to block while waiting for posted writes to that device
to complete.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2xxx clock: consolidate DELAYED_APP clock commits; fix barrier
Paul Walmsley [Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)]
OMAP2xxx clock: consolidate DELAYED_APP clock commits; fix barrier

Consolidate the commit code for DELAYED_APP clocks into a subroutine,
_omap2xxx_clk_commit().  Also convert the MPU barrier wmb() into an
OCP barrier, since with an MPU barrier, we have no guarantee that the
write actually reached the endpoint device.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: don't use a barrier after clk_disable()
Paul Walmsley [Wed, 7 Jan 2009 15:23:21 +0000 (17:23 +0200)]
OMAP2/3 clock: don't use a barrier after clk_disable()

clk_disable() previously used an ARM barrier, wmb(), to try to ensure
that the hardware write completed before continuing.  There are some
problems with this approach.

The first problem is that wmb() only ensures that the write leaves the
ARM -- not that it actually reaches the endpoint device.  In this
case, the endpoint device - either the PRM, CM, or SCM - is three
interconnects away from the ARM, and the final interconnect is
low-speed.  And the OCP interconnects will post the write, who knows
how long that will take to complete.  So the wmb() is not really what
we want.

Worse, the wmb() is indiscriminate; it will cause the ARM to flush any
other unrelated buffered writes and wait for the local interconnect to
acknowledge them - potentially very expensive.

This first problem could be fixed by doing a readback of the same PRM/CM/SCM
register.  Since these devices use a single OCP thread, this will cause the
MPU to wait for the write to complete.

But the primary problem is a conceptual one: clk_disable() should not
need any kind of barrier.  clk_enable() needs one since device driver
code must not access a device until its clocks are known to be
enabled.  But clk_disable() has no such restriction.

Since blocking the MPU on a PRM/CM/SCM write can be a very
high-latency operation - several hundred MPU cycles - it's worth
avoiding this barrier if possible.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: rearrange clock.h structure order
Russell King [Wed, 7 Jan 2009 15:23:21 +0000 (17:23 +0200)]
OMAP clock: rearrange clock.h structure order

... to eliminate unnecessary padding.  We have rather a lot of these
structures, so eliminating unnecessary padding results in a saving of
1488 bytes.

[paul@pwsan.com: updated against current linux-omap clock tree, now saves
1512 bytes on OMAP3 builds]

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: remove clk->owner
Russell King [Wed, 7 Jan 2009 15:20:26 +0000 (17:20 +0200)]
OMAP2/3 clock: remove clk->owner

clk->owner is always NULL, so its existence doesn't serve any useful
function other than bloating the kernel by 992 bytes.  Remove it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2 clock: drop CONFIG_PARTICIPANT clock flag
Paul Walmsley [Wed, 7 Jan 2009 15:20:25 +0000 (17:20 +0200)]
OMAP2 clock: drop CONFIG_PARTICIPANT clock flag

The CONFIG_PARTICIPANT flags indicates to the clock rate and parent
changing functions that they should not be used on this clock.  Better
just to remove the clock function pointers that operate on those
clocks.  The name of the flag is just terrible: its meaning has almost
nothing to do with its name, and the use of the CONFIG_ prefix makes
it appear to be a Kconfig option.  Get rid of it.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: remove VIRTUAL_CLOCK
Russell King [Wed, 7 Jan 2009 15:20:25 +0000 (17:20 +0200)]
OMAP clock: remove VIRTUAL_CLOCK

Nothing tests the clock flags for this bit, so it serves no purpose.
Remove it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: drop RATE_FIXED
Paul Walmsley [Wed, 7 Jan 2009 15:20:25 +0000 (17:20 +0200)]
OMAP clock: drop RATE_FIXED

The RATE_FIXED flag currently has no useful purpose.  Fixed rate clocks
should simply not implement the recalc, set_rate, set_parent, and round_rate
function pointers.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: drop the RATE_PROPAGATES flag
Paul Walmsley [Wed, 7 Jan 2009 15:20:25 +0000 (17:20 +0200)]
OMAP clock: drop the RATE_PROPAGATES flag

Now that clocks keep track of their children, the RATE_PROPAGATES flag
is no longer necessary.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: track child clocks
Paul Walmsley [Wed, 7 Jan 2009 15:20:24 +0000 (17:20 +0200)]
OMAP clock: track child clocks

Track child clocks for each struct clk.  This optimizes traversals of the
clock tree from parent to child, which happens during rate propagation, and
in the future, clock notifiers.

Previously, parent-to-child traversals sequentially scanned the entire
clock list at each step to determine the children of a particular
clock node.  Now each struct clk maintains a clock list of its
children.  For a DPLL3_M2_CK rate change, this converts what were
about O(6*180*2) operations into O(6*6*2) operations.  The savings
will be even more significant after the future notifier patches:
something like O(6*180*6) to O(6*6*6).

The price paid is additional runtime memory consumption - 8 bytes per
clock and 16 bytes per child clock - roughly 4.5KiB on OMAP3.  The
memory comes mostly from bootmem, since initial clock registration
takes place before slab is ready.  Several other operations will take
slightly more time due the extra bookkeeping: clk_register(),
clk_unregister(), clk_set_parent(), and omap2_init_clksel_parent().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: support "dry run" rate and parent changes
Paul Walmsley [Wed, 7 Jan 2009 15:20:24 +0000 (17:20 +0200)]
OMAP clock: support "dry run" rate and parent changes

For upcoming notifier support, modify the rate recalculation code to
take parent rate and rate storage parameters.  The goal here is to
allow the clock code to determine what the clock's rate would be after
a parent change or a rate change, without actually changing the
hardware registers.  This is used by the upcoming notifier patches to
pass a clock's current and planned rates to the notifier callbacks.

Also add a new clock flag, RECALC_ON_ENABLE, which causes the clock
framework code to recalculate the current clock's rate and propagate
down the tree after a clk_enable() or clk_disable().  This is used by
the OMAP3 DPLLs, which change rates when they enable or disable, unlike
most clocks.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: drop recalc function pointers from fixed rate clocks
Paul Walmsley [Wed, 7 Jan 2009 15:20:23 +0000 (17:20 +0200)]
OMAP2/3 clock: drop recalc function pointers from fixed rate clocks

Now that rate recalculation and rate propagation are two separate
operations, drop recalc function pointers from all fixed rate clocks.
Their rates are fixed, so there's no need to recalculate.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP clock: move rate recalc, propagation code up to plat-omap/clock.c
Paul Walmsley [Wed, 7 Jan 2009 15:20:23 +0000 (17:20 +0200)]
OMAP clock: move rate recalc, propagation code up to plat-omap/clock.c

Previously the individual clock recalculation functions handled their
own rate recalculation.  This can be handled in the clk_set_rate(),
clk_set_parent(), and recalculate_root_clocks() functions in
plat-omap/clock.c.  Removes duplicate code and clarifies the role of the
recalc functions.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3 clock: use standard set_rate fn in omap2_clk_arch_init()
Paul Walmsley [Wed, 7 Jan 2009 15:20:23 +0000 (17:20 +0200)]
OMAP2/3 clock: use standard set_rate fn in omap2_clk_arch_init()

Use the standard clk_set_rate() function in omap2_clk_arch_init()
rather than omap2_select_table_rate() -- this will ensure that clock
rates are recalculated and propagated correctly after those operations
are consolidated into clk_set_rate().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoomap mmc: remove duplicated #include's
Huang Weiyi [Sun, 4 Jan 2009 03:13:52 +0000 (11:13 +0800)]
omap mmc: remove duplicated #include's

Removed duplicated #include's in arch/arm/mach-omap1/board-voiceblue.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: OMAP: Fix gpio by switching to generic gpio calls
Jarkko Nikula [Wed, 7 Jan 2009 10:54:34 +0000 (12:54 +0200)]
ARM: OMAP: Fix gpio by switching to generic gpio calls

Fix compile by removing remaining omap specific gpio
calls. Based on earlier patches by Jarkko Nikula.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoUSB: OTG: twl4030 build fix
Kevin Hilman [Tue, 16 Dec 2008 00:00:03 +0000 (16:00 -0800)]
USB: OTG: twl4030 build fix

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agohsmmc: Leave out twl4030 dependency
Tony Lindgren [Tue, 30 Dec 2008 08:39:49 +0000 (10:39 +0200)]
hsmmc: Leave out twl4030 dependency

Also change the dependency to ARCH_OMAPP2430 || ARCH_OMAP3.
Based on comments by David Brownell.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agohsmmc: Fix bus voltage reset, clean-up for checkpatch
Tony Lindgren [Mon, 29 Dec 2008 16:15:47 +0000 (18:15 +0200)]
hsmmc: Fix bus voltage reset, clean-up for checkpatch

The bus voltage was being reset to 3V even if card was not
removed. Move the reset code to happen after slot has been
powered down. Also clean-up for checkpatch.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agohsmmc: Fix setting the voltage back to 3V
Tony Lindgren [Mon, 29 Dec 2008 14:24:25 +0000 (16:24 +0200)]
hsmmc: Fix setting the voltage back to 3V

We should not set it in mmc_omap_detect, as that does not necessarily
tell that card got removed. Reset the voltage back to 3V after powering
off the slot instead.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoMerge current mainline tree into linux-omap tree
Tony Lindgren [Mon, 29 Dec 2008 08:51:06 +0000 (10:51 +0200)]
Merge current mainline tree into linux-omap tree

Merge branches 'master' and 'linus'

15 years agoLinux 2.6.28 v2.6.28
Linus Torvalds [Wed, 24 Dec 2008 23:26:37 +0000 (15:26 -0800)]
Linux 2.6.28

Happy holidays..

15 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Wed, 24 Dec 2008 18:24:52 +0000 (10:24 -0800)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  V4L/DVB (9920): em28xx: fix NULL pointer dereference in call to VIDIOC_INT_RESET command
  V4L/DVB (9908a): MAINTAINERS: mark linux-uvc-devel as subscribers only
  V4L/DVB (9906): v4l2-compat: test for unlocked_ioctl as well.
  V4L/DVB (9885): drivers/media Kconfig's: fix bugzilla #12204
  V4L/DVB (9875): gspca - main: Fix vidioc_s_jpegcomp locking.
  V4L/DVB (9781): [PATCH] Cablestar 2 I2C retries (fix CableStar2 support)
  V4L/DVB (9780): dib0700: Stop repeating after user stops pushing button

15 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 24 Dec 2008 18:24:14 +0000 (10:24 -0800)]
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: disable X86_PTRACE_BTS

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Wed, 24 Dec 2008 18:23:21 +0000 (10:23 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Add missing terminators in patch_sigmatel.c

15 years agoALSA: hda - Add missing terminators in patch_sigmatel.c
Herton Ronaldo Krzesinski [Tue, 23 Dec 2008 18:53:00 +0000 (16:53 -0200)]
ALSA: hda - Add missing terminators in patch_sigmatel.c

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Cc: stable@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agox86: disable X86_PTRACE_BTS
Ingo Molnar [Wed, 24 Dec 2008 09:49:51 +0000 (10:49 +0100)]
x86: disable X86_PTRACE_BTS

there's a new ptrace arch level feature in .28:

  config X86_PTRACE_BTS
  bool "Branch Trace Store"

it has broken fork() handling: the old DS area gets copied over into
a new task without clearing it.

Fixes exist but they came too late:

  c5dee61: x86, bts: memory accounting
  bf53de9: x86, bts: add fork and exit handling

and are queued up for v2.6.29. This shows that the facility is still not
tested well enough to release into a stable kernel - disable it for now and
reactivate in .29. In .29 the hardware-branch-tracer will use the DS/BTS
facilities too - hopefully resulting in better code.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoparisc: disable UP-optimized flush_tlb_mm
Kyle McMartin [Tue, 23 Dec 2008 13:44:30 +0000 (08:44 -0500)]
parisc: disable UP-optimized flush_tlb_mm

flush_tlb_mm's "optimized" uniprocessor case of allocating a new
context for userspace is exposing a race where we can suddely return
to a syscall with the protection id and space id out of sync, trapping
on the next userspace access.

Debugged-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Wed, 24 Dec 2008 01:01:40 +0000 (17:01 -0800)]
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon: fix correctness of irq_enabled check for radeon.

15 years agoedac: fix edac core deadlock when removing a device
Harry Ciao [Tue, 23 Dec 2008 21:57:16 +0000 (13:57 -0800)]
edac: fix edac core deadlock when removing a device

When deleting an edac device, we have to wait for its edac_dev.work to be
completed before deleting the whole edac_dev structure.  Since we have no
idea which work in current edac_poller's workqueue is the work we are
conerned about, we wait for all work in the edac_poller's workqueue to be
proceseed.  This is done via flush_cpu_workqueue() which inserts a
wq_barrier into the tail of the workqueue and then sleeping on the
completion of this wq_barrier.  The edac_poller will wake up sleepers when
it is found.

EDAC core creates only one kernel worker thread, edac_poller, to run the
works of all current edac devices.  They share the same callback function
of edac_device_workq_function(), which would grab the mutex of
device_ctls_mutex first before it checks the device.  This is exactly
where edac_poller and rmmod would have a great chance to deadlock.

In below call trace of rmmod > ... >
edac_device_del_device >
edac_device_workq_teardown > flush_workqueue > flush_cpu_workqueue,

device_ctls_mutex would have already been grabbed by
edac_device_del_device().  So, on one hand rmmod would sleep on the
completion of a wq_barrier, holding device_ctls_mutex; on the other hand
edac_poller would be blocked on the same mutex when it's running any one
of works of existing edac evices(Note, this edac_dev.work is likely to be
totally irrelevant to the one that is being removed right now)and never
would have a chance to run the work of above wq_barrier to wake rmmod up.

edac_device_workq_teardown() should not be called within the critical
region of device_ctls_mutex.  Just like is done in edac_pci_del_device()
and edac_mc_del_mc(), where edac_pci_workq_teardown() and
edac_mc_workq_teardown() are called after related mutex are released.

Moreover, an edac_dev.work should check first if it is being removed.  If
this is the case, then it should bail out immediately.  Since not all of
existing edac devices are to be removed, this "shutting flag" should be
contained to edac device being removed.  The current edac_dev.op_state can
be used to serve this purpose.

The original deadlock problem and the solution have been witnessed and
tested on actual hardware.  Without the solution, rmmod an edac driver
would result in below deadlock:

root@localhost:/root> rmmod mv64x60_edac
EDAC DEBUG: mv64x60_dma_err_remove()
EDAC DEBUG: edac_device_del_device()
EDAC DEBUG: find_edac_device_by_dev()

(hang for a moment)

INFO: task edac-poller:2030 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
edac-poller   D 00000000     0  2030      2
Call Trace:
[df159dc0] [c0071e3c] free_hot_cold_page+0x17c/0x304 (unreliable)
[df159e80] [c000a024] __switch_to+0x6c/0xa0
[df159ea0] [c03587d8] schedule+0x2f4/0x4d8
[df159f00] [c03598a8] __mutex_lock_slowpath+0xa0/0x174
[df159f40] [e1030434] edac_device_workq_function+0x28/0xd8 [edac_core]
[df159f60] [c003beb4] run_workqueue+0x114/0x218
[df159f90] [c003c674] worker_thread+0x5c/0xc8
[df159fd0] [c004106c] kthread+0x5c/0xa0
[df159ff0] [c0013538] original_kernel_thread+0x44/0x60
INFO: task rmmod:2062 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
rmmod         D 0ff2c9fc     0  2062   1839
Call Trace:
[df119c00] [c0437a74] 0xc0437a74 (unreliable)
[df119cc0] [c000a024] __switch_to+0x6c/0xa0
[df119ce0] [c03587d8] schedule+0x2f4/0x4d8
[df119d40] [c03591dc] schedule_timeout+0xb0/0xf4

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocgroups: avoid accessing uninitialized data in failure path
Li Zefan [Tue, 23 Dec 2008 21:57:14 +0000 (13:57 -0800)]
cgroups: avoid accessing uninitialized data in failure path

If cgroup_get_rootdir() failed, free_cg_links() will be called in the
failure path, but tmp_cg_links hasn't been initialized at that time.

I introduced this bug in the 2.6.27 merge window.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocgroups: suppress bogus warning messages
Sharyathi Nagesh [Tue, 23 Dec 2008 21:57:12 +0000 (13:57 -0800)]
cgroups: suppress bogus warning messages

Remove spurious warning messages that are thrown onto the console during
cgroup operations.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Sharyathi Nagesh <sharyathi@in.ibm.com>
Acked-by: Serge E. Hallyn <serge@hallyn.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agow1: fix slave selection on big-endian systems
Evgeniy Polyakov [Tue, 23 Dec 2008 21:57:12 +0000 (13:57 -0800)]
w1: fix slave selection on big-endian systems

During test of the w1-gpio driver i found that in "w1.c:679
w1_slave_found()" the device id is converted to little-endian with
"cpu_to_le64()", but its not converted back to cpu format in "w1_io.c:293
w1_reset_select_slave()".

Based on a patch created by Andreas Hummel.

[akpm@linux-foundation.org: remove unneeded cast]
Reported-by: Andreas Hummel <andi_hummel@gmx.de>
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agortc: rtc-isl1208: reject invalid dates
Chris Elston [Tue, 23 Dec 2008 21:57:10 +0000 (13:57 -0800)]
rtc: rtc-isl1208: reject invalid dates

This patch for the rtc-isl1208 driver makes it reject invalid dates.

Signed-off-by: Chris Elston <celston@katalix.com>
[a.zummo@towertech.it: added comment explaining the check]
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: Hebert Valerio Riedel <hvr@gnu.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoOMAP2: fix recent build breakage
Paul Walmsley [Tue, 23 Dec 2008 06:28:10 +0000 (23:28 -0700)]
OMAP2: fix recent build breakage

Fix recent build breakage.  Boot-tested on N800.

  CC      arch/arm/mach-omap2/devices.o
arch/arm/mach-omap2/devices.c:110: error: 'OMAP34XX_MAILBOX_BASE' undeclared here (not in a function)
arch/arm/mach-omap2/devices.c:115: error: 'INT_34XX_MAIL_U0_MPU' undeclared here (not in a function)
make[1]: *** [arch/arm/mach-omap2/devices.o] Error 1

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agohsmmc: Fix comments from Pierre
Tony Lindgren [Tue, 23 Dec 2008 12:25:02 +0000 (14:25 +0200)]
hsmmc: Fix comments from Pierre

Also remove "change vdd back to 3V" in omap_mmc_remove() as it
seems unnecessary. If it's a hw workaround, we can add it back
as needed.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoV4L/DVB (9920): em28xx: fix NULL pointer dereference in call to VIDIOC_INT_RESET...
Devin Heitmueller [Wed, 17 Dec 2008 02:09:35 +0000 (23:09 -0300)]
V4L/DVB (9920): em28xx: fix NULL pointer dereference in call to VIDIOC_INT_RESET command

Fix a NULL pointer dereference that would occur if the video decoder tied to
the em28xx supports the VIDIOC_INT_RESET call (for example: the cx25840 driver)

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years agodrm/radeon: fix correctness of irq_enabled check for radeon.
Dave Airlie [Mon, 22 Dec 2008 07:11:02 +0000 (17:11 +1000)]
drm/radeon: fix correctness of irq_enabled check for radeon.

This check was introduced with the logic the wrong way around.

Fixes regression: http://bugzilla.kernel.org/show_bug.cgi?id=12216

Tested-by: François Valenduc <francois.valenduc@tvcablenet.be>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Mon, 22 Dec 2008 22:52:00 +0000 (14:52 -0800)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: don't cond_resched() when irqs_disabled()
  ACPI: fix 2.6.28 acpi.debug_level regression

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Mon, 22 Dec 2008 22:40:48 +0000 (14:40 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
  drivers/ide/{cs5530.c,sc1200.c}: Move a dereference below a NULL test

15 years agodrivers/ide/{cs5530.c,sc1200.c}: Move a dereference below a NULL test
Julia Lawall [Mon, 22 Dec 2008 22:05:06 +0000 (23:05 +0100)]
drivers/ide/{cs5530.c,sc1200.c}: Move a dereference below a NULL test

In each case, if the NULL test is necessary, then the dereference should be
moved below the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Mon, 22 Dec 2008 18:17:19 +0000 (10:17 -0800)]
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  MIPS: MIPS64R2: Fix buggy __arch_swab64
  MIPS: Fix preprocessor warnings flaged by GCC 4.4

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Mon, 22 Dec 2008 18:12:54 +0000 (10:12 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  ppp: fix segfaults introduced by netdev_priv changes
  net: Fix module refcount leak in kernel_accept()

15 years agoMerge branch 'for-tony-mailbox'
Tony Lindgren [Mon, 22 Dec 2008 15:27:47 +0000 (17:27 +0200)]
Merge branch 'for-tony-mailbox'

Conflicts:

arch/arm/plat-omap/Kconfig
arch/arm/plat-omap/include/mach/omap34xx.h
arch/arm/plat-omap/mailbox.c

15 years agoReset mailbox to mainline version
Tony Lindgren [Mon, 22 Dec 2008 15:09:49 +0000 (17:09 +0200)]
Reset mailbox to mainline version

This is to start using Hiroshi's branch against the mainline tree.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoMIPS: MIPS64R2: Fix buggy __arch_swab64
David Daney [Wed, 17 Dec 2008 21:28:39 +0000 (13:28 -0800)]
MIPS: MIPS64R2: Fix buggy __arch_swab64

The way the code is written it was assuming dshd has the function of a
hypothetical dshw instruction ...

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Fix preprocessor warnings flaged by GCC 4.4
David Daney [Thu, 18 Dec 2008 02:19:18 +0000 (18:19 -0800)]
MIPS: Fix preprocessor warnings flaged by GCC 4.4

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoNull pointer deref with hrtimer_try_to_cancel()
Thomas Gleixner [Sat, 20 Dec 2008 20:27:34 +0000 (21:27 +0100)]
Null pointer deref with hrtimer_try_to_cancel()

Impact: Prevent kernel crash with posix timer clockid CLOCK_MONOTONIC_RAW

commit 2d42244ae71d6c7b0884b5664cf2eda30fb2ae68 (clocksource:
introduce CLOCK_MONOTONIC_RAW) introduced a new clockid, which is only
available to read out the raw not NTP adjusted system time.

The above commit did not prevent that a posix timer can be created
with that clockid. The timer_create() syscall succeeds and initializes
the timer to a non existing hrtimer base. When the timer is deleted
either by timer_delete() or by the exit() cleanup the kernel crashes.

Prevent the creation of timers for CLOCK_MONOTONIC_RAW by setting the
posix clock function to no_timer_create which returns an error code.

Reported-and-tested-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
Linus Torvalds [Sat, 20 Dec 2008 19:07:31 +0000 (11:07 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  fs/9p: change simple_strtol to simple_strtoul
  9p: convert d_iname references to d_name.name
  9p: Remove potentially bad parameter from function entry debug print.

15 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 20 Dec 2008 19:07:18 +0000 (11:07 -0800)]
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: fix resume (S2R) broken by Intel microcode module, on A110L
  x86 gart: don't complain if no AMD GART found
  AMD IOMMU: panic if completion wait loop fails
  AMD IOMMU: set cmd buffer pointers to zero manually
  x86: re-enable MCE on secondary CPUS after suspend/resume
  AMD IOMMU: allocate rlookup_table with __GFP_ZERO

15 years agox86: fix resume (S2R) broken by Intel microcode module, on A110L
Dmitry Adamushko [Fri, 19 Dec 2008 23:15:24 +0000 (00:15 +0100)]
x86: fix resume (S2R) broken by Intel microcode module, on A110L

Impact: fix deadlock

This is in response to the following bug report:

Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=12100
Subject         : resume (S2R) broken by Intel microcode module, on A110L
Submitter       : Andreas Mohr <andi@lisas.de>
Date            : 2008-11-25 08:48 (19 days old)
Handled-By      : Dmitry Adamushko <dmitry.adamushko@gmail.com>

[ The deadlock scenario has been discovered by Andreas Mohr ]

I think I might have a logical explanation why the system:

  (http://bugzilla.kernel.org/show_bug.cgi?id=12100)

might hang upon resuming, OTOH it should have likely hanged each and every time.

(1) possible deadlock in microcode_resume_cpu() if either 'if' section is
taken;

(2) now, I don't see it in spec. and can't experimentally verify it (newer
ucodes don't seem to be available for my Core2duo)... but logically-wise, I'd
think that when read upon resuming, the 'microcode revision' (MSR 0x8B) should
be back to its original one (we need to reload ucode anyway so it doesn't seem
logical if a cpu doesn't drop the version)... if so, the comparison with
memcmp() for the full 'struct cpu_signature' is wrong... and that's how one of
the aforementioned 'if' sections might have been triggered - leading to a
deadlock.

Obviously, in my tests I simulated loading/resuming with the ucode of the same
version (just to see that the file is loaded/re-loaded upon resuming) so this
issue has never popped up.

I'd appreciate if someone with an appropriate system might give a try to the
2nd patch (titled "fix a comparison && deadlock...").

In any case, the deadlock situation is a must-have fix.

Reported-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Tested-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agofs/9p: change simple_strtol to simple_strtoul
Julia Lawall [Fri, 19 Dec 2008 22:50:22 +0000 (16:50 -0600)]
fs/9p: change simple_strtol to simple_strtoul

Since v9ses->uid is unsigned, it would seem better to use simple_strtoul that
simple_strtol.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r2@
long e;
position p;
@@

e = simple_strtol@p(...)

@@
position p != r2.p;
type T;
T e;
@@

e =
- simple_strtol@p
+ simple_strtoul
  (...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
15 years ago9p: convert d_iname references to d_name.name
Wu Fengguang [Fri, 19 Dec 2008 22:47:40 +0000 (16:47 -0600)]
9p: convert d_iname references to d_name.name

d_iname is rubbish for long file names.
Use d_name.name in printks instead.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
15 years ago9p: Remove potentially bad parameter from function entry debug print.
Duane Griffin [Fri, 19 Dec 2008 22:45:21 +0000 (16:45 -0600)]
9p: Remove potentially bad parameter from function entry debug print.

Signed-off-by: Duane Griffin <duaneg@dghda.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Fri, 19 Dec 2008 19:37:23 +0000 (11:37 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] mpt fusion: clear list of outstanding commands on host reset
  [SCSI] scsi_lib: only call scsi_unprep_request() under queue lock
  [SCSI] ibmvstgt: move crq_queue_create to the end of initialization
  [SCSI] libiscsi REGRESSION: fix passthrough support with older iscsi tools
  [SCSI] aacraid: disable Dell Percraid quirk on Adaptec 2200S and 2120S

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 19 Dec 2008 19:37:07 +0000 (11:37 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: Fix a Oops bug in omap soc driver.
  ALSA: hda - Remove non-working headphone control for Dell laptops
  ALSA: hda - Add no-jd model for IDT 92HD73xx
  ALSA: Revert "ALSA: hda: removed unneeded hp_nid references"
  ALSA: hda - Add quirk for Dell Studio 17
  ALSA: hda - Fix silent HP output on D975

15 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Fri, 19 Dec 2008 19:36:49 +0000 (11:36 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  cciss: fix problem that deleting multiple logical drives could cause a panic

15 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Fri, 19 Dec 2008 19:36:04 +0000 (11:36 -0800)]
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/i915: GEM on PAE has problems - disable it for now.
  drm/i915: Don't return busy for buffers left on the flushing list.

15 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Fri, 19 Dec 2008 19:34:36 +0000 (11:34 -0800)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md:
  md: Don't read past end of bitmap when reading bitmap.

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Fri, 19 Dec 2008 19:33:10 +0000 (11:33 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI hotplug: ibmphp: Fix module ref count underflow
  PCI hotplug: acpiphp wants a 64-bit _SUN
  PCI: pciehp: fix unexpected power off with pciehp_force
  PCI: fix aer resume sanity check

15 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Fri, 19 Dec 2008 14:37:12 +0000 (15:37 +0100)]
Merge branch 'fix/asoc' into for-linus

15 years agoALSA: Fix a Oops bug in omap soc driver.
Stanley Miao [Fri, 19 Dec 2008 14:08:22 +0000 (22:08 +0800)]
ALSA: Fix a Oops bug in omap soc driver.

There will be a Oops or frequent underrun messages when playing music with
omap soc driver, this is because a data region is incorretly sized, other data
region will be overwriten when writing to this data region.

Signed-off-by: Stanley Miao <stanley.miao@windriver.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: stable@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Remove non-working headphone control for Dell laptops
Takashi Iwai [Fri, 19 Dec 2008 13:02:32 +0000 (14:02 +0100)]
ALSA: hda - Remove non-working headphone control for Dell laptops

The previous commit re-enabled hp_nid setup for IDT92HD73*, but
it's unneeded indeed for Dell laptops that have multiple headphones.
Setting the extra hp_nid results in a non-working "Headpohne" mixer
control.  Thus hp_nid should be 0 for these dell models.

Also, the automatic addition of hp_nid should check whether it's
a dual-HP model or not.  For dual-HPs, the pins are already checked
by the early workaround.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoomap mailbox: remove unnecessary header file inclusion
Hiroshi DOYU [Mon, 24 Nov 2008 23:13:48 +0000 (01:13 +0200)]
omap mailbox: remove unnecessary header file inclusion

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
15 years agoomap mailbox: convert sequence bit checking to module paramter
Hiroshi DOYU [Mon, 24 Nov 2008 23:06:34 +0000 (01:06 +0200)]
omap mailbox: convert sequence bit checking to module paramter

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
15 years agoomap mailbox: move mailbox.h into mailbox.c
Hiroshi DOYU [Mon, 24 Nov 2008 22:50:39 +0000 (00:50 +0200)]
omap mailbox: move mailbox.h into mailbox.c

no need to keep mailbox.h separately.

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
15 years agoomap mailbox: add save_/restore_ctx() for PM
Hiroshi DOYU [Mon, 24 Nov 2008 22:48:12 +0000 (00:48 +0200)]
omap mailbox: add save_/restore_ctx() for PM

To preserve the registers during off-mode

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
15 years agoomap mailbox: fix empty struct device for omap2
Hiroshi DOYU [Mon, 24 Nov 2008 21:16:57 +0000 (23:16 +0200)]
omap mailbox: fix empty struct device for omap2

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>