* [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review
@ 2013-09-02 8:53 Luis Henriques
2013-09-02 8:53 ` [PATCH 01/58] drm/i915/lvds: ditch ->prepare special case Luis Henriques
` (57 more replies)
0 siblings, 58 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Luis Henriques
This is the start of the review cycle for the Linux 3.5.7.21 stable kernel.
This version contains 58 new patches, summarized below. The new patches are
posted as replies to this message and also available in this git branch:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;h=linux-3.5.y-review;a=shortlog
git://kernel.ubuntu.com/ubuntu/linux.git linux-3.5.y-review
The review period for version 3.5.7.21 will be open for the next three days.
To report a problem, please reply to the relevant follow-up patch message.
For more information about the Linux 3.5.y.z extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .
-Luis
--
arch/alpha/Makefile | 2 +-
arch/arm/boot/dts/at91sam9n12ek.dts | 4 +-
arch/arm/kernel/perf_event.c | 10 +++-
arch/arm/mach-davinci/board-dm355-leopard.c | 1 +
arch/arm/mach-davinci/board-dm644x-evm.c | 1 +
arch/arm/mach-davinci/board-dm646x-evm.c | 1 +
arch/arm/mach-davinci/board-neuros-osd2.c | 1 +
arch/arm/mm/Kconfig | 9 ++--
arch/m68k/emu/natfeat.c | 23 +++++++--
arch/m68k/include/asm/div64.h | 9 ++--
arch/microblaze/configs/mmu_defconfig | 52 +++++++++++++------
arch/microblaze/configs/nommu_defconfig | 73 ++++++++++++++++-----------
arch/mips/Kconfig | 2 +-
arch/mips/include/asm/io.h | 5 ++
arch/mips/include/asm/page.h | 15 +++---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/page.h | 10 ++++
arch/powerpc/kernel/lparcfg.c | 23 ++++-----
arch/x86/kernel/sys_x86_64.c | 2 +-
arch/x86/mm/mmap.c | 6 ++-
arch/x86/xen/setup.c | 22 ++++++++
arch/xtensa/kernel/Makefile | 1 +
drivers/ata/libata-pmp.c | 12 ++---
drivers/ata/sata_fsl.c | 5 +-
drivers/base/memory.c | 2 +
drivers/bluetooth/ath3k.c | 2 +
drivers/bluetooth/btusb.c | 1 +
drivers/firmware/efivars.c | 27 ++++++++++
drivers/gpu/drm/i915/i915_reg.h | 2 +
drivers/gpu/drm/i915/intel_lvds.c | 8 +--
drivers/gpu/drm/i915/intel_ringbuffer.c | 12 +++++
drivers/net/can/usb/peak_usb/pcan_usb.c | 2 +-
drivers/net/wireless/hostap/hostap_ioctl.c | 4 +-
drivers/net/wireless/iwlegacy/4965-mac.c | 16 +++---
drivers/net/wireless/iwlegacy/common.c | 1 +
drivers/net/wireless/iwlwifi/iwl-mac80211.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 10 ++--
drivers/net/wireless/zd1201.c | 4 +-
drivers/of/fdt.c | 2 +
drivers/s390/scsi/zfcp_erp.c | 29 ++++++++---
drivers/s390/scsi/zfcp_qdio.c | 8 +--
drivers/tty/hvc/hvsi_lib.c | 4 +-
drivers/tty/serial/mxs-auart.c | 2 +-
drivers/usb/core/quirks.c | 6 +++
drivers/usb/misc/adutux.c | 2 +-
drivers/usb/serial/keyspan.c | 2 +-
drivers/usb/serial/mos7720.c | 21 +++++---
drivers/usb/serial/mos7840.c | 2 +-
drivers/usb/serial/ti_usb_3410_5052.c | 9 ++--
drivers/usb/serial/usb_wwan.c | 20 ++++----
drivers/usb/wusbcore/wa-xfer.c | 9 +++-
drivers/xen/events.c | 2 +-
fs/ext4/ext4_jbd2.c | 8 +--
fs/jfs/jfs_dtree.c | 31 +++++++++---
fs/nilfs2/segbuf.c | 5 +-
fs/proc/task_mmu.c | 8 +--
include/linux/mm_types.h | 1 +
include/linux/wait.h | 58 +++++++++++++++++++++
kernel/workqueue.c | 25 +++++++--
mm/nommu.c | 10 ++++
net/key/af_key.c | 1 +
sound/oss/Kconfig | 1 +
sound/soc/codecs/cs42l52.c | 2 +-
sound/usb/6fire/midi.c | 16 +++++-
sound/usb/6fire/midi.h | 6 +--
sound/usb/6fire/pcm.c | 41 ++++++++++++++-
sound/usb/6fire/pcm.h | 2 +-
sound/usb/mixer.c | 7 ++-
68 files changed, 532 insertions(+), 194 deletions(-)
AceLan Kao (1):
Bluetooth: Add support for Atheros [0cf3:3121]
Andreas Schwab (1):
m68k: Truncate base in do_div()
Anthony Foiani (1):
sata_fsl: save irqs while coalescing
Benjamin Herrenschmidt (1):
powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor
Brian Austin (1):
ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume
Chris Wilson (1):
drm/i915: Invalidate TLBs for the rings after a reset
Dan Carpenter (1):
Hostap: copying wrong data prism2_ioctl_giwaplist()
Daniel Vetter (1):
drm/i915/lvds: ditch ->prepare special case
Dave Kleikamp (1):
jfs: fix readdir cookie incompatibility with NFSv4
David Vrabel (2):
xen/events: initialize local per-cpu mask for all possible events
x86/xen: do not identity map UNUSABLE regions in the machine E820
Emmanuel Grumbach (1):
iwlwifi: pcie: disable L1 Active after pci_enable_device
Eugene Surovegin (1):
powerpc/hvsi: Increase handshake timeout from 200ms to 400ms.
Geert Uytterhoeven (1):
m68k/atari: ARAnyM - Fix NatFeat module support
Jan Kara (1):
jbd2: Fix use after free after error in jbd2_journal_dirty_metadata()
Johan Hovold (5):
USB: mos7840: fix big-endian probe
USB: adutux: fix big-endian device-type reporting
USB: ti_usb_3410_5052: fix big-endian firmware handling
USB: mos7720: fix broken control requests
USB: keyspan: fix null-deref at disconnect and release
Jussi Kivilinna (1):
zd1201: do not use stack as URB transfer_buffer
Lai Jiangshan (1):
workqueue: fix possible stall on try_to_grab_pending() of a delayed work item
Linus Torvalds (1):
vm: add no-mmu vm_iomap_memory() stub
Markos Chandras (1):
MIPS: Expose missing pci_io{map,unmap} declarations
Martin Peschke (2):
[SCSI] zfcp: fix lock imbalance by reworking request queue locking
[SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops
Matt Burtch (1):
USB-Serial: Fix error handling of usb_wwan
Matt Fleming (1):
efivars: explicitly calculate length of VariableName
Max Filippov (1):
xtensa: fix linker script transformation for .text.unlikely
Michal Simek (1):
microblaze: Update microblaze defconfigs
Nicolas Dichtel (1):
af_key: initialize satype in key_notify_policy_flush()
Nicolas Ferre (1):
ARM: at91/DT: fix at91sam9n12ek memory node
Nicolas Pitre (1):
ARM: 7816/1: CONFIG_KUSER_HELPERS: fix help text
Oliver Neukum (1):
usb: add two quirky touchscreen
Paul Bolle (1):
sound: Fix make allmodconfig on MIPS correctly
Paul Mackerras (1):
powerpc: Work around gcc miscompilation of __pa() on 64-bit
Radu Caragea (1):
x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member
Ralf Baechle (1):
MIPS: Rewrite pfn_valid to work in modules, too.
Russ Anderson (1):
drivers/base/memory.c: fix show_mem_removable() to handle missing sections
Sekhar Nori (1):
ARM: davinci: nand: specify ecc strength
Stanislaw Gruszka (3):
iwl4965: set power mode early
iwl4965: reset firmware after rfkill off
iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL
Stephane Grosjean (1):
can: pcan_usb: fix wrong memcpy() bytes length
Stephen Boyd (1):
ARM: 7810/1: perf: Fix array out of bounds access in armpmu_map_hw_event()
Takashi Iwai (1):
sound: Fix make allmodconfig on MIPS
Terry Suereth (1):
libata: apply behavioral quirks to sil3826 PMP
Thomas Pugliese (1):
wusbcore: fix kernel panic when disconnecting a wireless USB->serial device
Torstein Hegge (1):
ALSA: usb: Parse UAC2 extension unit like for UAC1
Torsten Schenk (2):
ALSA: 6fire: make buffers DMA-able (pcm)
ALSA: 6fire: make buffers DMA-able (midi)
Vyacheslav Dubeyko (2):
nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error
nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection
Will Deacon (2):
ARM: 7809/1: perf: fix event validation for software group leaders
alpha: makefile: don't enforce small data model for kernel builds
Wladislav Wiebe (1):
of: fdt: fix memory initialization for expanded DT
Wolfram Sang (1):
serial: mxs: fix buffer overflow
yonghua zheng (1):
fs/proc/task_mmu.c: fix buffer overflow in add_page_map()
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 01/58] drm/i915/lvds: ditch ->prepare special case
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 02/58] ALSA: usb: Parse UAC2 extension unit like for UAC1 Luis Henriques
` (56 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Takashi Iwai, Giacomo Comes, Daniel Vetter, Haitao Zhang,
Anthony Wong, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <daniel.vetter@ffwll.ch>
commit 520c41cf2fa029d1e8b923ac2026f96664f17c4b upstream.
LVDS is the first output where dpms on/off and prepare/commit don't
perfectly match. Now the idea behind this special case seems to be
that for simple resolution changes on the LVDS we don't need to stop
the pipe, because (at least on newer chips) we can adjust the panel
fitter on the fly.
There are a few problems with the current code though:
- We still stop and restart the pipe unconditionally, because the crtc
helper code isn't flexible enough.
- We show some ugly flickering, especially when changing crtcs (this
the crtc helper would actually take into account, but we don't
implement the encoder->get_crtc callback required to make this work
properly).
So it doesn't even work as advertised. I agree that it would be nice
to do resolution changes on LVDS (and also eDP) whithout blacking the
screen where the panel fitter allows to do that. But imo we should
implement this as a special case a few layers up in the mode set code,
akin to how we already detect simple framebuffer changes (and only
update the required registers with ->mode_set_base).
Until this is all in place, make our lives easier and just rip it out.
Also note that this seems to fix actual bugs with enabling the lvds
output, see:
http://lists.freedesktop.org/archives/intel-gfx/2012-July/018614.html
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Giacomo Comes <comes@naic.edu>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Takashi Iwai <tiwai@suse.de>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Haitao Zhang <haitao.zhang@canonical.com>
Cc: Anthony Wong <anthony.wong@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/gpu/drm/i915/intel_lvds.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 440ed88..30a6a15 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -408,13 +408,7 @@ static void intel_lvds_prepare(struct drm_encoder *encoder)
{
struct intel_lvds *intel_lvds = to_intel_lvds(encoder);
- /*
- * Prior to Ironlake, we must disable the pipe if we want to adjust
- * the panel fitter. However at all other times we can just reset
- * the registers regardless.
- */
- if (!HAS_PCH_SPLIT(encoder->dev) && intel_lvds->pfit_dirty)
- intel_lvds_disable(intel_lvds);
+ intel_lvds_disable(intel_lvds);
}
static void intel_lvds_commit(struct drm_encoder *encoder)
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 02/58] ALSA: usb: Parse UAC2 extension unit like for UAC1
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
2013-09-02 8:53 ` [PATCH 01/58] drm/i915/lvds: ditch ->prepare special case Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 03/58] serial: mxs: fix buffer overflow Luis Henriques
` (55 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Torstein Hegge, Takashi Iwai, Chris J Arges, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Torstein Hegge <hegge@resisty.net>
commit 61ac51301e6c6d4ed977d7674ce2b8e713619a9b upstream.
UAC2_EXTENSION_UNIT_V2 differs from UAC1_EXTENSION_UNIT, but can be handled in
the same way when parsing the unit. Otherwise parse_audio_unit() fails when it
sees an extension unit on a UAC2 device.
UAC2_EXTENSION_UNIT_V2 is outside the range allocated by UAC1.
Signed-off-by: Torstein Hegge <hegge@resisty.net>
Acked-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
sound/usb/mixer.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 3e513a8..9c6a7fe 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -720,7 +720,10 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_
return 0;
}
case UAC1_PROCESSING_UNIT:
- case UAC1_EXTENSION_UNIT: {
+ case UAC1_EXTENSION_UNIT:
+ /* UAC2_PROCESSING_UNIT_V2 */
+ /* UAC2_EFFECT_UNIT */
+ case UAC2_EXTENSION_UNIT_V2: {
struct uac_processing_unit_descriptor *d = p1;
if (d->bNrInPins) {
id = d->baSourceID[0];
@@ -1983,6 +1986,8 @@ static int parse_audio_unit(struct mixer_build *state, int unitid)
return parse_audio_extension_unit(state, unitid, p1);
else /* UAC_VERSION_2 */
return parse_audio_processing_unit(state, unitid, p1);
+ case UAC2_EXTENSION_UNIT_V2:
+ return parse_audio_extension_unit(state, unitid, p1);
default:
snd_printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]);
return -EINVAL;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 03/58] serial: mxs: fix buffer overflow
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
2013-09-02 8:53 ` [PATCH 01/58] drm/i915/lvds: ditch ->prepare special case Luis Henriques
2013-09-02 8:53 ` [PATCH 02/58] ALSA: usb: Parse UAC2 extension unit like for UAC1 Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 04/58] fs/proc/task_mmu.c: fix buffer overflow in add_page_map() Luis Henriques
` (54 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Wolfram Sang, Greg Kroah-Hartman, Kamal Mostafa, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Wolfram Sang <wsa@the-dreams.de>
commit 4829e7650f8a40645e4e32b26a37fb833a5e75f0 upstream.
SMATCH correctly found an off-by-one error:
drivers/tty/serial/mxs-auart.c:889 auart_console_write() error: buffer overflow 'auart_port' 5 <= 5
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/tty/serial/mxs-auart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 64565f8..5ceeed8 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -547,7 +547,7 @@ auart_console_write(struct console *co, const char *str, unsigned int count)
unsigned int old_ctrl0, old_ctrl2;
unsigned int to = 20000;
- if (co->index > MXS_AUART_PORTS || co->index < 0)
+ if (co->index >= MXS_AUART_PORTS || co->index < 0)
return;
s = auart_port[co->index];
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 04/58] fs/proc/task_mmu.c: fix buffer overflow in add_page_map()
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (2 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 03/58] serial: mxs: fix buffer overflow Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 05/58] af_key: initialize satype in key_notify_policy_flush() Luis Henriques
` (53 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Yonghua Zheng, Andrew Morton, Linus Torvalds, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: yonghua zheng <younghua.zheng@gmail.com>
commit 8c8296223f3abb142be8fc31711b18a704c0e7d8 upstream.
Recently we met quite a lot of random kernel panic issues after enabling
CONFIG_PROC_PAGE_MONITOR. After debuggind we found this has something
to do with following bug in pagemap:
In struct pagemapread:
struct pagemapread {
int pos, len;
pagemap_entry_t *buffer;
bool v2;
};
pos is number of PM_ENTRY_BYTES in buffer, but len is the size of
buffer, it is a mistake to compare pos and len in add_page_map() for
checking buffer is full or not, and this can lead to buffer overflow and
random kernel panic issue.
Correct len to be total number of PM_ENTRY_BYTES in buffer.
[akpm@linux-foundation.org: document pagemapread.pos and .len units, fix PM_ENTRY_BYTES definition]
Signed-off-by: Yonghua Zheng <younghua.zheng@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
fs/proc/task_mmu.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 4540b8f..1868fe1 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -693,14 +693,14 @@ typedef struct {
} pagemap_entry_t;
struct pagemapread {
- int pos, len;
+ int pos, len; /* units: PM_ENTRY_BYTES, not bytes */
pagemap_entry_t *buffer;
};
#define PAGEMAP_WALK_SIZE (PMD_SIZE)
#define PAGEMAP_WALK_MASK (PMD_MASK)
-#define PM_ENTRY_BYTES sizeof(u64)
+#define PM_ENTRY_BYTES sizeof(pagemap_entry_t)
#define PM_STATUS_BITS 3
#define PM_STATUS_OFFSET (64 - PM_STATUS_BITS)
#define PM_STATUS_MASK (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET)
@@ -939,8 +939,8 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
if (!count)
goto out_task;
- pm.len = PM_ENTRY_BYTES * (PAGEMAP_WALK_SIZE >> PAGE_SHIFT);
- pm.buffer = kmalloc(pm.len, GFP_TEMPORARY);
+ pm.len = (PAGEMAP_WALK_SIZE >> PAGE_SHIFT);
+ pm.buffer = kmalloc(pm.len * PM_ENTRY_BYTES, GFP_TEMPORARY);
ret = -ENOMEM;
if (!pm.buffer)
goto out_task;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 05/58] af_key: initialize satype in key_notify_policy_flush()
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (3 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 04/58] fs/proc/task_mmu.c: fix buffer overflow in add_page_map() Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 06/58] vm: add no-mmu vm_iomap_memory() stub Luis Henriques
` (52 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nicolas Dichtel, Steffen Klassert, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
commit 85dfb745ee40232876663ae206cba35f24ab2a40 upstream.
This field was left uninitialized. Some user daemons perform check against this
field.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
net/key/af_key.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 7dcb525..b606ce5 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2687,6 +2687,7 @@ static int key_notify_policy_flush(const struct km_event *c)
hdr->sadb_msg_pid = c->pid;
hdr->sadb_msg_version = PF_KEY_V2;
hdr->sadb_msg_errno = (uint8_t) 0;
+ hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC;
hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
hdr->sadb_msg_reserved = 0;
pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 06/58] vm: add no-mmu vm_iomap_memory() stub
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (4 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 05/58] af_key: initialize satype in key_notify_policy_flush() Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 07/58] iwl4965: set power mode early Luis Henriques
` (51 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Linus Torvalds, Geert Uytterhoeven, Guenter Roeck, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <torvalds@linux-foundation.org>
commit 3c0b9de6d37a481673e81001c57ca0e410c72346 upstream.
I think we could just move the full vm_iomap_memory() function into
util.h or similar, but I didn't get any reply from anybody actually
using nommu even to this trivial patch, so I'm not going to touch it any
more than required.
Here's the fairly minimal stub to make the nommu case at least
potentially work. It doesn't seem like anybody cares, though.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
mm/nommu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mm/nommu.c b/mm/nommu.c
index a60db99..572c4c0 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1827,6 +1827,16 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
}
EXPORT_SYMBOL(remap_pfn_range);
+int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len)
+{
+ unsigned long pfn = start >> PAGE_SHIFT;
+ unsigned long vm_len = vma->vm_end - vma->vm_start;
+
+ pfn += vma->vm_pgoff;
+ return io_remap_pfn_range(vma, vma->vm_start, pfn, vm_len, vma->vm_page_prot);
+}
+EXPORT_SYMBOL(vm_iomap_memory);
+
int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
unsigned long pgoff)
{
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 07/58] iwl4965: set power mode early
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (5 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 06/58] vm: add no-mmu vm_iomap_memory() stub Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 08/58] iwl4965: reset firmware after rfkill off Luis Henriques
` (50 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stanislaw Gruszka, John W. Linville, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <sgruszka@redhat.com>
commit eca396d7a5bdcc1fd67b1b12f737c213ac78a6f4 upstream.
If device was put into a sleep and system was restarted or module
reloaded, we have to wake device up before sending other commands.
Otherwise it will fail to start with Microcode error.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index ff5d689..b7528ef 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5285,6 +5285,9 @@ il4965_alive_start(struct il_priv *il)
il->active_rate = RATES_MASK;
+ il_power_update_mode(il, true);
+ D_INFO("Updated power mode\n");
+
if (il_is_associated(il)) {
struct il_rxon_cmd *active_rxon =
(struct il_rxon_cmd *)&il->active;
@@ -5315,9 +5318,6 @@ il4965_alive_start(struct il_priv *il)
D_INFO("ALIVE processing complete.\n");
wake_up(&il->wait_command_queue);
- il_power_update_mode(il, true);
- D_INFO("Updated power mode\n");
-
return;
restart:
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 08/58] iwl4965: reset firmware after rfkill off
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (6 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 07/58] iwl4965: set power mode early Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 09/58] ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume Luis Henriques
` (49 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stanislaw Gruszka, John W. Linville, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <sgruszka@redhat.com>
commit 788f7a56fce1bcb2067b62b851a086fca48a0056 upstream.
Using rfkill switch can make firmware unstable, what cause various
Microcode errors and kernel warnings. Reseting firmware just after
rfkill off (radio on) helped with that.
Resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=977053
Reported-and-tested-by: Justin Pearce <whitefox@guardianfox.net>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 10 +++++-----
drivers/net/wireless/iwlegacy/common.c | 1 +
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index b7528ef..cbcf6f2 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -4411,12 +4411,12 @@ il4965_irq_tasklet(struct il_priv *il)
* is killed. Hence update the killswitch state here. The
* rfkill handler will care about restarting if needed.
*/
- if (!test_bit(S_ALIVE, &il->status)) {
- if (hw_rf_kill)
- set_bit(S_RFKILL, &il->status);
- else
- clear_bit(S_RFKILL, &il->status);
+ if (hw_rf_kill) {
+ set_bit(S_RFKILL, &il->status);
+ } else {
+ clear_bit(S_RFKILL, &il->status);
wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
+ il_force_reset(il, true);
}
handled |= CSR_INT_BIT_RF_KILL;
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index e2b25eb..6f9c1fa 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4659,6 +4659,7 @@ il_force_reset(struct il_priv *il, bool external)
return 0;
}
+EXPORT_SYMBOL(il_force_reset);
int
il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 09/58] ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (7 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 08/58] iwl4965: reset firmware after rfkill off Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 10/58] can: pcan_usb: fix wrong memcpy() bytes length Luis Henriques
` (48 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Brian Austin, Mark Brown, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Austin <brian.austin@cirrus.com>
commit e2c98a8bba958045bde861fe1d66be54315c7790 upstream.
Beep Volume Min/Max was backwards.
Change to SOC_SONGLE_SX_TLV for correct volume representation
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
sound/soc/codecs/cs42l52.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index 539e2f3..21b5d89 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -451,7 +451,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
SOC_ENUM("Beep Pitch", beep_pitch_enum),
SOC_ENUM("Beep on Time", beep_ontime_enum),
SOC_ENUM("Beep off Time", beep_offtime_enum),
- SOC_SINGLE_TLV("Beep Volume", CS42L52_BEEP_VOL, 0, 0x1f, 0x07, hl_tlv),
+ SOC_SINGLE_SX_TLV("Beep Volume", CS42L52_BEEP_VOL, 0, 0x07, 0x1f, hl_tlv),
SOC_SINGLE("Beep Mixer Switch", CS42L52_BEEP_TONE_CTL, 5, 1, 1),
SOC_ENUM("Beep Treble Corner Freq", beep_treble_enum),
SOC_ENUM("Beep Bass Corner Freq", beep_bass_enum),
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 10/58] can: pcan_usb: fix wrong memcpy() bytes length
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (8 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 09/58] ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 11/58] ALSA: 6fire: make buffers DMA-able (pcm) Luis Henriques
` (47 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stephane Grosjean, Marc Kleine-Budde, David S. Miller, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephane Grosjean <s.grosjean@peak-system.com>
commit 3c322a56b01695df15c70bfdc2d02e0ccd80654e upstream.
Fix possibly wrong memcpy() bytes length since some CAN records received from
PCAN-USB could define a DLC field in range [9..15].
In that case, the real DLC value MUST be used to move forward the record pointer
but, only 8 bytes max. MUST be copied into the data field of the struct
can_frame object of the skb given to the network core.
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/net/can/usb/peak_usb/pcan_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index 25723d8..925ab8e 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -649,7 +649,7 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)
if ((mc->ptr + rec_len) > mc->end)
goto decode_failed;
- memcpy(cf->data, mc->ptr, rec_len);
+ memcpy(cf->data, mc->ptr, cf->can_dlc);
mc->ptr += rec_len;
}
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 11/58] ALSA: 6fire: make buffers DMA-able (pcm)
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (9 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 10/58] can: pcan_usb: fix wrong memcpy() bytes length Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 12/58] ALSA: 6fire: make buffers DMA-able (midi) Luis Henriques
` (46 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Torsten Schenk, Takashi Iwai, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Torsten Schenk <torsten.schenk@zoho.com>
commit 5ece263f1d93fba8d992e67e3ab8a71acf674db9 upstream.
Patch makes pcm buffers DMA-able by allocating each one separately.
Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
sound/usb/6fire/pcm.c | 41 ++++++++++++++++++++++++++++++++++++++++-
sound/usb/6fire/pcm.h | 2 +-
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c
index 7c4f311..51e3f62f 100644
--- a/sound/usb/6fire/pcm.c
+++ b/sound/usb/6fire/pcm.c
@@ -578,6 +578,33 @@ static void __devinit usb6fire_pcm_init_urb(struct pcm_urb *urb,
urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB;
}
+static int usb6fire_pcm_buffers_init(struct pcm_runtime *rt)
+{
+ int i;
+
+ for (i = 0; i < PCM_N_URBS; i++) {
+ rt->out_urbs[i].buffer = kzalloc(PCM_N_PACKETS_PER_URB
+ * PCM_MAX_PACKET_SIZE, GFP_KERNEL);
+ if (!rt->out_urbs[i].buffer)
+ return -ENOMEM;
+ rt->in_urbs[i].buffer = kzalloc(PCM_N_PACKETS_PER_URB
+ * PCM_MAX_PACKET_SIZE, GFP_KERNEL);
+ if (!rt->in_urbs[i].buffer)
+ return -ENOMEM;
+ }
+ return 0;
+}
+
+static void usb6fire_pcm_buffers_destroy(struct pcm_runtime *rt)
+{
+ int i;
+
+ for (i = 0; i < PCM_N_URBS; i++) {
+ kfree(rt->out_urbs[i].buffer);
+ kfree(rt->in_urbs[i].buffer);
+ }
+}
+
int __devinit usb6fire_pcm_init(struct sfire_chip *chip)
{
int i;
@@ -589,6 +616,13 @@ int __devinit usb6fire_pcm_init(struct sfire_chip *chip)
if (!rt)
return -ENOMEM;
+ ret = usb6fire_pcm_buffers_init(rt);
+ if (ret) {
+ usb6fire_pcm_buffers_destroy(rt);
+ kfree(rt);
+ return ret;
+ }
+
rt->chip = chip;
rt->stream_state = STREAM_DISABLED;
rt->rate = ARRAY_SIZE(rates);
@@ -610,6 +644,7 @@ int __devinit usb6fire_pcm_init(struct sfire_chip *chip)
ret = snd_pcm_new(chip->card, "DMX6FireUSB", 0, 1, 1, &pcm);
if (ret < 0) {
+ usb6fire_pcm_buffers_destroy(rt);
kfree(rt);
snd_printk(KERN_ERR PREFIX "cannot create pcm instance.\n");
return ret;
@@ -625,6 +660,7 @@ int __devinit usb6fire_pcm_init(struct sfire_chip *chip)
snd_dma_continuous_data(GFP_KERNEL),
MAX_BUFSIZE, MAX_BUFSIZE);
if (ret) {
+ usb6fire_pcm_buffers_destroy(rt);
kfree(rt);
snd_printk(KERN_ERR PREFIX
"error preallocating pcm buffers.\n");
@@ -669,6 +705,9 @@ void usb6fire_pcm_abort(struct sfire_chip *chip)
void usb6fire_pcm_destroy(struct sfire_chip *chip)
{
- kfree(chip->pcm);
+ struct pcm_runtime *rt = chip->pcm;
+
+ usb6fire_pcm_buffers_destroy(rt);
+ kfree(rt);
chip->pcm = NULL;
}
diff --git a/sound/usb/6fire/pcm.h b/sound/usb/6fire/pcm.h
index 3104301..84610cf 100644
--- a/sound/usb/6fire/pcm.h
+++ b/sound/usb/6fire/pcm.h
@@ -32,7 +32,7 @@ struct pcm_urb {
struct urb instance;
struct usb_iso_packet_descriptor packets[PCM_N_PACKETS_PER_URB];
/* END DO NOT SEPARATE */
- u8 buffer[PCM_N_PACKETS_PER_URB * PCM_MAX_PACKET_SIZE];
+ u8 *buffer;
struct pcm_urb *peer;
};
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 12/58] ALSA: 6fire: make buffers DMA-able (midi)
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (10 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 11/58] ALSA: 6fire: make buffers DMA-able (pcm) Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 13/58] jbd2: Fix use after free after error in jbd2_journal_dirty_metadata() Luis Henriques
` (45 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Torsten Schenk, Takashi Iwai, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Torsten Schenk <torsten.schenk@zoho.com>
commit 4c2aee0032b70083dafebd733ed9c774633b2fa3 upstream.
Patch makes midi output buffer DMA-able by allocating it separately.
Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
sound/usb/6fire/midi.c | 16 +++++++++++++++-
sound/usb/6fire/midi.h | 6 +-----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/sound/usb/6fire/midi.c b/sound/usb/6fire/midi.c
index f0e5179..0c09867 100644
--- a/sound/usb/6fire/midi.c
+++ b/sound/usb/6fire/midi.c
@@ -19,6 +19,10 @@
#include "chip.h"
#include "comm.h"
+enum {
+ MIDI_BUFSIZE = 64
+};
+
static void usb6fire_midi_out_handler(struct urb *urb)
{
struct midi_runtime *rt = urb->context;
@@ -156,6 +160,12 @@ int __devinit usb6fire_midi_init(struct sfire_chip *chip)
if (!rt)
return -ENOMEM;
+ rt->out_buffer = kzalloc(MIDI_BUFSIZE, GFP_KERNEL);
+ if (!rt->out_buffer) {
+ kfree(rt);
+ return -ENOMEM;
+ }
+
rt->chip = chip;
rt->in_received = usb6fire_midi_in_received;
rt->out_buffer[0] = 0x80; /* 'send midi' command */
@@ -169,6 +179,7 @@ int __devinit usb6fire_midi_init(struct sfire_chip *chip)
ret = snd_rawmidi_new(chip->card, "6FireUSB", 0, 1, 1, &rt->instance);
if (ret < 0) {
+ kfree(rt->out_buffer);
kfree(rt);
snd_printk(KERN_ERR PREFIX "unable to create midi.\n");
return ret;
@@ -197,6 +208,9 @@ void usb6fire_midi_abort(struct sfire_chip *chip)
void usb6fire_midi_destroy(struct sfire_chip *chip)
{
- kfree(chip->midi);
+ struct midi_runtime *rt = chip->midi;
+
+ kfree(rt->out_buffer);
+ kfree(rt);
chip->midi = NULL;
}
diff --git a/sound/usb/6fire/midi.h b/sound/usb/6fire/midi.h
index 5114ecc..d101ecb 100644
--- a/sound/usb/6fire/midi.h
+++ b/sound/usb/6fire/midi.h
@@ -16,10 +16,6 @@
#include "common.h"
-enum {
- MIDI_BUFSIZE = 64
-};
-
struct midi_runtime {
struct sfire_chip *chip;
struct snd_rawmidi *instance;
@@ -32,7 +28,7 @@ struct midi_runtime {
struct snd_rawmidi_substream *out;
struct urb out_urb;
u8 out_serial; /* serial number of out packet */
- u8 out_buffer[MIDI_BUFSIZE];
+ u8 *out_buffer;
int buffer_offset;
void (*in_received)(struct midi_runtime *rt, u8 *data, int length);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 13/58] jbd2: Fix use after free after error in jbd2_journal_dirty_metadata()
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (11 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 12/58] ALSA: 6fire: make buffers DMA-able (midi) Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:53 ` [PATCH 14/58] USB-Serial: Fix error handling of usb_wwan Luis Henriques
` (44 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jan Kara, Theodore Ts'o, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit 91aa11fae1cf8c2fd67be0609692ea9741cdcc43 upstream.
When jbd2_journal_dirty_metadata() returns error,
__ext4_handle_dirty_metadata() stops the handle. However callers of this
function do not count with that fact and still happily used now freed
handle. This use after free can result in various issues but very likely
we oops soon.
The motivation of adding __ext4_journal_stop() into
__ext4_handle_dirty_metadata() in commit 9ea7a0df seems to be only to
improve error reporting. So replace __ext4_journal_stop() with
ext4_journal_abort_handle() which was there before that commit and add
WARN_ON_ONCE() to dump stack to provide useful information.
Reported-by: Sage Weil <sage@inktank.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
fs/ext4/ext4_jbd2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index f4f0ee6..a202728 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -109,10 +109,10 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
if (ext4_handle_valid(handle)) {
err = jbd2_journal_dirty_metadata(handle, bh);
- if (err) {
- /* Errors can only happen if there is a bug */
- handle->h_err = err;
- __ext4_journal_stop(where, line, handle);
+ /* Errors can only happen if there is a bug */
+ if (WARN_ON_ONCE(err)) {
+ ext4_journal_abort_handle(where, line, __func__, bh,
+ handle, err);
}
} else {
if (inode)
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 14/58] USB-Serial: Fix error handling of usb_wwan
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (12 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 13/58] jbd2: Fix use after free after error in jbd2_journal_dirty_metadata() Luis Henriques
@ 2013-09-02 8:53 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 15/58] USB: mos7840: fix big-endian probe Luis Henriques
` (43 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Matt Burtch, Greg Kroah-Hartman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Burtch <matt@grid-net.com>
commit 6c1ee66a0b2bdbd64c078fba684d640cf2fd38a9 upstream.
This fixes an issue where the bulk-in urb used for incoming data transfer
is not resubmitted if the packet recieved contains an error status. This
results in the driver locking until the port is closed and re-opened.
Tested on a custom board with a Cinterion GSM module.
Signed-off-by: Matt Burtch <matt@grid-net.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.5:
- adjusted context
- replaced dev_err() by printk() ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/usb/serial/usb_wwan.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index 25c8ee9..2956414 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -297,18 +297,18 @@ static void usb_wwan_indat_callback(struct urb *urb)
tty_kref_put(tty);
}
- /* Resubmit urb so we continue receiving */
- err = usb_submit_urb(urb, GFP_ATOMIC);
- if (err) {
- if (err != -EPERM) {
- printk(KERN_ERR "%s: resubmit read urb failed. "
- "(%d)", __func__, err);
- /* busy also in error unless we are killed */
- usb_mark_last_busy(port->serial->dev);
- }
- } else {
+ }
+ /* Resubmit urb so we continue receiving */
+ err = usb_submit_urb(urb, GFP_ATOMIC);
+ if (err) {
+ if (err != -EPERM) {
+ printk(KERN_ERR "%s: resubmit read urb failed. (%d)\n",
+ __func__, err);
+ /* busy also in error unless we are killed */
usb_mark_last_busy(port->serial->dev);
}
+ } else {
+ usb_mark_last_busy(port->serial->dev);
}
}
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 15/58] USB: mos7840: fix big-endian probe
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (13 preceding siblings ...)
2013-09-02 8:53 ` [PATCH 14/58] USB-Serial: Fix error handling of usb_wwan Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 16/58] USB: adutux: fix big-endian device-type reporting Luis Henriques
` (42 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hovold, Greg Kroah-Hartman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <jhovold@gmail.com>
commit d551ec9b690f3de65b0091a2e767f1382adc792d upstream.
Fix bug in device-type detection on big-endian machines originally
introduced by commit 0eafe4de ("USB: serial: mos7840: add support for
MCS7810 devices") which always matched on little-endian product ids.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/usb/serial/mos7840.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 0d51815..d9368be 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2405,7 +2405,7 @@ static int mos7810_check(struct usb_serial *serial)
static int mos7840_probe(struct usb_serial *serial,
const struct usb_device_id *id)
{
- u16 product = serial->dev->descriptor.idProduct;
+ u16 product = le16_to_cpu(serial->dev->descriptor.idProduct);
u8 *buf;
int device_type;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 16/58] USB: adutux: fix big-endian device-type reporting
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (14 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 15/58] USB: mos7840: fix big-endian probe Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 17/58] USB: ti_usb_3410_5052: fix big-endian firmware handling Luis Henriques
` (41 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hovold, Greg Kroah-Hartman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <jhovold@gmail.com>
commit d482b9d558602a9cacab063b1c8779f9b5214da7 upstream.
Make sure the reported device-type on big-endian machines is the same as
on little-endian ones.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/usb/misc/adutux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index 284b854..14d9142 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -829,7 +829,7 @@ static int adu_probe(struct usb_interface *interface,
/* let the user know what node this device is now attached to */
dev_info(&interface->dev, "ADU%d %s now attached to /dev/usb/adutux%d\n",
- udev->descriptor.idProduct, dev->serial_number,
+ le16_to_cpu(udev->descriptor.idProduct), dev->serial_number,
(dev->minor - ADU_MINOR_BASE));
exit:
dbg(2," %s : leave, return value %p (dev)", __func__, dev);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 17/58] USB: ti_usb_3410_5052: fix big-endian firmware handling
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (15 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 16/58] USB: adutux: fix big-endian device-type reporting Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 18/58] ARM: 7809/1: perf: fix event validation for software group leaders Luis Henriques
` (40 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hovold, Greg Kroah-Hartman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <jhovold@gmail.com>
commit e877dd2f2581628b7119df707d4cf03d940cff49 upstream.
Fix endianess bugs in firmware handling introduced by commits cb7a7c6a
("ti_usb_3410_5052: add Multi-Tech modem support") and 05a3d905
("ti_usb_3410_5052: support alternate firmware") which made the driver
use the wrong firmware for certain devices on big-endian machines.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/usb/serial/ti_usb_3410_5052.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 2f02f79..ea41faa 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1641,14 +1641,15 @@ static int ti_download_firmware(struct ti_device *tdev)
char buf[32];
/* try ID specific firmware first, then try generic firmware */
- sprintf(buf, "ti_usb-v%04x-p%04x.fw", dev->descriptor.idVendor,
- dev->descriptor.idProduct);
+ sprintf(buf, "ti_usb-v%04x-p%04x.fw",
+ le16_to_cpu(dev->descriptor.idVendor),
+ le16_to_cpu(dev->descriptor.idProduct));
status = request_firmware(&fw_p, buf, &dev->dev);
if (status != 0) {
buf[0] = '\0';
- if (dev->descriptor.idVendor == MTS_VENDOR_ID) {
- switch (dev->descriptor.idProduct) {
+ if (le16_to_cpu(dev->descriptor.idVendor) == MTS_VENDOR_ID) {
+ switch (le16_to_cpu(dev->descriptor.idProduct)) {
case MTS_CDMA_PRODUCT_ID:
strcpy(buf, "mts_cdma.fw");
break;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 18/58] ARM: 7809/1: perf: fix event validation for software group leaders
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (16 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 17/58] USB: ti_usb_3410_5052: fix big-endian firmware handling Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 19/58] m68k/atari: ARAnyM - Fix NatFeat module support Luis Henriques
` (39 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Will Deacon, Russell King, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit c95eb3184ea1a3a2551df57190c81da695e2144b upstream.
It is possible to construct an event group with a software event as a
group leader and then subsequently add a hardware event to the group.
This results in the event group being validated by adding all members
of the group to a fake PMU and attempting to allocate each event on
their respective PMU.
Unfortunately, for software events wthout a corresponding arm_pmu, this
results in a kernel crash attempting to dereference the ->get_event_idx
function pointer.
This patch fixes the problem by checking explicitly for software events
and ignoring those in event validation (since they can always be
scheduled). We will probably want to revisit this for 3.12, since the
validation checks don't appear to work correctly when dealing with
multiple hardware PMUs anyway.
Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Tested-by: Vince Weaver <vincent.weaver@maine.edu>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/arm/kernel/perf_event.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 55790a5..522c11d 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -319,6 +319,9 @@ validate_event(struct pmu_hw_events *hw_events,
struct hw_perf_event fake_event = event->hw;
struct pmu *leader_pmu = event->group_leader->pmu;
+ if (is_software_event(event))
+ return 1;
+
if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
return 1;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 19/58] m68k/atari: ARAnyM - Fix NatFeat module support
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (17 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 18/58] ARM: 7809/1: perf: fix event validation for software group leaders Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 20/58] m68k: Truncate base in do_div() Luis Henriques
` (38 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Geert Uytterhoeven, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <geert@linux-m68k.org>
commit e8184e10f89736a23ea6eea8e24cd524c5c513d2 upstream.
As pointed out by Andreas Schwab, pointers passed to ARAnyM NatFeat calls
should be physical addresses, not virtual addresses.
Fortunately on Atari, physical and virtual kernel addresses are the same,
as long as normal kernel memory is concerned, so this usually worked fine
without conversion.
But for modules, pointers to literal strings are located in vmalloc()ed
memory. Depending on the version of ARAnyM, this causes the nf_get_id()
call to just fail, or worse, crash ARAnyM itself with e.g.
Gotcha! Illegal memory access. Atari PC = $968c
This is a big issue for distro kernels, who want to have all drivers as
loadable modules in an initrd.
Add a wrapper for nf_get_id() that copies the literal to the stack to
work around this issue.
Reported-by: Thorsten Glaser <tg@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/m68k/emu/natfeat.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/arch/m68k/emu/natfeat.c b/arch/m68k/emu/natfeat.c
index 2291a7d..fa277ae 100644
--- a/arch/m68k/emu/natfeat.c
+++ b/arch/m68k/emu/natfeat.c
@@ -18,9 +18,11 @@
#include <asm/machdep.h>
#include <asm/natfeat.h>
+extern long nf_get_id2(const char *feature_name);
+
asm("\n"
-" .global nf_get_id,nf_call\n"
-"nf_get_id:\n"
+" .global nf_get_id2,nf_call\n"
+"nf_get_id2:\n"
" .short 0x7300\n"
" rts\n"
"nf_call:\n"
@@ -29,12 +31,25 @@ asm("\n"
"1: moveq.l #0,%d0\n"
" rts\n"
" .section __ex_table,\"a\"\n"
-" .long nf_get_id,1b\n"
+" .long nf_get_id2,1b\n"
" .long nf_call,1b\n"
" .previous");
-EXPORT_SYMBOL_GPL(nf_get_id);
EXPORT_SYMBOL_GPL(nf_call);
+long nf_get_id(const char *feature_name)
+{
+ /* feature_name may be in vmalloc()ed memory, so make a copy */
+ char name_copy[32];
+ size_t n;
+
+ n = strlcpy(name_copy, feature_name, sizeof(name_copy));
+ if (n >= sizeof(name_copy))
+ return 0;
+
+ return nf_get_id2(name_copy);
+}
+EXPORT_SYMBOL_GPL(nf_get_id);
+
void nfprint(const char *fmt, ...)
{
static char buf[256];
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 20/58] m68k: Truncate base in do_div()
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (18 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 19/58] m68k/atari: ARAnyM - Fix NatFeat module support Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 21/58] usb: add two quirky touchscreen Luis Henriques
` (37 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andreas Schwab, Geert Uytterhoeven, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Schwab <schwab@linux-m68k.org>
commit ea077b1b96e073eac5c3c5590529e964767fc5f7 upstream.
Explicitly truncate the second operand of do_div() to 32 bits to guard
against bogus code calling it with a 64-bit divisor.
[Thorsten]
After upgrading from 3.2 to 3.10, mounting a btrfs volume fails with:
btrfs: setting nodatacow, compression disabled
btrfs: enabling auto recovery
btrfs: disk space caching is enabled
*** ZERO DIVIDE *** FORMAT=2
Current process id is 722
BAD KERNEL TRAP: 00000000
Modules linked in: evdev mac_hid ext4 crc16 jbd2 mbcache btrfs xor lzo_compress zlib_deflate raid6_pq crc32c libcrc32c
PC: [<319535b2>] __btrfs_map_block+0x11c/0x119a [btrfs]
SR: 2000 SP: 30c1fab4 a2: 30f0faf0
d0: 00000000 d1: 00001000 d2: 00000000 d3: 00000000
d4: 00010000 d5: 00000000 a0: 3085c72c a1: 3085c72c
Process mount (pid: 722, task=30f0faf0)
Frame format=2 instr addr=319535ae
Stack from 30c1faec:
00000000 00000020 00000000 00001000 00000000 01401000 30253928 300ffc00
00a843ac 3026f640 00000000 00010000 0009e250 00d106c0 00011220 00000000
00001000 301c6830 0009e32a 000000ff 00000009 3085c72c 00000000 00000000
30c1fd14 00000000 00000020 00000000 30c1fd14 0009e26c 00000020 00000003
00000000 0009dd8a 300b0b6c 30253928 00a843ac 00001000 00000000 00000000
0000a008 3194e76a 30253928 00a843ac 00001000 00000000 00000000 00000002
Call Trace: [<00001000>] kernel_pg_dir+0x0/0x1000
[...]
Code: 222e ff74 2a2e ff5c 2c2e ff60 4c45 1402 <2d40> ff64 2d41 ff68 2205 4c2e 1800 ff68 4c04 0800 2041 d1c0 2206 4c2e 1400 ff68
[Geert]
As diagnosed by Andreas, fs/btrfs/volumes.c:__btrfs_map_block()
calls
do_div(stripe_nr, stripe_len);
with stripe_len u64, while do_div() assumes the divisor is a 32-bit number.
Due to the lack of truncation in the m68k-specific implementation of
do_div(), the division is performed using the upper 32-bit word of
stripe_len, which is zero.
This was introduced by commit 53b381b3abeb86f12787a6c40fee9b2f71edc23b
("Btrfs: RAID5 and RAID6"), which changed the divisor from
map->stripe_len (struct map_lookup.stripe_len is int) to a 64-bit temporary.
Reported-by: Thorsten Glaser <tg@debian.org>
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Tested-by: Thorsten Glaser <tg@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/m68k/include/asm/div64.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/m68k/include/asm/div64.h b/arch/m68k/include/asm/div64.h
index 444ea8a..ef881cf 100644
--- a/arch/m68k/include/asm/div64.h
+++ b/arch/m68k/include/asm/div64.h
@@ -15,16 +15,17 @@
unsigned long long n64; \
} __n; \
unsigned long __rem, __upper; \
+ unsigned long __base = (base); \
\
__n.n64 = (n); \
if ((__upper = __n.n32[0])) { \
asm ("divul.l %2,%1:%0" \
- : "=d" (__n.n32[0]), "=d" (__upper) \
- : "d" (base), "0" (__n.n32[0])); \
+ : "=d" (__n.n32[0]), "=d" (__upper) \
+ : "d" (__base), "0" (__n.n32[0])); \
} \
asm ("divu.l %2,%1:%0" \
- : "=d" (__n.n32[1]), "=d" (__rem) \
- : "d" (base), "1" (__upper), "0" (__n.n32[1])); \
+ : "=d" (__n.n32[1]), "=d" (__rem) \
+ : "d" (__base), "1" (__upper), "0" (__n.n32[1])); \
(n) = __n.n64; \
__rem; \
})
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 21/58] usb: add two quirky touchscreen
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (19 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 20/58] m68k: Truncate base in do_div() Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 22/58] USB: mos7720: fix broken control requests Luis Henriques
` (36 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Oliver Neukum, Greg Kroah-Hartman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <oneukum@suse.de>
commit 304ab4ab079a8ed03ce39f1d274964a532db036b upstream.
These devices tend to become unresponsive after S3
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/usb/core/quirks.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index b801512..d67ff42 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -103,6 +103,12 @@ static const struct usb_device_id usb_quirk_list[] = {
{ USB_DEVICE(0x04d8, 0x000c), .driver_info =
USB_QUIRK_CONFIG_INTF_STRINGS },
+ /* CarrolTouch 4000U */
+ { USB_DEVICE(0x04e7, 0x0009), .driver_info = USB_QUIRK_RESET_RESUME },
+
+ /* CarrolTouch 4500U */
+ { USB_DEVICE(0x04e7, 0x0030), .driver_info = USB_QUIRK_RESET_RESUME },
+
/* Samsung Android phone modem - ID conflict with SPH-I500 */
{ USB_DEVICE(0x04e8, 0x6601), .driver_info =
USB_QUIRK_CONFIG_INTF_STRINGS },
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 22/58] USB: mos7720: fix broken control requests
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (20 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 21/58] usb: add two quirky touchscreen Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 23/58] USB: keyspan: fix null-deref at disconnect and release Luis Henriques
` (35 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hovold, Greg Kroah-Hartman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <jhovold@gmail.com>
commit ef6c8c1d733e244f0499035be0dabe1f4ed98c6f upstream.
The parallel-port code of the drivers used a stack allocated
control-request buffer for asynchronous (and possibly deferred) control
requests. This not only violates the no-DMA-from-stack requirement but
could also lead to corrupt control requests being submitted.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/usb/serial/mos7720.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 614ad93..9809fbc 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -97,6 +97,7 @@ struct urbtracker {
struct list_head urblist_entry;
struct kref ref_count;
struct urb *urb;
+ struct usb_ctrlrequest *setup;
};
enum mos7715_pp_modes {
@@ -278,6 +279,7 @@ static void destroy_urbtracker(struct kref *kref)
struct mos7715_parport *mos_parport = urbtrack->mos_parport;
usb_free_urb(urbtrack->urb);
+ kfree(urbtrack->setup);
kfree(urbtrack);
kref_put(&mos_parport->ref_count, destroy_mos_parport);
}
@@ -360,7 +362,6 @@ static int write_parport_reg_nonblock(struct mos7715_parport *mos_parport,
struct urbtracker *urbtrack;
int ret_val;
unsigned long flags;
- struct usb_ctrlrequest setup;
struct usb_serial *serial = mos_parport->serial;
struct usb_device *usbdev = serial->dev;
@@ -378,14 +379,20 @@ static int write_parport_reg_nonblock(struct mos7715_parport *mos_parport,
kfree(urbtrack);
return -ENOMEM;
}
- setup.bRequestType = (__u8)0x40;
- setup.bRequest = (__u8)0x0e;
- setup.wValue = get_reg_value(reg, dummy);
- setup.wIndex = get_reg_index(reg);
- setup.wLength = 0;
+ urbtrack->setup = kmalloc(sizeof(*urbtrack->setup), GFP_KERNEL);
+ if (!urbtrack->setup) {
+ usb_free_urb(urbtrack->urb);
+ kfree(urbtrack);
+ return -ENOMEM;
+ }
+ urbtrack->setup->bRequestType = (__u8)0x40;
+ urbtrack->setup->bRequest = (__u8)0x0e;
+ urbtrack->setup->wValue = get_reg_value(reg, dummy);
+ urbtrack->setup->wIndex = get_reg_index(reg);
+ urbtrack->setup->wLength = 0;
usb_fill_control_urb(urbtrack->urb, usbdev,
usb_sndctrlpipe(usbdev, 0),
- (unsigned char *)&setup,
+ (unsigned char *)urbtrack->setup,
NULL, 0, async_complete, urbtrack);
kref_init(&urbtrack->ref_count);
INIT_LIST_HEAD(&urbtrack->urblist_entry);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 23/58] USB: keyspan: fix null-deref at disconnect and release
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (21 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 22/58] USB: mos7720: fix broken control requests Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 24/58] MIPS: Expose missing pci_io{map,unmap} declarations Luis Henriques
` (34 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hovold, Greg Kroah-Hartman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <jhovold@gmail.com>
commit ff8a43c10f1440f07a5faca0c1556921259f7f76 upstream.
Make sure to fail properly if the device is not accepted during attach
in order to avoid null-pointer derefs (of missing interface private
data) at disconnect or release.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/usb/serial/keyspan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 2d35ad4..9b55796 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -2439,7 +2439,7 @@ static int keyspan_startup(struct usb_serial *serial)
if (d_details == NULL) {
dev_err(&serial->dev->dev, "%s - unknown product id %x\n",
__func__, le16_to_cpu(serial->dev->descriptor.idProduct));
- return 1;
+ return -ENODEV;
}
/* Setup private data for serial driver */
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 24/58] MIPS: Expose missing pci_io{map,unmap} declarations
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (22 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 23/58] USB: keyspan: fix null-deref at disconnect and release Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 25/58] microblaze: Update microblaze defconfigs Luis Henriques
` (33 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Markos Chandras, linux-mips, Ralf Baechle, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Markos Chandras <markos.chandras@imgtec.com>
commit 78857614104a26cdada4c53eea104752042bf5a1 upstream.
The GENERIC_PCI_IOMAP does not depend on CONFIG_PCI so move
it to the CONFIG_MIPS symbol so it's always selected for MIPS.
This fixes the missing pci_iomap declaration for MIPS.
Moreover, the pci_iounmap function was not defined in the
io.h header file if the CONFIG_PCI symbol is not set,
but it should since MIPS is not using CONFIG_GENERIC_IOMAP.
This fixes the following problem on a allyesconfig:
drivers/net/ethernet/3com/3c59x.c:1031:2: error: implicit declaration of
function 'pci_iomap' [-Werror=implicit-function-declaration]
drivers/net/ethernet/3com/3c59x.c:1044:3: error: implicit declaration of
function 'pci_iounmap' [-Werror=implicit-function-declaration]
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5478/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/mips/Kconfig | 2 +-
arch/mips/include/asm/io.h | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index b3e10fd..3811c84 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -25,6 +25,7 @@ config MIPS
select HAVE_GENERIC_HARDIRQS
select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW
+ select GENERIC_PCI_IOMAP
select HAVE_ARCH_JUMP_LABEL
select IRQ_FORCED_THREADING
select HAVE_MEMBLOCK
@@ -2353,7 +2354,6 @@ config PCI
bool "Support for PCI controller"
depends on HW_HAS_PCI
select PCI_DOMAINS
- select GENERIC_PCI_IOMAP
select NO_GENERIC_PCI_IOPORT_MAP
help
Find out whether you have a PCI motherboard. PCI is the name of a
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 29d9c23..98ca652 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -169,6 +169,11 @@ static inline void * isa_bus_to_virt(unsigned long address)
extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags);
extern void __iounmap(const volatile void __iomem *addr);
+#ifndef CONFIG_PCI
+struct pci_dev;
+static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}
+#endif
+
static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
unsigned long flags)
{
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 25/58] microblaze: Update microblaze defconfigs
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (23 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 24/58] MIPS: Expose missing pci_io{map,unmap} declarations Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 26/58] sound: Fix make allmodconfig on MIPS Luis Henriques
` (32 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Michal Simek, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Simek <michal.simek@xilinx.com>
commit d0e045401f268a8de6f87d65678214748b772680 upstream.
The main reason is 0-day testing system which can directly
use these defconfigs for testing.
Enable support for all xilinx drivers which Microblaze
can use and disable dependency on external rootfs.cpio.
There is only one exception which is axi ethernet driver
which still uses NO_IRQ which is not defined for Microblaze.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/microblaze/configs/mmu_defconfig | 52 +++++++++++++++--------
arch/microblaze/configs/nommu_defconfig | 73 ++++++++++++++++++++-------------
2 files changed, 80 insertions(+), 45 deletions(-)
diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig
index b3f5eec..d2b097a 100644
--- a/arch/microblaze/configs/mmu_defconfig
+++ b/arch/microblaze/configs/mmu_defconfig
@@ -1,25 +1,22 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_FHANDLE=y
+CONFIG_AUDIT=y
+CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="rootfs.cpio"
-CONFIG_INITRAMFS_COMPRESSION_GZIP=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EXPERT=y
CONFIG_KALLSYMS_ALL=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-# CONFIG_HOTPLUG is not set
# CONFIG_BASE_FULL is not set
-# CONFIG_FUTEX is not set
-# CONFIG_EPOLL is not set
-# CONFIG_SIGNALFD is not set
-# CONFIG_SHMEM is not set
+CONFIG_EMBEDDED=y
CONFIG_SLAB=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_BLK_DEV_BSG is not set
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_EFI_PARTITION is not set
CONFIG_OPT_LIB_ASM=y
CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1
CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1
@@ -31,39 +28,62 @@ CONFIG_HZ_100=y
CONFIG_MMU=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE_FORCE=y
+CONFIG_HIGHMEM=y
+CONFIG_PCI=y
+CONFIG_PCI_XILINX=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
# CONFIG_INET_LRO is not set
# CONFIG_IPV6 is not set
+CONFIG_MTD=y
CONFIG_PROC_DEVICETREE=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_NETDEVICES=y
-CONFIG_NET_ETHERNET=y
CONFIG_XILINX_EMACLITE=y
+CONFIG_XILINX_LL_TEMAC=y
# CONFIG_INPUT is not set
# CONFIG_SERIO is not set
# CONFIG_VT is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
# CONFIG_HW_RANDOM is not set
+CONFIG_XILINX_HWICAP=y
+CONFIG_I2C=y
+CONFIG_I2C_XILINX=y
+CONFIG_SPI=y
+CONFIG_SPI_XILINX=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_XILINX=y
# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_XILINX_WATCHDOG=y
+CONFIG_FB=y
+CONFIG_FB_XILINX=y
# CONFIG_USB_SUPPORT is not set
+CONFIG_UIO=y
+CONFIG_UIO_PDRV=y
+CONFIG_UIO_PDRV_GENIRQ=y
+CONFIG_UIO_DMEM_GENIRQ=y
CONFIG_EXT2_FS=y
# CONFIG_DNOTIFY is not set
+CONFIG_CRAMFS=y
+CONFIG_ROMFS_FS=y
CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
CONFIG_CIFS=y
CONFIG_CIFS_STATS=y
CONFIG_CIFS_STATS2=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEBUG_SLAB=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_INFO=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
CONFIG_EARLY_PRINTK=y
+CONFIG_KEYS=y
+CONFIG_ENCRYPTED_KEYS=y
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/microblaze/configs/nommu_defconfig b/arch/microblaze/configs/nommu_defconfig
index 0249e4b..10b5172 100644
--- a/arch/microblaze/configs/nommu_defconfig
+++ b/arch/microblaze/configs/nommu_defconfig
@@ -1,41 +1,42 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
+CONFIG_FHANDLE=y
+CONFIG_AUDIT=y
+CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EXPERT=y
CONFIG_KALLSYMS_ALL=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-# CONFIG_HOTPLUG is not set
# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
CONFIG_SLAB=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_OPT_LIB_FUNCTION is not set
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_EFI_PARTITION is not set
CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1
CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1
CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1
CONFIG_XILINX_MICROBLAZE0_USE_DIV=1
CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2
CONFIG_XILINX_MICROBLAZE0_USE_FPU=2
-CONFIG_HIGH_RES_TIMERS=y
CONFIG_HZ_100=y
CONFIG_CMDLINE_BOOL=y
-CONFIG_BINFMT_FLAT=y
+CONFIG_CMDLINE_FORCE=y
+CONFIG_PCI=y
+CONFIG_PCI_XILINX=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
# CONFIG_INET_LRO is not set
# CONFIG_IPV6 is not set
-# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_MTD=y
-CONFIG_MTD_CONCAT=y
-CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
@@ -45,41 +46,55 @@ CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_RAM=y
CONFIG_MTD_UCLINUX=y
CONFIG_PROC_DEVICETREE=y
-CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_NETDEVICES=y
-CONFIG_NET_ETHERNET=y
+CONFIG_XILINX_EMACLITE=y
+CONFIG_XILINX_LL_TEMAC=y
# CONFIG_INPUT is not set
# CONFIG_SERIO is not set
# CONFIG_VT is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
-CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_XILINX_HWICAP=y
+CONFIG_I2C=y
+CONFIG_I2C_XILINX=y
+CONFIG_SPI=y
+CONFIG_SPI_XILINX=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_XILINX=y
# CONFIG_HWMON is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_WATCHDOG=y
+CONFIG_XILINX_WATCHDOG=y
+CONFIG_FB=y
+CONFIG_FB_XILINX=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_UIO=y
+CONFIG_UIO_PDRV=y
+CONFIG_UIO_PDRV_GENIRQ=y
+CONFIG_UIO_DMEM_GENIRQ=y
CONFIG_EXT2_FS=y
# CONFIG_DNOTIFY is not set
CONFIG_CRAMFS=y
CONFIG_ROMFS_FS=y
CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
-CONFIG_UNUSED_SYMBOLS=y
-CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_SHIRQ=y
+CONFIG_NLS=y
CONFIG_DETECT_HUNG_TASK=y
-CONFIG_SCHEDSTATS=y
-CONFIG_TIMER_STATS=y
-CONFIG_DEBUG_OBJECTS=y
-CONFIG_DEBUG_OBJECTS_SELFTEST=y
-CONFIG_DEBUG_OBJECTS_FREE=y
-CONFIG_DEBUG_OBJECTS_TIMERS=y
+CONFIG_DEBUG_SLAB=y
+CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_LIST=y
-CONFIG_DEBUG_SG=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-CONFIG_SYSCTL_SYSCALL_CHECK=y
CONFIG_EARLY_PRINTK=y
+CONFIG_KEYS=y
+CONFIG_ENCRYPTED_KEYS=y
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_MD4=y
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_DES=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRC32 is not set
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 26/58] sound: Fix make allmodconfig on MIPS
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (24 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 25/58] microblaze: Update microblaze defconfigs Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 27/58] sound: Fix make allmodconfig on MIPS correctly Luis Henriques
` (31 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ralf Baechle, Takashi Iwai, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit d4702b189c6b951c1cb3260036ff998f719bfb62 upstream.
The compile of soundcard.c is broken on MIPS when allmodconfig is used
because of the missing MAX_DMA_CHANNELS definition. As a simple
workaround, just add a Kconfig dependency.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
sound/oss/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index 5849b12..51c4ba9 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -250,6 +250,7 @@ config MSND_FIFOSIZE
menuconfig SOUND_OSS
tristate "OSS sound modules"
depends on ISA_DMA_API && VIRT_TO_BUS
+ depends on !ISA_DMA_SUPPORT_BROKEN
help
OSS is the Open Sound System suite of sound card drivers. They make
sound programming easier since they provide a common API. Say Y or
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 27/58] sound: Fix make allmodconfig on MIPS correctly
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (25 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 26/58] sound: Fix make allmodconfig on MIPS Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 28/58] alpha: makefile: don't enforce small data model for kernel builds Luis Henriques
` (30 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Paul Bolle, Takashi Iwai, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Bolle <pebolle@tiscali.nl>
commit a62ee234a572b4c98fe98cf5fb18e4e8b0f6e43d upstream.
Commit d4702b189c ("sound: Fix make allmodconfig on MIPS") added a
(negative) dependency on ISA_DMA_SUPPORT_BROKEN. Since that Kconfig
symbol doesn't exist, this dependency will always evaluate to true.
Apparently GENERIC_ISA_DMA_SUPPORT_BROKEN was meant to be used here.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
sound/oss/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index 51c4ba9..1a96402 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -250,7 +250,7 @@ config MSND_FIFOSIZE
menuconfig SOUND_OSS
tristate "OSS sound modules"
depends on ISA_DMA_API && VIRT_TO_BUS
- depends on !ISA_DMA_SUPPORT_BROKEN
+ depends on !GENERIC_ISA_DMA_SUPPORT_BROKEN
help
OSS is the Open Sound System suite of sound card drivers. They make
sound programming easier since they provide a common API. Say Y or
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 28/58] alpha: makefile: don't enforce small data model for kernel builds
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (26 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 27/58] sound: Fix make allmodconfig on MIPS correctly Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 29/58] MIPS: Rewrite pfn_valid to work in modules, too Luis Henriques
` (29 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Richard Henderson, Ivan Kokshaysky, Will Deacon, Michael Cree,
Linus Torvalds, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit cd8d2331756751b6aeb855a3c9cb0a92fbd9c725 upstream.
Due to all of the goodness being packed into today's kernels, the
resulting image isn't as slim as it once was.
In light of this, don't pass -msmall-data to gcc, which otherwise results
in link failures due to impossible relocations when compiling anything but
the most trivial configurations.
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Michael Cree <mcree@orcon.net.nz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/alpha/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index 4759fe7..2cc3cc5 100644
--- a/arch/alpha/Makefile
+++ b/arch/alpha/Makefile
@@ -12,7 +12,7 @@ NM := $(NM) -B
LDFLAGS_vmlinux := -static -N #-relax
CHECKFLAGS += -D__alpha__ -m64
-cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data
+cflags-y := -pipe -mno-fp-regs -ffixed-8
cflags-y += $(call cc-option, -fno-jump-tables)
cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 29/58] MIPS: Rewrite pfn_valid to work in modules, too.
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (27 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 28/58] alpha: makefile: don't enforce small data model for kernel builds Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 30/58] xtensa: fix linker script transformation for .text.unlikely Luis Henriques
` (28 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Ralf Baechle, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ralf Baechle <ralf@linux-mips.org>
commit 8b9232141bf40788cce31f893c13f344ec31ee66 upstream.
This fixes:
MODPOST 393 modules
ERROR: "min_low_pfn" [arch/mips/kvm/kvm.ko] undefined!
make[3]: *** [__modpost] Error 1
It would have been possible to just export min_low_pfn but in the end
pfn_valid should return 1 for any pfn argument for which a struct page
exists so using min_low_pfn was wrong anyway.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/mips/include/asm/page.h | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index da9bd7d..ccb77ec 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -175,14 +175,13 @@ typedef struct { unsigned long pgprot; } pgprot_t;
#ifdef CONFIG_FLATMEM
-#define pfn_valid(pfn) \
-({ \
- unsigned long __pfn = (pfn); \
- /* avoid <linux/bootmem.h> include hell */ \
- extern unsigned long min_low_pfn; \
- \
- __pfn >= min_low_pfn && __pfn < max_mapnr; \
-})
+static inline int pfn_valid(unsigned long pfn)
+{
+ /* avoid <linux/mm.h> include hell */
+ extern unsigned long max_mapnr;
+
+ return pfn >= ARCH_PFN_OFFSET && pfn < max_mapnr;
+}
#elif defined(CONFIG_SPARSEMEM)
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 30/58] xtensa: fix linker script transformation for .text.unlikely
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (28 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 29/58] MIPS: Rewrite pfn_valid to work in modules, too Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 31/58] wusbcore: fix kernel panic when disconnecting a wireless USB->serial device Luis Henriques
` (27 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Max Filippov, Chris Zankel, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Filippov <jcmvbkbc@gmail.com>
commit f6a03a12ecdbe0dd80a55f6df3b7206c5a403a49 upstream.
Now that binutils generate *.unlikely sections which don't follow
documented (info as) literal section naming rules, section name
transformation script doesn't work well resulting in the following
errors at vmlinux link time:
main.c:(.text.unlikely+0x3): dangerous relocation: l32r: literal
placed after use: .literal.unlikely
Fix section name transformation script by adding specific rule for
.text.unlikely sections.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/xtensa/kernel/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile
index 59fc3fe..0f9f35f 100644
--- a/arch/xtensa/kernel/Makefile
+++ b/arch/xtensa/kernel/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o
# Replicate rules in scripts/Makefile.build
sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \
+ -e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g' \
-e 's/\*(\(\.text\.[a-z]*\))/*(\1.literal \1)/g'
quiet_cmd__cpp_lds_S = LDS $@
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 31/58] wusbcore: fix kernel panic when disconnecting a wireless USB->serial device
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (29 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 30/58] xtensa: fix linker script transformation for .text.unlikely Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 32/58] ARM: 7810/1: perf: Fix array out of bounds access in armpmu_map_hw_event() Luis Henriques
` (26 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Thomas Pugliese, Greg Kroah-Hartman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Pugliese <thomas.pugliese@gmail.com>
commit ec58fad1feb76c323ef47efff1d1e8660ed4644c upstream.
This patch fixes a kernel panic that can occur when disconnecting a
wireless USB->serial device. When the serial device disconnects, the
device cleanup procedure ends up calling usb_hcd_disable_endpoint on the
serial device's endpoints. The wusbcore uses the ABORT_RPIPE command to
abort all transfers on the given endpoint but it does not properly give
back the URBs when the transfer results return from the HWA. This patch
prevents the transfer result processing code from bailing out when it sees
a WA_XFER_STATUS_ABORTED result code so that these urbs are flushed
properly by usb_hcd_disable_endpoint. It also updates wa_urb_dequeue to
handle the case where the endpoint has already been cleaned up when
usb_kill_urb is called which is where the panic originally occurred.
Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/usb/wusbcore/wa-xfer.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c
index 57c01ab..1ebc17e 100644
--- a/drivers/usb/wusbcore/wa-xfer.c
+++ b/drivers/usb/wusbcore/wa-xfer.c
@@ -1110,6 +1110,12 @@ int wa_urb_dequeue(struct wahc *wa, struct urb *urb)
}
spin_lock_irqsave(&xfer->lock, flags);
rpipe = xfer->ep->hcpriv;
+ if (rpipe == NULL) {
+ pr_debug("%s: xfer id 0x%08X has no RPIPE. %s",
+ __func__, wa_xfer_id(xfer),
+ "Probably already aborted.\n" );
+ goto out_unlock;
+ }
/* Check the delayed list -> if there, release and complete */
spin_lock_irqsave(&wa->xfer_list_lock, flags2);
if (!list_empty(&xfer->list_node) && xfer->seg == NULL)
@@ -1493,8 +1499,7 @@ static void wa_xfer_result_cb(struct urb *urb)
break;
}
usb_status = xfer_result->bTransferStatus & 0x3f;
- if (usb_status == WA_XFER_STATUS_ABORTED
- || usb_status == WA_XFER_STATUS_NOT_FOUND)
+ if (usb_status == WA_XFER_STATUS_NOT_FOUND)
/* taken care of already */
break;
xfer_id = xfer_result->dwTransferID;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 32/58] ARM: 7810/1: perf: Fix array out of bounds access in armpmu_map_hw_event()
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (30 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 31/58] wusbcore: fix kernel panic when disconnecting a wireless USB->serial device Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 33/58] iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL Luis Henriques
` (25 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stephen Boyd, Russell King, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <sboyd@codeaurora.org>
commit d9f966357b14e356dbd83b8f4a197a287ab4ff83 upstream.
Vince Weaver reports an oops in the ARM perf event code while
running his perf_fuzzer tool on a pandaboard running v3.11-rc4.
Unable to handle kernel paging request at virtual address 73fd14cc
pgd = eca6c000
[73fd14cc] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in: snd_soc_omap_hdmi omapdss snd_soc_omap_abe_twl6040 snd_soc_twl6040 snd_soc_omap snd_soc_omap_hdmi_card snd_soc_omap_mcpdm snd_soc_omap_mcbsp snd_soc_core snd_compress regmap_spi snd_pcm snd_page_alloc snd_timer snd soundcore
CPU: 1 PID: 2790 Comm: perf_fuzzer Not tainted 3.11.0-rc4 #6
task: eddcab80 ti: ed892000 task.ti: ed892000
PC is at armpmu_map_event+0x20/0x88
LR is at armpmu_event_init+0x38/0x280
pc : [<c001c3e4>] lr : [<c001c17c>] psr: 60000013
sp : ed893e40 ip : ecececec fp : edfaec00
r10: 00000000 r9 : 00000000 r8 : ed8c3ac0
r7 : ed8c3b5c r6 : edfaec00 r5 : 00000000 r4 : 00000000
r3 : 000000ff r2 : c0496144 r1 : c049611c r0 : edfaec00
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: aca6c04a DAC: 00000015
Process perf_fuzzer (pid: 2790, stack limit = 0xed892240)
Stack: (0xed893e40 to 0xed894000)
3e40: 00000800 c001c17c 00000002 c008a748 00000001 00000000 00000000 c00bf078
3e60: 00000000 edfaee50 00000000 00000000 00000000 edfaec00 ed8c3ac0 edfaec00
3e80: 00000000 c073ffac ed893f20 c00bf180 00000001 00000000 c00bf078 ed893f20
3ea0: 00000000 ed8c3ac0 00000000 00000000 00000000 c0cb0818 eddcab80 c00bf440
3ec0: ed893f20 00000000 eddcab80 eca76800 00000000 eca76800 00000000 00000000
3ee0: 00000000 ec984c80 eddcab80 c00bfe68 00000000 00000000 00000000 00000080
3f00: 00000000 ed892000 00000000 ed892030 00000004 ecc7e3c8 ecc7e3c8 00000000
3f20: 00000000 00000048 ecececec 00000000 00000000 00000000 00000000 00000000
3f40: 00000000 00000000 00297810 00000000 00000000 00000000 00000000 00000000
3f60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3f80: 00000002 00000002 000103a4 00000002 0000016c c00128e8 ed892000 00000000
3fa0: 00090998 c0012700 00000002 000103a4 00090ab8 00000000 00000000 0000000f
3fc0: 00000002 000103a4 00000002 0000016c 00090ab0 00090ab8 000107a0 00090998
3fe0: bed92be0 bed92bd0 0000b785 b6e8f6d0 40000010 00090ab8 00000000 00000000
[<c001c3e4>] (armpmu_map_event+0x20/0x88) from [<c001c17c>] (armpmu_event_init+0x38/0x280)
[<c001c17c>] (armpmu_event_init+0x38/0x280) from [<c00bf180>] (perf_init_event+0x108/0x180)
[<c00bf180>] (perf_init_event+0x108/0x180) from [<c00bf440>] (perf_event_alloc+0x248/0x40c)
[<c00bf440>] (perf_event_alloc+0x248/0x40c) from [<c00bfe68>] (SyS_perf_event_open+0x4f4/0x8fc)
[<c00bfe68>] (SyS_perf_event_open+0x4f4/0x8fc) from [<c0012700>] (ret_fast_syscall+0x0/0x48)
Code: 0a000005 e3540004 0a000016 e3540000 (0791010c)
This is because event->attr.config in armpmu_event_init()
contains a very large number copied directly from userspace and
is never checked against the size of the array indexed in
armpmu_map_hw_event(). Fix the problem by checking the value of
config before indexing the array and rejecting invalid config
values.
Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Tested-by: Vince Weaver <vincent.weaver@maine.edu>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/arm/kernel/perf_event.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 522c11d..54fbd46 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -109,7 +109,12 @@ armpmu_map_cache_event(const unsigned (*cache_map)
static int
armpmu_map_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config)
{
- int mapping = (*event_map)[config];
+ int mapping;
+
+ if (config >= PERF_COUNT_HW_MAX)
+ return -EINVAL;
+
+ mapping = (*event_map)[config];
return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping;
}
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 33/58] iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (31 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 32/58] ARM: 7810/1: perf: Fix array out of bounds access in armpmu_map_hw_event() Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 34/58] iwlwifi: pcie: disable L1 Active after pci_enable_device Luis Henriques
` (24 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stanislaw Gruszka, Johannes Berg, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <sgruszka@redhat.com>
commit 9186a1fd9ed190739423db84bc344d258ef3e3d7 upstream.
If channel switch is pending and we remove interface we can
crash like showed below due to passing NULL vif to mac80211:
BUG: unable to handle kernel paging request at fffffffffffff8cc
IP: [<ffffffff8130924d>] strnlen+0xd/0x40
Call Trace:
[<ffffffff8130ad2e>] string.isra.3+0x3e/0xd0
[<ffffffff8130bf99>] vsnprintf+0x219/0x640
[<ffffffff8130c481>] vscnprintf+0x11/0x30
[<ffffffff81061585>] vprintk_emit+0x115/0x4f0
[<ffffffff81657bd5>] printk+0x61/0x63
[<ffffffffa048987f>] ieee80211_chswitch_done+0xaf/0xd0 [mac80211]
[<ffffffffa04e7b34>] iwl_chswitch_done+0x34/0x40 [iwldvm]
[<ffffffffa04f83c3>] iwlagn_commit_rxon+0x2a3/0xdc0 [iwldvm]
[<ffffffffa04ebc50>] ? iwlagn_set_rxon_chain+0x180/0x2c0 [iwldvm]
[<ffffffffa04e5e76>] iwl_set_mode+0x36/0x40 [iwldvm]
[<ffffffffa04e5f0d>] iwlagn_mac_remove_interface+0x8d/0x1b0 [iwldvm]
[<ffffffffa0459b3d>] ieee80211_do_stop+0x29d/0x7f0 [mac80211]
This is because we nulify ctx->vif in iwlagn_mac_remove_interface()
before calling some other functions that teardown interface. To fix
just check ctx->vif on iwl_chswitch_done(). We should not call
ieee80211_chswitch_done() as channel switch works were already canceled
by mac80211 in ieee80211_do_stop() -> ieee80211_mgd_stop().
Resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=979581
Reported-by: Lukasz Jagiello <jagiello.lukasz@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/net/wireless/iwlwifi/iwl-mac80211.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index 2c86c55..40bf6ad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -958,7 +958,10 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success)
if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return;
- if (test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
+ if (!test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
+ return;
+
+ if (ctx->vif)
ieee80211_chswitch_done(ctx->vif, is_success);
}
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 34/58] iwlwifi: pcie: disable L1 Active after pci_enable_device
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (32 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 33/58] iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 35/58] zd1201: do not use stack as URB transfer_buffer Luis Henriques
` (23 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Emmanuel Grumbach, Johannes Berg, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
commit eabc4ac5d7606a57ee2b7308cb7323ea8f60183b upstream.
As Arjan pointed out, we mustn't do anything related to PCI
configuration until the device is properly enabled with
pci_enable_device().
Reported-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ luis: backported to 3.5:
- file rename: drivers/net/wireless/iwlwifi/pcie/trans.c ->
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index 844d0f6..283b423 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -2107,16 +2107,16 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
spin_lock_init(&trans_pcie->irq_lock);
init_waitqueue_head(&trans_pcie->ucode_write_waitq);
- /* W/A - seems to solve weird behavior. We need to remove this if we
- * don't want to stay in L1 all the time. This wastes a lot of power */
- pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
- PCIE_LINK_STATE_CLKPM);
-
if (pci_enable_device(pdev)) {
err = -ENODEV;
goto out_no_pci;
}
+ /* W/A - seems to solve weird behavior. We need to remove this if we
+ * don't want to stay in L1 all the time. This wastes a lot of power */
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
pci_set_master(pdev);
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36));
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 35/58] zd1201: do not use stack as URB transfer_buffer
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (33 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 34/58] iwlwifi: pcie: disable L1 Active after pci_enable_device Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 36/58] Hostap: copying wrong data prism2_ioctl_giwaplist() Luis Henriques
` (22 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jussi Kivilinna, John W. Linville, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jussi Kivilinna <jussi.kivilinna@iki.fi>
commit 1206ff4ff9d2ef7468a355328bc58ac6ebf5be44 upstream.
Patch fixes zd1201 not to use stack as URB transfer_buffer. URB buffers need
to be DMA-able, which stack is not.
Patch is only compile tested.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/net/wireless/zd1201.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index 48273dd..4312eca 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -98,10 +98,12 @@ static int zd1201_fw_upload(struct usb_device *dev, int apfw)
goto exit;
err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4,
- USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT);
+ USB_DIR_IN | 0x40, 0, 0, buf, sizeof(ret), ZD1201_FW_TIMEOUT);
if (err < 0)
goto exit;
+ memcpy(&ret, buf, sizeof(ret));
+
if (ret & 0x80) {
err = -EIO;
goto exit;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 36/58] Hostap: copying wrong data prism2_ioctl_giwaplist()
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (34 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 35/58] zd1201: do not use stack as URB transfer_buffer Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 37/58] ARM: at91/DT: fix at91sam9n12ek memory node Luis Henriques
` (21 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, John W. Linville, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 909bd5926d474e275599094acad986af79671ac9 upstream.
We want the data stored in "addr" and "qual", but the extra ampersands
mean we are copying stack data instead.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/net/wireless/hostap/hostap_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 18054d9..dbec2ff 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -522,9 +522,9 @@ static int prism2_ioctl_giwaplist(struct net_device *dev,
data->length = prism2_ap_get_sta_qual(local, addr, qual, IW_MAX_AP, 1);
- memcpy(extra, &addr, sizeof(struct sockaddr) * data->length);
+ memcpy(extra, addr, sizeof(struct sockaddr) * data->length);
data->flags = 1; /* has quality information */
- memcpy(extra + sizeof(struct sockaddr) * data->length, &qual,
+ memcpy(extra + sizeof(struct sockaddr) * data->length, qual,
sizeof(struct iw_quality) * data->length);
kfree(addr);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 37/58] ARM: at91/DT: fix at91sam9n12ek memory node
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (35 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 36/58] Hostap: copying wrong data prism2_ioctl_giwaplist() Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 38/58] drm/i915: Invalidate TLBs for the rings after a reset Luis Henriques
` (20 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Nicolas Ferre, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Ferre <nicolas.ferre@atmel.com>
commit a57603ca2871ee0773b00839c1ea35c4a2d3eeb0 upstream.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/arm/boot/dts/at91sam9n12ek.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index f4e43e3..84d8bdb 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -14,11 +14,11 @@
compatible = "atmel,at91sam9n12ek", "atmel,at91sam9n12", "atmel,at91sam9";
chosen {
- bootargs = "mem=128M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
+ bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
};
memory {
- reg = <0x20000000 0x10000000>;
+ reg = <0x20000000 0x8000000>;
};
clocks {
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 38/58] drm/i915: Invalidate TLBs for the rings after a reset
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (36 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 37/58] ARM: at91/DT: fix at91sam9n12ek memory node Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 39/58] libata: apply behavioral quirks to sil3826 PMP Luis Henriques
` (19 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Wilson, Daniel Vetter, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <chris@chris-wilson.co.uk>
commit 884020bf3d2a3787a1cc6df902e98e0eec60330b upstream.
After any "soft gfx reset" we must manually invalidate the TLBs
associated with each ring. Empirically, it seems that a
suspend/resume or D3-D0 cycle count as a "soft reset". The symptom is
that the hardware would fail to note the new address for its status
page, and so it would continue to write the shadow registers and
breadcrumbs into the old physical address (now used by something
completely different, scary). Whereas the driver would read the new
status page and never see any progress, it would appear that the GPU
hung immediately upon resume.
Based on a patch by naresh kumar kachhi <naresh.kumar.kacchi@intel.com>
Reported-by: Thiago Macieira <thiago@kde.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64725
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Thiago Macieira <thiago@kde.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/gpu/drm/i915/i915_reg.h | 2 ++
drivers/gpu/drm/i915/intel_ringbuffer.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 26b8bba..70bfc0f 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -572,6 +572,8 @@
will not assert AGPBUSY# and will only
be delivered when out of C3. */
#define INSTPM_FORCE_ORDERING (1<<7) /* GEN6+ */
+#define INSTPM_TLB_INVALIDATE (1<<9)
+#define INSTPM_SYNC_FLUSH (1<<5)
#define ACTHD 0x020c8
#define FW_BLC 0x020d8
#define FW_BLC2 0x020dc
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 78486c7..7e9d3db 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -773,6 +773,18 @@ void intel_ring_setup_status_page(struct intel_ring_buffer *ring)
I915_WRITE(mmio, (u32)ring->status_page.gfx_addr);
POSTING_READ(mmio);
+
+ /* Flush the TLB for this page */
+ if (INTEL_INFO(dev)->gen >= 6) {
+ u32 reg = RING_INSTPM(ring->mmio_base);
+ I915_WRITE(reg,
+ _MASKED_BIT_ENABLE(INSTPM_TLB_INVALIDATE |
+ INSTPM_SYNC_FLUSH));
+ if (wait_for((I915_READ(reg) & INSTPM_SYNC_FLUSH) == 0,
+ 1000))
+ DRM_ERROR("%s: wait for SyncFlush to complete for TLB invalidation timed out\n",
+ ring->name);
+ }
}
static int
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 39/58] libata: apply behavioral quirks to sil3826 PMP
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (37 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 38/58] drm/i915: Invalidate TLBs for the rings after a reset Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 40/58] ARM: davinci: nand: specify ecc strength Luis Henriques
` (18 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Terry Suereth, Tejun Heo, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Terry Suereth <terry.suereth@gmail.com>
commit 8ffff94d20b7eb446e848e0046107d51b17a20a8 upstream.
Fixing support for the Silicon Image 3826 port multiplier, by applying
to it the same quirks applied to the Silicon Image 3726. Specifically
fixes the repeated timeout/reset process which previously afflicted
the 3726, as described from line 290. Slightly based on notes from:
https://bugzilla.redhat.com/show_bug.cgi?id=890237
Signed-off-by: Terry Suereth <terry.suereth@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/ata/libata-pmp.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index f63a588..f5c35be 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -289,24 +289,24 @@ static int sata_pmp_configure(struct ata_device *dev, int print_info)
/* Disable sending Early R_OK.
* With "cached read" HDD testing and multiple ports busy on a SATA
- * host controller, 3726 PMP will very rarely drop a deferred
+ * host controller, 3x26 PMP will very rarely drop a deferred
* R_OK that was intended for the host. Symptom will be all
* 5 drives under test will timeout, get reset, and recover.
*/
- if (vendor == 0x1095 && devid == 0x3726) {
+ if (vendor == 0x1095 && (devid == 0x3726 || devid == 0x3826)) {
u32 reg;
err_mask = sata_pmp_read(&ap->link, PMP_GSCR_SII_POL, ®);
if (err_mask) {
rc = -EIO;
- reason = "failed to read Sil3726 Private Register";
+ reason = "failed to read Sil3x26 Private Register";
goto fail;
}
reg &= ~0x1;
err_mask = sata_pmp_write(&ap->link, PMP_GSCR_SII_POL, reg);
if (err_mask) {
rc = -EIO;
- reason = "failed to write Sil3726 Private Register";
+ reason = "failed to write Sil3x26 Private Register";
goto fail;
}
}
@@ -383,8 +383,8 @@ static void sata_pmp_quirks(struct ata_port *ap)
u16 devid = sata_pmp_gscr_devid(gscr);
struct ata_link *link;
- if (vendor == 0x1095 && devid == 0x3726) {
- /* sil3726 quirks */
+ if (vendor == 0x1095 && (devid == 0x3726 || devid == 0x3826)) {
+ /* sil3x26 quirks */
ata_for_each_link(link, ap, EDGE) {
/* link reports offline after LPM */
link->flags |= ATA_LFLAG_NO_LPM;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 40/58] ARM: davinci: nand: specify ecc strength
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (38 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 39/58] libata: apply behavioral quirks to sil3826 PMP Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 41/58] ARM: 7816/1: CONFIG_KUSER_HELPERS: fix help text Luis Henriques
` (17 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sekhar Nori, Kevin Hilman, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sekhar Nori <nsekhar@ti.com>
commit acd36357edc08649e85ff15dc4ed62353c912eff upstream.
Starting with kernel v3.5, it is mandatory
to specify ECC strength when using hardware
ECC. Without this, kernel panics with a warning
of the sort:
Driver must set ecc.strength when using hardware ECC
------------[ cut here ]------------
kernel BUG at drivers/mtd/nand/nand_base.c:3519!
Fix this by specifying ECC strength for the boards
which were missing this.
Reported-by: Holger Freyther <holger@freyther.de>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/arm/mach-davinci/board-dm355-leopard.c | 1 +
arch/arm/mach-davinci/board-dm644x-evm.c | 1 +
arch/arm/mach-davinci/board-dm646x-evm.c | 1 +
arch/arm/mach-davinci/board-neuros-osd2.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 8e77032..eeeb81f 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -75,6 +75,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
.parts = davinci_nand_partitions,
.nr_parts = ARRAY_SIZE(davinci_nand_partitions),
.ecc_mode = NAND_ECC_HW_SYNDROME,
+ .ecc_bits = 4,
.bbt_options = NAND_BBT_USE_FLASH,
};
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index d34ed55..87a904f 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -152,6 +152,7 @@ static struct davinci_nand_pdata davinci_evm_nandflash_data = {
.parts = davinci_evm_nandflash_partition,
.nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition),
.ecc_mode = NAND_ECC_HW,
+ .ecc_bits = 1,
.bbt_options = NAND_BBT_USE_FLASH,
.timing = &davinci_evm_nandflash_timing,
};
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 958679a..5d4b51f 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -89,6 +89,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
.parts = davinci_nand_partitions,
.nr_parts = ARRAY_SIZE(davinci_nand_partitions),
.ecc_mode = NAND_ECC_HW,
+ .ecc_bits = 1,
.options = 0,
};
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 5de69f2..198289c 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -88,6 +88,7 @@ static struct davinci_nand_pdata davinci_ntosd2_nandflash_data = {
.parts = davinci_ntosd2_nandflash_partition,
.nr_parts = ARRAY_SIZE(davinci_ntosd2_nandflash_partition),
.ecc_mode = NAND_ECC_HW,
+ .ecc_bits = 1,
.bbt_options = NAND_BBT_USE_FLASH,
};
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 41/58] ARM: 7816/1: CONFIG_KUSER_HELPERS: fix help text
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (39 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 40/58] ARM: davinci: nand: specify ecc strength Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 42/58] sata_fsl: save irqs while coalescing Luis Henriques
` (16 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nicolas Pitre, Russell King, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Pitre <nicolas.pitre@linaro.org>
commit ac124504ecf6b20a2457d873d0728a8b991a5b0c upstream.
Commit f6f91b0d9fd9 ("ARM: allow kuser helpers to be removed from the
vector page") introduced some help text for the CONFIG_KUSER_HELPERS
option which is rather contradictory.
Let's fix that, and improve it a little.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/arm/mm/Kconfig | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 8d194df..6c5a533 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -768,15 +768,18 @@ config KUSER_HELPERS
the CPU type fitted to the system. This permits binaries to be
run on ARMv4 through to ARMv7 without modification.
+ See Documentation/arm/kernel_user_helpers.txt for details.
+
However, the fixed address nature of these helpers can be used
by ROP (return orientated programming) authors when creating
exploits.
If all of the binaries and libraries which run on your platform
are built specifically for your platform, and make no use of
- these helpers, then you can turn this option off. However,
- when such an binary or library is run, it will receive a SIGILL
- signal, which will terminate the program.
+ these helpers, then you can turn this option off to hinder
+ such exploits. However, in that case, if a binary or library
+ relying on those helpers is run, it will receive a SIGILL signal,
+ which will terminate the program.
Say N here only if you are absolutely certain that you do not
need these helpers; otherwise, the safe option is to say Y.
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 42/58] sata_fsl: save irqs while coalescing
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (40 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 41/58] ARM: 7816/1: CONFIG_KUSER_HELPERS: fix help text Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 43/58] xen/events: initialize local per-cpu mask for all possible events Luis Henriques
` (15 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Anthony Foiani, Tejun Heo, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Anthony Foiani <anthony.foiani@gmail.com>
commit 99bbdfa6bdcb4bdf5be914a48e9b46941bf30819 upstream.
Before this patch, I was seeing the following lockdep splat on my
MPC8315 (PPC32) target:
[ 9.086051] =================================
[ 9.090393] [ INFO: inconsistent lock state ]
[ 9.094744] 3.9.7-ajf-gc39503d #1 Not tainted
[ 9.099087] ---------------------------------
[ 9.103432] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
[ 9.109431] scsi_eh_1/39 [HC1[1]:SC0[0]:HE0:SE1] takes:
[ 9.114642] (&(&host->lock)->rlock){?.+...}, at: [<c02f4168>] sata_fsl_interrupt+0x50/0x250
[ 9.123137] {HARDIRQ-ON-W} state was registered at:
[ 9.128004] [<c006cdb8>] lock_acquire+0x90/0xf4
[ 9.132737] [<c043ef04>] _raw_spin_lock+0x34/0x4c
[ 9.137645] [<c02f3560>] fsl_sata_set_irq_coalescing+0x68/0x100
[ 9.143750] [<c02f36a0>] sata_fsl_init_controller+0xa8/0xc0
[ 9.149505] [<c02f3f10>] sata_fsl_probe+0x17c/0x2e8
[ 9.154568] [<c02acc90>] driver_probe_device+0x90/0x248
[ 9.159987] [<c02acf0c>] __driver_attach+0xc4/0xc8
[ 9.164964] [<c02aae74>] bus_for_each_dev+0x5c/0xa8
[ 9.170028] [<c02ac218>] bus_add_driver+0x100/0x26c
[ 9.175091] [<c02ad638>] driver_register+0x88/0x198
[ 9.180155] [<c0003a24>] do_one_initcall+0x58/0x1b4
[ 9.185226] [<c05aeeac>] kernel_init_freeable+0x118/0x1c0
[ 9.190823] [<c0004110>] kernel_init+0x18/0x108
[ 9.195542] [<c000f6b8>] ret_from_kernel_thread+0x64/0x6c
[ 9.201142] irq event stamp: 160
[ 9.204366] hardirqs last enabled at (159): [<c043f778>] _raw_spin_unlock_irq+0x30/0x50
[ 9.212469] hardirqs last disabled at (160): [<c000f414>] reenable_mmu+0x30/0x88
[ 9.219867] softirqs last enabled at (144): [<c002ae5c>] __do_softirq+0x168/0x218
[ 9.227435] softirqs last disabled at (137): [<c002b0d4>] irq_exit+0xa8/0xb4
[ 9.234481]
[ 9.234481] other info that might help us debug this:
[ 9.240995] Possible unsafe locking scenario:
[ 9.240995]
[ 9.246898] CPU0
[ 9.249337] ----
[ 9.251776] lock(&(&host->lock)->rlock);
[ 9.255878] <Interrupt>
[ 9.258492] lock(&(&host->lock)->rlock);
[ 9.262765]
[ 9.262765] *** DEADLOCK ***
[ 9.262765]
[ 9.268684] no locks held by scsi_eh_1/39.
[ 9.272767]
[ 9.272767] stack backtrace:
[ 9.277117] Call Trace:
[ 9.279589] [cfff9da0] [c0008504] show_stack+0x48/0x150 (unreliable)
[ 9.285972] [cfff9de0] [c0447d5c] print_usage_bug.part.35+0x268/0x27c
[ 9.292425] [cfff9e10] [c006ace4] mark_lock+0x2ac/0x658
[ 9.297660] [cfff9e40] [c006b7e4] __lock_acquire+0x754/0x1840
[ 9.303414] [cfff9ee0] [c006cdb8] lock_acquire+0x90/0xf4
[ 9.308745] [cfff9f20] [c043ef04] _raw_spin_lock+0x34/0x4c
[ 9.314250] [cfff9f30] [c02f4168] sata_fsl_interrupt+0x50/0x250
[ 9.320187] [cfff9f70] [c0079ff0] handle_irq_event_percpu+0x90/0x254
[ 9.326547] [cfff9fc0] [c007a1fc] handle_irq_event+0x48/0x78
[ 9.332220] [cfff9fe0] [c007c95c] handle_level_irq+0x9c/0x104
[ 9.337981] [cfff9ff0] [c000d978] call_handle_irq+0x18/0x28
[ 9.343568] [cc7139f0] [c000608c] do_IRQ+0xf0/0x1a8
[ 9.348464] [cc713a20] [c000fc8c] ret_from_except+0x0/0x14
[ 9.353983] --- Exception: 501 at _raw_spin_unlock_irq+0x40/0x50
[ 9.353983] LR = _raw_spin_unlock_irq+0x30/0x50
[ 9.364839] [cc713af0] [c043db10] wait_for_common+0xac/0x188
[ 9.370513] [cc713b30] [c02ddee4] ata_exec_internal_sg+0x2b0/0x4f0
[ 9.376699] [cc713be0] [c02de18c] ata_exec_internal+0x68/0xa8
[ 9.382454] [cc713c20] [c02de4b8] ata_dev_read_id+0x158/0x594
[ 9.388205] [cc713ca0] [c02ec244] ata_eh_recover+0xd88/0x13d0
[ 9.393962] [cc713d20] [c02f2520] sata_pmp_error_handler+0xc0/0x8ac
[ 9.400234] [cc713dd0] [c02ecdc8] ata_scsi_port_error_handler+0x464/0x5e8
[ 9.407023] [cc713e10] [c02ecfd0] ata_scsi_error+0x84/0xb8
[ 9.412528] [cc713e40] [c02c4974] scsi_error_handler+0xd8/0x47c
[ 9.418457] [cc713eb0] [c004737c] kthread+0xa8/0xac
[ 9.423355] [cc713f40] [c000f6b8] ret_from_kernel_thread+0x64/0x6c
This fix was suggested by Bhushan Bharat <R65777@freescale.com>, and
was discussed in email at:
http://linuxppc.10917.n7.nabble.com/MPC8315-reboot-failure-lockdep-splat-possibly-related-tp75162.html
Same patch successfully tested with 3.9.7. linux-next compiled but
not tested on hardware.
This patch is based off linux-next tag next-20130819
(which is commit 66a01bae29d11916c09f9f5a937cafe7d402e4a5 )
Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/ata/sata_fsl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index d6577b9..a3f0bbd 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -290,6 +290,7 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host,
{
struct sata_fsl_host_priv *host_priv = host->private_data;
void __iomem *hcr_base = host_priv->hcr_base;
+ unsigned long flags;
if (count > ICC_MAX_INT_COUNT_THRESHOLD)
count = ICC_MAX_INT_COUNT_THRESHOLD;
@@ -302,12 +303,12 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host,
(count > ICC_MIN_INT_COUNT_THRESHOLD))
ticks = ICC_SAFE_INT_TICKS;
- spin_lock(&host->lock);
+ spin_lock_irqsave(&host->lock, flags);
iowrite32((count << 24 | ticks), hcr_base + ICC);
intr_coalescing_count = count;
intr_coalescing_ticks = ticks;
- spin_unlock(&host->lock);
+ spin_unlock_irqrestore(&host->lock, flags);
DPRINTK("intrrupt coalescing, count = 0x%x, ticks = %x\n",
intr_coalescing_count, intr_coalescing_ticks);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 43/58] xen/events: initialize local per-cpu mask for all possible events
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (41 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 42/58] sata_fsl: save irqs while coalescing Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 44/58] of: fdt: fix memory initialization for expanded DT Luis Henriques
` (14 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Vrabel, Konrad Rzeszutek Wilk, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Vrabel <david.vrabel@citrix.com>
commit 84ca7a8e45dafb49cd5ca90a343ba033e2885c17 upstream.
The sizeof() argument in init_evtchn_cpu_bindings() is incorrect
resulting in only the first 64 (or 32 in 32-bit guests) ports having
their bindings being initialized to VCPU 0.
In most cases this does not cause a problem as request_irq() will set
the irq affinity which will set the correct local per-cpu mask.
However, if the request_irq() is called on a VCPU other than 0, there
is a window between the unmasking of the event and the affinity being
set were an event may be lost because it is not locally unmasked on
any VCPU. If request_irq() is called on VCPU 0 then local irqs are
disabled during the window and the race does not occur.
Fix this by initializing all NR_EVENT_CHANNEL bits in the local
per-cpu masks.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/xen/events.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index b5b559a..025e98b 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -324,7 +324,7 @@ static void init_evtchn_cpu_bindings(void)
for_each_possible_cpu(i)
memset(per_cpu(cpu_evtchn_mask, i),
- (i == 0) ? ~0 : 0, sizeof(*per_cpu(cpu_evtchn_mask, i)));
+ (i == 0) ? ~0 : 0, NR_EVENT_CHANNELS/8);
}
static inline void clear_evtchn(int port)
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 44/58] of: fdt: fix memory initialization for expanded DT
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (42 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 43/58] xen/events: initialize local per-cpu mask for all possible events Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 45/58] [SCSI] zfcp: fix lock imbalance by reworking request queue locking Luis Henriques
` (13 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Wladislav Wiebe, Rob Herring, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Wladislav Wiebe <wladislav.kw@gmail.com>
commit 9e40127526e857fa3f29d51e83277204fbdfc6ba upstream.
Already existing property flags are filled wrong for properties created from
initial FDT. This could cause problems if this DYNAMIC device-tree functions
are used later, i.e. properties are attached/detached/replaced. Simply dumping
flags from the running system show, that some initial static (not allocated via
kzmalloc()) nodes are marked as dynamic.
I putted some debug extensions to property_proc_show(..) :
..
+ if (OF_IS_DYNAMIC(pp))
+ pr_err("DEBUG: xxx : OF_IS_DYNAMIC\n");
+ if (OF_IS_DETACHED(pp))
+ pr_err("DEBUG: xxx : OF_IS_DETACHED\n");
when you operate on the nodes (e.g.: ~$ cat /proc/device-tree/*some_node*) you
will see that those flags are filled wrong, basically in most cases it will dump
a DYNAMIC or DETACHED status, which is in not true.
(BTW. this OF_IS_DETACHED is a own define for debug purposes which which just
make a test_bit(OF_DETACHED, &x->_flags)
If nodes are dynamic kernel is allowed to kfree() them. But it will crash
attempting to do so on the nodes from FDT -- they are not allocated via
kzmalloc().
Signed-off-by: Wladislav Wiebe <wladislav.kw@gmail.com>
Acked-by: Alexander Sverdlin <alexander.sverdlin@nsn.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/of/fdt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 91a375f..17fad3b 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -390,6 +390,8 @@ static void __unflatten_device_tree(struct boot_param_header *blob,
mem = (unsigned long)
dt_alloc(size + 4, __alignof__(struct device_node));
+ memset((void *)mem, 0, size);
+
((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef);
pr_debug(" unflattening %lx...\n", mem);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 45/58] [SCSI] zfcp: fix lock imbalance by reworking request queue locking
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (43 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 44/58] of: fdt: fix memory initialization for expanded DT Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 46/58] [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops Luis Henriques
` (12 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Martin Peschke, Steffen Maier, James Bottomley, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Peschke <mpeschke@linux.vnet.ibm.com>
commit d79ff142624e1be080ad8d09101f7004d79c36e1 upstream.
This patch adds wait_event_interruptible_lock_irq_timeout(), which is a
straight-forward descendant of wait_event_interruptible_timeout() and
wait_event_interruptible_lock_irq().
The zfcp driver used to call wait_event_interruptible_timeout()
in combination with some intricate and error-prone locking. Using
wait_event_interruptible_lock_irq_timeout() as a replacement
nicely cleans up that locking.
This rework removes a situation that resulted in a locking imbalance
in zfcp_qdio_sbal_get():
BUG: workqueue leaked lock or atomic: events/1/0xffffff00/10
last function: zfcp_fc_wka_port_offline+0x0/0xa0 [zfcp]
It was introduced by commit c2af7545aaff3495d9bf9a7608c52f0af86fb194
"[SCSI] zfcp: Do not wait for SBALs on stopped queue", which had a new
code path related to ZFCP_STATUS_ADAPTER_QDIOUP that took an early exit
without a required lock being held. The problem occured when a
special, non-SCSI I/O request was being submitted in process context,
when the adapter's queues had been torn down. In this case the bug
surfaced when the Fibre Channel port connection for a well-known address
was closed during a concurrent adapter shut-down procedure, which is a
rare constellation.
This patch also fixes these warnings from the sparse tool (make C=1):
drivers/s390/scsi/zfcp_qdio.c:224:12: warning: context imbalance in
'zfcp_qdio_sbal_check' - wrong count at exit
drivers/s390/scsi/zfcp_qdio.c:244:5: warning: context imbalance in
'zfcp_qdio_sbal_get' - unexpected unlock
Last but not least, we get rid of that crappy lock-unlock-lock
sequence at the beginning of the critical section.
It is okay to call zfcp_erp_adapter_reopen() with req_q_lock held.
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/s390/scsi/zfcp_qdio.c | 8 ++----
include/linux/wait.h | 58 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 6 deletions(-)
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index e76d003..52c6b59 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -224,11 +224,9 @@ int zfcp_qdio_sbals_from_sg(struct zfcp_qdio *qdio, struct zfcp_qdio_req *q_req,
static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio)
{
- spin_lock_irq(&qdio->req_q_lock);
if (atomic_read(&qdio->req_q_free) ||
!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
return 1;
- spin_unlock_irq(&qdio->req_q_lock);
return 0;
}
@@ -246,9 +244,8 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
{
long ret;
- spin_unlock_irq(&qdio->req_q_lock);
- ret = wait_event_interruptible_timeout(qdio->req_q_wq,
- zfcp_qdio_sbal_check(qdio), 5 * HZ);
+ ret = wait_event_interruptible_lock_irq_timeout(qdio->req_q_wq,
+ zfcp_qdio_sbal_check(qdio), qdio->req_q_lock, 5 * HZ);
if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
return -EIO;
@@ -262,7 +259,6 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
zfcp_erp_adapter_reopen(qdio->adapter, 0, "qdsbg_1");
}
- spin_lock_irq(&qdio->req_q_lock);
return -EIO;
}
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 6c6c20e..d331566 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -572,6 +572,64 @@ do { \
__ret; \
})
+#define __wait_event_interruptible_lock_irq_timeout(wq, condition, \
+ lock, ret) \
+do { \
+ DEFINE_WAIT(__wait); \
+ \
+ for (;;) { \
+ prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \
+ if (condition) \
+ break; \
+ if (signal_pending(current)) { \
+ ret = -ERESTARTSYS; \
+ break; \
+ } \
+ spin_unlock_irq(&lock); \
+ ret = schedule_timeout(ret); \
+ spin_lock_irq(&lock); \
+ if (!ret) \
+ break; \
+ } \
+ finish_wait(&wq, &__wait); \
+} while (0)
+
+/**
+ * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets true or a timeout elapses.
+ * The condition is checked under the lock. This is expected
+ * to be called with the lock taken.
+ * @wq: the waitqueue to wait on
+ * @condition: a C expression for the event to wait for
+ * @lock: a locked spinlock_t, which will be released before schedule()
+ * and reacquired afterwards.
+ * @timeout: timeout, in jiffies
+ *
+ * The process is put to sleep (TASK_INTERRUPTIBLE) until the
+ * @condition evaluates to true or signal is received. The @condition is
+ * checked each time the waitqueue @wq is woken up.
+ *
+ * wake_up() has to be called after changing any variable that could
+ * change the result of the wait condition.
+ *
+ * This is supposed to be called while holding the lock. The lock is
+ * dropped before going to sleep and is reacquired afterwards.
+ *
+ * The function returns 0 if the @timeout elapsed, -ERESTARTSYS if it
+ * was interrupted by a signal, and the remaining jiffies otherwise
+ * if the condition evaluated to true before the timeout elapsed.
+ */
+#define wait_event_interruptible_lock_irq_timeout(wq, condition, lock, \
+ timeout) \
+({ \
+ int __ret = timeout; \
+ \
+ if (!(condition)) \
+ __wait_event_interruptible_lock_irq_timeout( \
+ wq, condition, lock, __ret); \
+ __ret; \
+})
+
+
/*
* These are the old interfaces to sleep waiting for an event.
* They are racy. DO NOT use them, use the wait_event* interfaces above.
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 46/58] [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (44 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 45/58] [SCSI] zfcp: fix lock imbalance by reworking request queue locking Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 47/58] nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error Luis Henriques
` (11 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Martin Peschke, Steffen Maier, James Bottomley, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Peschke <mpeschke@linux.vnet.ibm.com>
commit 924dd584b198a58aa7cb3efefd8a03326550ce8f upstream.
BUG: sleeping function called from invalid context at kernel/workqueue.c:2752
in_atomic(): 1, irqs_disabled(): 1, pid: 360, name: zfcperp0.0.1700
CPU: 1 Not tainted 3.9.3+ #69
Process zfcperp0.0.1700 (pid: 360, task: 0000000075b7e080, ksp: 000000007476bc30)
<snip>
Call Trace:
([<00000000001165de>] show_trace+0x106/0x154)
[<00000000001166a0>] show_stack+0x74/0xf4
[<00000000006ff646>] dump_stack+0xc6/0xd4
[<000000000017f3a0>] __might_sleep+0x128/0x148
[<000000000015ece8>] flush_work+0x54/0x1f8
[<00000000001630de>] __cancel_work_timer+0xc6/0x128
[<00000000005067ac>] scsi_device_dev_release_usercontext+0x164/0x23c
[<0000000000161816>] execute_in_process_context+0x96/0xa8
[<00000000004d33d8>] device_release+0x60/0xc0
[<000000000048af48>] kobject_release+0xa8/0x1c4
[<00000000004f4bf2>] __scsi_iterate_devices+0xfa/0x130
[<000003ff801b307a>] zfcp_erp_strategy+0x4da/0x1014 [zfcp]
[<000003ff801b3caa>] zfcp_erp_thread+0xf6/0x2b0 [zfcp]
[<000000000016b75a>] kthread+0xf2/0xfc
[<000000000070c9de>] kernel_thread_starter+0x6/0xc
[<000000000070c9d8>] kernel_thread_starter+0x0/0xc
Apparently, the ref_count for some scsi_device drops down to zero,
triggering device removal through execute_in_process_context(), while
the lldd error recovery thread iterates through a scsi device list.
Unfortunately, execute_in_process_context() decides to immediately
execute that device removal function, instead of scheduling asynchronous
execution, since it detects process context and thinks it is safe to do
so. But almost all calls to shost_for_each_device() in our lldd are
inside spin_lock_irq, even in thread context. Obviously, schedule()
inside spin_lock_irq sections is a bad idea.
Change the lldd to use the proper iterator function,
__shost_for_each_device(), in combination with required locking.
Occurences that need to be changed include all calls in zfcp_erp.c,
since those might be executed in zfcp error recovery thread context
with a lock held.
Other occurences of shost_for_each_device() in zfcp_fsf.c do not
need to be changed (no process context, no surrounding locking).
The problem was introduced in Linux 2.6.37 by commit
b62a8d9b45b971a67a0f8413338c230e3117dff5
"[SCSI] zfcp: Use SCSI device data zfcp_scsi_dev instead of zfcp_unit".
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/s390/scsi/zfcp_erp.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index e1b4f80..5c87270 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -102,10 +102,13 @@ static void zfcp_erp_action_dismiss_port(struct zfcp_port *port)
if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_INUSE)
zfcp_erp_action_dismiss(&port->erp_action);
- else
- shost_for_each_device(sdev, port->adapter->scsi_host)
+ else {
+ spin_lock(port->adapter->scsi_host->host_lock);
+ __shost_for_each_device(sdev, port->adapter->scsi_host)
if (sdev_to_zfcp(sdev)->port == port)
zfcp_erp_action_dismiss_lun(sdev);
+ spin_unlock(port->adapter->scsi_host->host_lock);
+ }
}
static void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter)
@@ -592,9 +595,11 @@ static void _zfcp_erp_lun_reopen_all(struct zfcp_port *port, int clear,
{
struct scsi_device *sdev;
- shost_for_each_device(sdev, port->adapter->scsi_host)
+ spin_lock(port->adapter->scsi_host->host_lock);
+ __shost_for_each_device(sdev, port->adapter->scsi_host)
if (sdev_to_zfcp(sdev)->port == port)
_zfcp_erp_lun_reopen(sdev, clear, id, 0);
+ spin_unlock(port->adapter->scsi_host->host_lock);
}
static void zfcp_erp_strategy_followup_failed(struct zfcp_erp_action *act)
@@ -1435,8 +1440,10 @@ void zfcp_erp_set_adapter_status(struct zfcp_adapter *adapter, u32 mask)
atomic_set_mask(common_mask, &port->status);
read_unlock_irqrestore(&adapter->port_list_lock, flags);
- shost_for_each_device(sdev, adapter->scsi_host)
+ spin_lock_irqsave(adapter->scsi_host->host_lock, flags);
+ __shost_for_each_device(sdev, adapter->scsi_host)
atomic_set_mask(common_mask, &sdev_to_zfcp(sdev)->status);
+ spin_unlock_irqrestore(adapter->scsi_host->host_lock, flags);
}
/**
@@ -1470,11 +1477,13 @@ void zfcp_erp_clear_adapter_status(struct zfcp_adapter *adapter, u32 mask)
}
read_unlock_irqrestore(&adapter->port_list_lock, flags);
- shost_for_each_device(sdev, adapter->scsi_host) {
+ spin_lock_irqsave(adapter->scsi_host->host_lock, flags);
+ __shost_for_each_device(sdev, adapter->scsi_host) {
atomic_clear_mask(common_mask, &sdev_to_zfcp(sdev)->status);
if (clear_counter)
atomic_set(&sdev_to_zfcp(sdev)->erp_counter, 0);
}
+ spin_unlock_irqrestore(adapter->scsi_host->host_lock, flags);
}
/**
@@ -1488,16 +1497,19 @@ void zfcp_erp_set_port_status(struct zfcp_port *port, u32 mask)
{
struct scsi_device *sdev;
u32 common_mask = mask & ZFCP_COMMON_FLAGS;
+ unsigned long flags;
atomic_set_mask(mask, &port->status);
if (!common_mask)
return;
- shost_for_each_device(sdev, port->adapter->scsi_host)
+ spin_lock_irqsave(port->adapter->scsi_host->host_lock, flags);
+ __shost_for_each_device(sdev, port->adapter->scsi_host)
if (sdev_to_zfcp(sdev)->port == port)
atomic_set_mask(common_mask,
&sdev_to_zfcp(sdev)->status);
+ spin_unlock_irqrestore(port->adapter->scsi_host->host_lock, flags);
}
/**
@@ -1512,6 +1524,7 @@ void zfcp_erp_clear_port_status(struct zfcp_port *port, u32 mask)
struct scsi_device *sdev;
u32 common_mask = mask & ZFCP_COMMON_FLAGS;
u32 clear_counter = mask & ZFCP_STATUS_COMMON_ERP_FAILED;
+ unsigned long flags;
atomic_clear_mask(mask, &port->status);
@@ -1521,13 +1534,15 @@ void zfcp_erp_clear_port_status(struct zfcp_port *port, u32 mask)
if (clear_counter)
atomic_set(&port->erp_counter, 0);
- shost_for_each_device(sdev, port->adapter->scsi_host)
+ spin_lock_irqsave(port->adapter->scsi_host->host_lock, flags);
+ __shost_for_each_device(sdev, port->adapter->scsi_host)
if (sdev_to_zfcp(sdev)->port == port) {
atomic_clear_mask(common_mask,
&sdev_to_zfcp(sdev)->status);
if (clear_counter)
atomic_set(&sdev_to_zfcp(sdev)->erp_counter, 0);
}
+ spin_unlock_irqrestore(port->adapter->scsi_host->host_lock, flags);
}
/**
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 47/58] nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (45 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 46/58] [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 48/58] nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection Luis Henriques
` (10 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vyacheslav Dubeyko, Andrew Morton, Linus Torvalds, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Vyacheslav Dubeyko <slava@dubeyko.com>
commit 2df37a19c686c2d7c4e9b4ce1505b5141e3e5552 upstream.
Remove double call of bio_put() in nilfs_end_bio_write() for the case of
BIO_EOPNOTSUPP error detection. The issue was found by Dan Carpenter
and he suggests first version of the fix too.
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
fs/nilfs2/segbuf.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index dc9a913..5bacf46 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -345,8 +345,7 @@ static void nilfs_end_bio_write(struct bio *bio, int err)
if (err == -EOPNOTSUPP) {
set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
- bio_put(bio);
- /* to be detected by submit_seg_bio() */
+ /* to be detected by nilfs_segbuf_submit_bio() */
}
if (!uptodate)
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 48/58] nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (46 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 47/58] nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 49/58] Bluetooth: Add support for Atheros [0cf3:3121] Luis Henriques
` (9 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vyacheslav Dubeyko, Dan Carpenter, Andrew Morton, Linus Torvalds,
Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Vyacheslav Dubeyko <slava@dubeyko.com>
commit 4bf93b50fd04118ac7f33a3c2b8a0a1f9fa80bc9 upstream.
Fix the issue with improper counting number of flying bio requests for
BIO_EOPNOTSUPP error detection case.
The sb_nbio must be incremented exactly the same number of times as
complete() function was called (or will be called) because
nilfs_segbuf_wait() will call wail_for_completion() for the number of
times set to sb_nbio:
do {
wait_for_completion(&segbuf->sb_bio_event);
} while (--segbuf->sb_nbio > 0);
Two functions complete() and wait_for_completion() must be called the
same number of times for the same sb_bio_event. Otherwise,
wait_for_completion() will hang or leak.
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
fs/nilfs2/segbuf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 5bacf46..2d8be51 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -376,12 +376,12 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
bio->bi_private = segbuf;
bio_get(bio);
submit_bio(mode, bio);
+ segbuf->sb_nbio++;
if (bio_flagged(bio, BIO_EOPNOTSUPP)) {
bio_put(bio);
err = -EOPNOTSUPP;
goto failed;
}
- segbuf->sb_nbio++;
bio_put(bio);
wi->bio = NULL;
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 49/58] Bluetooth: Add support for Atheros [0cf3:3121]
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (47 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 48/58] nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 50/58] efivars: explicitly calculate length of VariableName Luis Henriques
` (8 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: AceLan Kao, Gustavo Padovan, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: AceLan Kao <acelan.kao@canonical.com>
commit 1ebd0b21ab14efb75950079840eac29afea2a26e upstream.
Add support for the AR3012 chip.
T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=01 Dev#= 6 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=3121 Rev=00.02
C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Cc: AceLan Kao <acelan.kao@canonical.com>
[ AceLan: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/bluetooth/ath3k.c | 2 ++
drivers/bluetooth/btusb.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 8af01c1..47b0f70 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -90,6 +90,7 @@ static struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x13d3, 0x3393) },
{ USB_DEVICE(0x0489, 0xe04e) },
{ USB_DEVICE(0x0489, 0xe056) },
+ { USB_DEVICE(0x0cf3, 0x3121) },
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE02C) },
@@ -126,6 +127,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 },
/* Atheros AR5BBU22 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index ff0782c..f403d46 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -156,6 +156,7 @@ static struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 },
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 50/58] efivars: explicitly calculate length of VariableName
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (48 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 49/58] Bluetooth: Add support for Atheros [0cf3:3121] Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 51/58] workqueue: fix possible stall on try_to_grab_pending() of a delayed work item Luis Henriques
` (7 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Matthew Garrett, Josh Boyer, Michael Schroeder, Lee, Chun-Yi,
Lingzhu Xiang, Seiji Aguchi, Matt Fleming, Hui Wang,
Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Fleming <matt.fleming@intel.com>
commit ec50bd32f1672d38ddce10fb1841cbfda89cfe9a upstream.
It's not wise to assume VariableNameSize represents the length of
VariableName, as not all firmware updates VariableNameSize in the same
way (some don't update it at all if EFI_SUCCESS is returned). There
are even implementations out there that update VariableNameSize with
values that are both larger than the string returned in VariableName
and smaller than the buffer passed to GetNextVariableName(), which
resulted in the following bug report from Michael Schroeder,
> On HP z220 system (firmware version 1.54), some EFI variables are
> incorrectly named :
>
> ls -d /sys/firmware/efi/vars/*8be4d* | grep -v -- -8be returns
> /sys/firmware/efi/vars/dbxDefault-pport8be4df61-93ca-11d2-aa0d-00e098032b8c
> /sys/firmware/efi/vars/KEKDefault-pport8be4df61-93ca-11d2-aa0d-00e098032b8c
> /sys/firmware/efi/vars/SecureBoot-pport8be4df61-93ca-11d2-aa0d-00e098032b8c
> /sys/firmware/efi/vars/SetupMode-Information8be4df61-93ca-11d2-aa0d-00e098032b8c
The issue here is that because we blindly use VariableNameSize without
verifying its value, we can potentially read garbage values from the
buffer containing VariableName if VariableNameSize is larger than the
length of VariableName.
Since VariableName is a string, we can calculate its size by searching
for the terminating NULL character.
Reported-by: Frederic Crozat <fcrozat@suse.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: Michael Schroeder <mls@suse.com>
Cc: Lee, Chun-Yi <jlee@suse.com>
Cc: Lingzhu Xiang <lxiang@redhat.com>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Cc: Hui Wang <hui.wang@canonical.com>
[ Hui Wang: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/firmware/efivars.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index d7c3540..8c7a8cf 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -1006,6 +1006,31 @@ static ssize_t efivar_delete(struct file *filp, struct kobject *kobj,
}
/*
+ * Returns the size of variable_name, in bytes, including the
+ * terminating NULL character, or variable_name_size if no NULL
+ * character is found among the first variable_name_size bytes.
+ */
+static unsigned long var_name_strnsize(efi_char16_t *variable_name,
+ unsigned long variable_name_size)
+{
+ unsigned long len;
+ efi_char16_t c;
+
+ /*
+ * The variable name is, by definition, a NULL-terminated
+ * string, so make absolutely sure that variable_name_size is
+ * the value we expect it to be. If not, return the real size.
+ */
+ for (len = 2; len <= variable_name_size; len += sizeof(c)) {
+ c = variable_name[(len / sizeof(c)) - 1];
+ if (!c)
+ break;
+ }
+
+ return min(len, variable_name_size);
+}
+
+/*
* Let's not leave out systab information that snuck into
* the efivars driver
*/
@@ -1232,6 +1257,8 @@ int register_efivars(struct efivars *efivars,
&vendor_guid);
switch (status) {
case EFI_SUCCESS:
+ variable_name_size = var_name_strnsize(variable_name,
+ variable_name_size);
efivar_create_sysfs_entry(efivars,
variable_name_size,
variable_name,
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 51/58] workqueue: fix possible stall on try_to_grab_pending() of a delayed work item
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (49 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 50/58] efivars: explicitly calculate length of VariableName Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 52/58] x86/xen: do not identity map UNUSABLE regions in the machine E820 Luis Henriques
` (6 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lai Jiangshan, Tejun Heo, Li Zefan, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lai Jiangshan <laijs@cn.fujitsu.com>
commit 3aa62497594430ea522050b75c033f71f2c60ee6 upstream.
Currently, when try_to_grab_pending() grabs a delayed work item, it
leaves its linked work items alone on the delayed_works. The linked
work items are always NO_COLOR and will cause future
cwq_activate_first_delayed() increase cwq->nr_active incorrectly, and
may cause the whole cwq to stall. For example,
state: cwq->max_active = 1, cwq->nr_active = 1
one work in cwq->pool, many in cwq->delayed_works.
step1: try_to_grab_pending() removes a work item from delayed_works
but leaves its NO_COLOR linked work items on it.
step2: Later on, cwq_activate_first_delayed() activates the linked
work item increasing ->nr_active.
step3: cwq->nr_active = 1, but all activated work items of the cwq are
NO_COLOR. When they finish, cwq->nr_active will not be
decreased due to NO_COLOR, and no further work items will be
activated from cwq->delayed_works. the cwq stalls.
Fix it by ensuring the target work item is activated before stealing
PENDING in try_to_grab_pending(). This ensures that all the linked
work items are activated without incorrectly bumping cwq->nr_active.
tj: Updated comment and description.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
[ luis: backported to 3.5: based on Li Zefan's backport to 3.4 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
kernel/workqueue.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index dd488af..0395ca8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1744,10 +1744,9 @@ static void move_linked_works(struct work_struct *work, struct list_head *head,
*nextp = n;
}
-static void cwq_activate_first_delayed(struct cpu_workqueue_struct *cwq)
+static void cwq_activate_delayed_work(struct work_struct *work)
{
- struct work_struct *work = list_first_entry(&cwq->delayed_works,
- struct work_struct, entry);
+ struct cpu_workqueue_struct *cwq = get_work_cwq(work);
struct list_head *pos = gcwq_determine_ins_pos(cwq->gcwq, cwq);
trace_workqueue_activate_work(work);
@@ -1756,6 +1755,14 @@ static void cwq_activate_first_delayed(struct cpu_workqueue_struct *cwq)
cwq->nr_active++;
}
+static void cwq_activate_first_delayed(struct cpu_workqueue_struct *cwq)
+{
+ struct work_struct *work = list_first_entry(&cwq->delayed_works,
+ struct work_struct, entry);
+
+ cwq_activate_delayed_work(work);
+}
+
/**
* cwq_dec_nr_in_flight - decrement cwq's nr_in_flight
* @cwq: cwq of interest
@@ -2653,6 +2660,18 @@ static int try_to_grab_pending(struct work_struct *work)
smp_rmb();
if (gcwq == get_work_gcwq(work)) {
debug_work_deactivate(work);
+
+ /*
+ * A delayed work item cannot be grabbed directly
+ * because it might have linked NO_COLOR work items
+ * which, if left on the delayed_list, will confuse
+ * cwq->nr_active management later on and cause
+ * stall. Make sure the work item is activated
+ * before grabbing.
+ */
+ if (*work_data_bits(work) & WORK_STRUCT_DELAYED)
+ cwq_activate_delayed_work(work);
+
list_del_init(&work->entry);
cwq_dec_nr_in_flight(get_work_cwq(work),
get_work_color(work),
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 52/58] x86/xen: do not identity map UNUSABLE regions in the machine E820
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (50 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 51/58] workqueue: fix possible stall on try_to_grab_pending() of a delayed work item Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 53/58] jfs: fix readdir cookie incompatibility with NFSv4 Luis Henriques
` (5 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Vrabel, Konrad Rzeszutek Wilk, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Vrabel <david.vrabel@citrix.com>
commit 3bc38cbceb85881a8eb789ee1aa56678038b1909 upstream.
If there are UNUSABLE regions in the machine memory map, dom0 will
attempt to map them 1:1 which is not permitted by Xen and the kernel
will crash.
There isn't anything interesting in the UNUSABLE region that the dom0
kernel needs access to so we can avoid making the 1:1 mapping and
treat it as RAM.
We only do this for dom0, as that is where tboot case shows up.
A PV domU could have an UNUSABLE region in its pseudo-physical map
and would need to be handled in another patch.
This fixes a boot failure on hosts with tboot.
tboot marks a region in the e820 map as unusable and the dom0 kernel
would attempt to map this region and Xen does not permit unusable
regions to be mapped by guests.
(XEN) 0000000000000000 - 0000000000060000 (usable)
(XEN) 0000000000060000 - 0000000000068000 (reserved)
(XEN) 0000000000068000 - 000000000009e000 (usable)
(XEN) 0000000000100000 - 0000000000800000 (usable)
(XEN) 0000000000800000 - 0000000000972000 (unusable)
tboot marked this region as unusable.
(XEN) 0000000000972000 - 00000000cf200000 (usable)
(XEN) 00000000cf200000 - 00000000cf38f000 (reserved)
(XEN) 00000000cf38f000 - 00000000cf3ce000 (ACPI data)
(XEN) 00000000cf3ce000 - 00000000d0000000 (reserved)
(XEN) 00000000e0000000 - 00000000f0000000 (reserved)
(XEN) 00000000fe000000 - 0000000100000000 (reserved)
(XEN) 0000000100000000 - 0000000630000000 (usable)
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
[v1: Altered the patch and description with domU's with UNUSABLE regions]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/x86/xen/setup.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index c207fdb..1ba7725 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -318,6 +318,17 @@ static void xen_align_and_add_e820_region(u64 start, u64 size, int type)
e820_add_region(start, end - start, type);
}
+void xen_ignore_unusable(struct e820entry *list, size_t map_size)
+{
+ struct e820entry *entry;
+ unsigned int i;
+
+ for (i = 0, entry = list; i < map_size; i++, entry++) {
+ if (entry->type == E820_UNUSABLE)
+ entry->type = E820_RAM;
+ }
+}
+
/**
* machine_specific_memory_setup - Hook for machine specific memory setup.
**/
@@ -358,6 +369,17 @@ char * __init xen_memory_setup(void)
}
BUG_ON(rc);
+ /*
+ * Xen won't allow a 1:1 mapping to be created to UNUSABLE
+ * regions, so if we're using the machine memory map leave the
+ * region as RAM as it is in the pseudo-physical map.
+ *
+ * UNUSABLE regions in domUs are not handled and will need
+ * a patch in the future.
+ */
+ if (xen_initial_domain())
+ xen_ignore_unusable(map, memmap.nr_entries);
+
/* Make sure the Xen-supplied memory map is well-ordered. */
sanitize_e820_map(map, memmap.nr_entries, &memmap.nr_entries);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 53/58] jfs: fix readdir cookie incompatibility with NFSv4
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (51 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 52/58] x86/xen: do not identity map UNUSABLE regions in the machine E820 Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 54/58] powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor Luis Henriques
` (4 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Kleikamp, Ben Hutchings, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Kleikamp <dave.kleikamp@oracle.com>
commit 44512449c0ab368889dd13ae0031fba74ee7e1d2 upstream.
NFSv4 reserves readdir cookie values 0-2 for special entries (. and ..),
but jfs allows a value of 2 for a non-special entry. This incompatibility
can result in the nfs client reporting a readdir loop.
This patch doesn't change the value stored internally, but adds one to
the value exposed to the iterate method.
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Tested-by: Christian Kujau <lists@nerdbynature.de>
Cc: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
[ luis: backported to 3.5 (based on bwh's backport to 3.2):
- adjusted context
- replaced usage of ctx->pos by filp->f_pos ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
fs/jfs/jfs_dtree.c | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 9197a1b..9f7c758 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -3047,6 +3047,14 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
dir_index = (u32) filp->f_pos;
+ /*
+ * NFSv4 reserves cookies 1 and 2 for . and .. so the value
+ * we return to the vfs is one greater than the one we use
+ * internally.
+ */
+ if (dir_index)
+ dir_index--;
+
if (dir_index > 1) {
struct dir_table_slot dirtab_slot;
@@ -3086,7 +3094,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (p->header.flag & BT_INTERNAL) {
jfs_err("jfs_readdir: bad index table");
DT_PUTPAGE(mp);
- filp->f_pos = -1;
+ filp->f_pos = DIREND;
return 0;
}
} else {
@@ -3094,7 +3102,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
/*
* self "."
*/
- filp->f_pos = 0;
+ filp->f_pos = 1;
if (filldir(dirent, ".", 1, 0, ip->i_ino,
DT_DIR))
return 0;
@@ -3102,7 +3110,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
/*
* parent ".."
*/
- filp->f_pos = 1;
+ filp->f_pos = 2;
if (filldir(dirent, "..", 2, 1, PARENT(ip), DT_DIR))
return 0;
@@ -3123,24 +3131,25 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
/*
* Legacy filesystem - OS/2 & Linux JFS < 0.3.6
*
- * pn = index = 0: First entry "."
- * pn = 0; index = 1: Second entry ".."
+ * pn = 0; index = 1: First entry "."
+ * pn = 0; index = 2: Second entry ".."
* pn > 0: Real entries, pn=1 -> leftmost page
* pn = index = -1: No more entries
*/
dtpos = filp->f_pos;
- if (dtpos == 0) {
+ if (dtpos < 2) {
/* build "." entry */
+ filp->f_pos = 1;
if (filldir(dirent, ".", 1, filp->f_pos, ip->i_ino,
DT_DIR))
return 0;
- dtoffset->index = 1;
+ dtoffset->index = 2;
filp->f_pos = dtpos;
}
if (dtoffset->pn == 0) {
- if (dtoffset->index == 1) {
+ if (dtoffset->index == 2) {
/* build ".." entry */
if (filldir(dirent, "..", 2, filp->f_pos,
@@ -3233,6 +3242,12 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
}
jfs_dirent->position = unique_pos++;
}
+ /*
+ * We add 1 to the index because we may
+ * use a value of 2 internally, and NFSv4
+ * doesn't like that.
+ */
+ jfs_dirent->position++;
} else {
jfs_dirent->position = dtpos;
len = min(d_namleft, DTLHDRDATALEN_LEGACY);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 54/58] powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (52 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 53/58] jfs: fix readdir cookie incompatibility with NFSv4 Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 55/58] powerpc: Work around gcc miscompilation of __pa() on 64-bit Luis Henriques
` (3 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Benjamin Herrenschmidt, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
commit f5f6cbb61610b7bf9d9d96db9c3979d62a424bab upstream.
/proc/powerpc/lparcfg is an ancient facility (though still actively used)
which allows access to some informations relative to the partition when
running underneath a PAPR compliant hypervisor.
It makes no sense on non-pseries machines. However, currently, not only
can it be created on these if the kernel has pseries support, but accessing
it on such a machine will crash due to trying to do hypervisor calls.
In fact, it should also not do HV calls on older pseries that didn't have
an hypervisor either.
Finally, it has the plumbing to be a module but is a "bool" Kconfig option.
This fixes the whole lot by turning it into a machine_device_initcall
that is only created on pseries, and adding the necessary hypervisor
check before calling the H_GET_EM_PARMS hypercall
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/powerpc/kernel/lparcfg.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index f5725bc..7ebbae0 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -35,7 +35,13 @@
#include <asm/vdso_datapage.h>
#include <asm/vio.h>
#include <asm/mmu.h>
+#include <asm/machdep.h>
+
+/*
+ * This isn't a module but we expose that to userspace
+ * via /proc so leave the definitions here
+ */
#define MODULE_VERS "1.9"
#define MODULE_NAME "lparcfg"
@@ -419,7 +425,8 @@ static void parse_em_data(struct seq_file *m)
{
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
- if (plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS)
+ if (firmware_has_feature(FW_FEATURE_LPAR) &&
+ plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS)
seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]);
}
@@ -678,7 +685,6 @@ static int lparcfg_open(struct inode *inode, struct file *file)
}
static const struct file_operations lparcfg_fops = {
- .owner = THIS_MODULE,
.read = seq_read,
.write = lparcfg_write,
.open = lparcfg_open,
@@ -704,15 +710,4 @@ static int __init lparcfg_init(void)
proc_ppc64_lparcfg = ent;
return 0;
}
-
-static void __exit lparcfg_cleanup(void)
-{
- if (proc_ppc64_lparcfg)
- remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent);
-}
-
-module_init(lparcfg_init);
-module_exit(lparcfg_cleanup);
-MODULE_DESCRIPTION("Interface for LPAR configuration data");
-MODULE_AUTHOR("Dave Engebretsen");
-MODULE_LICENSE("GPL");
+machine_device_initcall(pseries, lparcfg_init);
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 55/58] powerpc: Work around gcc miscompilation of __pa() on 64-bit
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (53 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 54/58] powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 56/58] powerpc/hvsi: Increase handshake timeout from 200ms to 400ms Luis Henriques
` (2 subsequent siblings)
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Paul Mackerras, Benjamin Herrenschmidt, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Mackerras <paulus@samba.org>
commit bdbc29c19b2633b1d9c52638fb732bcde7a2031a upstream.
On 64-bit, __pa(&static_var) gets miscompiled by recent versions of
gcc as something like:
addis 3,2,.LANCHOR1+4611686018427387904@toc@ha
addi 3,3,.LANCHOR1+4611686018427387904@toc@l
This ends up effectively ignoring the offset, since its bottom 32 bits
are zero, and means that the result of __pa() still has 0xC in the top
nibble. This happens with gcc 4.8.1, at least.
To work around this, for 64-bit we make __pa() use an AND operator,
and for symmetry, we make __va() use an OR operator. Using an AND
operator rather than a subtraction ends up with slightly shorter code
since it can be done with a single clrldi instruction, whereas it
takes three instructions to form the constant (-PAGE_OFFSET) and add
it on. (Note that MEMORY_START is always 0 on 64-bit.)
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/page.h | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4d8336c..74b6ce4 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -975,6 +975,7 @@ config RELOCATABLE
must live at a different physical address than the primary
kernel.
+# This value must have zeroes in the bottom 60 bits otherwise lots will break
config PAGE_OFFSET
hex
default "0xc000000000000000"
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index f072e97..2e6c4e5a 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -211,9 +211,19 @@ extern long long virt_phys_offset;
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
#else
+#ifdef CONFIG_PPC64
+/*
+ * gcc miscompiles (unsigned long)(&static_var) - PAGE_OFFSET
+ * with -mcmodel=medium, so we use & and | instead of - and + on 64-bit.
+ */
+#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET))
+#define __pa(x) ((unsigned long)(x) & 0x0fffffffffffffffUL)
+
+#else /* 32-bit, non book E */
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START))
#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START)
#endif
+#endif
/*
* Unfortunately the PLT is in the BSS in the PPC32 ELF ABI,
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 56/58] powerpc/hvsi: Increase handshake timeout from 200ms to 400ms.
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (54 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 55/58] powerpc: Work around gcc miscompilation of __pa() on 64-bit Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 57/58] drivers/base/memory.c: fix show_mem_removable() to handle missing sections Luis Henriques
2013-09-02 8:54 ` [PATCH 58/58] x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member Luis Henriques
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eugene Surovegin, Benjamin Herrenschmidt, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Eugene Surovegin <ebs@ebshome.net>
commit d220980b701d838560a70de691b53be007e99e78 upstream.
This solves a problem observed in kexec'ed kernel where 200ms timeout is
too short and bootconsole fails to initialize. Console did eventually
become workable but much later into the boot process.
Observed timeout was around 260ms, but I decided to make it a little bigger
for more reliability.
This has been tested on Power7 machine with Petitboot as a primary
bootloader and PowerNV firmware.
Signed-off-by: Eugene Surovegin <surovegin@google.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/tty/hvc/hvsi_lib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
index 59c135d..2c51419 100644
--- a/drivers/tty/hvc/hvsi_lib.c
+++ b/drivers/tty/hvc/hvsi_lib.c
@@ -341,8 +341,8 @@ void hvsilib_establish(struct hvsi_priv *pv)
pr_devel("HVSI@%x: ... waiting handshake\n", pv->termno);
- /* Try for up to 200s */
- for (timeout = 0; timeout < 20; timeout++) {
+ /* Try for up to 400ms */
+ for (timeout = 0; timeout < 40; timeout++) {
if (pv->established)
goto established;
if (!hvsi_get_packet(pv))
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 57/58] drivers/base/memory.c: fix show_mem_removable() to handle missing sections
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (55 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 56/58] powerpc/hvsi: Increase handshake timeout from 200ms to 400ms Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
2013-09-02 8:54 ` [PATCH 58/58] x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member Luis Henriques
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Russ Anderson, Greg Kroah-Hartman, Rafael J. Wysocki, Yinghai Lu,
Andrew Morton, Linus Torvalds, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Russ Anderson <rja@sgi.com>
commit 21ea9f5ace3a7317cc3ba1fbc749758021a83136 upstream.
"cat /sys/devices/system/memory/memory*/removable" crashed the system.
The problem is that show_mem_removable() is passing a
bad pfn to is_mem_section_removable(), which causes
if (!node_online(page_to_nid(page)))
to blow up. Why is it passing in a bad pfn?
The reason is that show_mem_removable() will loop sections_per_block
times. sections_per_block is 16, but mem->section_count is 8,
indicating holes in this memory block. Checking that the memory section
is present before checking to see if the memory section is removable
fixes the problem.
harp5-sys:~ # cat /sys/devices/system/memory/memory*/removable
0
1
1
1
1
1
1
1
1
1
1
1
1
1
BUG: unable to handle kernel paging request at ffffea00c3200000
IP: [<ffffffff81117ed1>] is_pageblock_removable_nolock+0x1/0x90
PGD 83ffd4067 PUD 37bdfce067 PMD 0
Oops: 0000 [#1] SMP
Modules linked in: autofs4 binfmt_misc rdma_ucm rdma_cm iw_cm ib_addr ib_srp scsi_transport_srp scsi_tgt ib_ipoib ib_cm ib_uverbs ib_umad iw_cxgb3 cxgb3 mdio mlx4_en mlx4_ib ib_sa mlx4_core ib_mthca ib_mad ib_core fuse nls_iso8859_1 nls_cp437 vfat fat joydev loop hid_generic usbhid hid hwperf(O) numatools(O) dm_mod iTCO_wdt ipv6 iTCO_vendor_support igb i2c_i801 ioatdma i2c_algo_bit ehci_pci pcspkr lpc_ich i2c_core ehci_hcd ptp sg mfd_core dca rtc_cmos pps_core mperf button xhci_hcd sd_mod crc_t10dif usbcore usb_common scsi_dh_emc scsi_dh_hp_sw scsi_dh_alua scsi_dh_rdac scsi_dh gru(O) xvma(O) xfs crc32c libcrc32c thermal sata_nv processor piix mptsas mptscsih scsi_transport_sas mptbase megaraid_sas fan thermal_sys hwmon ext3 jbd ata_piix ahci libahci libata scsi_mod
CPU: 4 PID: 5991 Comm: cat Tainted: G O 3.11.0-rc5-rja-uv+ #10
Hardware name: SGI UV2000/ROMLEY, BIOS SGI UV 2000/3000 series BIOS 01/15/2013
task: ffff88081f034580 ti: ffff880820022000 task.ti: ffff880820022000
RIP: 0010:[<ffffffff81117ed1>] [<ffffffff81117ed1>] is_pageblock_removable_nolock+0x1/0x90
RSP: 0018:ffff880820023df8 EFLAGS: 00010287
RAX: 0000000000040000 RBX: ffffea00c3200000 RCX: 0000000000000004
RDX: ffffea00c30b0000 RSI: 00000000001c0000 RDI: ffffea00c3200000
RBP: ffff880820023e38 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000001 R12: ffffea00c33c0000
R13: 0000160000000000 R14: 6db6db6db6db6db7 R15: 0000000000000001
FS: 00007ffff7fb2700(0000) GS:ffff88083fc80000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffea00c3200000 CR3: 000000081b954000 CR4: 00000000000407e0
Call Trace:
show_mem_removable+0x41/0x70
dev_attr_show+0x2a/0x60
sysfs_read_file+0xf7/0x1c0
vfs_read+0xc8/0x130
SyS_read+0x5d/0xa0
system_call_fastpath+0x16/0x1b
Signed-off-by: Russ Anderson <rja@sgi.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/base/memory.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7dda4f7..d63a06b 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -154,6 +154,8 @@ static ssize_t show_mem_removable(struct device *dev,
container_of(dev, struct memory_block, dev);
for (i = 0; i < sections_per_block; i++) {
+ if (!present_section_nr(mem->start_section_nr + i))
+ continue;
pfn = section_nr_to_pfn(mem->start_section_nr + i);
ret &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
}
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
* [PATCH 58/58] x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
` (56 preceding siblings ...)
2013-09-02 8:54 ` [PATCH 57/58] drivers/base/memory.c: fix show_mem_removable() to handle missing sections Luis Henriques
@ 2013-09-02 8:54 ` Luis Henriques
57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2013-09-02 8:54 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Radu Caragea, Andrew Morton, Michel Lespinasse, Oleg Nesterov,
Rik van Riel, Ingo Molnar, Adrian Sendroiu, Greg KH,
Kamal Mostafa, Linus Torvalds, Luis Henriques
3.5.7.21 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Radu Caragea <sinaelgl@gmail.com>
commit 41aacc1eea645c99edbe8fbcf78a97dc9b862adc upstream.
This is the updated version of df54d6fa5427 ("x86 get_unmapped_area():
use proper mmap base for bottom-up direction") that only randomizes the
mmap base address once.
Signed-off-by: Radu Caragea <sinaelgl@gmail.com>
Reported-and-tested-by: Jeff Shorey <shoreyjeff@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michel Lespinasse <walken@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Adrian Sendroiu <molecula2788@gmail.com>
Cc: Greg KH <greg@kroah.com>
Cc: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/x86/kernel/sys_x86_64.c | 2 +-
arch/x86/mm/mmap.c | 6 ++++--
include/linux/mm_types.h | 1 +
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index b4d3c39..51534ef 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -115,7 +115,7 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
*begin = new_begin;
}
} else {
- *begin = TASK_UNMAPPED_BASE;
+ *begin = current->mm->mmap_legacy_base;
*end = TASK_SIZE;
}
}
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index 845df68..5c1ae28 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -112,12 +112,14 @@ static unsigned long mmap_legacy_base(void)
*/
void arch_pick_mmap_layout(struct mm_struct *mm)
{
+ mm->mmap_legacy_base = mmap_legacy_base();
+ mm->mmap_base = mmap_base();
+
if (mmap_is_legacy()) {
- mm->mmap_base = mmap_legacy_base();
+ mm->mmap_base = mm->mmap_legacy_base;
mm->get_unmapped_area = arch_get_unmapped_area;
mm->unmap_area = arch_unmap_area;
} else {
- mm->mmap_base = mmap_base();
mm->get_unmapped_area = arch_get_unmapped_area_topdown;
mm->unmap_area = arch_unmap_area_topdown;
}
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 704a626..b5bea2f 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -307,6 +307,7 @@ struct mm_struct {
void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
#endif
unsigned long mmap_base; /* base of mmap area */
+ unsigned long mmap_legacy_base; /* base of mmap area in bottom-up allocations */
unsigned long task_size; /* size of task vm space */
unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
--
1.8.3.2
^ permalink raw reply [flat|nested] 59+ messages in thread
end of thread, other threads:[~2013-09-02 9:14 UTC | newest]
Thread overview: 59+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-02 8:53 [ 3.5.y.z extended stable ] Linux 3.5.7.21 stable review Luis Henriques
2013-09-02 8:53 ` [PATCH 01/58] drm/i915/lvds: ditch ->prepare special case Luis Henriques
2013-09-02 8:53 ` [PATCH 02/58] ALSA: usb: Parse UAC2 extension unit like for UAC1 Luis Henriques
2013-09-02 8:53 ` [PATCH 03/58] serial: mxs: fix buffer overflow Luis Henriques
2013-09-02 8:53 ` [PATCH 04/58] fs/proc/task_mmu.c: fix buffer overflow in add_page_map() Luis Henriques
2013-09-02 8:53 ` [PATCH 05/58] af_key: initialize satype in key_notify_policy_flush() Luis Henriques
2013-09-02 8:53 ` [PATCH 06/58] vm: add no-mmu vm_iomap_memory() stub Luis Henriques
2013-09-02 8:53 ` [PATCH 07/58] iwl4965: set power mode early Luis Henriques
2013-09-02 8:53 ` [PATCH 08/58] iwl4965: reset firmware after rfkill off Luis Henriques
2013-09-02 8:53 ` [PATCH 09/58] ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume Luis Henriques
2013-09-02 8:53 ` [PATCH 10/58] can: pcan_usb: fix wrong memcpy() bytes length Luis Henriques
2013-09-02 8:53 ` [PATCH 11/58] ALSA: 6fire: make buffers DMA-able (pcm) Luis Henriques
2013-09-02 8:53 ` [PATCH 12/58] ALSA: 6fire: make buffers DMA-able (midi) Luis Henriques
2013-09-02 8:53 ` [PATCH 13/58] jbd2: Fix use after free after error in jbd2_journal_dirty_metadata() Luis Henriques
2013-09-02 8:53 ` [PATCH 14/58] USB-Serial: Fix error handling of usb_wwan Luis Henriques
2013-09-02 8:54 ` [PATCH 15/58] USB: mos7840: fix big-endian probe Luis Henriques
2013-09-02 8:54 ` [PATCH 16/58] USB: adutux: fix big-endian device-type reporting Luis Henriques
2013-09-02 8:54 ` [PATCH 17/58] USB: ti_usb_3410_5052: fix big-endian firmware handling Luis Henriques
2013-09-02 8:54 ` [PATCH 18/58] ARM: 7809/1: perf: fix event validation for software group leaders Luis Henriques
2013-09-02 8:54 ` [PATCH 19/58] m68k/atari: ARAnyM - Fix NatFeat module support Luis Henriques
2013-09-02 8:54 ` [PATCH 20/58] m68k: Truncate base in do_div() Luis Henriques
2013-09-02 8:54 ` [PATCH 21/58] usb: add two quirky touchscreen Luis Henriques
2013-09-02 8:54 ` [PATCH 22/58] USB: mos7720: fix broken control requests Luis Henriques
2013-09-02 8:54 ` [PATCH 23/58] USB: keyspan: fix null-deref at disconnect and release Luis Henriques
2013-09-02 8:54 ` [PATCH 24/58] MIPS: Expose missing pci_io{map,unmap} declarations Luis Henriques
2013-09-02 8:54 ` [PATCH 25/58] microblaze: Update microblaze defconfigs Luis Henriques
2013-09-02 8:54 ` [PATCH 26/58] sound: Fix make allmodconfig on MIPS Luis Henriques
2013-09-02 8:54 ` [PATCH 27/58] sound: Fix make allmodconfig on MIPS correctly Luis Henriques
2013-09-02 8:54 ` [PATCH 28/58] alpha: makefile: don't enforce small data model for kernel builds Luis Henriques
2013-09-02 8:54 ` [PATCH 29/58] MIPS: Rewrite pfn_valid to work in modules, too Luis Henriques
2013-09-02 8:54 ` [PATCH 30/58] xtensa: fix linker script transformation for .text.unlikely Luis Henriques
2013-09-02 8:54 ` [PATCH 31/58] wusbcore: fix kernel panic when disconnecting a wireless USB->serial device Luis Henriques
2013-09-02 8:54 ` [PATCH 32/58] ARM: 7810/1: perf: Fix array out of bounds access in armpmu_map_hw_event() Luis Henriques
2013-09-02 8:54 ` [PATCH 33/58] iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL Luis Henriques
2013-09-02 8:54 ` [PATCH 34/58] iwlwifi: pcie: disable L1 Active after pci_enable_device Luis Henriques
2013-09-02 8:54 ` [PATCH 35/58] zd1201: do not use stack as URB transfer_buffer Luis Henriques
2013-09-02 8:54 ` [PATCH 36/58] Hostap: copying wrong data prism2_ioctl_giwaplist() Luis Henriques
2013-09-02 8:54 ` [PATCH 37/58] ARM: at91/DT: fix at91sam9n12ek memory node Luis Henriques
2013-09-02 8:54 ` [PATCH 38/58] drm/i915: Invalidate TLBs for the rings after a reset Luis Henriques
2013-09-02 8:54 ` [PATCH 39/58] libata: apply behavioral quirks to sil3826 PMP Luis Henriques
2013-09-02 8:54 ` [PATCH 40/58] ARM: davinci: nand: specify ecc strength Luis Henriques
2013-09-02 8:54 ` [PATCH 41/58] ARM: 7816/1: CONFIG_KUSER_HELPERS: fix help text Luis Henriques
2013-09-02 8:54 ` [PATCH 42/58] sata_fsl: save irqs while coalescing Luis Henriques
2013-09-02 8:54 ` [PATCH 43/58] xen/events: initialize local per-cpu mask for all possible events Luis Henriques
2013-09-02 8:54 ` [PATCH 44/58] of: fdt: fix memory initialization for expanded DT Luis Henriques
2013-09-02 8:54 ` [PATCH 45/58] [SCSI] zfcp: fix lock imbalance by reworking request queue locking Luis Henriques
2013-09-02 8:54 ` [PATCH 46/58] [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops Luis Henriques
2013-09-02 8:54 ` [PATCH 47/58] nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error Luis Henriques
2013-09-02 8:54 ` [PATCH 48/58] nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection Luis Henriques
2013-09-02 8:54 ` [PATCH 49/58] Bluetooth: Add support for Atheros [0cf3:3121] Luis Henriques
2013-09-02 8:54 ` [PATCH 50/58] efivars: explicitly calculate length of VariableName Luis Henriques
2013-09-02 8:54 ` [PATCH 51/58] workqueue: fix possible stall on try_to_grab_pending() of a delayed work item Luis Henriques
2013-09-02 8:54 ` [PATCH 52/58] x86/xen: do not identity map UNUSABLE regions in the machine E820 Luis Henriques
2013-09-02 8:54 ` [PATCH 53/58] jfs: fix readdir cookie incompatibility with NFSv4 Luis Henriques
2013-09-02 8:54 ` [PATCH 54/58] powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor Luis Henriques
2013-09-02 8:54 ` [PATCH 55/58] powerpc: Work around gcc miscompilation of __pa() on 64-bit Luis Henriques
2013-09-02 8:54 ` [PATCH 56/58] powerpc/hvsi: Increase handshake timeout from 200ms to 400ms Luis Henriques
2013-09-02 8:54 ` [PATCH 57/58] drivers/base/memory.c: fix show_mem_removable() to handle missing sections Luis Henriques
2013-09-02 8:54 ` [PATCH 58/58] x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member Luis Henriques
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®