pandora-kernel.git
12 years agosignal.c: fix kernel-doc notation
Randy Dunlap [Tue, 14 Jun 2011 22:50:11 +0000 (15:50 -0700)]
signal.c: fix kernel-doc notation

Fix kernel-doc warnings in signal.c:

  Warning(kernel/signal.c:2374): No description found for parameter 'nset'
  Warning(kernel/signal.c:2374): Excess function parameter 'set' description in 'sys_rt_sigprocmask'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'for-linus' of git://git.infradead.org/users/eparis/selinux into for...
James Morris [Tue, 14 Jun 2011 23:41:48 +0000 (09:41 +1000)]
Merge branch 'for-linus' of git://git.infradead.org/users/eparis/selinux into for-linus

12 years agox86 idle: APM requires pm_idle/default_idle unconditionally when a module
Andy Whitcroft [Tue, 14 Jun 2011 19:45:10 +0000 (12:45 -0700)]
x86 idle: APM requires pm_idle/default_idle unconditionally when a module

[ Also from Ben Hutchings <ben@decadent.org.uk> and Vitaliy Ivanov
  <vitalivanov@gmail.com> ]

Commit 06ae40ce073d ("x86 idle: EXPORT_SYMBOL(default_idle, pm_idle)
only when APM demands it") removed the export for pm_idle/default_idle
unless the apm module was modularised and CONFIG_APM_CPU_IDLE was set.

But the apm module uses pm_idle/default_idle unconditionally,
CONFIG_APM_CPU_IDLE only affects the bios idle threshold.  Adjust the
export accordingly.

[ Used #ifdef instead of #if defined() as it's shorter, and what both
  Ben and Vitaliy used.. Andy, you're out-voted ;)    - Linus ]

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'for-linus-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg...
Linus Torvalds [Tue, 14 Jun 2011 18:28:54 +0000 (11:28 -0700)]
Merge branch 'for-linus-fixes' of git://git./linux/kernel/git/gerg/m68knommu

* 'for-linus-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
  m68k: use kernel processor defines for conditional optimizations
  m68knommu: create config options for CPU classes
  m68knommu: fix linker script exported name sections

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Tue, 14 Jun 2011 18:28:38 +0000 (11:28 -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:
  TOMOYO: Fix oops in tomoyo_mount_acl().

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt...
Linus Torvalds [Tue, 14 Jun 2011 18:25:56 +0000 (11:25 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/egtvedt/avr32-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/avr32-2.6:
  avr32, exec: remove redundant set_fs(USER_DS)
  avr32: make intc_resume() return void to conform to syscore_ops
  avr32: add some more at91 to cpu.h definition
  avr32: set CONFIG_CC_OPTIMIZE_FOR_SIZE=y for all defconfigs
  avr32/at32ap: fix mapping of platform device id for USART
  avr32: fix use of non-existing portnr variable in at32_map_usart()

12 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Tue, 14 Jun 2011 18:25:32 +0000 (11:25 -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: Compare only lower 32 bits of framebuffer map offsets
  drm/i915: Don't leak in i915_gem_shmem_pread_slow()
  drm/radeon/kms: do bounds checking for 3D_LOAD_VBPNTR and bump array limit
  drm/radeon/kms: fix mac g5 quirk
  x86/uv/x2apic: update for change in pci bridge handling.
  alpha, drm: Remove obsolete Alpha support in MGA DRM code
  alpha/drm: Cleanup Alpha support in DRM generic code
  savage: remove unnecessary if statement
  drm/radeon: fix GUI idle IH debug statements
  drm/radeon/kms: check modes against max pixel clock
  drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Tue, 14 Jun 2011 18:24:40 +0000 (11:24 -0700)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] update cifs version to 1.73
  [CIFS] trivial cleanup fscache cFYI and cERROR messages
  cifs: correctly handle NULL tcon pointer in CIFSTCon
  cifs: show sec= option in /proc/mounts
  cifs: don't allow cifs_reconnect to exit with NULL socket pointer
  CIFS: Fix sparse error

12 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Tue, 14 Jun 2011 18:21:21 +0000 (11:21 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md:
  md/raid5: remove unusual use of bio_iovec_idx()
  md/raid5: fix FUA request handling in ops_run_io()
  md/raid5: fix raid5_set_bi_hw_segments
  md:Documentation/md.txt - fix typo
  md/bitmap: remove unused fields from struct bitmap
  md/bitmap: use proper accessor macro
  md: check ->hot_remove_disk when removing disk
  md: Using poll  /proc/mdstat can monitor the events of adding a spare disks
  MD: use is_power_of_2 macro
  MD: raid5 do not set fullsync
  MD: support initial bitmap creation in-kernel
  MD: add sync_super to mddev_t struct
  MD: raid1 changes to allow use by device mapper
  MD: move thread wakeups into resume
  MD: possible typo
  MD: no sync IO while suspended
  MD: no integrity register if no gendisk

12 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Tue, 14 Jun 2011 18:19:27 +0000 (11:19 -0700)]
Merge branch 'fixes' of git://git./linux/kernel/git/davej/cpufreq

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Remove cpufreq_stats sysfs entries on module unload.
  MAINTAINERS: Update CPU FREQUENCY patterns

12 years agoSELinux: skip file_name_trans_write() when policy downgraded.
Roy.Li [Fri, 20 May 2011 02:38:06 +0000 (10:38 +0800)]
SELinux: skip file_name_trans_write() when policy downgraded.

When policy version is less than POLICYDB_VERSION_FILENAME_TRANS,
skip file_name_trans_write().

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
12 years ago[CIFS] update cifs version to 1.73
Steve French [Tue, 14 Jun 2011 16:19:54 +0000 (16:19 +0000)]
[CIFS] update cifs version to 1.73

Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years ago[CIFS] trivial cleanup fscache cFYI and cERROR messages
Steve French [Tue, 14 Jun 2011 15:51:18 +0000 (15:51 +0000)]
[CIFS] trivial cleanup fscache cFYI and cERROR messages

... for uniformity and cleaner debug logs.

Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoavr32, exec: remove redundant set_fs(USER_DS)
Mathias Krause [Fri, 10 Jun 2011 13:09:05 +0000 (15:09 +0200)]
avr32, exec: remove redundant set_fs(USER_DS)

The address limit is already set in flush_old_exec() so this
set_fs(USER_DS) is redundant.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
12 years agoavr32: make intc_resume() return void to conform to syscore_ops
Hans-Christian Egtvedt [Mon, 6 Jun 2011 16:19:20 +0000 (18:19 +0200)]
avr32: make intc_resume() return void to conform to syscore_ops

This patch removes the unneeded, and now wrong, return 0 from intc_resume() and
lets the function return void instead. This matches the resume callback in
struct syscore_ops.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
12 years agoavr32: add some more at91 to cpu.h definition
Nicolas Ferre [Sat, 14 May 2011 22:23:32 +0000 (00:23 +0200)]
avr32: add some more at91 to cpu.h definition

Somme common drivers will need those at91 cpu_is_xxx() definitions.
Those definitions are already in Linus' tree so if we want to use them
in common drivers, we will need them in AVR32 cpu.h file.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
12 years agoavr32: set CONFIG_CC_OPTIMIZE_FOR_SIZE=y for all defconfigs
Hans-Christian Egtvedt [Wed, 1 Jun 2011 13:10:49 +0000 (15:10 +0200)]
avr32: set CONFIG_CC_OPTIMIZE_FOR_SIZE=y for all defconfigs

This patch makes sure the kconfig option CC_OPTIMIZE_FOR_SIZE is set to yes for
all default configuration files. This ensures the kernel is optimized for size,
and avoids potential relocation truncated to fit problems.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
12 years agoavr32/at32ap: fix mapping of platform device id for USART
Hans-Christian Egtvedt [Wed, 8 Jun 2011 08:47:25 +0000 (10:47 +0200)]
avr32/at32ap: fix mapping of platform device id for USART

This patch will fix the mapping of the platform device id when mapping USART
peripheral ID to UART platform device id. Not setting the platform device id
will in most cases (when you map USART > 0 to UART 0) make the console not
available.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
12 years agoavr32: fix use of non-existing portnr variable in at32_map_usart()
Hans-Christian Egtvedt [Wed, 1 Jun 2011 09:08:01 +0000 (11:08 +0200)]
avr32: fix use of non-existing portnr variable in at32_map_usart()

This patch fixes the use of the non-existing portnr variable in
at32_map_usart() to use the provided line number instead. Typo was introduced
in commit 2b348e2f82f532e3aff8e0ce9293033b3294c1e0.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
12 years agofbdev/atyfb: Fix 2 defined-but-not-used warnings
Geert Uytterhoeven [Mon, 13 Jun 2011 18:12:58 +0000 (18:12 +0000)]
fbdev/atyfb: Fix 2 defined-but-not-used warnings

If CONFIG_FB_ATY_BACKLIGHT=y but CONFIG_PCI=n:

drivers/video/aty/atyfb_base.c:2272: warning: ‘aty_bl_exit’ defined but not used

If CONFIG_ATARI=y for a modular build:

drivers/video/aty/atyfb_base.c:2794: warning: ‘store_video_par’ defined but not
used

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agoefifb: Fix call to wrong unregister function
Wanlong Gao [Sun, 12 Jun 2011 10:52:33 +0000 (10:52 +0000)]
efifb: Fix call to wrong unregister function

platform_device_unregister() needs to unregister the device, not the
driver.

Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Acked-by: Andy Lutomirski <luto@mit.edu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agosh, exec: remove redundant set_fs(USER_DS)
Mathias Krause [Fri, 10 Jun 2011 13:10:48 +0000 (13:10 +0000)]
sh, exec: remove redundant set_fs(USER_DS)

The address limit is already set in flush_old_exec() so those calls to
set_fs(USER_DS) are redundant.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
Paul Mundt [Tue, 14 Jun 2011 06:15:49 +0000 (15:15 +0900)]
Merge branch 'master' of git://git./linux/kernel/git/torvalds/linux-2.6 into sh-fixes-for-linus

12 years agodrivers: sh: resume enabled clocks fix
Magnus Damm [Mon, 13 Jun 2011 04:42:15 +0000 (04:42 +0000)]
drivers: sh: resume enabled clocks fix

Extend the SH / SH-Mobile ARM clock framework to only
resume clocks that have been enabled.

Without this fix divide-by-zero is triggering on sh7372
FSIDIV during system wide resume of Suspend-to-RAM.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agoARM: mach-shmobile: Correct SCIF port types for SH7367.
Paul Mundt [Tue, 14 Jun 2011 06:07:06 +0000 (15:07 +0900)]
ARM: mach-shmobile: Correct SCIF port types for SH7367.

While SH7377 and others were updated to properly use SCIFA/B port types,
SH7367 was left behind. Fix it up accordingly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agoARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix
Magnus Damm [Thu, 9 Jun 2011 06:20:03 +0000 (06:20 +0000)]
ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix

Initialize ->irq_set_wake() in gic_arch_extn to unbreak wake
up from the KEYSC device on AG5EVM in case of Suspend-to-RAM.

Without this patch "echo mem > /sys/power/state" and a key
press results in the following message on resume:

WARNING: at kernel/irq/manage.c:507 irq_set_irq_wake+0x7c/0xd8()
Unbalanced IRQ 103 wake disable

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agoARM: mach-shmobile: Mackerel USB platform data update
Magnus Damm [Thu, 9 Jun 2011 07:03:37 +0000 (07:03 +0000)]
ARM: mach-shmobile: Mackerel USB platform data update

This patch updates the board specific USB support
code for the sh7372 Mackerel board.

With this patch applied port CN22 is driven by the
recently added renesas_usbhs driver using the first
USB controller included in sh7372 aka USBHS0.

Hotplugging of USBHS0 unfortunately has to be
handled by software polling. The sh7372 SoC itself
obviously supports hotplug notification by IRQ but
on the Mackerel board this IRQ happens to be used
for the touch screen.

Also fix the pinmux configuration to avoid setting
up unused pins and fix minor spelling errors.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agoARM: mach-shmobile: AG5EVM SDHI1 platform data update
Magnus Damm [Thu, 9 Jun 2011 09:02:25 +0000 (09:02 +0000)]
ARM: mach-shmobile: AG5EVM SDHI1 platform data update

Add a flag for SDHI1 to enable SDIO IRQ, and remove DMA Engine
slave id:s to disable DMA as a workaround.

Tested on sh73a0/AG5EVM with a BCM4318-based SDIO card.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agodmaengine: shdma: SH_DMAC_MAX_CHANNELS message fix
Magnus Damm [Thu, 9 Jun 2011 06:35:08 +0000 (06:35 +0000)]
dmaengine: shdma: SH_DMAC_MAX_CHANNELS message fix

Fix the recently added SH_DMAC_MAX_CHANNELS handling code in
300e5f9 dmaengine: shdma: Fix SH_DMAC_MAX_CHANNELS handling

Without this fix the shdma driver outputs silly messages in
case SH_DMAC_MAX_CHANNELS happens to match the platform data:

sh-dma-engine sh-dma-engine.0: Attempting to register 20 DMA channels when a max
imum of 20 are supported.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 years agoTOMOYO: Fix oops in tomoyo_mount_acl().
Tetsuo Handa [Mon, 13 Jun 2011 04:49:11 +0000 (13:49 +0900)]
TOMOYO: Fix oops in tomoyo_mount_acl().

In tomoyo_mount_acl() since 2.6.36, kern_path() was called without checking
dev_name != NULL. As a result, an unprivileged user can trigger oops by issuing
mount(NULL, "/", "ext3", 0, NULL) request.
Fix this by checking dev_name != NULL before calling kern_path(dev_name).

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: stable@kernel.org
Signed-off-by: James Morris <jmorris@namei.org>
12 years agomd/raid5: remove unusual use of bio_iovec_idx()
Namhyung Kim [Tue, 14 Jun 2011 04:23:57 +0000 (14:23 +1000)]
md/raid5: remove unusual use of bio_iovec_idx()

In the bio_for_each_segment loop, bvl always points current
bio_vec, so the same as bio_iovec_idx(, i). Let's get rid of
it.

Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid5: fix FUA request handling in ops_run_io()
Namhyung Kim [Tue, 14 Jun 2011 04:20:19 +0000 (14:20 +1000)]
md/raid5: fix FUA request handling in ops_run_io()

Commit e9c7469bb4f5 ("md: implment REQ_FLUSH/FUA support")
introduced R5_WantFUA flag and set rw to WRITE_FUA in that case.
However remaining code still checks whether rw is exactly same
as WRITE or not, so FUAed-write ends up with being treated as
READ. Fix it.

This bug has been present since 2.6.37 and the fix is suitable for any
-stable kernel since then.  It is not clear why this has not caused
more problems.

Cc: Tejun Heo <tj@kernel.org>
Cc: stable@kernel.org
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid5: fix raid5_set_bi_hw_segments
Namhyung Kim [Mon, 13 Jun 2011 05:48:22 +0000 (14:48 +0900)]
md/raid5: fix raid5_set_bi_hw_segments

The @bio->bi_phys_segments consists of active stripes count in the
lower 16 bits and processed stripes count in the upper 16 bits. So
logical-OR operator should be bitwise one.

This bug has been present since 2.6.27 and the fix is suitable for any
-stable kernel since then.  Fortunately the bad code is only used on
error paths and is relatively unlikely to be hit.

Cc: stable@kernel.org
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agom68k: use kernel processor defines for conditional optimizations
Greg Ungerer [Thu, 2 Jun 2011 06:07:33 +0000 (16:07 +1000)]
m68k: use kernel processor defines for conditional optimizations

Older m68k-linux compilers will include pre-defined symbols that
confuse what processor it is being targeted for. For example gcc-4.1.2
will pre-define __mc68020__ even if you specify the target processor
as -m68000 on the gcc command line. Newer versions of gcc have this
corrected.

In a few places the m68k code uses defined(__mc68020__) for optimizations
that include instructions that are specific to the CPU 68020 and above.
When compiling with older compilers this will be true even when we have
selected to compile for the older 68000 processors.

Switch to using the kernel processor defines, CONFIG_M68020 and friends.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68knommu: create config options for CPU classes
Greg Ungerer [Thu, 2 Jun 2011 05:50:48 +0000 (15:50 +1000)]
m68knommu: create config options for CPU classes

There are 3 families of CPU core types that we support in the m68knommu
architecture branch. They are

. traditional 68000
. CPU32 (a 68020 core derivative without MMU or bitfield instructions)
. ColdFire

It will be useful going forward to have a CONFIG_ option defined for
each type. We already have one for ColdFire (CONFIG_COLDFIRE), so add
for the other 2 families, CONFIG_M68000 and CONFIG_MCPU32.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68knommu: fix linker script exported name sections
Greg Ungerer [Thu, 2 Jun 2011 04:09:32 +0000 (14:09 +1000)]
m68knommu: fix linker script exported name sections

The recent commit titled "module: Sort exported symbols" (f02e8a65)
changed the exported symbol name sections. Bring the m68knommu linker
script into line with those changes - including the sorting of the
symbol names.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agodrm: Compare only lower 32 bits of framebuffer map offsets
Tormod Volden [Mon, 30 May 2011 19:45:43 +0000 (19:45 +0000)]
drm: Compare only lower 32 bits of framebuffer map offsets

Drivers using multiple framebuffers got broken by commit
41c2e75e60200a860a74b7c84a6375c105e7437f which ignored the framebuffer
(or register) map offset when looking for existing maps. The rationale
was that the kernel-userspace ABI is fixed at a 32-bit offset, so the
real offsets could not always be handed over for comparison.

Instead of ignoring the offset we will compare the lower 32 bit. Drivers
using multiple framebuffers should just make sure that the lower 32 bit
are different. The existing drivers in question are practically limited
to 32-bit systems so that should be fine for them.

It is assumed that current drivers always specify a correct framebuffer
map offset, even if this offset was ignored since above commit. So this
patch should not change anything for drivers using only one framebuffer.

Drivers needing multiple framebuffers with 64-bit map offsets will need
to cook up something, for instance keeping an ID in the lower bit which
is to be aligned away when it comes to using the offset.

All of above applies to _DRM_REGISTERS as well.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/i915: Don't leak in i915_gem_shmem_pread_slow()
Jesper Juhl [Sun, 12 Jun 2011 20:53:44 +0000 (20:53 +0000)]
drm/i915: Don't leak in i915_gem_shmem_pread_slow()

It seems to me that we are leaking 'user_pages' in
drivers/gpu/drm/i915/i915_gem.c::i915_gem_shmem_pread_slow() if
read_cache_page_gfp() fails.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: do bounds checking for 3D_LOAD_VBPNTR and bump array limit
Marek Olšák [Fri, 10 Jun 2011 14:41:26 +0000 (14:41 +0000)]
drm/radeon/kms: do bounds checking for 3D_LOAD_VBPNTR and bump array limit

To my knowledge, the limit is 16 on r300.
(the docs don't say what the limit is)

The lack of bounds checking can be abused to do all sorts of things
(from bypassing parts of the CS checker to crashing the kernel).

Bugzilla:
https://bugs.freedesktop.org/show_bug.cgi?id=36745

Cc: stable@kernel.org
Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: fix mac g5 quirk
Alex Deucher [Mon, 6 Jun 2011 16:53:30 +0000 (12:53 -0400)]
drm/radeon/kms: fix mac g5 quirk

Apple uses the same subsystem pci ids for lots of
hardware much of which is wired up differently.  In
this case, the G5 imac and the G5 tower.

Only apply the quirk configuration to G5 towers.

Reported-by: Joachim Henke <j-o@users.sourceforge.net>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Joachim Henke <j-o@users.sourceforge.net>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agox86/uv/x2apic: update for change in pci bridge handling.
Dave Airlie [Wed, 25 May 2011 04:00:49 +0000 (14:00 +1000)]
x86/uv/x2apic: update for change in pci bridge handling.

When I added 3448a19da479b6bd1e28e2a2be9fa16c6a6feb39
I forgot about the special uv handling code for this, so this
patch fixes it up.

Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Ingo Molnar
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoalpha, drm: Remove obsolete Alpha support in MGA DRM code
Jay Estabrook [Thu, 9 Jun 2011 22:19:12 +0000 (18:19 -0400)]
alpha, drm: Remove obsolete Alpha support in MGA DRM code

Remove an obsolete Alpha adjustment in the drm for MGA on Alpha.

Signed-off-by: Jay Estabrook <jay.estabrook@gmail.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoalpha/drm: Cleanup Alpha support in DRM generic code
Jay Estabrook [Thu, 9 Jun 2011 22:18:39 +0000 (18:18 -0400)]
alpha/drm: Cleanup Alpha support in DRM generic code

Remove an obsolete Alpha adjustment, and modify another,
to go with the current Alpha architecture support.

Signed-off-by: Jay Estabrook <jay.estabrook@gmail.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agosavage: remove unnecessary if statement
Greg Dietsche [Mon, 13 Jun 2011 14:40:38 +0000 (09:40 -0500)]
savage: remove unnecessary if statement

the code always returns ret regardless, so if(ret) check is unnecessary.

v2: fixed up the spelling.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Reviewed-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoLinux 3.0-rc3 v3.0-rc3
Linus Torvalds [Mon, 13 Jun 2011 22:29:59 +0000 (15:29 -0700)]
Linux 3.0-rc3

12 years agocifs: correctly handle NULL tcon pointer in CIFSTCon
Jeff Layton [Sun, 12 Jun 2011 01:17:10 +0000 (21:17 -0400)]
cifs: correctly handle NULL tcon pointer in CIFSTCon

Long ago (in commit 00e485b0), I added some code to handle share-level
passwords in CIFSTCon. That code ignored the fact that it's legit to
pass in a NULL tcon pointer when connecting to the IPC$ share on the
server.

This wasn't really a problem until recently as we only called CIFSTCon
this way when the server returned -EREMOTE. With the introduction of
commit c1508ca2 however, it gets called this way on every mount, causing
an oops when share-level security is in effect.

Fix this by simply treating a NULL tcon pointer as if user-level
security were in effect. I'm not aware of any servers that protect the
IPC$ share with a specific password anyway. Also, add a comment to the
top of CIFSTCon to ensure that we don't make the same mistake again.

Cc: <stable@kernel.org>
Reported-by: Martijn Uffing <mp3project@sarijopen.student.utwente.nl>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: show sec= option in /proc/mounts
Jeff Layton [Mon, 13 Jun 2011 15:50:41 +0000 (11:50 -0400)]
cifs: show sec= option in /proc/mounts

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: don't allow cifs_reconnect to exit with NULL socket pointer
Jeff Layton [Fri, 10 Jun 2011 20:14:57 +0000 (16:14 -0400)]
cifs: don't allow cifs_reconnect to exit with NULL socket pointer

It's possible for the following set of events to happen:

cifsd calls cifs_reconnect which reconnects the socket. A userspace
process then calls cifs_negotiate_protocol to handle the NEGOTIATE and
gets a reply. But, while processing the reply, cifsd calls
cifs_reconnect again.  Eventually the GlobalMid_Lock is dropped and the
reply from the earlier NEGOTIATE completes and the tcpStatus is set to
CifsGood. cifs_reconnect then goes through and closes the socket and sets the
pointer to zero, but because the status is now CifsGood, the new socket
is not created and cifs_reconnect exits with the socket pointer set to
NULL.

Fix this by only setting the tcpStatus to CifsGood if the tcpStatus is
CifsNeedNegotiate, and by making sure that generic_ip_connect is always
called at least once in cifs_reconnect.

Note that this is not a perfect fix for this issue. It's still possible
that the NEGOTIATE reply is handled after the socket has been closed and
reconnected. In that case, the socket state will look correct but it no
NEGOTIATE was performed on it be for the wrong socket. In that situation
though the server should just shut down the socket on the next attempted
send, rather than causing the oops that occurs today.

Cc: <stable@kernel.org> # .38.x: fd88ce9: [CIFS] cifs: clarify the meaning of tcpStatus == CifsGood
Reported-and-Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Fix sparse error
Pavel Shilovsky [Thu, 9 Jun 2011 08:58:53 +0000 (12:58 +0400)]
CIFS: Fix sparse error

cifs_sb_master_tlink was declared as inline, but without a definition.
Remove the declaration and move the definition up.

Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
Linus Torvalds [Mon, 13 Jun 2011 20:00:53 +0000 (13:00 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/penberg/slab-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  SLAB: Record actual last user of freed objects.
  slub: always align cpu_slab to honor cmpxchg_double requirement

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Mon, 13 Jun 2011 18:21:50 +0000 (11:21 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: unwind canceled flock state
  ceph: fix ENOENT logic in striped_read
  ceph: fix short sync reads from the OSD
  ceph: fix sync vs canceled write
  ceph: use ihold when we already have an inode ref

12 years agoMerge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 13 Jun 2011 17:47:04 +0000 (10:47 -0700)]
Merge branch 'timers-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  rtc: Staticize non-exported __rtc_set_alarm()
  rtc: Fix ioctl error path return
  ptp: Fix some locking bugs in ptp_read()
  ptp: Return -EFAULT on copy_to_user() errors

12 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 13 Jun 2011 17:45:49 +0000 (10:45 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ftrace: Revert 8ab2b7efd ftrace: Remove unnecessary disabling of irqs
  kprobes/trace: Fix kprobe selftest for gcc 4.6
  ftrace: Fix possible undefined return code
  oprofile, dcookies: Fix possible circular locking dependency
  oprofile: Fix locking dependency in sync_start()
  oprofile: Free potentially owned tasks in case of errors
  oprofile, x86: Add comments to IBS LVT offset initialization

12 years agoMerge branches 'x86-urgent-for-linus' and 'irq-urgent-for-linus' of git://git.kernel...
Linus Torvalds [Mon, 13 Jun 2011 17:45:10 +0000 (10:45 -0700)]
Merge branches 'x86-urgent-for-linus' and 'irq-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: devicetree: Add missing early_init_dt_setup_initrd_arch stub
  x86: cpu-hotplug: Prevent softirq wakeup on wrong CPU

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: Prevent potential NULL dereference in irq_set_irq_wake()

12 years agoMerge branch 'spi/merge' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Mon, 13 Jun 2011 17:33:31 +0000 (10:33 -0700)]
Merge branch 'spi/merge' of git://git.secretlab.ca/git/linux-2.6

* 'spi/merge' of git://git.secretlab.ca/git/linux-2.6:
  spi-pl022: Add missing return value update

12 years agoMerge branch 's5p-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 13 Jun 2011 17:32:53 +0000 (10:32 -0700)]
Merge branch 's5p-fixes-for-linus' of git://git./linux/kernel/git/kgene/linux-samsung

* 's5p-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
  ARM: S3C2410: remove the now empty mach-s3c2410/irq.c
  ARM: S3C24XX: Move s3c24xx_irq_syscore_ops to plat-s3c24xx/irq.c
  ARM: S3C24xx: Fix missing struct for s3c2410_dma_chan
  ARM: SAMSUNG: Remove unused onenand plat functions
  ARM: EXYNOS4: Remove compiler warning on exynos4_pwm4_resume
  ARM: S5P: Fix compilation error for exynos4_defconfig
  ARM: S5P: Should be S3C_VA_USB_HSPHY instead of S5P_VA_XX
  ARM: S5P64X0: Fix SPI platform device name
  ARM: S5PV210: Fix possible null pointer dereference

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
Linus Torvalds [Mon, 13 Jun 2011 17:32:24 +0000 (10:32 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ryusuke/nilfs2

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
  nilfs2: fix problem in setting checkpoint interval
  nilfs2: fix missing block address termination in btree node shrinking
  nilfs2: fix incorrect block address termination in node concatenation

12 years agospi-pl022: Add missing return value update
Virupax Sadashivpetimath [Mon, 13 Jun 2011 10:53:46 +0000 (16:23 +0530)]
spi-pl022: Add missing return value update

Return error on out of range cpsdvsr value.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoDelay struct net freeing while there's a sysfs instance refering to it
Al Viro [Thu, 9 Jun 2011 01:13:01 +0000 (21:13 -0400)]
Delay struct net freeing while there's a sysfs instance refering to it

* new refcount in struct net, controlling actual freeing of the memory
* new method in kobj_ns_type_operations (->drop_ns())
* ->current_ns() semantics change - it's supposed to be followed by
corresponding ->drop_ns().  For struct net in case of CONFIG_NET_NS it bumps
the new refcount; net_drop_ns() decrements it and calls net_free() if the
last reference has been dropped.  Method renamed to ->grab_current_ns().
* old net_free() callers call net_drop_ns() instead.
* sysfs_exit_ns() is gone, along with a large part of callchain
leading to it; now that the references stored in ->ns[...] stay valid we
do not need to hunt them down and replace them with NULL.  That fixes
problems in sysfs_lookup() and sysfs_readdir(), along with getting rid
of sb->s_instances abuse.

Note that struct net *shutdown* logics has not changed - net_cleanup()
is called exactly when it used to be called.  The only thing postponed by
having a sysfs instance refering to that struct net is actual freeing of
memory occupied by struct net.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoafs: fix sget() races, close leak on umount
Al Viro [Sun, 12 Jun 2011 20:01:21 +0000 (16:01 -0400)]
afs: fix sget() races, close leak on umount

* set ->s_fs_info in set() callback passed to sget()
* allocate the thing and set it up enough for afs_test_super() before
making it visible
* have it freed in ->kill_sb() (current tree simply leaks it)
* have ->put_super() leave ->s_fs_info->volume alone; it's too early for
dropping it; do that from ->kill_sb() after having called kill_anon_super().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoubifs: fix sget races
Al Viro [Sun, 12 Jun 2011 14:24:33 +0000 (10:24 -0400)]
ubifs: fix sget races

* allocate ubifs_info in ->mount(), fill it enough for sb_test() and
set ->s_fs_info to it in set() callback passed to sget().
* do *not* free it in ->put_super(); do that in ->kill_sb() after we'd
done kill_anon_super().
* don't free it in ubifs_fill_super() either - deactivate_locked_super()
done by caller when ubifs_fill_super() returns an error will take care
of that sucker.
* get rid of kludge with passing ubi to ubifs_fill_super() in ->s_fs_info;
we only need it in alloc_ubifs_info(), so ubifs_fill_super() will need
only ubifs_info.  Which it will find in ->s_fs_info just fine, no need to
reassign anything...

As the result, sb_test() becomes safe to apply to all superblocks that
can be found by sget() (and a kludge with temporary use of ->s_fs_info
to store a pointer to very different structure goes away).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoubifs: split allocation of ubifs_info into a separate function
Al Viro [Sun, 12 Jun 2011 14:07:03 +0000 (10:07 -0400)]
ubifs: split allocation of ubifs_info into a separate function

preparation to ubifs sget() race fixes

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agofix leak in proc_set_super()
Al Viro [Sun, 12 Jun 2011 13:42:17 +0000 (09:42 -0400)]
fix leak in proc_set_super()

set_anon_super() can fail...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years ago[CPUFREQ] Remove cpufreq_stats sysfs entries on module unload.
Dave Jones [Sun, 12 Jun 2011 20:35:28 +0000 (16:35 -0400)]
[CPUFREQ] Remove cpufreq_stats sysfs entries on module unload.

cpufreq_stats leaves behind its sysfs entries, which causes a panic
when something stumbled across them.
(Discovered by unloading cpufreq_stats while powertop was loaded).

Signed-off-by: Dave Jones <davej@redhat.com>
Cc: stable@kernel.org
12 years agoMAINTAINERS: Update CPU FREQUENCY patterns
Joe Perches [Wed, 1 Jun 2011 17:59:10 +0000 (10:59 -0700)]
MAINTAINERS: Update CPU FREQUENCY patterns

Commit bb0a56ecc4ba ("[CPUFREQ] Move x86 drivers to drivers/cpufreq/")
moved the files, remove the old pattern.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dave Jones <davej@redhat.com>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
Linus Torvalds [Sun, 12 Jun 2011 18:06:36 +0000 (11:06 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/btrfs-unstable

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: use join_transaction in btrfs_evict_inode()
  Btrfs - use %pU to print fsid
  Btrfs: fix extent state leak on failed nodatasum reads
  btrfs: fix unlocked access of delalloc_inodes
  Btrfs: avoid stack bloat in btrfs_ioctl_fs_info()
  btrfs: remove 64bit alignment padding to allow extent_buffer to fit into one fewer cacheline
  Btrfs: clear current->journal_info on async transaction commit
  Btrfs: make sure to recheck for bitmaps in clusters
  btrfs: remove unneeded includes from scrub.c
  btrfs: reinitialize scrub workers
  btrfs: scrub: errors in tree enumeration
  Btrfs: don't map extent buffer if path->skip_locking is set
  Btrfs: unlock the trans lock properly
  Btrfs: don't map extent buffer if path->skip_locking is set
  Btrfs: fix duplicate checking logic
  Btrfs: fix the allocator loop logic
  Btrfs: fix bitmap regression
  Btrfs: don't commit the transaction if we dont have enough pinned bytes
  Btrfs: noinline the cluster searching functions
  Btrfs: cache bitmaps when searching for a cluster

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Sun, 12 Jun 2011 18:04:25 +0000 (11:04 -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:
  ALSA: hda: Fix inaudible internal speakers on CyberpowerPC Gamer Xplorer N57001 laptop
  ALSA: Use %pV for snd_printk()
  ALSA: hda - Fix initialization of hp pins with master_mute in Realtek
  ALSA: hda - Fix invalid unsol tag for some alc262 model quirks
  ASoC: SAMSUNG: Fix the incorrect referencing of I2SCON register
  ASoC: snd_soc_new_{mixer,mux,pga} make sure to use right DAPM context
  ASoC: fsl: fix initialization of DMA buffers
  ASoC: WM8804 does not support sample rates below 32kHz
  ASoC: Fix WM8962 headphone volume update for use of advanced caches
  ASoC: Blackfin: bf5xx-ad1836: Fix codec device name
  ALSA: hda: Fix quirk for Dell Inspiron 910
  ASoC: AD1836: Fix setting the PCM format
  ASoC: Check for NULL register bank in snd_soc_get_cache_val()
  ASoC: Add missing break in WM8915 FLL source selection
  ASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK
  ASoC: atmel_ssc: Don't try to free ssc if request failed

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
Linus Torvalds [Sun, 12 Jun 2011 18:04:11 +0000 (11:04 -0700)]
Merge git://git./linux/kernel/git/davem/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
  ide-cd: signedness warning fix again

12 years agoMerge branch 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Sun, 12 Jun 2011 18:03:29 +0000 (11:03 -0700)]
Merge branch 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6

* 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6:
  gpio/basic_mmio: add missing include of spinlock_types.h
  gpio/nomadik: fix sleepmode for elder Nomadik

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Sun, 12 Jun 2011 18:03:08 +0000 (11:03 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (55 commits)
  ISDN, hfcsusb: Don't leak in hfcsusb_ph_info()
  netpoll: call dev_put() on error in netpoll_setup()
  net: ep93xx_eth: fix DMA API violations
  net: ep93xx_eth: drop GFP_DMA from call to dma_alloc_coherent()
  net: ep93xx_eth: allocate buffers using kmalloc()
  net: ep93xx_eth: pass struct device to DMA API functions
  ep93xx: set DMA masks for the ep93xx_eth
  vlan: Fix the ingress VLAN_FLAG_REORDER_HDR check
  dl2k: EEPROM CRC calculation wrong endianess on bigendian machine
  NET: am79c961: fix assembler warnings
  NET: am79c961: ensure multicast filter is correctly set at open
  NET: am79c961: ensure asm() statements are marked volatile
  ethtool.h: fix typos
  ep93xx_eth: Update MAINTAINERS
  ipv4: Fix packet size calculation for raw IPsec packets in __ip_append_data
  netpoll: prevent netpoll setup on slave devices
  net: pmtu_expires fixes
  gianfar:localized filer table
  iwlegacy: fix channel switch locking
  mac80211: fix IBSS teardown race
  ...

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Sun, 12 Jun 2011 02:56:25 +0000 (19:56 -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:
  AppArmor: Fix sleep in invalid context from task_setrlimit

12 years agoISDN, hfcsusb: Don't leak in hfcsusb_ph_info()
Jesper Juhl [Sat, 11 Jun 2011 06:36:42 +0000 (06:36 +0000)]
ISDN, hfcsusb: Don't leak in hfcsusb_ph_info()

We leak the memory allocated to 'phi' when the variable goes out of scope
in hfcsusb_ph_info().

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetpoll: call dev_put() on error in netpoll_setup()
Dan Carpenter [Sun, 12 Jun 2011 01:55:22 +0000 (18:55 -0700)]
netpoll: call dev_put() on error in netpoll_setup()

There is a dev_put(ndev) missing on an error path.  This was
introduced in 0c1ad04aecb "netpoll: prevent netpoll setup on slave
devices".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: ep93xx_eth: fix DMA API violations
Mika Westerberg [Sat, 11 Jun 2011 08:39:58 +0000 (08:39 +0000)]
net: ep93xx_eth: fix DMA API violations

Russell King said:
>
> So, to summarize what its doing:
>
> 1. It allocates buffers for rx and tx.
> 2. It maps them with dma_map_single().
>       This transfers ownership of the buffer to the DMA device.
> 3. In ep93xx_xmit,
> 3a. It copies the data into the buffer with skb_copy_and_csum_dev()
>       This violates the DMA buffer ownership rules - the CPU should
>       not be writing to this buffer while it is (in principle) owned
>       by the DMA device.
> 3b. It then calls dma_sync_single_for_cpu() for the buffer.
>       This transfers ownership of the buffer to the CPU, which surely
>       is the wrong direction.
> 4. In ep93xx_rx,
> 4a. It calls dma_sync_single_for_cpu() for the buffer.
>       This at least transfers the DMA buffer ownership to the CPU
>       before the CPU reads the buffer
> 4b. It then uses skb_copy_to_linear_data() to copy the data out.
>       At no point does it transfer ownership back to the DMA device.
> 5. When the driver is removed, it dma_unmap_single()'s the buffer.
>       This transfers ownership of the buffer to the CPU.
> 6. It frees the buffer.
>
> While it may work on ep93xx, it's not respecting the DMA API rules,
> and with DMA debugging enabled it will probably encounter quite a few
> warnings.

This patch fixes these violations.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Petr Stetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: ep93xx_eth: drop GFP_DMA from call to dma_alloc_coherent()
Mika Westerberg [Sat, 11 Jun 2011 08:39:57 +0000 (08:39 +0000)]
net: ep93xx_eth: drop GFP_DMA from call to dma_alloc_coherent()

Commit a197b59ae6e8 (mm: fail GFP_DMA allocations when ZONE_DMA is not
configured) made page allocator to return NULL if GFP_DMA is set but
CONFIG_ZONE_DMA is disabled.

This causes ep93xx_eth to fail:

 WARNING: at mm/page_alloc.c:2251 __alloc_pages_nodemask+0x11c/0x638()
 Modules linked in:
 [<c0035498>] (unwind_backtrace+0x0/0xf4) from [<c0043da4>] (warn_slowpath_common+0x48/0x60)
 [<c0043da4>] (warn_slowpath_common+0x48/0x60) from [<c0043dd8>] (warn_slowpath_null+0x1c/0x24)
 [<c0043dd8>] (warn_slowpath_null+0x1c/0x24) from [<c0083b6c>] (__alloc_pages_nodemask+0x11c/0x638)
 [<c0083b6c>] (__alloc_pages_nodemask+0x11c/0x638) from [<c00366fc>] (__dma_alloc+0x8c/0x3ec)
 [<c00366fc>] (__dma_alloc+0x8c/0x3ec) from [<c0036adc>] (dma_alloc_coherent+0x54/0x60)
 [<c0036adc>] (dma_alloc_coherent+0x54/0x60) from [<c0227808>] (ep93xx_open+0x20/0x864)
 [<c0227808>] (ep93xx_open+0x20/0x864) from [<c0283144>] (__dev_open+0xb8/0x108)
 [<c0283144>] (__dev_open+0xb8/0x108) from [<c0280528>] (__dev_change_flags+0x70/0x128)
 [<c0280528>] (__dev_change_flags+0x70/0x128) from [<c0283054>] (dev_change_flags+0x10/0x48)
 [<c0283054>] (dev_change_flags+0x10/0x48) from [<c001a720>] (ip_auto_config+0x190/0xf68)
 [<c001a720>] (ip_auto_config+0x190/0xf68) from [<c00233b0>] (do_one_initcall+0x34/0x18c)
 [<c00233b0>] (do_one_initcall+0x34/0x18c) from [<c0008400>] (kernel_init+0x94/0x134)
 [<c0008400>] (kernel_init+0x94/0x134) from [<c0030858>] (kernel_thread_exit+0x0/0x8)

Since there is no restrictions for DMA on ep93xx, we can fix this by just
removing the GFP_DMA flag from the call.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Petr Stetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: ep93xx_eth: allocate buffers using kmalloc()
Mika Westerberg [Sat, 11 Jun 2011 08:39:56 +0000 (08:39 +0000)]
net: ep93xx_eth: allocate buffers using kmalloc()

We can use simply kmalloc() to allocate the buffers. This also simplifies the
code and allows us to perform DMA sync operations more easily.

Memory is allocated with only GFP_KERNEL since there are no DMA allocation
restrictions on this platform.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Petr Stetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: ep93xx_eth: pass struct device to DMA API functions
Mika Westerberg [Sat, 11 Jun 2011 08:39:55 +0000 (08:39 +0000)]
net: ep93xx_eth: pass struct device to DMA API functions

We shouldn't use NULL for any DMA API functions, unless we are dealing with
ISA or EISA device. So pass correct struct dev pointer to these functions.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoep93xx: set DMA masks for the ep93xx_eth
Mika Westerberg [Sat, 11 Jun 2011 08:39:54 +0000 (08:39 +0000)]
ep93xx: set DMA masks for the ep93xx_eth

Since the driver uses the DMA API, we should pass it valid DMA masks.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Petr Stetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agovlan: Fix the ingress VLAN_FLAG_REORDER_HDR check
Jiri Pirko [Fri, 10 Jun 2011 06:56:58 +0000 (06:56 +0000)]
vlan: Fix the ingress VLAN_FLAG_REORDER_HDR check

Testing of VLAN_FLAG_REORDER_HDR does not belong in vlan_untag
but rather in vlan_do_receive.  Otherwise the vlan header
will not be properly put on the packet in the case of
vlan header accelleration.

As we remove the check from vlan_check_reorder_header
rename it vlan_reorder_header to keep the naming clean.

Fix up the skb->pkt_type early so we don't look at the packet
after adding the vlan tag, which guarantees we don't goof
and look at the wrong field.

Use a simple if statement instead of a complicated switch
statement to decided that we need to increment rx_stats
for a multicast packet.

Hopefully at somepoint we will just declare the case where
VLAN_FLAG_REORDER_HDR is cleared as unsupported and remove
the code.  Until then this keeps it working correctly.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Acked-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodl2k: EEPROM CRC calculation wrong endianess on bigendian machine
Daniel Hellstrom [Fri, 10 Jun 2011 04:55:16 +0000 (04:55 +0000)]
dl2k: EEPROM CRC calculation wrong endianess on bigendian machine

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoNET: am79c961: fix assembler warnings
Russell King - ARM Linux [Fri, 10 Jun 2011 00:52:35 +0000 (00:52 +0000)]
NET: am79c961: fix assembler warnings

Fix:
/tmp/ccvoZ6h8.s: Assembler messages:
/tmp/ccvoZ6h8.s:284: Warning: register range not in ascending order
/tmp/ccvoZ6h8.s:881: Warning: register range not in ascending order
/tmp/ccvoZ6h8.s:1087: Warning: register range not in ascending order

by ensuring that we have temporary variables placed into specific
registers.  Reorder the code a bit to allow the resulting assembly
to be slightly more optimal.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoNET: am79c961: ensure multicast filter is correctly set at open
Russell King - ARM Linux [Fri, 10 Jun 2011 00:52:14 +0000 (00:52 +0000)]
NET: am79c961: ensure multicast filter is correctly set at open

We were clearing out the multicast filter whenever the interface was
upped, and not setting the mode bits correctly.  This can cause
problems if there are any multicast addresses already set at this
point, or if ALLMULTI was set.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoNET: am79c961: ensure asm() statements are marked volatile
Russell King - ARM Linux [Fri, 10 Jun 2011 00:51:54 +0000 (00:51 +0000)]
NET: am79c961: ensure asm() statements are marked volatile

Without this the compiler can (and does) optimize register reads away
from within loops, and other such optimizations.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoide-cd: signedness warning fix again
Connor Hansen [Sat, 11 Jun 2011 22:06:48 +0000 (15:06 -0700)]
ide-cd: signedness warning fix again

One of the legit warnings 'make W=3 drivers/ide/ide-cd.c'
generates is:
drivers/ide/ide-cd.c: In function ide_cd_do_request
drivers/ide/ide-cd.c:828:2: warning: conversion to int from \
unsigned int may change the sign of the result
drivers/ide/ide-cd.c:833:2: warning: conversion to int from \
unsigned int may change the sign of the result

nsectors is declared int, should be unsigned int.

blk_rq_sectors() returns unsigned int, and ide_complete_rq
expects unsigned int as well.  Fixes both warnings.

Signed-off-by: Connor Hansen <cmdkhh@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agolinux/seqlock.h should #include asm/processor.h for cpu_relax()
David Howells [Sat, 11 Jun 2011 11:29:58 +0000 (12:29 +0100)]
linux/seqlock.h should #include asm/processor.h for cpu_relax()

It uses cpu_relax(), and so needs <asm/processor.h>

Without this patch, I see:

   CC      arch/mn10300/kernel/asm-offsets.s
  In file included from include/linux/time.h:8,
                   from include/linux/timex.h:56,
                   from include/linux/sched.h:57,
                   from arch/mn10300/kernel/asm-offsets.c:7:
  include/linux/seqlock.h: In function 'read_seqbegin':
  include/linux/seqlock.h:91: error: implicit declaration of function 'cpu_relax'

whilst building asb2364_defconfig on MN10300.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoBtrfs: use join_transaction in btrfs_evict_inode()
Li Zefan [Wed, 8 Jun 2011 03:56:44 +0000 (03:56 +0000)]
Btrfs: use join_transaction in btrfs_evict_inode()

The WARN_ON() in start_transaction() was triggered while balancing.

The cause is btrfs_relocate_chunk() started a transaction and
then called iput() on the inode that stores free space cache,
and iput() called btrfs_start_transaction() again.

Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Reviewed-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agonilfs2: fix problem in setting checkpoint interval
Ryusuke Konishi [Thu, 9 Jun 2011 15:33:06 +0000 (00:33 +0900)]
nilfs2: fix problem in setting checkpoint interval

Checkpoint generation interval of nilfs goes wrong after user has
changed the interval parameter with nilfs-tune tool.

 segctord starting. Construction interval = 5 seconds,
 CP frequency < 30 seconds
 segctord starting. Construction interval = 0 seconds,
 CP frequency < 30 seconds

This turned out to be caused by a trivial bug in initialization code
of log writer.  This will fix it.

Reported-by: Andrea Gelmini <andrea.gelmini@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
12 years agonilfs2: fix missing block address termination in btree node shrinking
Ryusuke Konishi [Wed, 25 May 2011 14:00:27 +0000 (23:00 +0900)]
nilfs2: fix missing block address termination in btree node shrinking

nilfs_btree_delete function does not terminate part of virtual block
addresses when shrinking the last remaining child node into the root
node.  The missing address termination causes that dead btree node
blocks persist and chip away free disk space.

This fixes the leak bug on the btree node deletion.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
12 years agonilfs2: fix incorrect block address termination in node concatenation
Ryusuke Konishi [Wed, 25 May 2011 14:00:27 +0000 (23:00 +0900)]
nilfs2: fix incorrect block address termination in node concatenation

nilfs_btree_delete function wrongly terminates virtual block address
of the btree node held by its parent at index 0.  When concatenating
the index-0 node with its right sibling node, nilfs_btree_delete
terminates the block address of index-0 node instead of the right
sibling node which should be deleted.

This bug not only wears disk space in the long run, but also causes
file system corruption.  This will fix it.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
12 years agoARM: footbridge: fix clock event support
Russell King [Fri, 10 Jun 2011 23:46:17 +0000 (00:46 +0100)]
ARM: footbridge: fix clock event support

4e8d7637 (ARM: footbridge: convert to clockevents/clocksource) did
not set the cpumask for the clock event device.  This causes boot
to fail.  Add the necessary initialization.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: footbridge: fix debug macros
Russell King [Fri, 10 Jun 2011 23:44:35 +0000 (00:44 +0100)]
ARM: footbridge: fix debug macros

More of the same of 5f2c1b30 (ARM: footbridge: fix debug macros),
this time for the DC21285-based debugging code rather than the 8250-
based debugging code.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: initrd: disable initrds outside of memory
Russell King [Fri, 10 Jun 2011 23:43:21 +0000 (00:43 +0100)]
ARM: initrd: disable initrds outside of memory

We can't cope with initrds outside of memory, so check that the
initrd is within some declared memory to the kernel before using
it.  Otherwise we're likely to OOPS during boot.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoBtrfs - use %pU to print fsid
Ilya Dryomov [Wed, 9 Feb 2011 14:05:31 +0000 (16:05 +0200)]
Btrfs - use %pU to print fsid

Get rid of FIXME comment.  Uuids from dmesg are now the same as uuids
given by btrfs-progs.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: fix extent state leak on failed nodatasum reads
Jan Schmidt [Wed, 4 May 2011 14:18:50 +0000 (16:18 +0200)]
Btrfs: fix extent state leak on failed nodatasum reads

When encountering an EIO while reading from a nodatasum extent, we
insert an error record into the inode's failure tree.
btrfs_readpage_end_io_hook returns early for nodatasum inodes. We'd
better clear the failure tree in that case, otherwise the kernel
complains about

BUG extent_state: Objects remaining on kmem_cache_close()

on rmmod.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoMerge branch 'for-chris' of git://git.kernel.org/pub/scm/linux/kernel/git/arne/btrfs...
Chris Mason [Fri, 10 Jun 2011 22:58:08 +0000 (18:58 -0400)]
Merge branch 'for-chris' of git://git./linux/kernel/git/arne/btrfs-unstable-arne into for-linus

12 years agobtrfs: fix unlocked access of delalloc_inodes
David Sterba [Thu, 9 Jun 2011 10:02:51 +0000 (10:02 +0000)]
btrfs: fix unlocked access of delalloc_inodes

list_splice_init will make delalloc_inodes empty, but without a spinlock
around, this may produce corrupted list head, accessed in many placess,
The race window is very tight and nobody seems to have hit it so far.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: avoid stack bloat in btrfs_ioctl_fs_info()
Li Zefan [Wed, 8 Jun 2011 08:27:56 +0000 (08:27 +0000)]
Btrfs: avoid stack bloat in btrfs_ioctl_fs_info()

The size of struct btrfs_ioctl_fs_info_args is as big as 1KB, so
don't declare the variable on stack.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Reviewed-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agobtrfs: remove 64bit alignment padding to allow extent_buffer to fit into one fewer...
richard kennedy [Tue, 7 Jun 2011 10:46:32 +0000 (10:46 +0000)]
btrfs: remove 64bit alignment padding to allow extent_buffer to fit into one fewer cacheline

Reorder extent_buffer to remove 8 bytes of alignment padding on 64 bit
builds. This shrinks its size to 128 bytes allowing it to fit into one
fewer cache lines and allows more objects per slab in its kmem_cache.

slabinfo extent_buffer reports :-

 before:-
    Sizes (bytes)     Slabs
    ----------------------------------
    Object :     136  Total  :     123
    SlabObj:     136  Full   :     121
    SlabSiz:    4096  Partial:       0
    Loss   :       0  CpuSlab:       2
    Align  :       8  Objects:      30

 after :-
    Object :     128  Total  :       4
    SlabObj:     128  Full   :       2
    SlabSiz:    4096  Partial:       0
    Loss   :       0  CpuSlab:       2
    Align  :       8  Objects:      32

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clear current->journal_info on async transaction commit
Sage Weil [Fri, 10 Jun 2011 18:43:13 +0000 (18:43 +0000)]
Btrfs: clear current->journal_info on async transaction commit

Normally current->jouranl_info is cleared by commit_transaction.  For an
async snap or subvol creation, though, it runs in a work queue.  Clear
it in btrfs_commit_transaction_async() to avoid leaking a non-NULL
journal_info when we return to userspace.  When the actual commit runs in
the other thread it won't care that it's current->journal_info is already
NULL.

Signed-off-by: Sage Weil <sage@newdream.net>
Tested-by: Jim Schutt <jaschut@sandia.gov>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: make sure to recheck for bitmaps in clusters
Chris Mason [Fri, 10 Jun 2011 20:36:57 +0000 (16:36 -0400)]
Btrfs: make sure to recheck for bitmaps in clusters

Josef recently changed the free extent cache to look in
the block group cluster for any bitmaps before trying to
add a new bitmap for the same offset.  This avoids BUG_ON()s due
covering duplicate ranges.

But it didn't go quite far enough.  A given free range might span
between one or more bitmaps or free space entries.  The code has
looping to cover this, but it doesn't check for clustered bitmaps
every time.

This shuffles our gotos to check for a bitmap in the cluster
for every new bitmap entry we try to add.

Signed-off-by: Chris Mason <chris.mason@oracle.com>