]> pilppa.com Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
15 years agoMerge branch 'omap-clock-fixes' of git://git.pwsan.com/linux-2.6 master
Tony Lindgren [Fri, 10 Apr 2009 19:03:31 +0000 (12:03 -0700)]
Merge branch 'omap-clock-fixes' of git://git.pwsan.com/linux-2.6

Conflicts:
arch/arm/mach-omap2/board-omap3beagle.c

15 years agoOMAP2/3 GPTIMER: allow system tick GPTIMER to be changed in board-*.c files
Paul Walmsley [Fri, 10 Apr 2009 16:38:55 +0000 (10:38 -0600)]
OMAP2/3 GPTIMER: allow system tick GPTIMER to be changed in board-*.c files

Add a function omap2_gp_clockevent_set_gptimer() for board-*.c files
to use in .init_irq functions to configure the system tick GPTIMER.
Practical choices at this point are GPTIMER1 or GPTIMER12.  Both of
these timers are in the WKUP powerdomain, and so are unaffected by
chip power management.  GPTIMER1 can use sys_clk as a source, for
applications where a high-resolution timer is more important than
power management.  GPTIMER12 has the special property that it has the
secure 32kHz oscillator as its source clock, which may be less prone
to glitches than the off-chip 32kHz oscillator.  But on HS devices, it
may not be available for Linux use.

It appears that most boards are fine with GPTIMER1, but BeagleBoard
should use GPTIMER12 when using a 32KiHz timer source, due to hardware bugs
in revisions B4 and below.  Modify board-omap3beagle.c to use GPTIMER12.

This patch originally used a Kbuild config option to select the GPTIMER,
but was changed to allow this to be specified in board-*.c files, per
Tony's request.

Tested on Beagle rev B4 ES2.1, with and without CONFIG_OMAP_32K_TIMER, and
3430SDP.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP: dmtimer: enable all timers to be wakeup events
Kevin Hilman [Fri, 10 Apr 2009 16:38:55 +0000 (10:38 -0600)]
OMAP: dmtimer: enable all timers to be wakeup events

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

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
15 years agoOMAP3 GPTIMER: fix GPTIMER12 IRQ
Paul Walmsley [Fri, 10 Apr 2009 16:38:55 +0000 (10:38 -0600)]
OMAP3 GPTIMER: fix GPTIMER12 IRQ

GPTIMER12 IRQ is at IRQ 95 on OMAP3, unlike OMAP2.  (ref: OMAP34xx
Multimedia High Security (HS) Device Silicon Revision 3.0 Security
Addendum Rev. B, SWPU119B)

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP1: clock: Typo fix for clock in omap1
Arun KS [Fri, 10 Apr 2009 16:31:49 +0000 (10:31 -0600)]
OMAP1: clock: Typo fix for clock in omap1

Typo error when requesting for clock for dsp in omap1

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
15 years agoOMAP3: clock: Camera module doesn't have IDLEST bit
Sergio Aguirre [Fri, 10 Apr 2009 02:21:38 +0000 (20:21 -0600)]
OMAP3: clock: Camera module doesn't have IDLEST bit

This patch avoids waiting for the camera module to become ready,
since it doesn't have IDLEST bit.

Based on a earlier hack done by Paul Walmsley on Sep 9 2008 on
linux-omap tree.

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
15 years agoOMAP2xxx clock: fix broken cpu_mask code
Paul Walmsley [Fri, 10 Apr 2009 02:20:41 +0000 (20:20 -0600)]
OMAP2xxx clock: fix broken cpu_mask code

Commit 8ad8ff6548f1c0bcbeaa02f274b3927c5015a921 breaks the OMAP2xxx
cpu_mask code, which causes OMAP2xxx to panic on boot.  Fix by
removing the cpu_mask auto variable and by changing CK_242X
and CK_243X to use RATE_IN_242X/RATE_IN_243X.

Resolves

<1>Unable to handle kernel NULL pointer dereference at virtual address 0000000c
<1>pgd = c0004000
<1>[0000000c] *pgd=00000000
Internal error: Oops: 5 [#1]
Modules linked in:
CPU: 0    Not tainted  (2.6.29-omap1 #32)
PC is at omap2_clk_set_parent+0x104/0x120
LR is at omap2_clk_set_parent+0x28/0x120

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Russell King <linux@arm.linux.org.uk>
15 years agoOMAP2xxx clock: init osc_ck, sys_ck internal lists early
Paul Walmsley [Fri, 10 Apr 2009 02:20:41 +0000 (20:20 -0600)]
OMAP2xxx clock: init osc_ck, sys_ck internal lists early

Commit 3f0a820c4c0b4670fb5f164baa5582e23c2ef118 breaks OMAP2xxx boot
during initial propagate_rate() on osc_ck and sys_ck.  Fix by calling
clk_init_one() for these clocks first.

Resolves

<1>Unable to handle kernel NULL pointer dereference at virtual address 00000000
<1>pgd = c0004000
<1>[00000000] *pgd=00000000
Internal error: Oops: 5 [#1]
Modules linked in:
CPU: 0    Not tainted  (2.6.29-omap1 #37)
PC is at propagate_rate+0x10/0x60
LR is at omap2_clk_init+0x30/0x218
...

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Russell King <linux@arm.linux.org.uk>
15 years agoMerge branch 'omap-fixes'
Tony Lindgren [Wed, 8 Apr 2009 00:05:31 +0000 (17:05 -0700)]
Merge branch 'omap-fixes'

15 years agoARM: Do early I/O mapping if spinlock debugging is enabled
Juha Yrjola [Wed, 8 Apr 2009 00:04:53 +0000 (17:04 -0700)]
ARM: Do early I/O mapping if spinlock debugging is enabled

At least on OMAP, sched_clock() requires the I/O maps to be initialized.
Spinlock debugging invokes sched_clock() very early.

Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agommc: Fix compile for omap_hsmmc.c
Tony Lindgren [Wed, 8 Apr 2009 00:04:33 +0000 (17:04 -0700)]
mmc: Fix compile for omap_hsmmc.c

This fixes the issue noted by Russell King:

drivers/mmc/host/omap_hsmmc.c: In function 'mmc_omap_xfer_done':
drivers/mmc/host/omap_hsmmc.c:301: error: implicit declaration of function 'mmc_omap_fclk_lazy_disable'

This got broken by 4a694dc915c9a223044ce21fc0d99e63facd1d64.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoRemove executable permission for dma.c
Tony Lindgren [Tue, 7 Apr 2009 23:41:51 +0000 (16:41 -0700)]
Remove executable permission for dma.c

As noted by Russ Dill. This somehow got set while moving
code to omap-pool branch.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoMerge branch 'omap-pool'
Tony Lindgren [Tue, 7 Apr 2009 23:40:35 +0000 (16:40 -0700)]
Merge branch 'omap-pool'

Conflicts:
drivers/Makefile
drivers/mmc/host/omap_hsmmc.c

15 years agoMerge branch 'omap-fixes'
Tony Lindgren [Tue, 7 Apr 2009 23:36:16 +0000 (16:36 -0700)]
Merge branch 'omap-fixes'

Conflicts:
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-rx51.c
drivers/mmc/host/omap_hsmmc.c

15 years agoomap_hsmmc: Flush posted write to IRQ
Kevin Hilman [Tue, 7 Apr 2009 23:33:35 +0000 (16:33 -0700)]
omap_hsmmc: Flush posted write to IRQ

Spurious IRQs seen on MMC after 2.6.29.  Flush posted write in IRQ
handler.

The interrupt line is released by clearing the error status bits
in the MMCHS_STAT register, which must occur before the interrupt
handler returns to avoid unwanted irqs.  Hence the need to flush
the posted write.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Tony Lindgen <tony@atomide.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: Do early I/O mapping if spinlock debugging is enabled
Juha Yrjola [Tue, 7 Apr 2009 23:33:35 +0000 (16:33 -0700)]
ARM: Do early I/O mapping if spinlock debugging is enabled

At least on OMAP, sched_clock() requires the I/O maps to be initialized.
Spinlock debugging invokes sched_clock() very early.

Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoMerge branch 'omap-pool'
Tony Lindgren [Tue, 7 Apr 2009 23:27:19 +0000 (16:27 -0700)]
Merge branch 'omap-pool'

Conflicts:
drivers/Makefile

15 years agoExtra omap code in linux-omap tree
Tony Lindgren [Tue, 7 Apr 2009 23:22:17 +0000 (16:22 -0700)]
Extra omap code in linux-omap tree

This patch contains all the uncategorized patches not in
mainline. These patches will be reworked for mainline or
removed.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoExtra omap code in linux-omap tree
Tony Lindgren [Tue, 7 Apr 2009 23:22:17 +0000 (16:22 -0700)]
Extra omap code in linux-omap tree

This patch contains all the uncategorized patches not in
mainline. These patches will be reworked for mainline or
removed.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoAdd Nokia CBUS support
Tony Lindgren [Tue, 7 Apr 2009 23:19:46 +0000 (16:19 -0700)]
Add Nokia CBUS support

15 years agoExtra config files for linux-omap
Tony Lindgren [Tue, 7 Apr 2009 23:18:25 +0000 (16:18 -0700)]
Extra config files for linux-omap

15 years agoMake DEBUG_LL work
Tony Lindgren [Tue, 7 Apr 2009 23:16:17 +0000 (16:16 -0700)]
Make DEBUG_LL work

15 years agoChange Makefile revision and set the cross compiler
Tony Lindgren [Tue, 7 Apr 2009 23:14:23 +0000 (16:14 -0700)]
Change Makefile revision and set the cross compiler

15 years agoUSB: Add OMAP EHCI glue layer
Vikram Pandita [Tue, 7 Apr 2009 23:00:56 +0000 (16:00 -0700)]
USB: Add OMAP EHCI glue layer

Add OMAP EHCI glue layer

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Acked-by: Kamat, Nishant <nskamat@ti.com>
15 years agoMerge branch 'omap-pool'
Tony Lindgren [Tue, 7 Apr 2009 22:55:24 +0000 (15:55 -0700)]
Merge branch 'omap-pool'

Conflicts:
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-overo.c
drivers/regulator/core.c
drivers/regulator/twl4030-regulator.c
include/linux/i2c/twl4030.h
include/linux/regulator/driver.h

15 years agoUSB: Add OMAP EHCI glue layer
Vikram Pandita [Tue, 7 Apr 2009 22:37:51 +0000 (15:37 -0700)]
USB: Add OMAP EHCI glue layer

Add OMAP EHCI glue layer

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Acked-by: Kamat, Nishant <nskamat@ti.com>
15 years agoOMAP: Don't warn user about expected behaviour in mmc-twl4030
Mark Brown [Tue, 7 Apr 2009 22:37:37 +0000 (15:37 -0700)]
OMAP: Don't warn user about expected behaviour in mmc-twl4030

The approach that's being taken by the mmc-twl4030 driver to disabling
regulators is a normal and supported one so there is no need to print
messages on the console warning about this - their system is functioning
normally.

Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoInitial import of extra code in arch/arm/*omap* into omap-pool branch
Tony Lindgren [Tue, 7 Apr 2009 22:29:08 +0000 (15:29 -0700)]
Initial import of extra code in arch/arm/*omap* into omap-pool branch

This patch moves all arch/arm/*omap* changes not in mainline kernel
into omap-pool branch where it can be worked into patches for mainline,
or removed.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years ago[OMAP,sDMA] Fix for possible race condition in omap_free_dma()
Santosh Shilimkar [Tue, 7 Apr 2009 22:28:14 +0000 (15:28 -0700)]
[OMAP,sDMA] Fix for possible race condition in omap_free_dma()

Fix the possible race condition in omap_free_dma(). Function omap_free_dma()
sets the dev_id = -1 and then accesses the channel afterwards to clear it.
But setting the dev_id=-1 makes the channel available for allocation again.
So it is possible someone else can grab it and results are unpredictable.
To avod this DMA channle is cleared first and then the dev_id = -1 is set.

Thanks to McNeil, Sean <sean.mcneil@ti.com> for ointing out this issue.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: OMAP3: Clean up spurious interrupt check logic
Roger Quadros [Tue, 7 Apr 2009 22:28:13 +0000 (15:28 -0700)]
ARM: OMAP3: Clean up spurious interrupt check logic

SPURIOUSIRQ is contained in bits 31:7 of INTC_SIR, so
INTC_SIR must be right shifted by 7, not 6.

No change in logic, only changes for better readability.
Refer to register definition of INTCPS_SIR_IRQ in OMAP3 Manual.

Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoGPIO: OMAP: Fixed spurious IRQ issue for GPIO interrupts
Roger Quadros [Tue, 7 Apr 2009 22:28:13 +0000 (15:28 -0700)]
GPIO: OMAP: Fixed spurious IRQ issue for GPIO interrupts

Flush posted write to IRQSTATUS register in GPIO IRQ handler.
This eliminates the below error for all peripherals that use GPIO interrupts.

<4>Spurious irq 95: 0xffffffdf, please flush posted write for irq 31

Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: OMAP: Remove defines and resource init for OMAP24XX EAC
Jarkko Nikula [Tue, 7 Apr 2009 22:28:13 +0000 (15:28 -0700)]
ARM: OMAP: Remove defines and resource init for OMAP24XX EAC

There is no anymore legacy driver for OMAP24XX Enhanced Audio Controller
in linux-omap and it was newer in mainline so cleanup these unneeded
defines and initialization code.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoi2c-omap: Fix BUFSTAT_REG reading
Eero Nurkkala [Tue, 7 Apr 2009 22:27:49 +0000 (15:27 -0700)]
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 agoARM: OMAP: Enable idlemodes for DMA OCP
Kalle Jokiniemi [Tue, 7 Apr 2009 22:27:42 +0000 (15:27 -0700)]
ARM: OMAP: Enable idlemodes for DMA OCP

This patch enables MStandby smart-idle mode, autoidle smartidle mode,
and the autoidle bit for DMA4_OCP_SYSCONFIG.

Signed-off-by: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: OMAP: Remove old dead gpio expander code
Tony Lindgren [Tue, 7 Apr 2009 22:27:42 +0000 (15:27 -0700)]
ARM: OMAP: Remove old dead gpio expander code

This should be done with GPIO calls. Patches against the
mainline tree welcome to add the necessary working functionality
back.

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoboard H2: simplify MMC setup
Ladislav Michl [Tue, 7 Apr 2009 22:27:41 +0000 (15:27 -0700)]
board H2: simplify MMC setup

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoomap mmc: Remove power_pin
Ladislav Michl [Tue, 7 Apr 2009 22:27:40 +0000 (15:27 -0700)]
omap mmc: Remove power_pin

On Tue, Jan 13, 2009 at 03:43:44PM +0200, Tony Lindgren wrote:
> > diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h
> > index 031250f..1129e97 100644
> > --- a/arch/arm/plat-omap/include/mach/mmc.h
> > +++ b/arch/arm/plat-omap/include/mach/mmc.h
> > @@ -51,7 +51,6 @@ struct omap_mmc_platform_data {
> >    * not supported */
> >   int (* init)(struct device *dev);
> >   void (* cleanup)(struct device *dev);
> > - void (* shutdown)(struct device *dev);
> >
> >   /* To handle board related suspend/resume functionality for MMC */
> >   int (*suspend)(struct device *dev, int slot);
> > @@ -77,10 +76,6 @@ struct omap_mmc_platform_data {
> >
> >   /* use the internal clock */
> >   unsigned internal_clock:1;
> > - s16 power_pin;
> > -
> > - int switch_pin; /* gpio (card detect) */
> > - int gpio_wp; /* gpio (write protect) */
> >
> >   int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
> >   int (* set_power)(struct device *dev, int slot, int power_on, int vdd);
>
> Hmm, aren't switch_pin and gpio_wp  used at least in the
> mmc-twl4030.c?

Yes, they are. I missed them completely. Sorry.

> I guess they could be internal to mmc-twl4030.c if not used
> in the drivers directly.

They could, but that's a bit more complicated. Will look at it later.

> > diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
> > index 67d7b7f..84de289 100644
> > --- a/drivers/mmc/host/omap.c
> > +++ b/drivers/mmc/host/omap.c
> > @@ -157,8 +157,6 @@ struct mmc_omap_host {
> >   struct timer_list dma_timer;
> >   unsigned dma_len;
> >
> > - short power_pin;
> > -
> >   struct mmc_omap_slot    *slots[OMAP_MMC_MAX_SLOTS];
> >   struct mmc_omap_slot    *current_slot;
> >   spinlock_t              slot_lock;
> >
>
> Looks like power_pin could go though.

Updated patch follows

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: OMAP: Fix mmc_set_power GPIO usage
Ladislav Michl [Tue, 7 Apr 2009 22:27:39 +0000 (15:27 -0700)]
ARM: OMAP: Fix mmc_set_power GPIO usage

Simple simplification...

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoOMAP2/3: GPIO: do not attempt to wake-enable
Kevin Hilman [Tue, 7 Apr 2009 22:27:39 +0000 (15:27 -0700)]
OMAP2/3: GPIO: do not attempt to wake-enable

The GPIO IRQ enable/disable path attempts to also enable IRQ wake
support for the parent GPIO bank IRQ as well.  However, since there is
no 'set_wake' hook for the bank IRQs, these calls will always fail.
Also, since the enable will fail on the suspend path, the disable on
the resume path will trigger unbalanced enable/disable warnings.

This was discovered in the suspend/resume path on OMAP3/Beagle using
the gpio-keys driver which disables/re-enables GPIO IRQ wakeups in the
suspend/resume path.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoARM: OMAP2: possible division by 0
Roel Kluin [Tue, 7 Apr 2009 22:27:08 +0000 (15:27 -0700)]
ARM: OMAP2: possible division by 0

In linus' git tree the functions can be found at:
vi arch/arm/mach-omap2/usb-tusb6010.c +200 - tusb6010_platform_retime()
vi arch/arm/mach-omap2/gpmc.c +94 - gpmc_get_fclk_period()
vi arch/arm/mach-omap2/usb-tusb6010.c +53 - tusb_set_async_mode()
vi arch/arm/mach-omap2/usb-tusb6010.c +111 - tusb_set_sync_mode()

is -ENODEV appropriate when sysclk_ps == 0?

This was found by code analysis, please review.
------------------------------>8-------------8<---------------------------------
gpmc_get_fclk_period() may return 0 when gpmc_l3_clk is not enabled. This is
not checked in tusb6010_platform_retime() nor in tusb_set_async_mode() it
seems. In tusb_set_sync_mode() this may result in a division by zero.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoSubject: [ARM] OMAP: remove duplicated #include
Huang Weiyi [Tue, 7 Apr 2009 22:26:30 +0000 (15:26 -0700)]
Subject: [ARM] OMAP: remove duplicated #include

Removed duplicated #include in arch/arm/mach-omap2/board-rx51.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoLinux 2.6.30-rc1
Linus Torvalds [Tue, 7 Apr 2009 21:25:01 +0000 (14:25 -0700)]
Linux 2.6.30-rc1

15 years agoMerge branch 'core/softlockup' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
Linus Torvalds [Tue, 7 Apr 2009 21:11:07 +0000 (14:11 -0700)]
Merge branch 'core/softlockup' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'core/softlockup' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  softlockup: make DETECT_HUNG_TASK default depend on DETECT_SOFTLOCKUP
  softlockup: move 'one' to the softlockup section in sysctl.c
  softlockup: ensure the task has been switched out once
  softlockup: remove timestamp checking from hung_task
  softlockup: convert read_lock in hung_task to rcu_read_lock
  softlockup: check all tasks in hung_task
  softlockup: remove unused definition for spawn_softlockup_task
  softlockup: fix potential race in hung_task when resetting timeout
  softlockup: fix to allow compiling with !DETECT_HUNG_TASK
  softlockup: decouple hung tasks check from softlockup detection

15 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 7 Apr 2009 21:10:10 +0000 (14:10 -0700)]
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  branch tracer, intel-iommu: fix build with CONFIG_BRANCH_TRACER=y
  branch tracer: Fix for enabling branch profiling makes sparse unusable
  ftrace: Correct a text align for event format output
  Update /debug/tracing/README
  tracing/ftrace: alloc the started cpumask for the trace file
  tracing, x86: remove duplicated #include
  ftrace: Add check of sched_stopped for probe_sched_wakeup
  function-graph: add proper initialization for init task
  tracing/ftrace: fix missing include string.h
  tracing: fix incorrect return type of ns2usecs()
  tracing: remove CALLER_ADDR2 from wakeup tracer
  blktrace: fix pdu_len when tracing packet command requests
  blktrace: small cleanup in blk_msg_write()
  blktrace: NUL-terminate user space messages
  tracing: move scripts/trace/power.pl to scripts/tracing/power.pl

15 years agoMerge branch 'irq/threaded' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
Linus Torvalds [Tue, 7 Apr 2009 21:07:52 +0000 (14:07 -0700)]
Merge branch 'irq/threaded' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'irq/threaded' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: fix devres.o build for GENERIC_HARDIRQS=n
  genirq: provide old request_irq() for CONFIG_GENERIC_HARDIRQ=n
  genirq: threaded irq handlers review fixups
  genirq: add support for threaded interrupts to devres
  genirq: add threaded interrupt handler support

15 years agoNFS: Fix the return value in nfs_page_mkwrite()
Trond Myklebust [Tue, 7 Apr 2009 21:02:53 +0000 (14:02 -0700)]
NFS: Fix the return value in nfs_page_mkwrite()

Commit c2ec175c39f62949438354f603f4aa170846aabb ("mm: page_mkwrite
change prototype to match fault") exposed a bug in the NFS
implementation of page_mkwrite.  We should be returning 0 on success...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.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/jbarnes...
Linus Torvalds [Tue, 7 Apr 2009 18:24:19 +0000 (11:24 -0700)]
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: pci_slot: grab refcount on slot's bus
  PCI Hotplug: acpiphp: grab refcount on p2p subordinate bus
  PCI: allow PCI core hotplug to remove PCI root bus
  PCI: Fix oops in pci_vpd_truncate
  PCI: don't corrupt enable_cnt when doing manual resource alignment
  PCI: annotate pci_rescan_bus as __ref, not __devinit
  PCI-IOV: fix missing kernel-doc
  PCI: Setup disabled bridges even if buses are added
  PCI: SR-IOV quirk for Intel 82576 NIC

15 years agoMerge branch 'omap-pool'
Tony Lindgren [Tue, 7 Apr 2009 18:14:50 +0000 (11:14 -0700)]
Merge branch 'omap-pool'

15 years agoUSB: Add OMAP EHCI glue layer
Vikram Pandita [Tue, 7 Apr 2009 18:14:13 +0000 (11:14 -0700)]
USB: Add OMAP EHCI glue layer

Add OMAP EHCI glue layer

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Acked-by: Kamat, Nishant <nskamat@ti.com>
15 years agoMove the ehci-omap code into omap-pool branch
Tony Lindgren [Tue, 7 Apr 2009 18:08:23 +0000 (11:08 -0700)]
Move the ehci-omap code into omap-pool branch

Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Tue, 7 Apr 2009 18:06:41 +0000 (11:06 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  loop: mutex already unlocked in loop_clr_fd()
  cfq-iosched: don't let idling interfere with plugging
  block: remove unused REQ_UNPLUG
  cfq-iosched: kill two unused cfqq flags
  cfq-iosched: change dispatch logic to deal with single requests at the time
  mflash: initial support
  cciss: change to discover first memory BAR
  cciss: kernel scan thread for MSA2012
  cciss: fix residual count for block pc requests
  block: fix inconsistency in I/O stat accounting code
  block: elevator quiescing helpers

15 years agoMerge branch 'omap-pool'
Tony Lindgren [Tue, 7 Apr 2009 18:06:39 +0000 (11:06 -0700)]
Merge branch 'omap-pool'

15 years ago[omap-git] ehci-omap buildfix
David Brownell [Mon, 6 Apr 2009 09:36:51 +0000 (09:36 +0000)]
[omap-git] ehci-omap buildfix

device.bus_id doesn't exist any more

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
15 years agoMerge branch 'omap-fixes'
Tony Lindgren [Tue, 7 Apr 2009 18:05:35 +0000 (11:05 -0700)]
Merge branch 'omap-fixes'

15 years agoomap_hsmmc: Flush posted write to IRQ
Kevin Hilman [Mon, 6 Apr 2009 12:01:19 +0000 (12:01 +0000)]
omap_hsmmc: Flush posted write to IRQ

Spurious IRQs seen on MMC after 2.6.29.  Flush posted write in IRQ
handler.

The interrupt line is released by clearing the error status bits
in the MMCHS_STAT register, which must occur before the interrupt
handler returns to avoid unwanted irqs.  Hence the need to flush
the posted write.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Tony Lindgen <tony@atomide.com>
15 years ago[OMAP,sDMA] Fix for possible race condition in omap_free_dma()
Santosh Shilimkar [Tue, 7 Apr 2009 17:24:52 +0000 (10:24 -0700)]
[OMAP,sDMA] Fix for possible race condition in omap_free_dma()

Fix the possible race condition in omap_free_dma(). Function omap_free_dma()
sets the dev_id = -1 and then accesses the channel afterwards to clear it.
But setting the dev_id=-1 makes the channel available for allocation again.
So it is possible someone else can grab it and results are unpredictable.
To avod this DMA channle is cleared first and then the dev_id = -1 is set.

Thanks to McNeil, Sean <sean.mcneil@ti.com> for ointing out this issue.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
15 years agoFix build errors due to CONFIG_BRANCH_TRACER=y
Linus Torvalds [Tue, 7 Apr 2009 14:59:41 +0000 (07:59 -0700)]
Fix build errors due to CONFIG_BRANCH_TRACER=y

The code that enables branch tracing for all (non-constant) branches
plays games with the preprocessor and #define's the C 'if ()' construct
to do tracing.

That's all fine, but it fails for some unusual but valid C code that is
sometimes used in macros, notably by the intel-iommu code:

if (i=drhd->iommu, drhd->ignored) ..

because now the preprocessor complains about multiple arguments to the
'if' macro.

So make the macro expansion of this particularly horrid trick use
varargs, and handle the case of comma-expressions in if-statements.  Use
another macro to do it cleanly in just one place.

This replaces a patch by David (and acked by Steven) that did this all
inside that one already-too-horrid macro.

Tested-by: Ingo Molnar <mingo@elte.hu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Linus Torvalds [Tue, 7 Apr 2009 15:54:43 +0000 (08:54 -0700)]
Merge branch 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6

* 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6:
  ASoC: TWL4030: Compillation error fix

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Tue, 7 Apr 2009 15:53:38 +0000 (08:53 -0700)]
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: (36 commits)
  ALSA: hda - Add VREF powerdown sequence for another board
  ALSA: oss - volume control for CSWITCH and CROUTE
  ALSA: hda - add missing comma in ad1884_slave_vols
  sound: usb-audio: allow period sizes less than 1 ms
  sound: usb-audio: save data packet interval in audioformat structure
  sound: usb-audio: remove check_hw_params_convention()
  sound: usb-audio: show sample format width in proc file
  ASoC: fsl_dma: Pass the proper device for dma mapping routines
  ASoC: Fix null dereference in ak4535_remove()
  ALSA: hda - enable SPDIF output for Intel DX58SO board
  ALSA: snd-atmel-abdac: increase periods_min to 6 instead of 4
  ALSA: snd-atmel-abdac: replace bus_id with dev_name()
  ALSA: snd-atmel-ac97c: replace bus_id with dev_name()
  ALSA: snd-atmel-ac97c: cleanup registers when removing driver
  ALSA: snd-atmel-ac97c: do a proper reset of the external codec
  ALSA: snd-atmel-ac97c: enable interrupts to catch events for error reporting
  ALSA: snd-atmel-ac97c: set correct size for buffer hardware parameter
  ALSA: snd-atmel-ac97c: do not overwrite OCA and ICA when assigning channels
  ALSA: snd-atmel-ac97c: remove dead break statements after return in switch case
  ALSA: snd-atmel-ac97c: cleanup register definitions
  ...

15 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Tue, 7 Apr 2009 15:53:02 +0000 (08:53 -0700)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  sata_mv: shorten register names
  sata_mv: workaround errata SATA#13
  sata_mv: cosmetic renames
  sata_mv: workaround errata SATA#26
  sata_mv: workaround errata PCI#7
  sata_mv: replace 0x1f with ATA_PIO4 (v2)
  sata_mv: fix irq mask races
  sata_mv: revert SoC irq breakage
  libata: ahci enclosure management bios workaround
  ata: Add TRIM infrastructure
  ata_piix: VGN-BX297XP wants the controller power up on suspend
  libata: Remove some redundant casts from pata_octeon_cf.c
  pata_artop: typo

15 years agoMerge branch 'i2c-for-2630-v2' of git://aeryn.fluff.org.uk/bjdooks/linux
Linus Torvalds [Tue, 7 Apr 2009 15:45:12 +0000 (08:45 -0700)]
Merge branch 'i2c-for-2630-v2' of git://aeryn.fluff.org.uk/bjdooks/linux

* 'i2c-for-2630-v2' of git://aeryn.fluff.org.uk/bjdooks/linux:
  i2c: imx: Make disable_delay a per-device variable
  i2c: xtensa s6000 i2c driver
  powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board
  i2c: i2c-mpc: make I2C bus speed configurable
  i2c: i2c-mpc: use dev based printout function
  i2c: i2c-mpc: various coding style fixes
  i2c: imx: Add missing request_mem_region in probe()
  i2c: i2c-s3c2410: Initialise Samsung I2C controller early
  i2c-s3c2410: Simplify bus frequency calculation
  i2c-s3c2410: sda_delay should be in ns, not clock ticks
  i2c: iMX/MXC support

15 years agoMerge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
Linus Torvalds [Tue, 7 Apr 2009 15:44:43 +0000 (08:44 -0700)]
Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  hwmon: Add Asus ATK0110 support
  hwmon: (lm95241) Convert to new-style i2c driver

15 years agoparport: Use the PCI IRQ if offered
Alan Cox [Tue, 7 Apr 2009 14:30:57 +0000 (15:30 +0100)]
parport: Use the PCI IRQ if offered

PCI parallel port devices can IRQ share so we should stop them hogging
the line and making a mess on modern PC systems.  We know the sharing
side works as the PCMCIA driver has shared the parallel port IRQ for
some time.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: jsm cleanups
Breno Leitao [Tue, 7 Apr 2009 15:53:48 +0000 (16:53 +0100)]
tty: jsm cleanups

Here are some cleanups, mainly removing unused variables and silly
declarations.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAdjust path to gpio headers
Mike Frysinger [Tue, 7 Apr 2009 15:53:11 +0000 (16:53 +0100)]
Adjust path to gpio headers

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoKGDB_SERIAL_CONSOLE check for module
Mike Frysinger [Tue, 7 Apr 2009 15:52:49 +0000 (16:52 +0100)]
KGDB_SERIAL_CONSOLE check for module

Depend on KGDB_SERIAL_CONSOLE being set to N rather than !Y, since it can
be built as a module.

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoChange KCONFIG name
Mike Frysinger [Tue, 7 Apr 2009 15:52:39 +0000 (16:52 +0100)]
Change KCONFIG name

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Blackin CTS/RTS
Sonic Zhang [Tue, 7 Apr 2009 15:52:26 +0000 (16:52 +0100)]
tty: Blackin CTS/RTS

Both software emulated and hardware based CTS and RTS are enabled in
serial driver.

The CTS RTS PIN connection on BF548 UART port is defined as a modem
device not as a host device.  In order to test it under Linux, please
nake a cross UART cable to exchange CTS and RTS signal.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoChange hardware flow control from poll to interrupt driven
Sonic Zhang [Tue, 7 Apr 2009 15:51:15 +0000 (16:51 +0100)]
Change hardware flow control from poll to interrupt driven

Only the CTS bit is affected.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAdd support for the MAX3100 SPI UART.
Christian Pellegrin [Tue, 7 Apr 2009 15:48:51 +0000 (16:48 +0100)]
Add support for the MAX3100 SPI UART.

(akpm: queued pending confirmation of the new major number)

[randy.dunlap@oracle.com: select SERIAL_CORE]
Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agolanana: assign a device name and numbering for MAX3100
Alan Cox [Tue, 7 Apr 2009 15:48:35 +0000 (16:48 +0100)]
lanana: assign a device name and numbering for MAX3100

This is a low density serial port so needs a real major/minor

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoserqt: initial clean up pass for tty side
Alan Cox [Tue, 7 Apr 2009 15:48:27 +0000 (16:48 +0100)]
serqt: initial clean up pass for tty side

Avoid using port->tty where possible (makes refcount fixing easier
later).

Remove unused code (the ioctl path is not used if the device has
mget/mset functions)

Remove various un-needed typecasts and long names so it could read it to
do the changes.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Use the generic RS485 ioctl on CRIS
Claudio Scordino [Tue, 7 Apr 2009 15:48:19 +0000 (16:48 +0100)]
tty: Use the generic RS485 ioctl on CRIS

Use the new general RS485 Linux data structure (introduced by Alan with
commit number c26c56c0f40e200e61d1390629c806f6adaffbcc) in the Cris
architecture too (currently, Cris still uses the old private data
structure instead of the new one).

Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Tested-by: Hinko Kocevar <hinko.kocevar@cetrtapot.si>
Tested-by: Janez Cufer <janez.cufer@cetrtapot.si>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Correct inline types for tty_driver_kref_get()
Adrian Bunk [Tue, 7 Apr 2009 15:48:07 +0000 (16:48 +0100)]
tty: Correct inline types for tty_driver_kref_get()

tty_driver_kref_get() should be static inline and not extern inline
(the latter even changed it's semantics in gcc >= 4.3).

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosplice: fix deadlock in splicing to file
Miklos Szeredi [Mon, 6 Apr 2009 15:41:00 +0000 (17:41 +0200)]
splice: fix deadlock in splicing to file

There's a possible deadlock in generic_file_splice_write(),
splice_from_pipe() and ocfs2_file_splice_write():

 - task A calls generic_file_splice_write()
 - this calls inode_double_lock(), which locks i_mutex on both
   pipe->inode and target inode
 - ordering depends on inode pointers, can happen that pipe->inode is
   locked first
 - __splice_from_pipe() needs more data, calls pipe_wait()
 - this releases lock on pipe->inode, goes to interruptible sleep
 - task B calls generic_file_splice_write(), similarly to the first
 - this locks pipe->inode, then tries to lock inode, but that is
   already held by task A
 - task A is interrupted, it tries to lock pipe->inode, but fails, as
   it is already held by task B
 - ABBA deadlock

Fix this by explicitly ordering locks: the outer lock must be on
target inode and the inner lock (which is later unlocked and relocked)
must be on pipe->inode.  This is OK, pipe inodes and target inodes
form two nonoverlapping sets, generic_file_splice_write() and friends
are not called with a target which is a pipe.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Mark Fasheh <mfasheh@suse.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: support nanosecond timestamp
Ryusuke Konishi [Tue, 7 Apr 2009 02:02:00 +0000 (19:02 -0700)]
nilfs2: support nanosecond timestamp

After a review of user's feedback for finding out other compatibility
issues, I found nilfs improperly initializes timestamps in inode;
CURRENT_TIME was used there instead of CURRENT_TIME_SEC even though nilfs
didn't have nanosecond timestamps on disk.  A few users gave us the report
that the tar program sometimes failed to expand symbolic links on nilfs,
and it turned out to be the cause.

Instead of applying the above displacement, I've decided to support
nanosecond timestamps on this occation.  Fortunetaly, a needless 64-bit
field was in the nilfs_inode struct, and I found it's available for this
purpose without impact for the users.

So, this will do the enhancement and resolve the tar problem.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: introduce secondary super block
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:59 +0000 (19:01 -0700)]
nilfs2: introduce secondary super block

The former versions didn't have extra super blocks.  This improves the
weak point by introducing another super block at unused region in tail of
the partition.

This doesn't break disk format compatibility; older versions just ingore
the secondary super block, and new versions just recover it if it doesn't
exist.  The partition created by an old mkfs may not have unused region,
but in that case, the secondary super block will not be added.

This doesn't make more redundant copies of the super block; it is a future
work.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: simplify handling of active state of segments
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:58 +0000 (19:01 -0700)]
nilfs2: simplify handling of active state of segments

will reduce some lines of segment constructor.  Previously, the state was
complexly controlled through a list of segments in order to keep
consistency in meta data of usage state of segments.  Instead, this
presents ``calculated'' active flags to userland cleaner program and stop
maintaining its real flag on disk.

Only by this fake flag, the cleaner cannot exactly know if each segment is
reclaimable or not.  However, the recent extension of nilfs_sustat ioctl
struct (nilfs2-extend-nilfs_sustat-ioctl-struct.patch) can prevent the
cleaner from reclaiming in-use segment wrongly.

So, now I can apply this for simplification.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: mark minor flag for checkpoint created by internal operation
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:57 +0000 (19:01 -0700)]
nilfs2: mark minor flag for checkpoint created by internal operation

Nilfs creates checkpoints even for garbage collection or metadata updates
such as checkpoint mode change.  So, user often sees checkpoints created
only by such internal operations.

This is inconvenient in some situations.  For example, application that
monitors checkpoints and changes them to snapshots, will fall into an
infinite loop because it cannot distinguish internally created
checkpoints.

This patch solves this sort of problem by adding a flag to checkpoint for
identification.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: clean up sketch file
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:56 +0000 (19:01 -0700)]
nilfs2: clean up sketch file

The sketch file is a file to mark checkpoints with user data.  It was
experimentally introduced in the original implementation, and now
obsolete.  The file was handled differently with regular files; the file
size got truncated when a checkpoint was created.

This stops the special treatment and will treat it as a regular file.
Most users are not affected because mkfs.nilfs2 no longer makes this file.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: super block operations fix endian bug
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:55 +0000 (19:01 -0700)]
nilfs2: super block operations fix endian bug

This adds a missing endian conversion of checksum field in the super
block.  This fixes compatibility issue on big endian machines which will
come to surface after supporting recovery of super block.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: replace BUG_ON and BUG calls triggerable from ioctl
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:55 +0000 (19:01 -0700)]
nilfs2: replace BUG_ON and BUG calls triggerable from ioctl

Pekka Enberg advised me:
> It would be nice if BUG(), BUG_ON(), and panic() calls would be
> converted to proper error handling using WARN_ON() calls. The BUG()
> call in nilfs_cpfile_delete_checkpoints(), for example, looks to be
> triggerable from user-space via the ioctl() system call.

This will follow the comment and keep them to a minimum.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: extend nilfs_sustat ioctl struct
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:54 +0000 (19:01 -0700)]
nilfs2: extend nilfs_sustat ioctl struct

This adds a new argument to the nilfs_sustat structure.

The extended field allows to delete volatile active state of segments,
which was needed to protect freshly-created segments from garbage
collection but has confused code dealing with segments.  This
extension alleviates the mess and gives room for further
simplifications.

The volatile active flag is not persistent, so it's eliminable on this
occasion without affecting compatibility other than the ioctl change.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: use unlocked_ioctl
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:53 +0000 (19:01 -0700)]
nilfs2: use unlocked_ioctl

Pekka Enberg suggested converting ->ioctl operations to use
->unlocked_ioctl to avoid BKL.

The conversion was verified to be safe, so I will take it on this
occasion.

Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: remove compat ioctl code
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:53 +0000 (19:01 -0700)]
nilfs2: remove compat ioctl code

This removes compat code from the nilfs ioctls and applies the same
function for both .ioctl and .compat_ioctl file operations.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: use fixed sized types for ioctl structures
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:52 +0000 (19:01 -0700)]
nilfs2: use fixed sized types for ioctl structures

Nilfs ioctl had structures not having fixed sized types such as:

  struct nilfs_argv {
         void *v_base;
         size_t v_nmembs;
         size_t v_size;
         int v_index;
         int v_flags;
  };

Further, some of them are wrongly aligned:

  e.g.

  struct nilfs_cpmode {
        __u64 cm_cno;
        int cm_mode;
  };

The size of wrongly aligned structures varies depending on
architectures, and it breaks the identity of ioctl commands, which
leads to arch dependent errors.

Previously, these are compensated by using compat_ioctl.

This fixes these problems and allows removal of compat ioctl.

Since this will change sizes of those structures, binary compatibility
for the past utilities will once break; new utilities have to be used
instead.  However, it would be helpful to avoid platform dependent
problems in the long term.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: remove timedwait ioctl command
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:51 +0000 (19:01 -0700)]
nilfs2: remove timedwait ioctl command

This removes NILFS_IOCTL_TIMEDWAIT command from ioctl interface along
with the related flags and wait queue.

The command is terrible because it just sleeps in the ioctl.  I prefer
to avoid this by devising means of event polling in userland program.
By reconsidering the userland GC daemon, I found this is possible
without changing behaviour of the daemon and sacrificing efficiency.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: fix buggy behavior seen in enumerating checkpoints
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:50 +0000 (19:01 -0700)]
nilfs2: fix buggy behavior seen in enumerating checkpoints

This will fix the weird behavior of lscp command in listing continuously
created checkpoints; the output of lscp is rewinded regularly for the
recent nilfs.  As a result of debugging, a defect was found in
nilfs_cpfile_do_get_cpinfo() function.

Though the function can be repeatedly called to enumerate checkpoints and
it can skip invalid checkpoint entries, the index value was not carried
between successive calls.

The bug has long been present, and came to surface after applying a bugfix
nilfs2-fix-problems-of-memory-allocation-in-ioctl.patch, which increased
frequency of calling the function.  The similar bugfix was already applied
for ``snapshots'' by
nilfs2-fix-gc-failure-on-volumes-keeping-numerous-snapshots.patch.

This fixes the problem by making the index argument bidirectional on the
function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: clean up indirect function calling conventions
Pekka Enberg [Tue, 7 Apr 2009 02:01:49 +0000 (19:01 -0700)]
nilfs2: clean up indirect function calling conventions

This cleans up the strange indirect function calling convention used in
nilfs to follow the normal kernel coding style.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: fix improper return values of nilfs_get_cpinfo ioctl
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:48 +0000 (19:01 -0700)]
nilfs2: fix improper return values of nilfs_get_cpinfo ioctl

A few tool developers gave me requests for fixing inconvenient return
value of nilfs_get_cpinfo() ioctl; if the requested mode is NILFS_SNAPSHOT
and the specified start entry is not a snapshot, the ioctl unnaturally
returns one as the number of acquired snapshot item.

In addition, the ioctl function returns an ENOENT error for checkpoints
within blocks deleted by garbage collection.

These behaviors require corrections for programs which enumerate
snapshots.  This resolves the inconvenience by changing the return values
to zero for the above cases.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: fix gc failure on volumes keeping numerous snapshots
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:47 +0000 (19:01 -0700)]
nilfs2: fix gc failure on volumes keeping numerous snapshots

This resolves the following failure of nilfs2 cleaner daemon:

 nilfs_cleanerd[20670]: cannot clean segments: No such file or directory
 nilfs_cleanerd[20670]: shutdown

When creating thousands of snapshots, the cleaner daemon had rarely died
as above due to an error returned from the kernel code.

After applying the recent patch which fixed memory allocation problems in
ioctl (Message-Id: <20081215.155840.105124170.ryusuke@osrg.net>), the
problem gets more frequent.

It turned out to be a bug of nilfs_ioctl_wrap_copy function and one of its
callback routines to read out information of snapshots; if the
nilfs_ioctl_wrap_copy function divided a large read request into multiple
requests, the second and later requests have failed since a restart
position on snapshot meta data was not properly set forward.

It's a deficiency of the callback interface that cannot pass the restart
position among multiple requests.  This patch fixes the issue by allowing
nilfs_ioctl_wrap_copy and snapshot read functions to exchange a position
argument.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: add maintainer
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:46 +0000 (19:01 -0700)]
nilfs2: add maintainer

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: insert explanations in gcinode file
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:45 +0000 (19:01 -0700)]
nilfs2: insert explanations in gcinode file

The file gcinode.c gives buffer cache functions for on-disk blocks
moved in garbage collection.  Joern Engel has suggested inserting its
explanations in the source file (Message-ID:
<20080917144146.GD8750@logfs.org> and
<20080917224953.GB14644@logfs.org>).

This follows the comment.

Cc: Joern Engel <joern@logfs.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: avoid double error caused by nilfs_transaction_end
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:45 +0000 (19:01 -0700)]
nilfs2: avoid double error caused by nilfs_transaction_end

Pekka Enberg pointed out that double error handlings found after
nilfs_transaction_end() can be avoided by separating abort operation:

 OK, I don't understand this. The only way nilfs_transaction_end() can
 fail is if we have NILFS_TI_SYNC set and we fail to construct the
 segment. But why do we want to construct a segment if we don't commit?

 I guess what I'm asking is why don't we have a separate
 nilfs_transaction_abort() function that can't fail for the erroneous
 case to avoid this double error value tracking thing?

This does the separation and renames nilfs_transaction_end() to
nilfs_transaction_commit() for clarification.

Since, some calls of these functions were used just for exclusion control
against the segment constructor, they are replaced with semaphore
operations.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: cleanup nilfs_clear_inode
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:44 +0000 (19:01 -0700)]
nilfs2: cleanup nilfs_clear_inode

This will remove the following unnecessary locks and cleanup code in
nilfs_clear_inode():

- unnecessary protection using nilfs_transaction_begin() and
  nilfs_transaction_end().

- cleanup code of i_dirty list field which is never chained
  when this function is called.

- spinlock used when releasing i_bh field.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: fix problems of memory allocation in ioctl
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:43 +0000 (19:01 -0700)]
nilfs2: fix problems of memory allocation in ioctl

This is another patch for fixing the following problems of a memory
copy function in nilfs2 ioctl:

(1) It tries to allocate 128KB size of memory even for small objects.

(2) Though the function repeatedly tries large memory allocations
    while reducing the size, GFP_NOWAIT flag is not specified.
    This increases the possibility of system memory shortage.

(3) During the retries of (2), verbose warnings are printed
    because _GFP_NOWARN flag is not used for the kmalloc calls.

The first patch was still doing large allocations by kmalloc which are
repeatedly tried while reducing the size.

Andi Kleen told me that using copy_from_user for large memory is not
good from the viewpoint of preempt latency:

 On Fri, 12 Dec 2008 21:24:11 +0100, Andi Kleen <andi@firstfloor.org> wrote:
 > > In the current interface, each data item is copied twice: one is to
 > > the allocated memory from user space (via copy_from_user), and another
 >
 > For such large copies it is better to use multiple smaller (e.g. 4K)
 > copy user, that gives better real time preempt latencies. Each cfu has a
 > cond_resched(), but only one, not multiple times in the inner loop.

He also advised me that:

 On Sun, 14 Dec 2008 16:13:27 +0100, Andi Kleen <andi@firstfloor.org> wrote:
 > Better would be if you could go to PAGE_SIZE. order 0 allocations
 > are typically the fastest / least likely to stall.
 >
 > Also in this case it's a good idea to use __get_free_pages()
 > directly, kmalloc tends to be become less efficient at larger
 > sizes.

For the function in question, the size of buffer memory can be reduced
since the buffer is repeatedly used for a number of small objects.  On
the other hand, it may incur large preempt latencies for larger buffer
because a copy_from_user (and a copy_to_user) was applied only once
each cycle.

With that, this revision uses the order 0 allocations with
__get_free_pages() to fix the original problems.

Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: update makefile and Kconfig
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:41 +0000 (19:01 -0700)]
nilfs2: update makefile and Kconfig

This adds a Makefile for the nilfs2 file system, and updates the
makefile and Kconfig file in the file system directory.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: ioctl operations
Koji Sato [Tue, 7 Apr 2009 02:01:41 +0000 (19:01 -0700)]
nilfs2: ioctl operations

This adds userland interface implemented with ioctl.

Signed-off-by: Koji Sato <sato.koji@lab.ntt.co.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: block cache for garbage collection
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:40 +0000 (19:01 -0700)]
nilfs2: block cache for garbage collection

This adds the cache of on-disk blocks to be moved in garbage
collection.  The disk blocks are held with dummy inodes (called
gcinodes), and this file provides lookup function of the dummy inodes,
and their buffer read function.

Signed-off-by: Seiji Kihara <kihara.seiji@lab.ntt.co.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Yoshiji Amagai <amagai.yoshiji@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: another dat for garbage collection
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:39 +0000 (19:01 -0700)]
nilfs2: another dat for garbage collection

NILFS2 uses another DAT inode during garbage collection to ensure
atomicity and consistency of the DAT in the transient state.  This
twin inode is called GCDAT.

This adds functions to initialize the GCDAT and to switch page caches
and B-tree node caches between these two inodes.

Signed-off-by: Seiji Kihara <kihara.seiji@lab.ntt.co.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Yoshiji Amagai <amagai.yoshiji@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>