linux-2.6
15 years agoASoC: TWL4030: Add support Voice DAI
Joonyoung Shim [Mon, 20 Apr 2009 10:21:35 +0000 (19:21 +0900)] 
ASoC: TWL4030: Add support Voice DAI

Add Voice DAI to support the PCM voice interface of the twl4030 codec.

The PCM voice interface can be used with 8-kHz(voice narrowband) or
16-kHz(voice wideband) sampling rates, and 16bits, and mono RX and mono
TX or stereo TX.

The PCM voice interface has two modes
 - PCM mode1 : This uses the normal FS polarity and the rising edge of
               the clock signal.
 - PCM mode2 : This uses the FS polarity inverted and the falling edge
               of the clock signal.

If the system master clock is not 26MHz or the twl4030 codec mode is not
option2, the voice PCM interface is not available.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: TWL4030: Fix for the constraint handling
Peter Ujfalusi [Fri, 17 Apr 2009 12:55:08 +0000 (15:55 +0300)] 
ASoC: TWL4030: Fix for the constraint handling

The original implementation of the constraints were good against sane
applications.
If the opening sequence is:
stream1_open, stream1_hw_params, stream2_open, stream2_hw_params -> the
constraints are set correctly for stream2.

But if the sequence is:
stream1_open, stream2_open, stream2_hw_params, stream1_hw_params -> than stream2
would receive constraint rate = 0, sample_bits = 0, since the stream1 has not
yet called hw_params...

The command to trigger this event:
gst-launch-0.10 alsasrc device=hw:0 ! alsasink device=hw:0 sync=false

This patch does some 'black magic' in order to always set the correct
constraints and sets it only when it is needed for the other stream.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoMerge branch 'for-2.6.30' into for-2.6.31
Mark Brown [Thu, 16 Apr 2009 13:14:35 +0000 (14:14 +0100)] 
Merge branch 'for-2.6.30' into for-2.6.31

15 years agoASoC: OMAP: Add DSP_A mode support for mcbsp
Peter Ujfalusi [Wed, 15 Apr 2009 12:38:56 +0000 (15:38 +0300)] 
ASoC: OMAP: Add DSP_A mode support for mcbsp

DSP_A mode is similar to the DSP_B, but the MSB is delayed with
one bclk (appears after the FS pulse and not under it).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: OMAP: Use single-phase for DSP mode
Peter Ujfalusi [Wed, 15 Apr 2009 12:38:55 +0000 (15:38 +0300)] 
ASoC: OMAP: Use single-phase for DSP mode

Use single-phase mode for the DSP mode and keep the dual phase
mode for the I2S mode.

The mono (1 channel) mode already used single phase mode,
now it is more cleaner. There is no need to configure the
second phase, when the single phase is used.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: OMAP: Fix FS polarity in OSK5912 machine driver
Jarkko Nikula [Wed, 15 Apr 2009 10:48:17 +0000 (13:48 +0300)] 
ASoC: OMAP: Fix FS polarity in OSK5912 machine driver

Using inverted FS polarity in OSK5912 must be an error since TLV320AIC23
do not have support for inverted polarities. This is mostly due the hassle
with the DSP formats in OMAP McBSP DAI and inversion on OMAP side probably
just made this configuration working at some point.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Acked-by: Arun KS <arunks@mistralsolutions.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: OMAP: Fix DSP_B format in OMAP McBSP DAI driver
Jarkko Nikula [Wed, 15 Apr 2009 10:48:16 +0000 (13:48 +0300)] 
ASoC: OMAP: Fix DSP_B format in OMAP McBSP DAI driver

The DSP format wasn't still correct in OMAP McBSP DAI even after the commit
bd25867a6cbe7a00ef7dbe8d9ddebc91b00b9b3f.

Thanks to Peter Ujfalusi <peter.ujfalusi@nokia.com> for noticing and being
part of the fix. Now the FS length definition is more clear by defining
it with  FWID(0).

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Fix include build error in s3c2412-i2s.c
Ben Dooks [Thu, 16 Apr 2009 09:32:21 +0000 (10:32 +0100)] 
ASoC: Fix include build error in s3c2412-i2s.c

Fix accidental change of <mach/regs-gpio.h> to
<plat/regs-gpio.h> in s3c2412-i2s.c

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Fix s3c-i2s-v2.c snd_soc_dai changes
Ben Dooks [Thu, 16 Apr 2009 09:32:22 +0000 (10:32 +0100)] 
ASoC: Fix s3c-i2s-v2.c snd_soc_dai changes

Fix the build error in s3c-i2s-v2.c caused by
a change to the snd_soc_dai ops field.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: s3c-i2s-v2.c fix for s3c_i2sv2_iis_calc_rate
Ben Dooks [Thu, 16 Apr 2009 09:32:23 +0000 (10:32 +0100)] 
ASoC: s3c-i2s-v2.c fix for s3c_i2sv2_iis_calc_rate

The definition of s3c_i2sv2_iis_calc_rate was never
renamed from s3c2412_iis_calc_rate, so rename this
to allow the build to work.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Fix jive_wm8750.c build problems
Ben Dooks [Thu, 16 Apr 2009 09:32:20 +0000 (10:32 +0100)] 
ASoC: Fix jive_wm8750.c build problems

Fix build errors in sound/soc/s3c24xx/jive_wm8750.c
from changes to ASoC.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: pxa-ssp: allow setting of dai format 0
Daniel Mack [Wed, 15 Apr 2009 18:24:45 +0000 (20:24 +0200)] 
ASoC: pxa-ssp: allow setting of dai format 0

pxa_ssp_set_dai_fmt() currently has an early exit if the desired format
equals the current configuration. This is correct behaviour unless this
function is called with a zero value parameter for the first time.
Zero is a valid value for this function, but the early exit is bogus in
this case.

Hence, set priv->dai_fmt to -1 in the beginning so we can configure the
port.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: pHilipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Request shared rates for WM8903
Mark Brown [Thu, 16 Apr 2009 09:08:39 +0000 (10:08 +0100)] 
ASoC: Request shared rates for WM8903

It has a shared LRCLK.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Volume controls are never of boolean type
Mark Brown [Wed, 15 Apr 2009 20:37:46 +0000 (21:37 +0100)] 
ASoC: Volume controls are never of boolean type

Some limited volume controls (mostly simple attenuations) have only two
settings so the ASoC info functions misreport them as booleans. Since
we currently have no better information check for " Volume" in the
control name and always report any controls matching as being integer.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Check we have DAI ops when calling via accessor functions
Mark Brown [Wed, 15 Apr 2009 20:35:26 +0000 (21:35 +0100)] 
ASoC: Check we have DAI ops when calling via accessor functions

Also make sure we're checking for the right operation while we're here.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoMerge branch 'for-2.6.30' into for-2.6.31
Mark Brown [Tue, 14 Apr 2009 12:22:37 +0000 (13:22 +0100)] 
Merge branch 'for-2.6.30' into for-2.6.31

15 years agoMerge branch 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Tue, 14 Apr 2009 09:48:25 +0000 (11:48 +0200)] 
Merge branch 'for-2.6.30' of git://git./linux/kernel/git/broonie/sound-2.6 into topic/asoc

15 years agoMerge branch 'for-2.6.30' into for-2.6.31
Mark Brown [Mon, 13 Apr 2009 14:12:48 +0000 (15:12 +0100)] 
Merge branch 'for-2.6.30' into for-2.6.31

15 years agoASoC: Add WM8960 CODEC driver
Mark Brown [Tue, 7 Apr 2009 18:20:14 +0000 (19:20 +0100)] 
ASoC: Add WM8960 CODEC driver

The WM8960 is a low power, high quality stereo codec designed for
portable digital audio applications.

Stereo class D speaker drivers provide 1W per channel into 8W loads.
Guaranteed low leakage, excellent PSRR and pop/click suppression
mechanisms enable direct battery connection for the speaker supply.

The device also integrates a complete microphone interface and a stereo
headphone driver. External component requirements are drastically
reduced as no separate microphone, speaker or headphone amplifiers are
required. Advanced on-chip digital signal processing performs automatic
level control for the microphone or line input.

Stereo 24-bit sigma-delta ADCs and DACs are used with low power
over-sampling digital interpolation and decimation filters and a
flexible digital audio interface.

The master clock can be input directly or generated internally by an
onboard PLL, supporting most commonly-used clocking schemes.

This driver was originally written by Liam Girdwood, with substantial
subsequent additions and updates for feature completeness and changes in
the ASoC framework from me.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: pxa-ssp.c fix clock/frame invert
Daniel Ribeiro [Wed, 8 Apr 2009 13:51:24 +0000 (10:51 -0300)] 
ASoC: pxa-ssp.c fix clock/frame invert

SCMODE(0): Data Driven (Falling), Data Sampled (Rising), Idle State (Low)
SCMODE(1): Data Driven (Rising), Data Sampled (Falling), Idle State (Low)
SCMODE(2): Data Driven (Rising), Data Sampled (Falling), Idle State (High)
SCMODE(3): Data Driven (Falling), Data Sampled (Rising), Idle State (High)

SCMODE(3) does not invert the clock polarity compared to the default SCMODE(0).

This patch also adds all possible NF/IF, NB/IB combinations to the DSP_A and
DSP_B modes.

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Move the WM9713 voice DAC powerdown to a DAPM event
Mark Brown [Mon, 13 Apr 2009 10:29:10 +0000 (11:29 +0100)] 
ASoC: Move the WM9713 voice DAC powerdown to a DAPM event

This ensures that we sync with the DAPM powerdown sequencing properly
and don't need to bounce the power on the voice DAC so often.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Support DAPM events for DACs and ADCs
Mark Brown [Mon, 13 Apr 2009 10:27:03 +0000 (11:27 +0100)] 
ASoC: Support DAPM events for DACs and ADCs

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Factor out application of power for generic widgets
Mark Brown [Mon, 13 Apr 2009 10:09:18 +0000 (11:09 +0100)] 
ASoC: Factor out application of power for generic widgets

This is simple code motion, intended to support future refactoring of
the DAPM algorithms and (more immediately) the additon of events for
DACs and ADCs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: WM9713 requires symmetric rates on the voice DAI
Mark Brown [Mon, 13 Apr 2009 09:53:02 +0000 (10:53 +0100)] 
ASoC: WM9713 requires symmetric rates on the voice DAI

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: n810: replace BUG() with BUG_ON()
Alexander Beregalov [Sun, 12 Apr 2009 01:04:43 +0000 (05:04 +0400)] 
ASoC: n810: replace BUG() with BUG_ON()

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Disable S3C64xx support in Kconfig
Mark Brown [Thu, 9 Apr 2009 15:40:41 +0000 (16:40 +0100)] 
ASoC: Disable S3C64xx support in Kconfig

Due to the process and communications issues with the 2.6.30 S3C
platform merges none of the underlying arch/arm code for S3C64xx audio
support made it into mainline, rendering the drivers useless.  Disable
them in Kconfig to avoid user confusion - users patching in the required
support can always reenable this too.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: tlv320aic23: add DSP_A format support
Peter Ujfalusi [Thu, 9 Apr 2009 09:34:40 +0000 (12:34 +0300)] 
ASoC: tlv320aic23: add DSP_A format support

Add DSP_A interface format support by setting the LRP bit in
DSP mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: magician: remove un-necessary #include of pxa-regs.h and hardware.h
Eric Miao [Thu, 9 Apr 2009 06:13:07 +0000 (14:13 +0800)] 
ASoC: magician: remove un-necessary #include of pxa-regs.h and hardware.h

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoLinux 2.6.30-rc1 v2.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./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./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./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./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 '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 's6000' into for-2.6.31
Mark Brown [Tue, 7 Apr 2009 17:51:34 +0000 (18:51 +0100)] 
Merge branch 's6000' into for-2.6.31

15 years agoASoC: Add WM8988 CODEC driver
Mark Brown [Tue, 7 Apr 2009 17:45:21 +0000 (18:45 +0100)] 
ASoC: Add WM8988 CODEC driver

The WM8988 is a low power, high quality stereo CODEC designed for
portable digital audio applications.

The device integrates complete interfaces to 2 stereo headphone or line
out ports. External component requirements are drastically reduced as no
separate headphone amplifiers are required. Advanced on-chip digital
signal processing performs graphic equaliser, 3-D sound enhancement and
automatic level control for the microphone or line input.

The WM8988 can operate as a master or a slave, with various master clock
frequencies including 12 or 24MHz for USB devices, or standard 256fs
rates like 12.288MHz and 24.576MHz. Different audio sample rates such as
96kHz, 48kHz, 44.1kHz are generated directly from the master clock
without the need for an external PLL.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Provide core support for symmetric sample rates
Mark Brown [Tue, 7 Apr 2009 17:10:13 +0000 (18:10 +0100)] 
ASoC: Provide core support for symmetric sample rates

Many devices require symmetric configurations of capture and playback
data formats, often due to shared clocking but sometimes also due to
other shared playback and record configuration in the device. Start
providing core support for this by allowing the DAIs or the machine
to specify that the sample rates used should be kept symmetric.

A flag symmetric_rates is provided in the snd_soc_dai and
snd_soc_dai_link structures. If this is set in either of the DAIs or in
the machine then a constraint will be applied when a stream is already
open preventing any changes in sample rate.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Display return code when failing to add a DAPM kcontrol
Mark Brown [Mon, 6 Apr 2009 15:59:32 +0000 (16:59 +0100)] 
ASoC: Display return code when failing to add a DAPM kcontrol

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.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./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./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./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>
15 years agonilfs2: recovery functions
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:38 +0000 (19:01 -0700)] 
nilfs2: recovery functions

This adds recovery function on mount.

Usually the recovery is achieved by just finding the latest super
root.  When logs without checkpoints were appended for data sync
operations after the latest super root, the recovery function will
perform roll forwarding and reconstruct new log(s) with a super root.

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 missed-sync issue for do_sync_mapping_range()
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:38 +0000 (19:01 -0700)] 
nilfs2: fix missed-sync issue for do_sync_mapping_range()

Chris Mason pointed out that there is a missed sync issue in
nilfs_writepages():

On Wed, 17 Dec 2008 21:52:55 -0500, Chris Mason wrote:
> It looks like nilfs_writepage ignores WB_SYNC_NONE, which is used by
> do_sync_mapping_range().

where WB_SYNC_NONE in do_sync_mapping_range() was replaced with
WB_SYNC_ALL by Nick's patch (commit:
ee53a891f47444c53318b98dac947ede963db400).

This fixes the problem by letting nilfs_writepages() write out the log of
file data within the range if sync_mode is WB_SYNC_ALL.

This involves removal of nilfs_file_aio_write() which was previously
needed to ensure O_SYNC sync writes.

Cc: Chris Mason <chris.mason@oracle.com>
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: segment constructor
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:37 +0000 (19:01 -0700)] 
nilfs2: segment constructor

This adds the segment constructor (also called log writer).

The segment constructor collects dirty buffers for every dirty inode,
makes summaries of the buffers, assigns disk block addresses to the
buffers, and then submits BIOs for the buffers.

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: segment buffer
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:36 +0000 (19:01 -0700)] 
nilfs2: segment buffer

This adds the segment buffer which is used to constuct logs.

[akpm@linux-foundation.org: BIO_RW_SYNC got removed]
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
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:35 +0000 (19:01 -0700)] 
nilfs2: super block operations

This adds super block operations for the nilfs2 file system.

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: operations for the_nilfs core object
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:35 +0000 (19:01 -0700)] 
nilfs2: operations for the_nilfs core object

This adds functions on the_nilfs object, which keeps shared resources and
states among a read/write mount and snapshots mounts going individually.

the_nilfs is allocated per block device; it is created when user first
mount a snapshot or a read/write mount on the device, then it is reused
for successive mounts.  It will be freed when all mount instances on the
device are detached.

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: pathname operations
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:34 +0000 (19:01 -0700)] 
nilfs2: pathname operations

This adds pathname operations, most of which comes from the ext2 file
system.

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: directory entry operations
Yoshiji Amagai [Tue, 7 Apr 2009 02:01:34 +0000 (19:01 -0700)] 
nilfs2: directory entry operations

This adds directory handling functions, most of which comes from the ext2
file system.

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: file operations
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:33 +0000 (19:01 -0700)] 
nilfs2: file operations

This adds primitives for regular file handling.

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: inode operations
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:32 +0000 (19:01 -0700)] 
nilfs2: inode operations

This adds inode level operations of the nilfs2 file system.

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: segment usage file
Koji Sato [Tue, 7 Apr 2009 02:01:32 +0000 (19:01 -0700)] 
nilfs2: segment usage file

This adds a meta data file which stores the allocation state of segments.

[konishi.ryusuke@lab.ntt.co.jp: fix wrong counting of checkpoints and dirty segments]
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: checkpoint file
Koji Sato [Tue, 7 Apr 2009 02:01:31 +0000 (19:01 -0700)] 
nilfs2: checkpoint file

This adds a meta data file which holds checkpoint entries in its data
blocks.

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: inode map file
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:30 +0000 (19:01 -0700)] 
nilfs2: inode map file

This adds a meta data file which stores on-disk inodes in its data blocks.

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: disk address translator
Koji Sato [Tue, 7 Apr 2009 02:01:30 +0000 (19:01 -0700)] 
nilfs2: disk address translator

This adds the disk address translation file (DAT) whose primary function
is to convert virtual disk block numbers to actual disk block numbers.

The virtual block numbers of NILFS are associated with checkpoint
generation numbers, and this file also provides functions to manage the
lifetime information of each virtual block number.

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: persistent object allocator
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:29 +0000 (19:01 -0700)] 
nilfs2: persistent object allocator

This adds common functions to allocate or deallocate entries with bitmaps
on a meta data file.  This feature is used by the DAT and ifile.

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: 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: meta data file
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:28 +0000 (19:01 -0700)] 
nilfs2: meta data file

This adds the meta data file, which serves common buffer functions to the
DAT, sufile, cpfile, ifile, and so forth.

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: buffer and page operations
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:27 +0000 (19:01 -0700)] 
nilfs2: buffer and page operations

This adds common routines for buffer/page operations used in B-tree
node caches, meta data files, or segment constructor (log writer).

NILFS uses copy functions for buffers and pages due to the following
reasons:

 1) Relocation required for COW
    Since NILFS changes address of on-disk blocks, moving buffers
    in page cache is needed for the buffers which are not addressed
    by a file offset.  If buffer size is smaller than page size,
    this involves partial copy of pages.

 2) Freezing mmapped pages
    NILFS calculates checksums for each log to ensure its validity.
    If page data changes after the checksum calculation, this validity
    check will not work correctly.  To avoid this failure for mmaped
    pages, NILFS freezes their data by copying.

 3) Copy-on-write for DAT pages
    NILFS makes clones of DAT page caches in a copy-on-write manner
    during GC processes, and this ensures atomicity and consistency
    of the DAT in the transient state.

In addition, NILFS uses two obsolete functions, nilfs_mark_buffer_dirty()
and nilfs_clear_page_dirty() respectively.

* nilfs_mark_buffer_dirty() was required to avoid NULL pointer
  dereference faults:

  Since the page cache of B-tree node pages or data page cache of pseudo
  inodes does not have a valid mapping->host, calling mark_buffer_dirty()
  for their buffers causes the fault; it calls __mark_inode_dirty(NULL)
  through __set_page_dirty().

* nilfs_clear_page_dirty() was needed in the two cases:

 1) For B-tree node pages and data pages of the dat/gcdat, NILFS2 clears
    page dirty flags when it copies back pages from the cloned cache
    (gcdat->{i_mapping,i_btnode_cache}) to its original cache
    (dat->{i_mapping,i_btnode_cache}).

 2) Some B-tree operations like insertion or deletion may dispose buffers
    in dirty state, and this needs to cancel the dirty state of their
    pages.  clear_page_dirty_for_io() caused faults because it does not
    clear the dirty tag on the page cache.

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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>