pandora-kernel.git
14 years agox86: Fix code patching for paravirt-alternatives on 486
Ben Hutchings [Thu, 10 Sep 2009 01:53:50 +0000 (02:53 +0100)]
x86: Fix code patching for paravirt-alternatives on 486

As reported in <http://bugs.debian.org/511703> and
<http://bugs.debian.org/515982>, kernels with paravirt-alternatives
enabled crash in text_poke_early() on at least some 486-class
processors.

The problem is that text_poke_early() itself uses inline functions
affected by paravirt-alternatives and so will modify instructions that
have already been prefetched.  Pentium and later processors will
invalidate the prefetched instructions in this case, but 486-class
processors do not.

Change sync_core() to limit prefetching on 486-class (and 386-class)
processors, and move the call to sync_core() above the call to the
modifiable local_irq_restore().

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
LKML-Reference: <1252547631.3423.134.camel@localhost>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge branch 'next' into for-linus
James Morris [Thu, 10 Sep 2009 22:04:49 +0000 (08:04 +1000)]
Merge branch 'next' into for-linus

14 years agomd: Fix "strchr" [drivers/md/dm-log-userspace.ko] undefined!
Geert Uytterhoeven [Thu, 10 Sep 2009 21:13:28 +0000 (23:13 +0200)]
md: Fix "strchr" [drivers/md/dm-log-userspace.ko] undefined!

Commit b8313b6da7e2e7c7f47d93d8561969a3ff9ba0ea ("dm log: remove incorrect
field from userspace table output") added a call to strstr() with a
single-character "needle" string parameter.

Unfortunately some versions of gcc replace such calls to strstr() by calls
to strchr() behind our back.  This causes linking errors if strchr() is
defined as an inline function in <asm/string.h> (e.g. on m68k):

| WARNING: "strchr" [drivers/md/dm-log-userspace.ko] undefined!

Avoid this by explicitly calling strchr() instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosched: Fix sched::sched_stat_wait tracepoint field
Ingo Molnar [Thu, 10 Sep 2009 18:52:09 +0000 (20:52 +0200)]
sched: Fix sched::sched_stat_wait tracepoint field

This weird perf trace output:

  cc1-9943  [001]  2802.059479616: sched_stat_wait: task: as:9944 wait: 2801938766276 [ns]

Is caused by setting one component field of the delta to zero
a bit too early. Move it to later.

( Note, this does not affect the NEW_FAIR_SLEEPERS interactivity bug,
  it's just a reporting bug in essence. )

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Nikos Chantziaras <realnc@arcor.de>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <4AA93D34.8040500@arcor.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Disable NEW_FAIR_SLEEPERS for now
Ingo Molnar [Thu, 10 Sep 2009 18:34:48 +0000 (20:34 +0200)]
sched: Disable NEW_FAIR_SLEEPERS for now

Nikos Chantziaras and Jens Axboe reported that turning off
NEW_FAIR_SLEEPERS improves desktop interactivity visibly.

Nikos described his experiences the following way:

  " With this setting, I can do "nice -n 19 make -j20" and
    still have a very smooth desktop and watch a movie at
    the same time.  Various other annoyances (like the
    "logout/shutdown/restart" dialog of KDE not appearing
    at all until the background fade-out effect has finished)
    are also gone.  So this seems to be the single most
    important setting that vastly improves desktop behavior,
    at least here. "

Jens described it the following way, referring to a 10-seconds
xmodmap scheduling delay he was trying to debug:

  " Then I tried switching NO_NEW_FAIR_SLEEPERS on, and then
    I get:

    Performance counter stats for 'xmodmap .xmodmap-carl':

         9.009137  task-clock-msecs         #      0.447 CPUs
               18  context-switches         #      0.002 M/sec
                1  CPU-migrations           #      0.000 M/sec
              315  page-faults              #      0.035 M/sec

    0.020167093  seconds time elapsed

    Woot! "

So disable it for now. In perf trace output i can see weird
delta timestamps:

  cc1-9943  [001]  2802.059479616: sched_stat_wait: task: as:9944 wait: 2801938766276 [ns]

That nsec field is not supposed to be that large. More digging
is needed - but lets turn it off while the real bug is found.

Reported-by: Nikos Chantziaras <realnc@arcor.de>
Tested-by: Nikos Chantziaras <realnc@arcor.de>
Reported-by: Jens Axboe <jens.axboe@oracle.com>
Tested-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <4AA93D34.8040500@arcor.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMerge branch 'topic/ymfpci' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:33:09 +0000 (15:33 +0200)]
Merge branch 'topic/ymfpci' into for-linus

* topic/ymfpci:
  sound: ymfpci: increase timer resolution to 96 kHz

14 years agoMerge branch 'topic/usb-audio' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:33:07 +0000 (15:33 +0200)]
Merge branch 'topic/usb-audio' into for-linus

* topic/usb-audio:
  ALSA: usb-audio - Fix types taken in min()
  sound: usb-audio: do not make URBs longer than sync packet interval
  sound: usb-audio: add MIDI drain callback
  sound: usb-audio: use multiple output URBs
  sound: usb-audio: use multiple input URBs
  sound: usb-audio: Xonar U1 digital output support

14 years agoMerge branch 'topic/tlv-minmax' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:33:06 +0000 (15:33 +0200)]
Merge branch 'topic/tlv-minmax' into for-linus

* topic/tlv-minmax:
  ALSA: usb-audio - Correct bogus volume dB information
  ALSA: usb-audio - Use the new TLV_DB_MINMAX type
  ALSA: Add new TLV types for dBwith min/max

14 years agoMerge branch 'topic/soundcore-preclaim' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:33:04 +0000 (15:33 +0200)]
Merge branch 'topic/soundcore-preclaim' into for-linus

* topic/soundcore-preclaim:
  sound: make OSS device number claiming optional and schedule its removal
  sound: request char-major-* module aliases for missing OSS devices
  chrdev: implement __[un]register_chrdev()

14 years agoMerge branch 'topic/snd-printk' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:33:03 +0000 (15:33 +0200)]
Merge branch 'topic/snd-printk' into for-linus

* topic/snd-printk:
  ALSA: Fixed a typo of printk()
  ALSA: Add debug module option
  ALSA: core - strip too long file names in snd_print*()

14 years agoMerge branch 'topic/pcm-estrpipe-in-pm' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:33:02 +0000 (15:33 +0200)]
Merge branch 'topic/pcm-estrpipe-in-pm' into for-linus

* topic/pcm-estrpipe-in-pm:
  ALSA: pcm - Tell user that stream to be rewound is suspended

14 years agoMerge branch 'topic/pcm-drain-nonblock' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:33:00 +0000 (15:33 +0200)]
Merge branch 'topic/pcm-drain-nonblock' into for-linus

* topic/pcm-drain-nonblock:
  ALSA: pcm - Increase protocol version
  ALSA: pcm - Fix drain behavior in non-blocking mode

14 years agoMerge branch 'topic/oxygen' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:59 +0000 (15:32 +0200)]
Merge branch 'topic/oxygen' into for-linus

* topic/oxygen:
  sound: oxygen: work around MCE when changing volume

14 years agoMerge branch 'topic/oss' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:58 +0000 (15:32 +0200)]
Merge branch 'topic/oss' into for-linus

* topic/oss:
  ALSA: allocation may fail in snd_pcm_oss_change_params()
  sound: vwsnd: Fix setting of cfgval and ctlval in li_setup_dma()
  sound: fix OSS MIDI output data loss

14 years agoMerge branch 'topic/misc' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:57 +0000 (15:32 +0200)]
Merge branch 'topic/misc' into for-linus

* topic/misc:
  ALSA: Remove unneeded ifdef from sound/core.h
  ALSA: Remove struct snd_monitor_file from public sound/core.h
  ALSA: Release v1.0.21

14 years agoMerge branch 'topic/midi' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:56 +0000 (15:32 +0200)]
Merge branch 'topic/midi' into for-linus

* topic/midi:
  sound: rawmidi: disable active-sensing-on-close by default
  sound: seq_oss_midi: remove magic numbers
  sound: seq_midi: do not send MIDI reset when closing
  seq-midi: always log message on output overrun

14 years agoMerge branch 'topic/ice1724-pm' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:55 +0000 (15:32 +0200)]
Merge branch 'topic/ice1724-pm' into for-linus

* topic/ice1724-pm:
  ALSA: ice1724 - Fix section mismatch
  ALSA: ice1724 - Patch for suspend/resume for Audiotrak Prodigy HD2

14 years agoMerge branch 'topic/hdsp' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:54 +0000 (15:32 +0200)]
Merge branch 'topic/hdsp' into for-linus

* topic/hdsp:
  ALSA: hdsp - allow proc reporting with disconnected io box

14 years agoMerge branch 'topic/hda' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:52 +0000 (15:32 +0200)]
Merge branch 'topic/hda' into for-linus

* topic/hda: (92 commits)
  ALSA: hda - Use auto model for HP laptops with ALC268 codec
  ALSA: hda/realtek: Added support for CLEVO M540R subsystem, 6 channel + digital
  ALSA: hda - Add support of Alienware M17x laptop
  ALSA: hda - Remove dead codes from patch_sigmatel.c
  ALSA: hda - Fix input source selection of IDT92HD73xx
  ALSA: hda - Fix obsolete CONFIG_SND_DEBUG_DETECT
  ALSA: hda - Unmute docking line-out as default with AD1984A codec
  ALSA: hda - Add another entry for Nvidia HDMI device
  ALSA: hda - Add missing GPIO initialization for AD1984A laptop model
  ALSA: hda - Add support of docking auto-mute/mic for AD1984A laptop model
  ALSA: hda - Fix ALC268/ALC269 headphone pin routing
  ALSA: hda - Create "Digital Mic Capture Volume" correctly for IDT codecs
  ALSA: hda - Add more quirk for HP laptops with AD1984A
  ALSA: hda - Add / fix model entries for HD-audio driver
  ALSA: hda - Add full audio support on Acer Aspire 7730G notebook
  ALSA: hda - Improve auto-cfg mixer name for ALC662
  ALSA: hda - Improve auto-cfg mixer name for ALC861-VD
  ALSA: hda - Improve auto-cfg mixer name for ALC262
  ALSA: hda - Improve auto-cfg mixer name for ALC260
  ALSA: hda - Improve auto-cfg mixer name for ALC880
  ...

14 years agoMerge branch 'topic/dummy' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:51 +0000 (15:32 +0200)]
Merge branch 'topic/dummy' into for-linus

* topic/dummy:
  ALSA: dummy - Increase MAX_PCM_SUBSTREAMS to 128
  ALSA: dummy - Add debug proc file
  ALSA: Add const prefix to proc helper functions
  ALSA: Re-export snd_pcm_format_name() function
  ALSA: dummy - Fake buffer allocations
  ALSA: dummy - Fix the timer calculation in systimer mode
  ALSA: dummy - Add more description
  ALSA: dummy - Better jiffies handling
  ALSA: dummy - Support high-res timer mode

14 years agoMerge branch 'topic/dma-sgbuf' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:50 +0000 (15:32 +0200)]
Merge branch 'topic/dma-sgbuf' into for-linus

* topic/dma-sgbuf:
  ALSA: Fix SG-buffer DMA with non-coherent architectures

14 years agoMerge branch 'topic/ctxfi' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:48 +0000 (15:32 +0200)]
Merge branch 'topic/ctxfi' into for-linus

* topic/ctxfi:
  ALSA: ctxfi - Simple code clean up
  ALSA: ctxfi - Native timer support for emu20k2

14 years agoMerge branch 'topic/ctl-add-remove-fixes' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:47 +0000 (15:32 +0200)]
Merge branch 'topic/ctl-add-remove-fixes' into for-linus

* topic/ctl-add-remove-fixes:
  sound: snd_ctl_remove_user_ctl: prevent removal of kernel controls
  sound: snd_ctl_remove_unlocked_id: simplify user control counting
  sound: snd_ctl_remove_unlocked_id: simplify error paths
  sound: snd_ctl_elem_add: fix value count check

14 years agoMerge branch 'topic/cs46xx' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:46 +0000 (15:32 +0200)]
Merge branch 'topic/cs46xx' into for-linus

* topic/cs46xx:
  ALSA: cs46xx - Fix minimum period size

14 years agoMerge branch 'topic/cmi8330' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:45 +0000 (15:32 +0200)]
Merge branch 'topic/cmi8330' into for-linus

* topic/cmi8330:
  ALSA: cmi8330: Allow MPU-401-less operation
  ALSA: cmi8330: find OPL3 port automatically
  cmi8330: Add basic CMI8329 support
  ALSA: cmi8330: revert comments about AD1848 back

14 years agoMerge branch 'topic/cleanup' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:43 +0000 (15:32 +0200)]
Merge branch 'topic/cleanup' into for-linus

* topic/cleanup:
  ALSA: info - Use krealloc()

14 years agoMerge branch 'topic/azt3328' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:41 +0000 (15:32 +0200)]
Merge branch 'topic/azt3328' into for-linus

* topic/azt3328:
  ALSA: azt3328: fix previous breakage, improve suspend, cleanups
  ALSA: azt3328: large codec cleanup, add I2S port etc.
  ALSA: azt3328: fix Kconfig entry

14 years agoMerge branch 'topic/asoc' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:40 +0000 (15:32 +0200)]
Merge branch 'topic/asoc' into for-linus

* topic/asoc: (226 commits)
  ASoC: au1x: PSC-AC97 bugfixes
  ASoC: Fix WM835x Out4 capture enumeration
  ASoC: Remove unuused hw_read_t
  ASoC: fix pxa2xx-ac97.c breakage
  ASoC: Fully specify DC servo bits to update in wm_hubs
  ASoC: Debugged improper setting of PLL fields in WM8580 driver
  ASoC: new board driver to connect bfin-5xx with ad1836 codec
  ASoC: OMAP: Add functionality to set CLKR and FSR sources in McBSP DAI
  ASoC: davinci: i2c device creation moved into board files
  ASoC: Don't reconfigure WM8350 FLL if not needed
  ASoC: Fix s3c-i2s-v2 build
  ASoC: Make platform data optional for TLV320AIC3x
  ASoC: Add S3C24xx dependencies for Simtec machines
  ASoC: SDP3430: Fix TWL GPIO6 pin mux request
  ASoC: S3C platform: Fix s3c2410_dma_started() called at improper time
  ARM: OMAP: McBSP: Merge two functions into omap_mcbsp_start/_stop
  ASoC: OMAP: Fix setup of XCCR and RCCR registers in McBSP DAI
  OMAP: McBSP: Use textual values in DMA operating mode sysfs files
  ARM: OMAP: DMA: Add support for DMA channel self linking on OMAP1510
  ASoC: Select core DMA when building for S3C64xx
  ...

14 years agoMerge branch 'topic/ali5451-cleanup' into for-linus
Takashi Iwai [Thu, 10 Sep 2009 13:32:38 +0000 (15:32 +0200)]
Merge branch 'topic/ali5451-cleanup' into for-linus

* topic/ali5451-cleanup:
  ALSA: ali5451: remove dead code

14 years agobinfmt_elf: fix PT_INTERP bss handling
Roland McGrath [Wed, 9 Sep 2009 02:49:40 +0000 (19:49 -0700)]
binfmt_elf: fix PT_INTERP bss handling

In fs/binfmt_elf.c, load_elf_interp() calls padzero() for .bss even if
the PT_LOAD has no PROT_WRITE and no .bss.  This generates EFAULT.

Here is a small test case.  (Yes, there are other, useful PT_INTERP
which have only .text and no .data/.bss.)

----- ptinterp.S
_start: .globl _start
 nop
 int3
-----
$ gcc -m32 -nostartfiles -nostdlib -o ptinterp ptinterp.S
$ gcc -m32 -Wl,--dynamic-linker=ptinterp -o hello hello.c
$ ./hello
Segmentation fault  # during execve() itself

After applying the patch:
$ ./hello
Trace trap  # user-mode execution after execve() finishes

If the ELF headers are actually self-inconsistent, then dying is fine.
But having no PROT_WRITE segment is perfectly normal and correct if
there is no segment with p_memsz > p_filesz (i.e. bss).  John Reiser
suggested checking for PROT_WRITE in the bss logic.  I think it makes
most sense to simply apply the bss logic only when there is bss.

This patch looks less trivial than it is due to some reindentation.
It just moves the "if (last_bss > elf_bss) {" test up to include the
partial-page bss logic as well as the more-pages bss logic.

Reported-by: John Reiser <jreiser@bitwagon.com>
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
14 years agoTPM: Fixup boot probe timeout for tpm_tis driver
Jason Gunthorpe [Wed, 9 Sep 2009 23:22:18 +0000 (17:22 -0600)]
TPM: Fixup boot probe timeout for tpm_tis driver

When probing the device in tpm_tis_init the call request_locality
uses timeout_a, which wasn't being initalized until after
request_locality. This results in request_locality falsely timing
out if the chip is still starting. Move the initialization to before
request_locality.

This probably only matters for embedded cases (ie mine), a BIOS likely
gets the TPM into a state where this code path isn't necessary.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Acked-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
14 years agoMerge branch 'lookup-permissions-cleanup'
Linus Torvalds [Thu, 10 Sep 2009 03:04:54 +0000 (20:04 -0700)]
Merge branch 'lookup-permissions-cleanup'

* lookup-permissions-cleanup:
  jffs2/jfs/xfs: switch over to 'check_acl' rather than 'permission()'
  ext[234]: move over to 'check_acl' permission model
  shmfs: use 'check_acl' instead of 'permission'
  Make 'check_acl()' a first-class filesystem op
  Simplify exec_permission_lite(), part 3
  Simplify exec_permission_lite() further
  Simplify exec_permission_lite() logic
  Do not call 'ima_path_check()' for each path component

14 years agobinfmt_elf: fix PT_INTERP bss handling
Roland McGrath [Wed, 9 Sep 2009 02:49:40 +0000 (19:49 -0700)]
binfmt_elf: fix PT_INTERP bss handling

In fs/binfmt_elf.c, load_elf_interp() calls padzero() for .bss even if
the PT_LOAD has no PROT_WRITE and no .bss.  This generates EFAULT.

Here is a small test case.  (Yes, there are other, useful PT_INTERP
which have only .text and no .data/.bss.)

----- ptinterp.S
_start: .globl _start
 nop
 int3
-----
$ gcc -m32 -nostartfiles -nostdlib -o ptinterp ptinterp.S
$ gcc -m32 -Wl,--dynamic-linker=ptinterp -o hello hello.c
$ ./hello
Segmentation fault  # during execve() itself

After applying the patch:
$ ./hello
Trace trap  # user-mode execution after execve() finishes

If the ELF headers are actually self-inconsistent, then dying is fine.
But having no PROT_WRITE segment is perfectly normal and correct if
there is no segment with p_memsz > p_filesz (i.e. bss).  John Reiser
suggested checking for PROT_WRITE in the bss logic.  I think it makes
most sense to simply apply the bss logic only when there is bss.

This patch looks less trivial than it is due to some reindentation.
It just moves the "if (last_bss > elf_bss) {" test up to include the
partial-page bss logic as well as the more-pages bss logic.

Reported-by: John Reiser <jreiser@bitwagon.com>
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosysfs: Add labeling support for sysfs
David P. Quigley [Wed, 9 Sep 2009 18:25:37 +0000 (14:25 -0400)]
sysfs: Add labeling support for sysfs

This patch adds a setxattr handler to the file, directory, and symlink
inode_operations structures for sysfs. The patch uses hooks introduced in the
previous patch to handle the getting and setting of security information for
the sysfs inodes. As was suggested by Eric Biederman the struct iattr in the
sysfs_dirent structure has been replaced by a structure which contains the
iattr, secdata and secdata length to allow the changes to persist in the event
that the inode representing the sysfs_dirent is evicted. Because sysfs only
stores this information when a change is made all the optional data is moved
into one dynamically allocated field.

This patch addresses an issue where SELinux was denying virtd access to the PCI
configuration entries in sysfs. The lack of setxattr handlers for sysfs
required that a single label be assigned to all entries in sysfs. Granting virtd
access to every entry in sysfs is not an acceptable solution so fine grained
labeling of sysfs is required such that individual entries can be labeled
appropriately.

[sds:  Fixed compile-time warnings, coding style, and setting of inode security init flags.]

Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: Stephen D. Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
14 years agoLSM/SELinux: inode_{get,set,notify}secctx hooks to access LSM security context inform...
David P. Quigley [Thu, 3 Sep 2009 18:25:57 +0000 (14:25 -0400)]
LSM/SELinux: inode_{get,set,notify}secctx hooks to access LSM security context information.

This patch introduces three new hooks. The inode_getsecctx hook is used to get
all relevant information from an LSM about an inode. The inode_setsecctx is
used to set both the in-core and on-disk state for the inode based on a context
derived from inode_getsecctx.The final hook inode_notifysecctx will notify the
LSM of a change for the in-core state of the inode in question. These hooks are
for use in the labeled NFS code and addresses concerns of how to set security
on an inode in a multi-xattr LSM. For historical reasons Stephen Smalley's
explanation of the reason for these hooks is pasted below.

Quote Stephen Smalley

inode_setsecctx:  Change the security context of an inode.  Updates the
in core security context managed by the security module and invokes the
fs code as needed (via __vfs_setxattr_noperm) to update any backing
xattrs that represent the context.  Example usage:  NFS server invokes
this hook to change the security context in its incore inode and on the
backing file system to a value provided by the client on a SETATTR
operation.

inode_notifysecctx:  Notify the security module of what the security
context of an inode should be.  Initializes the incore security context
managed by the security module for this inode.  Example usage:  NFS
client invokes this hook to initialize the security context in its
incore inode to the value provided by the server for the file when the
server returned the file's attributes to the client.

Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
14 years agoVFS: Factor out part of vfs_setxattr so it can be called from the SELinux hook for...
David P. Quigley [Thu, 3 Sep 2009 18:25:56 +0000 (14:25 -0400)]
VFS: Factor out part of vfs_setxattr so it can be called from the SELinux hook for inode_setsecctx.

This factors out the part of the vfs_setxattr function that performs the
setting of the xattr and its notification. This is needed so the SELinux
implementation of inode_setsecctx can handle the setting of the xattr while
maintaining the proper separation of layers.

Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
14 years agoLinux 2.6.31 v2.6.31
Linus Torvalds [Wed, 9 Sep 2009 22:13:59 +0000 (15:13 -0700)]
Linux 2.6.31

14 years agoRDMA/iwcm: Reject the connection when the cm_id is destroyed
Steve Wise [Wed, 9 Sep 2009 18:37:38 +0000 (11:37 -0700)]
RDMA/iwcm: Reject the connection when the cm_id is destroyed

If the cm_id of a connect request is destroyed prior to the ULP
accepting or rejecting the connection, then the provider never cleans
up the connection.  The iwcm should explicitly reject these
connections if the cm_id is destroyed.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoRDMA/cxgb3: Clean up properly on FW mismatch failures
Steve Wise [Wed, 9 Sep 2009 18:25:56 +0000 (11:25 -0700)]
RDMA/cxgb3: Clean up properly on FW mismatch failures

FW mismatches can cause a crash in the iw_cxgb3 event handler.

- NULL the t3cdev->ulp pointer on failures in cxio_rdev_open()
- Silently ignore events when the ulp ptr is NULL in iwch_err_handler()

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoRDMA/cxgb3: Don't ignore insert_handle() failures
Steve Wise [Wed, 9 Sep 2009 18:25:55 +0000 (11:25 -0700)]
RDMA/cxgb3: Don't ignore insert_handle() failures

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agosched: Keep kthreads at default priority
Mike Galbraith [Wed, 9 Sep 2009 13:41:37 +0000 (15:41 +0200)]
sched: Keep kthreads at default priority

Removes kthread/workqueue priority boost, they increase worst-case
desktop latencies.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1252486344.28645.18.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Re-tune the scheduler latency defaults to decrease worst-case latencies
Mike Galbraith [Wed, 9 Sep 2009 13:41:37 +0000 (15:41 +0200)]
sched: Re-tune the scheduler latency defaults to decrease worst-case latencies

Reduce the latency target from 20 msecs to 5 msecs.

Why? Larger latencies increase spread, which is good for scaling,
but bad for worst case latency.

We still have the ilog(nr_cpus) rule to scale up on bigger
server boxes.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1252486344.28645.18.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Turn off child_runs_first
Mike Galbraith [Wed, 9 Sep 2009 13:41:37 +0000 (15:41 +0200)]
sched: Turn off child_runs_first

Set child_runs_first default to off.

It hurts 'optimal' make -j<NR_CPUS> workloads as make jobs
get preempted by child tasks, reducing parallelism.

Note, this patch might make existing races in user
applications more prominent than before - so breakages
might be bisected to this commit.

Child-runs-first is broken on SMP to begin with, and we
already had it off briefly in v2.6.23 so most of the
offenders ought to be fixed. Would be nice not to revert
this commit but fix those apps finally ...

Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1252486344.28645.18.camel@marge.simson.net>
[ made the sysctl independent of CONFIG_SCHED_DEBUG, in case
  people want to work around broken apps. ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoaoe: allocate unused request_queue for sysfs
Ed Cashin [Wed, 9 Sep 2009 12:10:18 +0000 (14:10 +0200)]
aoe: allocate unused request_queue for sysfs

Andy Whitcroft reported an oops in aoe triggered by use of an
incorrectly initialised request_queue object:

  [ 2645.959090] kobject '<NULL>' (ffff880059ca22c0): tried to add
an uninitialized object, something is seriously wrong.
  [ 2645.959104] Pid: 6, comm: events/0 Not tainted 2.6.31-5-generic #24-Ubuntu
  [ 2645.959107] Call Trace:
  [ 2645.959139] [<ffffffff8126ca2f>] kobject_add+0x5f/0x70
  [ 2645.959151] [<ffffffff8125b4ab>] blk_register_queue+0x8b/0xf0
  [ 2645.959155] [<ffffffff8126043f>] add_disk+0x8f/0x160
  [ 2645.959161] [<ffffffffa01673c4>] aoeblk_gdalloc+0x164/0x1c0 [aoe]

The request queue of an aoe device is not used but can be allocated in
code that does not sleep.

Bruno bisected this regression down to

  cd43e26f071524647e660706b784ebcbefbd2e44

  block: Expose stacked device queues in sysfs

"This seems to generate /sys/block/$device/queue and its contents for
 everyone who is using queues, not just for those queues that have a
 non-NULL queue->request_fn."

Addresses http://bugs.launchpad.net/bugs/410198
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13942

Note that embedding a queue inside another object has always been
an illegal construct, since the queues are reference counted and
must persist until the last reference is dropped. So aoe was
always buggy in this respect (Jens).

Signed-off-by: Ed Cashin <ecashin@coraid.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Bruno Premont <bonbons@linux-vserver.org>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoKEYS: Add missing linux/tracehook.h #inclusions
David Howells [Wed, 9 Sep 2009 07:30:21 +0000 (08:30 +0100)]
KEYS: Add missing linux/tracehook.h #inclusions

Add #inclusions of linux/tracehook.h to those arch files that had the tracehook
call for TIF_NOTIFY_RESUME added when support for that flag was added to that
arch.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
14 years agosata_fsl: Defer non-ncq commands when ncq commands active
Ashish Kalra [Wed, 29 Jul 2009 15:45:49 +0000 (21:15 +0530)]
sata_fsl: Defer non-ncq commands when ncq commands active

Fix for non-ncq & ncq commands causing timeouts when both are issued
simultaneously to the same device.

Signed-off-by: Ashish Kalra <Ashish.Kalra@freescale.com>
[fixed to be actual compileable C code -jg]
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agolibata: add SATA PMP revision information for spec 1.2
Shane Huang [Tue, 8 Sep 2009 09:37:01 +0000 (17:37 +0800)]
libata: add SATA PMP revision information for spec 1.2

This small patch is just adding the information for PMP spec 1.2

Signed-off-by: Shane Huang <shane.huang@amd.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agolibata: fix off-by-one error in ata_tf_read_block()
Tejun Heo [Sun, 16 Aug 2009 12:21:21 +0000 (21:21 +0900)]
libata: fix off-by-one error in ata_tf_read_block()

ata_tf_read_block() has off-by-one error when converting CHS address
to LBA.  The bug isn't very visible because ata_tf_read_block() is
used only when generating sense data for a failed RW command and CHS
addressing isn't used too often these days.

This problem was spotted by Atsushi Nemoto.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agoahci: Gigabyte GA-MA69VM-S2 can't do 64bit DMA
Tejun Heo [Sun, 16 Aug 2009 12:06:57 +0000 (21:06 +0900)]
ahci: Gigabyte GA-MA69VM-S2 can't do 64bit DMA

Gigabyte GA-MA69VM-S2 can't do 64bit DMA either.  It's yet unknown
whether recent BIOS fixes the problem.  Blacklist regardless of BIOS
revisions for now.

Sandor Bodo-Merle reported and provided the initial patch for this
issue.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Sandor Bodo-Merle <sbodomerle@gmail.com>
Cc: Shane Huang <shane.huang@amd.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agoahci: make ahci_asus_m2a_vm_32bit_only() quirk more generic
Tejun Heo [Sun, 16 Aug 2009 12:04:02 +0000 (21:04 +0900)]
ahci: make ahci_asus_m2a_vm_32bit_only() quirk more generic

It turns out ASUS M2A-VM isn't the only one with the 32bit DMA
problem.  Make ahci_asus_m2a_vm_32bit_only() more generic using the
new dmi_get_date() and rename it to ahci_sb600_32bit_only().  Cut off
date is now pointed to by dmi_system_id->driver_data in "yyyymmdd"
format and it's now also allowed to be omitted.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Sandor Bodo-Merle <sbodomerle@gmail.com>
Cc: Shane Huang <shane.huang@amd.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agodmi: extend dmi_get_year() to dmi_get_date()
Tejun Heo [Sun, 16 Aug 2009 12:02:36 +0000 (21:02 +0900)]
dmi: extend dmi_get_year() to dmi_get_date()

There are cases where full date information is required instead of
just the year.  Add month and day parsing to dmi_get_year() and rename
it to dmi_get_date().

As the original function only required '/' followed by any number of
parseable characters at the end of the string, keep that behavior to
avoid upsetting existing users.

The new function takes dates of format [mm[/dd]]/yy[yy].  Year, month
and date are checked to be in the ranges of [1-9999], [1-12] and
[1-31] respectively and any invalid or out-of-range component is
returned as zero.

The dummy implementation is updated accordingly but the return value
is updated to indicate field not found which is consistent with how
other dummy functions behave.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agodmi: fix date handling in dmi_get_year()
Tejun Heo [Sun, 16 Aug 2009 12:01:22 +0000 (21:01 +0900)]
dmi: fix date handling in dmi_get_year()

Year parsing in dmi_get_year() had the following two bugs.

* "00" is treated as invalid instead of 2000 because zero return from
  simple_strtoul() is treated as error.

* "0N" where N >= 8 is treated as invalid of 200N because the leading
  0 is considered to specify octal.

Fix the above two bugs by using endptr to detect invalid number and
forcing decimal.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agolibata: unbreak TPM filtering by reorganizing ata_scsi_pass_thru()
Tejun Heo [Thu, 3 Sep 2009 07:08:11 +0000 (16:08 +0900)]
libata: unbreak TPM filtering by reorganizing ata_scsi_pass_thru()

ata_scsi_pass_thru() was checking for input sanity and disallowed
commands while initializaing qc from scmd.  TPM filtering was added
right after protocol check at which point tf wasn't initialized
properly.  This means that TPM filtering has never really worked.

This patch fixes the bug by reorganizing ata_scsi_pass_thru() such
that qc is fully initialized before checking for invalid conditions
which is way less error prone.

Discovered while Thilo-Alexander Ginkel was trying debug patches for
bko#13416.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Thilo-Alexander Ginkel <thilo@ginkel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agosata_sis: convert to slave_link
Tejun Heo [Tue, 1 Sep 2009 14:19:10 +0000 (23:19 +0900)]
sata_sis: convert to slave_link

During introduction of slave_link, sata_sis slipped through the crack
and left with ad-hoc merged SCR access.  As SCR status was shared for
both the master and slave devices, when only one of the device is
online, libata EH would think both are online but would only get valid
device signature for the actually present one, which in turn trigger
the probing safety net mechanism and make EH retry causing large delay
during boot.  This patch converts sata_sis to slave_link mechanism.

This bug was reported by TAXI in bko#14075.

 http://bugzilla.kernel.org/show_bug.cgi?id=14075

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: TAXI <taxi@a-city.de>
Cc: Uwe Koziolek <uwe.koziolek@gmx.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agoi915: disable interrupts before tearing down GEM state
Linus Torvalds [Wed, 9 Sep 2009 00:09:24 +0000 (17:09 -0700)]
i915: disable interrupts before tearing down GEM state

Reinette Chatre reports a frozen system (with blinking keyboard LEDs)
when switching from graphics mode to the text console, or when
suspending (which does the same thing). With netconsole, the oops
turned out to be

BUG: unable to handle kernel NULL pointer dereference at 0000000000000084
IP: [<ffffffffa03ecaab>] i915_driver_irq_handler+0x26b/0xd20 [i915]

and it's due to the i915_gem.c code doing drm_irq_uninstall() after
having done i915_gem_idle(). And the i915_gem_idle() path will do

  i915_gem_idle() ->
    i915_gem_cleanup_ringbuffer() ->
      i915_gem_cleanup_hws() ->
        dev_priv->hw_status_page = NULL;

but if an i915 interrupt comes in after this stage, it may want to
access that hw_status_page, and gets the above NULL pointer dereference.

And since the NULL pointer dereference happens from within an interrupt,
and with the screen still in graphics mode, the common end result is
simply a silently hung machine.

Fix it by simply uninstalling the irq handler before idling rather than
after. Fixes

    http://bugzilla.kernel.org/show_bug.cgi?id=13819

Reported-and-tested-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoNFSv4: Disallow 'mount -t nfs4 -overs=2' and 'mount -t nfs4 -overs=3'
Trond Myklebust [Tue, 8 Sep 2009 23:50:07 +0000 (19:50 -0400)]
NFSv4: Disallow 'mount -t nfs4 -overs=2' and 'mount -t nfs4 -overs=3'

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoNFS: Allow the "nfs" file system type to support NFSv4
Chuck Lever [Tue, 8 Sep 2009 23:50:03 +0000 (19:50 -0400)]
NFS: Allow the "nfs" file system type to support NFSv4

When mounting an "nfs" type file system, recognize "v4," "vers=4," or
"nfsvers=4" mount options, and convert the file system to "nfs4" under
the covers.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
[trondmy: fixed up binary mount code so it sets the 'version' field too]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoNFS: Move details of nfs4_get_sb() to a helper
Chuck Lever [Tue, 8 Sep 2009 23:50:00 +0000 (19:50 -0400)]
NFS: Move details of nfs4_get_sb() to a helper

Clean up: Refactor nfs4_get_sb() to allow its guts to be invoked by
nfs_get_sb().

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoNFS: Refactor NFSv4 text-based mount option validation
Chuck Lever [Tue, 8 Sep 2009 23:49:57 +0000 (19:49 -0400)]
NFS: Refactor NFSv4 text-based mount option validation

Clean up: Refactor the part of nfs4_validate_mount_options() that
handles text-based options, so we can call it from the NFSv2/v3
option validation function.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoNFS: Mount option parser should detect missing "port="
Chuck Lever [Tue, 8 Sep 2009 23:49:47 +0000 (19:49 -0400)]
NFS: Mount option parser should detect missing "port="

The meaning of not specifying the "port=" mount option is different
for "-t nfs" and "-t nfs4" mounts.  The default port value for
NFSv2/v3 mounts is 0, but the default for NFSv4 mounts is 2049.

To support "-t nfs -o vers=4", the mount option parser must detect
when "port=" is missing so that the correct default port value can be
set depending on which NFS version is requested.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoNFS: out of date comment regarding O_EXCL above nfs3_proc_create()
Harshula Jayasuriya [Tue, 8 Sep 2009 23:49:33 +0000 (19:49 -0400)]
NFS: out of date comment regarding O_EXCL above nfs3_proc_create()

Hi Trond,

Recently we were observing the behaviour difference between a 2.4.x and
2.6.x kernel with respect to O_EXCL. A comment from 2.4.x era, "For now,
we don't implement O_EXCL." seems inaccurate in TOT.

If so, here's a patch to remove the comment.

This patch is against:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6

Signed-off-by: Harshula Jayasuriya <harshula@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoASoC: au1x: PSC-AC97 bugfixes
Manuel Lauss [Tue, 8 Sep 2009 17:45:17 +0000 (19:45 +0200)]
ASoC: au1x: PSC-AC97 bugfixes

This patch fixes the following bugs:

- only reprogram bitdepth if it has changed since last call to hw_params.
- add locking inside ac97_read/write functions:
  When reprogramming sample depth, the ac97 unit has to be disabled,
  which should not be done in the middle of codec register accesses.

- retry timed-out codec register accesses.

- wait for status bits to set/clear when starting/stopping various
  functional blocks; very important after reenabling AC97 unit else
  sound may be distorted (e.g. high-pitch noise in 1kHz sine wave).

- clear fifos before/after starting/stopping RX/TX.

- longer timeouts waiting for PSC/AC97 ready after cold reset
  with certain codecs this can take ridiculous amounts of time.

Run-tested on various Au1200 platforms with various codecs.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
14 years agojffs2/jfs/xfs: switch over to 'check_acl' rather than 'permission()'
Linus Torvalds [Fri, 28 Aug 2009 19:29:03 +0000 (12:29 -0700)]
jffs2/jfs/xfs: switch over to 'check_acl' rather than 'permission()'

This avoids an indirect call in the VFS for each path component lookup.

Well, at least as long as you own the directory in question, and the ACL
check is unnecessary.

Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoext[234]: move over to 'check_acl' permission model
Linus Torvalds [Fri, 28 Aug 2009 19:12:24 +0000 (12:12 -0700)]
ext[234]: move over to 'check_acl' permission model

Don't implement per-filesystem 'extX_permission()' functions that have
to be called for every path component operation, and instead just expose
the actual ACL checking so that the VFS layer can now do it for us.

Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoshmfs: use 'check_acl' instead of 'permission'
Linus Torvalds [Fri, 28 Aug 2009 19:04:28 +0000 (12:04 -0700)]
shmfs: use 'check_acl' instead of 'permission'

shmfs wants purely standard POSIX ACL semantics, so we can use the new
generic VFS layer POSIX ACL checking rather than cooking our own
'permission()' function.

Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMake 'check_acl()' a first-class filesystem op
Linus Torvalds [Fri, 28 Aug 2009 18:51:25 +0000 (11:51 -0700)]
Make 'check_acl()' a first-class filesystem op

This is stage one in flattening out the callchains for the common
permission testing.  Rather than have most filesystem implement their
own inode->i_op->permission function that just calls back down to the
VFS layers 'generic_permission()' with the per-filesystem ACL checking
function, the filesystem can just expose its 'check_acl' function
directly, and let the VFS layer do everything for it.

This is all just preparatory - no filesystem actually enables this yet.

Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoSimplify exec_permission_lite(), part 3
Linus Torvalds [Fri, 28 Aug 2009 18:08:31 +0000 (11:08 -0700)]
Simplify exec_permission_lite(), part 3

Don't call down to the generic inode_permission() function just to
call the inode-specific permission function - just do it directly.

The generic inode_permission() code does things like checking MAY_WRITE
and devcgroup_inode_permission(), neither of which are relevant for the
light pathname walk permission checks (we always do just MAY_EXEC, and
the inode is never a special device).

Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoSimplify exec_permission_lite() further
Linus Torvalds [Fri, 28 Aug 2009 17:53:56 +0000 (10:53 -0700)]
Simplify exec_permission_lite() further

This function is only called for path components that are already known
to be directories (they have a '->lookup' method).  So don't bother
doing that whole S_ISDIR() testing, the whole point of the 'lite()'
version is that we know that we are looking at a directory component,
and that we're only checking name lookup permission.

Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoSimplify exec_permission_lite() logic
Linus Torvalds [Fri, 28 Aug 2009 17:50:37 +0000 (10:50 -0700)]
Simplify exec_permission_lite() logic

Instead of returning EAGAIN and having the caller do something
special for that case,  just do the special case directly.

Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoDo not call 'ima_path_check()' for each path component
Linus Torvalds [Fri, 28 Aug 2009 17:05:33 +0000 (10:05 -0700)]
Do not call 'ima_path_check()' for each path component

Not only is that a supremely timing-critical path, but it's hopefully
some day going to be lockless for the common case, and ima can't do
that.

Plus the integrity code doesn't even care about non-regular files, so it
was always a total waste of time and effort.

Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agodrm/i915: fix mask bits setting
Zhenyu Wang [Tue, 8 Sep 2009 06:52:25 +0000 (14:52 +0800)]
drm/i915: fix mask bits setting

eDP is exclusive connector too, and add missing crtc_mask
setting for TV.

This fixes

http://bugzilla.kernel.org/show_bug.cgi?id=14139

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Reported-and-tested-by: Carlos R. Mafra <crmafra2@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agokmemleak: fix sparse warning for static declarations
Luis R. Rodriguez [Tue, 8 Sep 2009 16:31:45 +0000 (17:31 +0100)]
kmemleak: fix sparse warning for static declarations

This fixes these sparse warnings:

mm/kmemleak.c:1179:6: warning: symbol 'start_scan_thread' was not declared. Should it be static?
mm/kmemleak.c:1194:6: warning: symbol 'stop_scan_thread' was not declared. Should it be static?

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
14 years agokmemleak: fix sparse warning over overshadowed flags
Luis R. Rodriguez [Tue, 8 Sep 2009 16:32:34 +0000 (17:32 +0100)]
kmemleak: fix sparse warning over overshadowed flags

A secondary irq_save is not required as a locking before it was
already disabling irqs.

This fixes this sparse warning:
mm/kmemleak.c:512:31: warning: symbol 'flags' shadows an earlier one
mm/kmemleak.c:448:23: originally declared here

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
14 years agokmemleak: move common painting code together
Luis R. Rodriguez [Sat, 5 Sep 2009 00:44:52 +0000 (17:44 -0700)]
kmemleak: move common painting code together

When painting grey or black we do the same thing, bring
this together into a helper and identify coloring grey or
black explicitly with defines. This makes this a little
easier to read.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
14 years agoALSA: dummy - Increase MAX_PCM_SUBSTREAMS to 128
Takashi Iwai [Tue, 8 Sep 2009 16:15:17 +0000 (18:15 +0200)]
ALSA: dummy - Increase MAX_PCM_SUBSTREAMS to 128

Increase the limit of PCM substreams to 128.  The default value is
unchanged; only the max accept value is increased.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agokmemleak: add clear command support
Luis R. Rodriguez [Sat, 5 Sep 2009 00:44:51 +0000 (17:44 -0700)]
kmemleak: add clear command support

In an ideal world your kmemleak output will be small, when its
not (usually during initial bootup) you can use the clear command
to ingore previously reported and unreferenced kmemleak objects. We
do this by painting all currently reported unreferenced objects grey.
We paint them grey instead of black to allow future scans on the same
objects as such objects could still potentially reference newly
allocated objects in the future.

To test a critical section on demand with a clean
/sys/kernel/debug/kmemleak you can do:

echo clear > /sys/kernel/debug/kmemleak
        test your kernel or modules
echo scan > /sys/kernel/debug/kmemleak

Then as usual to get your report with:

cat /sys/kernel/debug/kmemleak

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
14 years agokmemleak: use bool for true/false questions
Luis R. Rodriguez [Tue, 8 Sep 2009 15:34:50 +0000 (16:34 +0100)]
kmemleak: use bool for true/false questions

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
14 years agokmemleak: Do no create the clean-up thread during kmemleak_disable()
Catalin Marinas [Mon, 7 Sep 2009 09:14:42 +0000 (10:14 +0100)]
kmemleak: Do no create the clean-up thread during kmemleak_disable()

The kmemleak_disable() function could be called from various contexts
including IRQ. It creates a clean-up thread but the kthread_create()
function has restrictions on which contexts it can be called from,
mainly because of the kthread_create_lock. The patch changes the
kmemleak clean-up thread to a workqueue.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Eric Paris <eparis@redhat.com>
14 years agoALSA: dummy - Add debug proc file
Takashi Iwai [Tue, 8 Sep 2009 12:30:49 +0000 (14:30 +0200)]
ALSA: dummy - Add debug proc file

Added the debug proc file to see or change the snd_pcm_hardware fields
to emulate.  The parameters can be changed by writing to a proc file like:

    # echo periods_min 4 > /proc/asound/card1/dummy_pcm

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: Add const prefix to proc helper functions
Takashi Iwai [Tue, 8 Sep 2009 12:29:58 +0000 (14:29 +0200)]
ALSA: Add const prefix to proc helper functions

Add appropriate const prefix to char * arguments in proc helper functions.
Also fixed the caller side to be proper const pointers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: Re-export snd_pcm_format_name() function
Takashi Iwai [Tue, 8 Sep 2009 12:26:51 +0000 (14:26 +0200)]
ALSA: Re-export snd_pcm_format_name() function

Re-export snd_pcm_format_name() function to be used outside the PCM core.
As a first example, usbaudio is changed to use it now again.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agosched: Ensure that a child can't gain time over it's parent after fork()
Mike Galbraith [Tue, 8 Sep 2009 09:12:28 +0000 (11:12 +0200)]
sched: Ensure that a child can't gain time over it's parent after fork()

A fork/exec load is usually "pass the baton", so the child
should never be placed behind the parent.  With START_DEBIT we
make room for the new task, but with child_runs_first, that
room comes out of the _parent's_ hide. There's nothing to say
that the parent wasn't ahead of min_vruntime at fork() time,
which means that the "baton carrier", who is essentially the
parent in drag, can gain time and increase scheduling latencies
for waiters.

With NEW_FAIR_SLEEPERS + START_DEBIT + child_runs_first
enabled, we essentially pass the sleeper fairness off to the
child, which is fine, but if we don't base placement on the
parent's updated vruntime, we can end up compounding latency
woes if the child itself then does fork/exec.  The debit
incurred at fork doesn't hurt the parent who is then going to
sleep and maybe exit, but the child who acquires the error
harms all comers.

This improves latencies of make -j<n> kernel build workloads.

Reported-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoALSA: hda - Use auto model for HP laptops with ALC268 codec
Takashi Iwai [Tue, 8 Sep 2009 09:03:41 +0000 (11:03 +0200)]
ALSA: hda - Use auto model for HP laptops with ALC268 codec

The HP laptops with ALC268 codec seem working better with model=auto
than model=toshiba; e.g. the auto model fixes missing digital outputs.
Let's fix quirk entry to choose auto model explicitly.

Tested-by: Jens Jorgensen <jbj1@ultraemail.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: cs46xx - Fix minimum period size
Sophie Hamilton [Tue, 8 Sep 2009 08:58:42 +0000 (10:58 +0200)]
ALSA: cs46xx - Fix minimum period size

Fix minimum period size for cs46xx cards. This fixes a problem in the
case where neither a period size nor a buffer size is passed to ALSA;
this is the case in Audacious, OpenAL, and others.

Signed-off-by: Sophie Hamilton <kernel@theblob.org>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoMAINTAINERS: InfiniBand/RDMA mailing list transition to vger
Roland Dreier [Tue, 8 Sep 2009 04:54:38 +0000 (21:54 -0700)]
MAINTAINERS: InfiniBand/RDMA mailing list transition to vger

InfiniBand/RDMA development discussion is moving from
general@lists.openfabrics.org to linux-rdma@vger.kernel.org.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agosched: enable SD_WAKE_IDLE
Peter Zijlstra [Mon, 7 Sep 2009 16:32:32 +0000 (18:32 +0200)]
sched: enable SD_WAKE_IDLE

Now that SD_WAKE_IDLE doesn't make pipe-test suck anymore,
enable it by default for MC, CPU and NUMA domains.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Mon, 7 Sep 2009 18:42:25 +0000 (11:42 -0700)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon/kms: add LTE/GTE discard + rv515 two sided stencil register.

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Mon, 7 Sep 2009 18:41:15 +0000 (11:41 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  IMA: update ima_counts_put

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Mon, 7 Sep 2009 18:40:24 +0000 (11:40 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  gianfar: Fix build.

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
Linus Torvalds [Mon, 7 Sep 2009 18:40:15 +0000 (11:40 -0700)]
Merge git://git./linux/kernel/git/davem/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
  pcmcia: add CNF-CDROM-ID for ide

14 years agosched: Deal with low-load in wake_affine()
Peter Zijlstra [Mon, 7 Sep 2009 16:28:05 +0000 (18:28 +0200)]
sched: Deal with low-load in wake_affine()

wake_affine() would always fail under low-load situations where
both prev and this were idle, because adding a single task will
always be a significant imbalance, even if there's nothing
around that could balance it.

Deal with this by allowing imbalance when there's nothing you
can do about it.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Remove short cut from select_task_rq_fair()
Peter Zijlstra [Mon, 7 Sep 2009 16:12:06 +0000 (18:12 +0200)]
sched: Remove short cut from select_task_rq_fair()

select_task_rq_fair() incorrectly skips the wake_affine()
logic, remove this.

When prev_cpu == this_cpu, the code jumps straight to the
wake_idle() logic, this doesn't give the wake_affine() logic
the chance to pin the task to this cpu.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt...
Linus Torvalds [Mon, 7 Sep 2009 18:38:30 +0000 (11:38 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/anholt/drm-intel

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel:
  agp/intel: support for new chip variant of IGDNG mobile
  drm/i915: Unref old_obj on get_fence_reg() error path
  drm/i915: increase default latency constant (v2 w/comment)

14 years agoASoC: Fix WM835x Out4 capture enumeration
Mark Brown [Mon, 7 Sep 2009 17:09:58 +0000 (18:09 +0100)]
ASoC: Fix WM835x Out4 capture enumeration

It's the 8th enum of a zero indexed array. This is why I don't let
new drivers use these arrays of enums...

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
14 years agoIB/mad: Allow tuning of QP0 and QP1 sizes
Hal Rosenstock [Mon, 7 Sep 2009 15:28:48 +0000 (08:28 -0700)]
IB/mad: Allow tuning of QP0 and QP1 sizes

MADs are UD and can be dropped if there are no receives posted, so
allow receive queue size to be set with a module parameter in case the
queue needs to be lengthened.  Send side tuning is done for symmetry
with receive.

Signed-off-by: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoIB/mad: Fix possible lock-lock-timer deadlock
Roland Dreier [Mon, 7 Sep 2009 15:27:50 +0000 (08:27 -0700)]
IB/mad: Fix possible lock-lock-timer deadlock

Lockdep reported a possible deadlock with cm_id_priv->lock,
mad_agent_priv->lock and mad_agent_priv->timed_work.timer; this
happens because the mad module does

cancel_delayed_work(&mad_agent_priv->timed_work);

while holding mad_agent_priv->lock.  cancel_delayed_work() internally
does del_timer_sync(&mad_agent_priv->timed_work.timer).

This can turn into a deadlock because mad_agent_priv->lock is taken
inside cm_id_priv->lock, so we can get the following set of contexts
that deadlock each other:

 A: holding cm_id_priv->lock, waiting for mad_agent_priv->lock
 B: holding mad_agent_priv->lock, waiting for del_timer_sync()
 C: interrupt during mad_agent_priv->timed_work.timer that takes
    cm_id_priv->lock

Fix this by using the new __cancel_delayed_work() interface (which
internally does del_timer() instead of del_timer_sync()) in all the
places where we are holding a lock.

Addresses: http://bugzilla.kernel.org/show_bug.cgi?id=13757
Reported-by: Bart Van Assche <bart.vanassche@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoALSA: Remove unneeded ifdef from sound/core.h
Takashi Iwai [Mon, 7 Sep 2009 13:52:30 +0000 (15:52 +0200)]
ALSA: Remove unneeded ifdef from sound/core.h

Remove the old hack that was needed for building alsa-driver modules
externally for old kernels.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: Remove struct snd_monitor_file from public sound/core.h
Takashi Iwai [Mon, 7 Sep 2009 13:50:18 +0000 (15:50 +0200)]
ALSA: Remove struct snd_monitor_file from public sound/core.h

The struct snd_monitor_file is used locally only in sound/core/init.c,
thus it should be moved there from the public sound/core.h.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoKEYS: Fix default security_session_to_parent()
David Howells [Mon, 7 Sep 2009 12:24:17 +0000 (13:24 +0100)]
KEYS: Fix default security_session_to_parent()

Fix the default security_session_to_parent() in linux/security.h to have a
body.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
14 years agoASoC: Remove unuused hw_read_t
Mark Brown [Mon, 7 Sep 2009 11:46:42 +0000 (12:46 +0100)]
ASoC: Remove unuused hw_read_t

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>