7 years agoALSA: hda - hide HDMI/ELD printks unless snd.debug=2
Fengguang Wu [Tue, 10 Apr 2012 09:00:35 +0000]
ALSA: hda - hide HDMI/ELD printks unless snd.debug=2

Also remove two warnings when CONFIG_SND_DEBUG is not set:

sound/pci/hda/patch_hdmi.c: In function ‘hdmi_intrinsic_event’:
sound/pci/hda/patch_hdmi.c:761:6: warning: unused variable ‘eldv’ [-Wunused-variable]
sound/pci/hda/patch_hdmi.c:760:6: warning: unused variable ‘pd’ [-Wunused-variable]

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: sound/isa/sscape.c: add missing resource-release code
Julia Lawall [Mon, 9 Apr 2012 08:16:35 +0000]
ALSA: sound/isa/sscape.c: add missing resource-release code

At the point of this error-handling code, both regions and the dma have
been allocated, so free it as done in previous and subsequent
error-handling code.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agosound: sound/oss/msnd_pinnacle.c: add vfrees
Julia Lawall [Mon, 9 Apr 2012 08:16:32 +0000]
sound: sound/oss/msnd_pinnacle.c: add vfrees

At the point of this error-handling code, HAVE_DSPCODEH may be undefined,
so free INITCODE and PERMCODE as done elsewhere.  A jump and label are
introduced to avoid code duplication.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS
Stephen Warren [Wed, 18 Apr 2012 14:04:27 +0000]
ASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS

Commit d4a2eca "ASoC: Tegra I2S: Remove dependency on pdev->id" changed
the prototype of tegra_i2s_debug_add, but didn't update the dummy inline
used when !CONFIG_DEBUG_FS. Fix that.

Change-Id: I50d69cc7de3946dfc32e7e6b3e54ae128a46d961
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: <stable@vger.kernel.org> # 3.3

7 years agoASoC: set idle_bias_off=1 for all platform DAPM contexts
Stephen Warren [Thu, 5 Apr 2012 18:28:01 +0000]
ASoC: set idle_bias_off=1 for all platform DAPM contexts

The ASoC core currently defaults to using STANDBY rather than OFF for
idle ASoC platform devices, which causes a permanent pm_runtime_get() on
them. This keeps the device active unnecessarily. This can be especially
problematic when the ASoC platform device and DAI device are the same

The distinction between OFF and STANDBY is likely not relevant for ASoC
platform drivers, since they aren't analog devices. So, solve this issue
by hard-coding idle_bias_off = 1 for all ASoC platform devices. If this
turns out to be a problem, this value could be sourced from the
snd_soc_platform_driver, similarly to soc_probe_codec().

Note: Prior to this change, this caused a large (10) runtime_active count
for the Tegra I2S controller even when not in use, and a leak in that
value as streams were started and stopped. This change probably hides a

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: imx-audmux: Check for NULL pointer
Fabio Estevam [Thu, 5 Apr 2012 13:57:51 +0000]
ASoC: imx-audmux: Check for NULL pointer

Check for NULL pointer before accessing it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: imx-audmux: Fix ssi port numbers in sysfs
Fabio Estevam [Thu, 5 Apr 2012 12:45:51 +0000]
ASoC: imx-audmux: Fix ssi port numbers in sysfs

Doing a 'cat /sys/kernel/debug/audmux/ssi7' causes the following oops to be printed by the kernel:

Uhandled fault: external abort on non-linefetch (0x008) at 0xf53b003c
Internal error: : 8 [#1] PREEMPT
Modules linked in:
CPU: 0    Not tainted  (3.3.0-00033-gecc726e-dirty #307)
PC is at audmux_read_file+0x68/0x2f4
LR is at clk_enable+0x3c/0x48
pc : [<c001b8c8>]   lr : [<c00190a0>]    psr: a0000013
sp : c3ad3f38  ip : c30a4000  fp : 00000003
r10: 00001000  r9 : be83fb00  r8 : c3ad3f80
r7 : c3ad3f80  r6 : 00000007  r5 : 00031010  r4 : c30a5000
r3 : f53b0000  r2 : 0000003c  r1 : 380fa100  r0 : c068dda0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 83034000  DAC: 00000015
Process cat (pid: 1042, stack limit = 0xc3ad2270)
Stack: (0xc3ad3f38 to 0xc3ad4000)
3f20:                                                      c3139180 00000000
3f40: c3bc6500 00001000 be83fb00 c3ad3f80 00001000 c3ad2000 00000000 c0095f3c
3f60: 00000003 c3bc6508 c3bc6500 be83fb00 00000000 00000000 00001000 c0096010
3f80: 00000000 00000000 b6fe2050 00000000 00001000 be83fb00 00000003 00000003
3fa0: c000eb88 c000e9e0 00001000 be83fb00 00000003 be83fb00 00001000 00000000
3fc0: 00001000 be83fb00 00000003 00000003 00000001 00000001 00000000 00000003
3fe0: 000bec8c be83fae0 0000f808 b6ea8d5c 60000010 00000003 7dff7ede 749bedf1
[<c001b8c8>] (audmux_read_file+0x68/0x2f4) from [<c0095f3c>] (vfs_read+0xb0/0x144)
[<c0095f3c>] (vfs_read+0xb0/0x144) from [<c0096010>] (sys_read+0x40/0x70)
[<c0096010>] (sys_read+0x40/0x70) from [<c000e9e0>] (ret_fast_syscall+0x0/0x2c)
Code: e1a02186 e2822004 e3500000 e7935186 (e7937002)
---[ end trace 4d046e31309023de ]---

Fix the ssi port numbers in sysfs to fix this problem.

Reported-by: Joan Carles <joancarles@fqingenieria.es>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: ak4642: fixup: mute needs +1 step
Kuninori Morimoto [Thu, 5 Apr 2012 06:28:01 +0000]
ASoC: ak4642: fixup: mute needs +1 step

ak4642 out_tlv is +12.0dB to -115.0 dB, and it supports mute.
But current settings didn't care +1 step for mute.
This patch adds it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org

7 years agoMAINTAINERS: Don't list everyone working on Wolfson drivers
Mark Brown [Wed, 4 Apr 2012 11:06:24 +0000]
MAINTAINERS: Don't list everyone working on Wolfson drivers

Rather than listing every single person who works on the drivers include
the mailing list where they can all be found.  Leave myself as a human

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

7 years agoMAINTAINERS: Add missing ASoC OMAP co-maintainer
Jarkko Nikula [Tue, 3 Apr 2012 06:45:43 +0000]
MAINTAINERS: Add missing ASoC OMAP co-maintainer

Peter Ujfalusi has been co-maintaining sound/soc/omap/ for years but
was missing from this MAINTAINERS entry.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: pxa: pxa2xx-i2s: add io.h for IOMEM macro
Martin Jansa [Mon, 2 Apr 2012 08:24:08 +0000]
ASoC: pxa: pxa2xx-i2s: add io.h for IOMEM macro

* fixes
  sound/soc/pxa/pxa2xx-i2s.c:86:2: error: implicit declaration of function 'IOMEM' [-Werror=implicit-function-declaration]
  sound/soc/pxa/pxa2xx-i2s.c:86:2: error: initializer element is not constant
  after 23019a733bb83c8499f192fb428b7e6e81c95a34 removed IOMEM
  definition from arch/arm/mach-pxa/include/mach/hardware.h

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

7 years agoASoC: tegra: ensure clocks are enabled when touching registers
Stephen Warren [Wed, 18 Apr 2012 14:01:26 +0000]
ASoC: tegra: ensure clocks are enabled when touching registers

Debugfs files could be accessed any time, so explicitly enable clocks
when reading registers to generate debugfs file content.

Change-Id: Idd4cff386f805ac0e9b466e5c738002cf65c2aa4
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: sgtl5000: Enable VAG when DAC/ADC up
Zeng Zhaoming [Thu, 29 Mar 2012 16:13:02 +0000]
ASoC: sgtl5000: Enable VAG when DAC/ADC up

As manual described, VAG is an internal voltage reference of DAC/ADC,
So enabled it before DAC/ADC up.

One more thing should care about is VAG fully ramped down requires 400ms,
wait it to avoid pop.

Signed-off-by: Zeng Zhaoming <zengzm.kernel@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoALSA: hda - clean up CX20549 test mixer setup
Michael Karcher [Fri, 6 Apr 2012 13:34:20 +0000]
ALSA: hda - clean up CX20549 test mixer setup

name pins consistently (MIC1/LINE1/HP-OUT/CD) on all controls
affecting those pins.

remove duplicate SET_AMP_GAIN_MUTE to 0x17/index 0 and 0x17/index 1

really select MIC1, not Mixer out for recording

"Mixer out" for recording is not a "pin", adjust comment

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - CX20549 doesn't need pin_amp_workaround.
Michael Karcher [Fri, 6 Apr 2012 13:34:19 +0000]
ALSA: hda - CX20549 doesn't need pin_amp_workaround.

CX20549 (ctx5045) doesn't accept data on index 1 for output pins,
as shown in the following hda-var transaction:

  $ hda-verb /dev/snd/hwC0D0 0x10 set_amp_gain 0xb126
  nid = 0x10, verb = 0x300, param = 0xb126
  value = 0x0
  $ hda-verb /dev/snd/hwC0D0 0x10 get_amp_gain 0x8001
  nid = 0x10, verb = 0xb00, param = 0x8001
  value = 0x0

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - Remove CD control from model=benq for CX20549
Michael Karcher [Fri, 6 Apr 2012 13:34:18 +0000]
ALSA: hda - Remove CD control from model=benq for CX20549

The ID used for detection of the BenQ R55E actually identifies the
Quanta TW3 ODM design, which is also used for the Gigabyte W551 laptop
series. Schematics on the internet clearly indicate that the "Port C"
(analog input connected to record source #4 and mixer input #4) is

Playing an audio CD through analog playback (using cdplay from cdtools)
produces no sound, even with the mixer input labelled "CD" enabled, and
the volume control in the CD drive set to maximum. This indicates the
connection is really not present.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - fix record volume controls of CX20459 ("Venice")
Michael Karcher [Fri, 6 Apr 2012 13:34:17 +0000]
ALSA: hda - fix record volume controls of CX20459 ("Venice")

The "input converter" widget of the CX20459 has only one input amplifier,
expose that one as "Capture Volume/Capture Switch". The actual record
source selection is already exposed through the separately installed
input mux.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - Rename capture sources of CX20549 to match common conventions
Michael Karcher [Fri, 6 Apr 2012 13:34:16 +0000]
ALSA: hda - Rename capture sources of CX20549 to match common conventions

This includes renaming "Line In" to line, also in the mixer settings.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - Fix proc output for ADC amp values of CX20549
Michael Karcher [Fri, 6 Apr 2012 13:34:15 +0000]
ALSA: hda - Fix proc output for ADC amp values of CX20549

The CX20549 has only one single input amp on it's input converter
widget. Fix printing of values in the codec file in /proc/asound.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: asihpi - fix return value of hpios_locked_mem_alloc()
Eliot Blennerhassett [Thu, 29 Mar 2012 20:52:25 +0000]
ALSA: asihpi - fix return value of hpios_locked_mem_alloc()

Make this function consistent with others in this module by
returning 1 for error, instead of -ENOMEM
(reverts function signature change from a938fb1e)

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years ago[media] uvcvideo: Fix race-related crash in uvc_video_clock_update()
Laurent Pinchart [Tue, 27 Mar 2012 08:51:00 +0000]
[media] uvcvideo: Fix race-related crash in uvc_video_clock_update()

The driver frees the clock samples buffer before stopping the video
buffers queue. If a DQBUF call arrives in-between,
uvc_video_clock_update() will be called with a NULL clock samples
buffer, leading to a crash. This occurs very frequently when using the
webcam with the flash browser plugin.

Move clock initialization/cleanup to uvc_video_enable() in order to free
the clock samples buffer after the queue is stopped. Make sure the clock
is reset at resume time to avoid miscalculating timestamps.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] Drivers/media/radio: Fix build error
Hans Verkuil [Sun, 1 Apr 2012 18:24:48 +0000]
[media] Drivers/media/radio: Fix build error

On Sunday, April 01, 2012 21:09:34 Tracey Dent wrote:
> radio-maxiradio depends on SND_FM801_TEA575X_BOOL to build or will
> result in an build error such as:
> Kernel: arch/x86/boot/bzImage is ready  (#1)
> ERROR: "snd_tea575x_init" [drivers/media/radio/radio-maxiradio.ko] undefined!
> ERROR: "snd_tea575x_exit" [drivers/media/radio/radio-maxiradio.ko] undefined!
> WARNING: modpost: Found 6 section mismatch(es).
> To see full details build your kernel with:
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
> Select CONFIG_SND_TEA575X to fixes problem and enable
> the driver to be built as desired.
> v2:
> instead of selecting CONFIG_SND_FM801_TEA575X_BOOL, select
> CONFIG_SND_TEA575X, which in turns selects CONFIG_SND_FM801_TEA575X_BOOL
> and any other dependencies for it to build.

No, this is the correct patch:

RADIO_MAXIRADIO should be treated just like RADIO_SF16FMR2, I just didn't
realize at the time that it had to be added as a SND_TEA575X dependency.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Shea Levy <shea@shealevy.com>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] dvb_frontend: fix compiler warning
Hans Petter Selasky [Tue, 27 Mar 2012 15:53:19 +0000]
[media] dvb_frontend: fix compiler warning

has_get_frontend() should return a boolean, not a pointer.

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] it913x: fix firmware loading errors
Malcolm Priestley [Sun, 25 Mar 2012 09:57:49 +0000]
[media] it913x: fix firmware loading errors

On some systems the device does not respond or give obscure values after cold,
warm or firmware reboot.

This patch retries to get chip version and type 5 times. If it
fails it applies chip version 0x1 and type 0x9135.

This patch does not fix warm cycle problems from other operating
systems and indeed the reverse applies. Users should power off cold boot.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] ivtv: Fix AUDIO_(BILINGUAL_)CHANNEL_SELECT regression
Hans Verkuil [Sat, 31 Mar 2012 08:18:19 +0000]
[media] ivtv: Fix AUDIO_(BILINGUAL_)CHANNEL_SELECT regression

When I converted ivtv to the new decoder API I introduced a regression in the
support of the old channel select API.

Thanks to Martin Dauskardt for reporting this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] dvb_frontend: regression fix: userspace ABI broken for xine
Chris Rankin [Fri, 6 Apr 2012 21:38:18 +0000]
[media] dvb_frontend: regression fix: userspace ABI broken for xine

The commit e399ce77e6e has broken the DVB ABI for xine:

The problem is that xine is expecting every event after a successful
FE_SET_FRONTEND ioctl to have a non-zero frequency parameter, regardless
of whether the tuning process has LOCKed yet. What used to happen is
that the events inherited the initial tuning parameters from the
FE_SET_FRONTEND call. However, the fepriv->parameters_out struct is now
not initialised until the status contains the FE_HAS_LOCK bit.

You might argue that this behaviour is intentional, except that if an
application other than xine uses the DVB adapter and manages to set the
parameters_out.frequency field to something other than zero, then xine
no longer has any problems until either the adapter is replugged or the
kernel modules reloaded. This can only mean that the
fepriv->parameters_out struct still contains the (stale) tuning
information from the previous application.

Signed-off-by: Chris Rankin <rankincj@yahoo.com>
Cc: stable@kernel.org # for kernel version 3.3
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years agoGFS2: Allow caching of rindex glock
Bob Peterson [Tue, 10 Apr 2012 12:56:04 +0000]
GFS2: Allow caching of rindex glock

This patch allows caching of the rindex glock. We were previously
setting the GL_NOCACHE bit when the glock was released. That forced
the rindex inode to be invalidated, which caused us to re-read
rindex at the next access. However, it caused the glock to be
unnecessarily bounced around the cluster. This patch allows
the glock to remain cached, but it still causes the rindex to be
re-read once it has been written to by gfs2_grow.

Ben and I have tested single-node gfs2_grow cases and I've tested
clustered gfs2_grow cases on my four-node cluster.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

7 years agoGFS2: Make sure rindex is uptodate before starting transactions
Bob Peterson [Thu, 5 Apr 2012 02:11:16 +0000]
GFS2: Make sure rindex is uptodate before starting transactions

This patch removes the call from gfs2_blk2rgrd to function
gfs2_rindex_update and replaces it with individual calls.
The former way turned out to be too problematic.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

7 years agoGFS2: use depends instead of select in kconfig
Benjamin Poirier [Fri, 23 Mar 2012 22:06:18 +0000]
GFS2: use depends instead of select in kconfig

Avoids having to duplicate the dependencies of what is 'select'ed (and on

Those dependencies are currently incomplete, leading to broken builds with

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

7 years agoGFS2: put glock reference in error patch of read_rindex_entry
Bob Peterson [Thu, 22 Mar 2012 12:58:30 +0000]
GFS2: put glock reference in error patch of read_rindex_entry

This patch fixes the error path of function read_rindex_entry
so that it correctly gives up its glock reference in cases where
there is a race to re-read the rindex after gfs2_grow.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

7 years agox86: merge 32/64-bit versions of 'strncpy_from_user()' and speed it up
Linus Torvalds [Fri, 6 Apr 2012 21:32:32 +0000]
x86: merge 32/64-bit versions of 'strncpy_from_user()' and speed it up

This merges the 32- and 64-bit versions of the x86 strncpy_from_user()
by just rewriting it in C rather than the ancient inline asm versions
that used lodsb/stosb and had been duplicated for (trivial) differences
between the 32-bit and 64-bit versions.

While doing that, it also speeds them up by doing the accesses a word at
a time.  Finally, the new routines also properly handle the case of
hitting the end of the address space, which we have never done correctly
before (fs/namei.c has a hack around it for that reason).

Despite all these improvements, it actually removes more lines than it
adds, due to the de-duplication.  Also, we no longer export (or define)
the legacy __strncpy_from_user() function (that was defined to not do
the user permission checks), since it's not actually used anywhere, and
the user address space checks are built in to the new code.

Other architecture maintainers have been notified that the old hack in
fs/namei.c will be going away in the 3.5 merge window, in case they
copied the x86 approach of being a bit cavalier about the end of the
address space.

Cc: linux-arch@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Anvin" <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agocred: copy_process() should clear child->replacement_session_keyring
Oleg Nesterov [Mon, 9 Apr 2012 19:03:50 +0000]
cred: copy_process() should clear child->replacement_session_keyring

keyctl_session_to_parent(task) sets ->replacement_session_keyring,
it should be processed and cleared by key_replace_session_keyring().

However, this task can fork before it notices TIF_NOTIFY_RESUME and
the new child gets the bogus ->replacement_session_keyring copied by
dup_task_struct(). This is obviously wrong and, if nothing else, this
leads to put_cred(already_freed_cred).

change copy_creds() to clear this member. If copy_process() fails
before this point the wrong ->replacement_session_keyring doesn't
matter, exit_creds() won't be called.

Cc: <stable@vger.kernel.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agoSmack: build when CONFIG_AUDIT not defined
Kees Cook [Tue, 10 Apr 2012 20:26:44 +0000]
Smack: build when CONFIG_AUDIT not defined

This fixes builds where CONFIG_AUDIT is not defined and

This got introduced by the stack-usage reducation commit 48c62af68a40
("LSM: shrink the common_audit_data data union").

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agonetdma: adding alignment check for NETDMA ops
Dave Jiang [Wed, 4 Apr 2012 23:10:46 +0000]
netdma: adding alignment check for NETDMA ops

This is the fallout from adding memcpy alignment workaround for certain
IOATDMA hardware. NetDMA will only use DMA engine that can handle byte align

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agoioatdma: DMA copy alignment needed to address IOAT DMA silicon errata
Dave Jiang [Wed, 4 Apr 2012 23:10:41 +0000]
ioatdma: DMA copy alignment needed to address IOAT DMA silicon errata

Silicon errata where when RAID and legacy descriptors are mixed, the legacy
(memcpy and friends) operation must have alignment of 64 bytes to avoid
hanging. This effects Intel Xeon C55xx, C35xx, E5-2600.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agoioat: ring size variables need to be 32bit to avoid overflow
Dave Jiang [Wed, 4 Apr 2012 23:10:35 +0000]
ioat: ring size variables need to be 32bit to avoid overflow

The alloc order can be up to 16 and 1 << 16 will over flow the 16bit
integer. Change the appropriate variables to 16bit to avoid overflow.

Reported-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agoiop-adma: Corrected array overflow in RAID6 Xscale(R) test.
Don Morris [Thu, 15 Mar 2012 18:07:30 +0000]
iop-adma: Corrected array overflow in RAID6 Xscale(R) test.

Bug: cppcheck reported overflow in array assignment (for loop walks

Reported as: https://bugzilla.kernel.org/show_bug.cgi?id=42677

Test code pq_src array was grown by two elements to correspond with actual
usage (IOP_ADMA_NUM_SRC_TEST+2), stack consumption was kept constant by
modifying the pq_dest two element array which is only used when pq_src
is referenced up to IOP_ADMA_NUM_SRC_TEST elements into the address
of the new last two elements of the pq_src array. This is presumed to
be the original intent but would be reliant on compilers always having
pq_dest contiguous with the final element of pq_src.

Note: This is a re-send of a request for review from two weeks ago.
Looking for review (or shootdown), adding LKML to list for a wider
audience. Thanks.

Updated per review comments of Sergei Shtylyov <sshtylyov@mvista.com>

Signed-off-by: Don Morris <don.morris@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agoioat: fix size of 'completion' for Xen
Dan Williams [Fri, 23 Mar 2012 20:36:42 +0000]
ioat: fix size of 'completion' for Xen

Starting with v3.2 Jonathan reports that Xen crashes loading the ioatdma
driver.  A debug run shows:

  ioatdma 0000:00:16.4: desc[0]: (0x300cc7000->0x300cc7040) cookie: 0 flags: 0x2 ctl: 0x29 (op: 0 int_en: 1 compl: 1)
  ioatdma 0000:00:16.4: ioat_get_current_completion: phys_complete: 0xcc7000

...which shows that in this environment GFP_KERNEL memory may be backed
by a 64-bit dma address.  This breaks the driver's assumption that an
unsigned long should be able to contain the physical address for
descriptor memory.  Switch to dma_addr_t which beyond being the right
size, is the true type for the data i.e. an io-virtual address
inidicating the engine's last processed descriptor.

[stable: 3.2+]
Cc: <stable@vger.kernel.org>
Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Reported-by: William Dauchy <wdauchy@gmail.com>
Tested-by: William Dauchy <wdauchy@gmail.com>
Tested-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agosparc32,leon: fix leon build
Sam Ravnborg [Wed, 4 Apr 2012 19:20:01 +0000]
sparc32,leon: fix leon build

Minimal fix to allow leon to be built.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Konrad Eisele <konrad@gaisler.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

7 years agosparc/mm/fault_32.c: Port OOM changes to do_sparc_fault
Kautuk Consul [Mon, 26 Mar 2012 06:47:54 +0000]
sparc/mm/fault_32.c: Port OOM changes to do_sparc_fault

Commit d065bd810b6deb67d4897a14bfe21f8eb526ba99
(mm: retry page fault when blocking on disk transfer) and
commit 37b23e0525d393d48a7d59f870b3bc061a30ccdb
(x86,mm: make pagefault killable)

The above commits introduced changes into the x86 pagefault handler
for making the page fault handler retryable as well as killable.

These changes reduce the mmap_sem hold time, which is crucial
during OOM killer invocation.

Port these changes to 32-bit sparc.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

7 years agosparc/mm/fault_64.c: Port OOM changes to do_sparc64_fault
Kautuk Consul [Mon, 26 Mar 2012 06:40:49 +0000]
sparc/mm/fault_64.c: Port OOM changes to do_sparc64_fault

Commit d065bd810b6deb67d4897a14bfe21f8eb526ba99
(mm: retry page fault when blocking on disk transfer) and
commit 37b23e0525d393d48a7d59f870b3bc061a30ccdb
(x86,mm: make pagefault killable)

The above commits introduced changes into the x86 pagefault handler
for making the page fault handler retryable as well as killable.

These changes reduce the mmap_sem hold time, which is crucial
during OOM killer invocation.

Port these changes to 64-bit sparc.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

7 years agoregulator: anatop: fix 'anatop_regulator' name collision
Shawn Guo [Mon, 2 Apr 2012 06:57:01 +0000]
regulator: anatop: fix 'anatop_regulator' name collision

There is a name collision between 'struct platform_driver
anatop_regulator' and 'struct anatop_regulator', which causes some
section mismatch warnings like below.

WARNING: vmlinux.o(.data+0x154d4): Section mismatch in reference from the variable anatop_regulator to the function .devinit.text:anatop_regulator_probe()
The variable anatop_regulator references
the function __devinit anatop_regulator_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Rename 'struct platform_driver anatop_regulator' to
'struct platform_driver anatop_regulator_driver' to fix the warnings.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoum: uml_setup_stubs': warning: unused variable 'pages'
Boaz Harrosh [Tue, 27 Mar 2012 02:18:22 +0000]
um: uml_setup_stubs': warning: unused variable 'pages'

Fix the following gcc complain
arch/um/kernel/skas/mmu.c: In function 'uml_setup_stubs':
arch/um/kernel/skas/mmu.c:106:16: warning: unused variable 'pages' [-Wunused-variable]

Signed-Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

7 years agoum: Use asm-generic/switch_to.h
Richard Weinberger [Thu, 29 Mar 2012 17:10:42 +0000]
um: Use asm-generic/switch_to.h

Signed-off-by: Richard Weinberger <richard@nod.at>

7 years agoum: Disintegrate asm/system.h
Richard Weinberger [Thu, 29 Mar 2012 16:47:46 +0000]
um: Disintegrate asm/system.h

Signed-off-by: Richard Weinberger <richard@nod.at>
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
CC: dhowells@redhat.com

7 years agoum: switch cow_user.h to htobe{32,64}/betoh{32,64}
Al Viro [Fri, 6 Apr 2012 03:35:03 +0000]
um: switch cow_user.h to htobe{32,64}/betoh{32,64}

... rather than open-coding the 64bit versions.  endian.h has those guys.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>

7 years agoum: several x86 hw-dependent crypto modules won't build on uml
Al Viro [Mon, 9 Apr 2012 00:31:22 +0000]
um: several x86 hw-dependent crypto modules won't build on uml

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

7 years agoum: fix linker script generation
Al Viro [Mon, 9 Apr 2012 17:59:00 +0000]
um: fix linker script generation

while we can't just use -U$(SUBARCH), we still need to kill idiotic define
(implicit -Di386=1), both for SUBARCH=i386 and SUBARCH=x86/CONFIG_64BIT=n

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

7 years agoi2c: prevent spurious interrupt on Designware controllers
Kristen Carlson Accardi [Tue, 10 Apr 2012 13:15:41 +0000]
i2c: prevent spurious interrupt on Designware controllers

Don't call i2c_enable on resume because it causes a spurious

Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agomodpost: Fix modpost license checking of vmlinux.o
Frank Rowand [Tue, 10 Apr 2012 00:59:03 +0000]
modpost: Fix modpost license checking of vmlinux.o

Commit f02e8a6596b7 ("module: Sort exported symbols") sorts symbols
placing each of them in its own elf section.  This sorting and merging
into the canonical sections are done by the linker.

Unfortunately modpost to generate Module.symvers file parses vmlinux.o
(which is not linked yet) and all modules object files (which aren't
linked yet).  These aren't sanitized by the linker yet.  That breaks
modpost that can't detect license properly for modules.

This patch makes modpost aware of the new exported symbols structure.

[ This above is a slightly corrected version of the explanation of the
  problem, copied from commit 62a2635610db ("modpost: Fix modpost's
  license checking V3").  That commit fixed the problem for module
  object files, but not for vmlinux.o.  This patch fixes modpost for
  vmlinux.o. ]

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
Signed-off-by: Alessio Igor Bogani <abogani@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agoandroid, lowmemorykiller: remove task handoff notifier
David Rientjes [Wed, 18 Apr 2012 13:42:27 +0000]
android, lowmemorykiller: remove task handoff notifier

The task handoff notifier leaks task_struct since it never gets freed
after the callback returns NOTIFY_OK, which means it is responsible for
doing so.

It turns out the lowmemorykiller actually doesn't need this notifier at
all.  It's used to prevent unnecessary killing by waiting for a thread
to exit as a result of lowmem_shrink(), however, it's possible to do
this in the same way the kernel oom killer works by setting TIF_MEMDIE
and avoid killing if we're still waiting for it to exit.

The kernel oom killer will already automatically set TIF_MEMDIE for
threads that are attempting to allocate memory that have a fatal signal.
The thread selected by lowmem_shrink() will have such a signal after the
lowmemorykiller sends it a SIGKILL, so this won't result in an
unnecessary use of memory reserves for the thread to exit.

This has the added benefit that we don't have to rely on
CONFIG_PROFILING to prevent needlessly killing tasks.

Reported-by: Werner Landgraf <w.landgraf@ru.ru>
Cc: stable@vger.kernel.org
Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>



Change-Id: I698333320b1c5569636812da9e0e9439df9aa616

7 years agommc: card: block: remove mmc_blk_set_blksize
Varun Wadekar [Wed, 18 Apr 2012 13:39:45 +0000]
mmc: card: block: remove mmc_blk_set_blksize

Change-Id: I4492df9cbd4c76067a2da0f6e382d1b91545ad41
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoLinux 3.4-rc2
Linus Torvalds [Sun, 8 Apr 2012 01:30:41 +0000]
Linux 3.4-rc2

7 years agoKVM: Resolve RCU vs. async page fault problem
Gleb Natapov [Wed, 4 Apr 2012 12:30:33 +0000]
KVM: Resolve RCU vs. async page fault problem

"Page ready" async PF can kick vcpu out of idle state much like IRQ.
We need to tell RCU about this.

Reported-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

7 years agoKVM: PPC: Book3S: PR: Fix preemption
Alexander Graf [Tue, 13 Mar 2012 22:31:02 +0000]
KVM: PPC: Book3S: PR: Fix preemption

We were leaking preemption counters. Fix the code to always toggle
between preempt and non-preempt properly.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

7 years agoKVM: PPC: Save/Restore CR over vcpu_run
Alexander Graf [Mon, 5 Mar 2012 15:00:28 +0000]
KVM: PPC: Save/Restore CR over vcpu_run

On PPC, CR2-CR4 are nonvolatile, thus have to be saved across function calls.
We didn't respect that for any architecture until Paul spotted it in his
patch for Book3S-HV. This patch saves/restores CR for all KVM capable PPC hosts.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

7 years agoKVM: PPC: Book3S HV: Save and restore CR in __kvmppc_vcore_entry
Paul Mackerras [Fri, 3 Feb 2012 00:53:21 +0000]
KVM: PPC: Book3S HV: Save and restore CR in __kvmppc_vcore_entry

The ABI specifies that CR fields CR2--CR4 are nonvolatile across function
calls.  Currently __kvmppc_vcore_entry doesn't save and restore the CR,
leading to CR2--CR4 getting corrupted with guest values, possibly leading
to incorrect behaviour in its caller.  This adds instructions to save
and restore CR at the points where we save and restore the nonvolatile

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

7 years agoKVM: PPC: Book3S HV: Fix kvm_alloc_linear in case where no linears exist
Paul Mackerras [Fri, 3 Feb 2012 00:45:02 +0000]
KVM: PPC: Book3S HV: Fix kvm_alloc_linear in case where no linears exist

In kvm_alloc_linear we were using and deferencing ri after the
list_for_each_entry had come to the end of the list.  In that
situation, ri is not really defined and probably points to the
list head.  This will happen every time if the free_linears list
is empty, for instance.  This led to a NULL pointer dereference
crash in memset on POWER7 while trying to allocate an HPT in the
case where no HPTs were preallocated.

This fixes it by using a separate variable for the return value
from the loop iterator.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

7 years agoKVM: PPC: Book3S: Compile fix for ppc32 in HIOR access code
Alexander Graf [Tue, 13 Mar 2012 18:59:39 +0000]
KVM: PPC: Book3S: Compile fix for ppc32 in HIOR access code

We were failing to compile on book3s_32 with the following errors:

arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:898:79: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Fix this by explicity casting the u64 to long before we use it as a pointer.

Also, on PPC32 we can not use get_user/put_user for 64bit wide variables,
as there is no single instruction that could load or store variables that big.

So instead, we have to use copy_from/to_user which works everywhere.

Reported-by: Jörg Sommer <joerg@alea.gnuu.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

7 years agoKVM: VMX: vmx_set_cr0 expects kvm->srcu locked
Marcelo Tosatti [Tue, 27 Mar 2012 22:47:26 +0000]
KVM: VMX: vmx_set_cr0 expects kvm->srcu locked

vmx_set_cr0 is called from vcpu run context, therefore it expects
kvm->srcu to be held (for setting up the real-mode TSS).

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

7 years agoKVM: PMU: Fix integer constant is too large warning in kvm_pmu_set_msr()
Sasikantha babu [Wed, 21 Mar 2012 13:19:00 +0000]
KVM: PMU: Fix integer constant is too large warning in kvm_pmu_set_msr()

Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

7 years agosh: fix clock-sh7757 for the latest sh_mobile_sdhi driver
Shimoda, Yoshihiro [Wed, 4 Apr 2012 02:56:07 +0000]
sh: fix clock-sh7757 for the latest sh_mobile_sdhi driver

The commit 996bc8aebd2cd5b6d4c5d85085f171fa2447f364 (mmc: sh_mobile_sdhi:
do not manage PM clocks manually) modified the sh_mobile_sdhi driver to
remove the clk_enable/clk_disable. So, we need to change

If we don't change this, we will see the following error from the driver:
    sh_mobile_sdhi sh_mobile_sdhi.0: timeout waiting for hardware interrupt (CMD52)

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

7 years agoserial: sh-sci: use serial_port_in/out vs sci_in/out.
Paul Mundt [Fri, 30 Mar 2012 10:50:15 +0000]
serial: sh-sci: use serial_port_in/out vs sci_in/out.

Follows the 8250 change for pretty much the same rationale.

See commit "serial: use serial_port_in/out vs serial_in/out in 8250".

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

7 years agosh: vsyscall: Fix up .eh_frame generation.
Paul Mundt [Fri, 30 Mar 2012 10:42:26 +0000]
sh: vsyscall: Fix up .eh_frame generation.

Some improper formatting caused the .eh_frame generation to fail,
resulting in gcc/g++ testsuite failures with regards to unwinding through
the vDSO. Now that someone is actually working on this on the gcc side
it's time to fix up the kernel side, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

7 years agosh: dma: Fix up device attribute mismatch from sysdev fallout.
Paul Mundt [Fri, 30 Mar 2012 10:36:03 +0000]
sh: dma: Fix up device attribute mismatch from sysdev fallout.

This fixes up an attribute mismatch that was introduced in the
sysdev->struct device migration.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

7 years agosh: dwarf unwinder depends on SHcompact.
Paul Mundt [Fri, 30 Mar 2012 10:31:22 +0000]
sh: dwarf unwinder depends on SHcompact.

Presently there's no SHmedia support plugged in for the dwarf unwinder.
While it's trivial to provide an SHmedia version of dwarf_read_arch_reg(),
the general sh64 case is more complicated in that the TLB miss handler
uses a locked down set of registers for optimization (including the frame
pointer) which we need for the unwind table generation.

While freeing up the frame pointer for use in the TLB miss handler is
reasonably straightforward, it's still more trouble than it's worth, so
we simply restrict the unwinder to 32-bit for now.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

7 years agosh: fix up fallout from system.h disintegration.
Paul Mundt [Fri, 30 Mar 2012 10:29:57 +0000]
sh: fix up fallout from system.h disintegration.

Quite a bit of fallout all over the place, nothing terribly exciting.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

7 years agosysctl: fix write access to dmesg_restrict/kptr_restrict
Kees Cook [Wed, 4 Apr 2012 18:40:19 +0000]
sysctl: fix write access to dmesg_restrict/kptr_restrict

Commit bfdc0b4 adds code to restrict access to dmesg_restrict,
however, it incorrectly alters kptr_restrict rather than

The original patch from Richard Weinberger
(https://lkml.org/lkml/2011/3/14/362) alters dmesg_restrict as
expected, and so the patch seems to have been misapplied.

This adds the CAP_SYS_ADMIN check to both dmesg_restrict and
kptr_restrict, since both are sensitive.

Reported-by: Phillip Lougher <plougher@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Acked-by: Richard Weinberger <richard@nod.at>
Cc: stable@vger.kernel.org
Signed-off-by: James Morris <james.l.morris@oracle.com>

7 years agoMAINTAINERS: Update git url for ACPI
Igor Murzov [Fri, 30 Mar 2012 18:40:12 +0000]
MAINTAINERS: Update git url for ACPI

Signed-off-by: Igor Murzov <e-mail@date.by>
Signed-off-by: Len Brown <len.brown@intel.com>

7 years agocpuidle: Fix panic in CPU off-lining with no idle driver
Toshi Kani [Sun, 1 Apr 2012 03:37:02 +0000]
cpuidle: Fix panic in CPU off-lining with no idle driver

Fix a NULL pointer dereference panic in cpuidle_play_dead() during
CPU off-lining when no cpuidle driver is registered.  A cpuidle
driver may be registered at boot-time based on CPU type.  This patch
allows an off-lined CPU to enter HLT-based idle in this condition.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Cc: Boris Ostrovsky <boris.ostrovsky@amd.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Tested-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>

7 years agoACPI processor: Use safe_halt() rather than halt() in acpi_idle_play_dead()
Luck, Tony [Tue, 3 Apr 2012 16:37:28 +0000]
ACPI processor: Use safe_halt() rather than halt() in acpi_idle_play_dead()

ACPI code is shared by arch/x86 and arch/ia64. ia64 doesn't provide a plain
"halt()" function.  Use safe_halt() instead.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Signed-off-by: Len Brown <len.brown@intel.com>

7 years agotcm_fc: Do not free tpg structure during wq allocation failure
Mark Rustad [Tue, 3 Apr 2012 17:24:52 +0000]
tcm_fc: Do not free tpg structure during wq allocation failure

Avoid freeing a registered tpg structure if an alloc_workqueue call
fails.  This fixes a bug where the failure was leaking memory associated
with se_portal_group setup during the original core_tpg_register() call.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Acked-by: Kiran Patil <Kiran.patil@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

7 years agotcm_fc: Add abort flag for gracefully handling exchange timeout
Mark Rustad [Tue, 3 Apr 2012 17:24:41 +0000]
tcm_fc: Add abort flag for gracefully handling exchange timeout

Add abort flag and use it to terminate processing when an exchange
is timed out or is reset. The abort flag is used in place of the
transport_generic_free_cmd function call in the reset and timeout
cases, because calling that function in that context would free
memory that was in use. The aborted flag allows the lifetime to
be managed in a more normal way, while truncating the processing.

This change eliminates a source of memory corruption which
manifested in a variety of ugly ways.

(nab: Drop unused struct fc_exch *ep in ft_recv_seq)

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Acked-by: Kiran Patil <Kiran.patil@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

7 years agodrivers/net/ethernet/tile: fix netdev_alloc_skb() bombing
Chris Metcalf [Mon, 2 Apr 2012 17:17:37 +0000]
drivers/net/ethernet/tile: fix netdev_alloc_skb() bombing

Commit dae2e9f430c46c29e3f771110094bd3da3625aa4 changed dev_alloc_skb()
to netdev_alloc_skb(), adding a dev pointer, but erroneously used "->"
instead of "." for a struct member when accessing the dev pointer.
This change fixes the build breakage.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoMAINTAINERS: update EDAC information
Chris Metcalf [Sat, 31 Mar 2012 13:46:03 +0000]
MAINTAINERS: update EDAC information

The bluesmoke mailing list no longer works, so use
linux-edac@vger.kernel.org.  And, use a less restrictive pattern so all
drivers/edac changes go to linux-edac as well.

Borislav suggested I just push this through the tile tree since there
is currently no core edac maintainer (emails to Doug Thompson bounce).

Acked-by: Borislav Petkov <bp@amd64.org>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agotilepro ethernet driver: fix a few minor issues
Chris Metcalf [Fri, 30 Mar 2012 23:23:35 +0000]
tilepro ethernet driver: fix a few minor issues

This commit fixes a number of issues seen with the driver:

- Improve handling of return credits to the hardware shim
- Use skb_frag_size() appropriately
- Fix driver so it works properly with netpoll for console over UDP

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agotile-srom.c driver: minor code cleanup
Chris Metcalf [Fri, 30 Mar 2012 23:03:04 +0000]
tile-srom.c driver: minor code cleanup

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoedac: say "TILEGx" not "TILEPro" for the tilegx edac driver
Chris Metcalf [Fri, 30 Mar 2012 22:58:37 +0000]
edac: say "TILEGx" not "TILEPro" for the tilegx edac driver

This is just an aesthetic change but it was silly to say TILEPro
when booting up on the tilegx architecture.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: avoid accidentally unmasking NMI-type interrupt accidentally
Chris Metcalf [Fri, 30 Mar 2012 20:29:06 +0000]
arch/tile: avoid accidentally unmasking NMI-type interrupt accidentally

The return path as we reload registers and core state requires that r30
hold a boolean indicating whether we are returning from an NMI, but in a
couple of cases we weren't setting this properly, with the result that we
could accidentally unmask the NMI interrupt(s), which could cause confusion.
Now we set r30 in every place where we jump into the interrupt return path.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: remove bogus performance optimization
Chris Metcalf [Fri, 30 Mar 2012 20:27:20 +0000]
arch/tile: remove bogus performance optimization

We were re-homing the initial task's kernel stack on the boot cpu,
but in fact it's better to let it stay globally homed, since that
task isn't bound to the boot cpu anyway.  This is more of a general
cleanup than an actual performance optimization, but it removes
code, which is a good thing. :-)

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: return SIGBUS for addresses that are unaligned AND invalid
Chris Metcalf [Fri, 30 Mar 2012 20:24:41 +0000]
arch/tile: return SIGBUS for addresses that are unaligned AND invalid

Previously we were returning SIGSEGV in this case.  It seems cleaner
to return SIGBUS since the hardware figures out alignment traps
before TLB violations, so SIGBUS is the "more correct" signal.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: fix finv_buffer_remote() for tilegx
Chris Metcalf [Fri, 30 Mar 2012 19:47:38 +0000]
arch/tile: fix finv_buffer_remote() for tilegx

There were some correctness issues with this code that are now fixed
with this change.  The change is likely less performant than it could
be, but it should no longer be vulnerable to any races with memory
operations on the memory network while invalidating a range of memory.
This code is run infrequently so performance isn't critical, but
correctness definitely is.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: use atomic exchange in arch_write_unlock()
Chris Metcalf [Fri, 30 Mar 2012 19:46:29 +0000]
arch/tile: use atomic exchange in arch_write_unlock()

This idiom is used elsewhere when we do an unlock by writing a zero,
but I missed it here.  Using an atomic operation avoids waiting
on the write buffer for the unlocking write to be sent to the home cache.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: stop mentioning the "kvm" subdirectory
Chris Metcalf [Fri, 30 Mar 2012 19:29:40 +0000]
arch/tile: stop mentioning the "kvm" subdirectory

It causes "make clean" to fail, for example.  Once we have KVM support
complete, we'll reinstate the subdir reference.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: export the page_home() function.
Chris Metcalf [Thu, 29 Mar 2012 20:19:45 +0000]
arch/tile: export the page_home() function.

This avois a bug in modules trying to use the function.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: fix pointer cast in cacheflush.c
Chris Metcalf [Thu, 29 Mar 2012 20:14:40 +0000]
arch/tile: fix pointer cast in cacheflush.c

Pragmatically it couldn't be wrong to cast pointers to long to compare
them (since all kernel addresses are in the top half of VA space),
but it's more correct to cast to unsigned long.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: fix single-stepping over swint1 instructions on tilegx
Chris Metcalf [Thu, 29 Mar 2012 20:11:09 +0000]
arch/tile: fix single-stepping over swint1 instructions on tilegx

If we are single-stepping and make a syscall, we call ptrace_notify()
explicitly on the return path back to user space, since we are returning
to a pc value set artificially to the next instruction, and otherwise
we won't register that we stepped over the syscall instruction (swint1).

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: implement panic_smp_self_stop()
Chris Metcalf [Thu, 29 Mar 2012 19:59:11 +0000]
arch/tile: implement panic_smp_self_stop()

This allows the later-panicking tiles to wait in a lower power state
until they get interrupted with an smp_send_stop().

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: add "nop" after "nap" to help GX idle power draw
Chris Metcalf [Thu, 29 Mar 2012 19:57:18 +0000]
arch/tile: add "nop" after "nap" to help GX idle power draw

This avoids the hardware istream prefetcher doing unnecessary work.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: use proper memparse() for "maxmem" options
Chris Metcalf [Thu, 29 Mar 2012 19:56:18 +0000]
arch/tile: use proper memparse() for "maxmem" options

This is more standard and avoids having to remember what units
the options actually take.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: fix up locking in pgtable.c slightly
Chris Metcalf [Thu, 29 Mar 2012 19:50:08 +0000]
arch/tile: fix up locking in pgtable.c slightly

We should be holding the init_mm.page_table_lock in shatter_huge_page()
since we are modifying the kernel page tables.  Then, only if we are
walking the other root page tables to update them, do we want to take
the pgd_lock.

Add a comment about taking the pgd_lock that we always do it with
interrupts disabled and therefore are not at risk from the tlbflush
IPI deadlock as is seen on x86.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: don't leak kernel memory when we unload modules
Chris Metcalf [Thu, 29 Mar 2012 19:44:10 +0000]
arch/tile: don't leak kernel memory when we unload modules

We were failing to track the memory when we allocated it.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: fix bug in delay_backoff()
Chris Metcalf [Thu, 29 Mar 2012 19:43:20 +0000]
arch/tile: fix bug in delay_backoff()

We were carefully computing a value to use for the number of loops
to spin for, and then ignoring it.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: fix bug in loading kernels larger than 16 MB
Chris Metcalf [Thu, 29 Mar 2012 19:42:27 +0000]
arch/tile: fix bug in loading kernels larger than 16 MB

Previously we only handled kernels up to a single huge page in size.
Now we create additional PTEs appropriately.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: don't enable irqs unconditionally in page fault handler
Chris Metcalf [Thu, 29 Mar 2012 19:40:50 +0000]
arch/tile: don't enable irqs unconditionally in page fault handler

If we took a page fault while we had interrupts disabled, we
shouldn't enable them in the page fault handler.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: don't set the homecache of a PTE unless appropriate
Chris Metcalf [Thu, 29 Mar 2012 19:36:53 +0000]
arch/tile: don't set the homecache of a PTE unless appropriate

We make sure not to try to set the home for an MMIO PTE (on tilegx)
or a PTE that isn't referencing memory managed by Linux.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: don't wait for migrating PTEs in an NMI handler
Chris Metcalf [Thu, 29 Mar 2012 19:34:52 +0000]
arch/tile: don't wait for migrating PTEs in an NMI handler

Doing so raises the possibility of self-deadlock if we are waiting
for a backtrace for an oprofile or perf interrupt while we are
in the middle of migrating our own stack page.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile/Makefile: use KCFLAGS when figuring out the libgcc path.
Chris Metcalf [Thu, 29 Mar 2012 19:30:19 +0000]
arch/tile/Makefile: use KCFLAGS when figuring out the libgcc path.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: fix a couple of comments that needed updating
Chris Metcalf [Thu, 29 Mar 2012 19:29:28 +0000]
arch/tile: fix a couple of comments that needed updating

Not associated with any code changes, so I'm just lumping these
comment changes into a commit by themselves.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoarch/tile: fix up some minor trap handling issues
Chris Metcalf [Thu, 29 Mar 2012 19:23:54 +0000]
arch/tile: fix up some minor trap handling issues

We now respond to MEM_ERROR traps (e.g. an atomic instruction to
non-cacheable memory) with a SIGBUS.

We also no longer generate a console crash message if a user
process die due to a SIGTRAP.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>