* [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review
@ 2014-12-02 19:17 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 001/121] ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect Kamal Mostafa
` (120 more replies)
0 siblings, 121 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:17 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa
This is the start of the review cycle for the Linux 3.13.11-ckt12 stable kernel.
This version contains 121 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.13.y-review;a=shortlog
git://kernel.ubuntu.com/ubuntu/linux.git linux-3.13.y-review
The review period for version 3.13.11-ckt12 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.13.y-ckt extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .
-Kamal
--
.../bindings/interrupt-controller/interrupts.txt | 4 -
arch/arm/Kconfig.debug | 2 +-
arch/arm/boot/compressed/head.S | 20 ++-
arch/arm/mach-pxa/include/mach/addr-map.h | 5 +
arch/arm/mm/Kconfig | 1 +
arch/arm64/lib/clear_user.S | 2 +-
arch/mips/oprofile/backtrace.c | 2 +-
arch/parisc/include/uapi/asm/shmbuf.h | 25 ++-
arch/parisc/kernel/syscall_table.S | 8 +-
arch/powerpc/kernel/entry_64.S | 6 +
arch/x86/include/asm/cpufeature.h | 1 +
arch/x86/include/asm/kvm_para.h | 10 +-
arch/x86/include/asm/page_32_types.h | 1 -
arch/x86/include/asm/page_64_types.h | 11 +-
arch/x86/include/asm/traps.h | 1 +
arch/x86/kernel/cpu/amd.c | 7 +
arch/x86/kernel/cpu/common.c | 2 +
arch/x86/kernel/dumpstack_64.c | 1 -
arch/x86/kernel/entry_64.S | 81 +++-------
arch/x86/kernel/microcode_core.c | 8 +
arch/x86/kernel/traps.c | 71 ++++++---
arch/x86/kvm/emulate.c | 8 +
arch/x86/kvm/x86.c | 2 +-
arch/x86/mm/init_64.c | 11 +-
arch/xtensa/include/uapi/asm/unistd.h | 3 +-
drivers/acpi/device_pm.c | 2 +-
drivers/ata/ahci.c | 19 ++-
drivers/base/core.c | 4 +-
drivers/base/regmap/regmap.c | 6 +-
drivers/block/rbd.c | 2 +-
drivers/char/hw_random/pseries-rng.c | 11 +-
drivers/clocksource/sun4i_timer.c | 10 +-
drivers/crypto/caam/key_gen.c | 29 ++--
drivers/firewire/core-cdev.c | 3 +-
drivers/gpu/drm/i915/intel_pm.c | 39 +++--
drivers/gpu/drm/radeon/cik.c | 7 +-
drivers/gpu/drm/radeon/cik_sdma.c | 21 +--
drivers/gpu/drm/radeon/evergreen.c | 4 +
drivers/gpu/drm/radeon/r100.c | 3 +
drivers/gpu/drm/radeon/r600_dma.c | 20 +--
drivers/gpu/drm/radeon/r600_dpm.c | 2 +-
drivers/gpu/drm/radeon/rs600.c | 3 +
drivers/gpu/drm/radeon/rs690.c | 3 +
drivers/gpu/drm/radeon/rv515.c | 3 +
drivers/gpu/drm/radeon/si.c | 3 +
drivers/i2c/busses/i2c-at91.c | 2 +-
drivers/infiniband/ulp/isert/ib_isert.c | 44 ++++--
drivers/infiniband/ulp/srpt/ib_srpt.c | 8 +
drivers/input/mouse/alps.c | 28 +++-
drivers/md/dm-bufio.c | 12 +-
drivers/md/dm-raid.c | 11 +-
drivers/md/dm-thin.c | 16 +-
drivers/md/md.c | 4 +
drivers/md/persistent-data/dm-btree-internal.h | 6 +
drivers/md/persistent-data/dm-btree-spine.c | 2 +-
drivers/md/persistent-data/dm-btree.c | 24 ++-
drivers/media/dvb-frontends/ds3000.c | 7 +
drivers/media/usb/ttusb-dec/ttusbdecfe.c | 3 +
drivers/net/can/dev.c | 2 +-
drivers/net/can/usb/esd_usb2.c | 1 +
drivers/net/macvtap.c | 2 +
drivers/net/tun.c | 16 +-
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 13 ++
drivers/net/wireless/ath/ath9k/hw.c | 13 --
drivers/net/wireless/ath/ath9k/reg.h | 13 +-
drivers/net/wireless/rt2x00/rt2x00queue.c | 50 ++----
drivers/of/address.c | 19 ++-
drivers/of/base.c | 88 +++--------
drivers/of/selftest.c | 66 +++++++-
drivers/platform/x86/acer-wmi.c | 19 +++
drivers/platform/x86/samsung-laptop.c | 10 ++
drivers/power/charger-manager.c | 65 +++++---
drivers/regulator/max77693.c | 2 +-
drivers/scsi/scsi_error.c | 4 +-
drivers/spi/spi-fsl-dspi.c | 4 +-
drivers/spi/spi-pxa2xx.c | 7 +-
drivers/staging/iio/meter/ade7758.h | 1 -
drivers/staging/iio/meter/ade7758_core.c | 57 ++-----
drivers/staging/iio/meter/ade7758_ring.c | 5 +-
drivers/staging/zram/zram_drv.c | 3 +-
drivers/target/target_core_transport.c | 2 +-
drivers/tty/serial/serial_core.c | 2 +-
drivers/tty/tty_io.c | 15 +-
drivers/tty/vt/consolemap.c | 8 +
drivers/usb/class/cdc-acm.c | 6 +-
drivers/usb/core/hcd.c | 2 +
drivers/usb/host/xhci-pci.c | 14 +-
drivers/usb/serial/kobil_sct.c | 5 +-
drivers/usb/serial/opticon.c | 2 +-
drivers/usb/storage/transport.c | 26 ++++
drivers/vhost/scsi.c | 24 +++
fs/btrfs/file-item.c | 2 +-
fs/nfs/delegation.c | 25 ++-
fs/nfs/delegation.h | 1 +
fs/nfs/direct.c | 1 +
fs/nfs/inode.c | 2 +-
fs/nfs/nfs4filelayout.c | 3 -
fs/nfs/nfs4proc.c | 76 ++++-----
fs/nfs/pagelist.c | 2 +-
fs/nfsd/nfscache.c | 53 ++-----
include/drm/i915_powerwell.h | 5 +-
include/linux/bitops.h | 7 +-
include/linux/nfs_xdr.h | 11 ++
include/linux/of.h | 84 ++++++++--
include/linux/power/charger-manager.h | 1 -
include/sound/soc-dpcm.h | 2 +
kernel/audit_tree.c | 1 +
kernel/rcu/tree.c | 22 ++-
net/ceph/crypto.c | 169 ++++++++++++++++-----
net/mac80211/aes_ccm.c | 3 +
net/mac80211/ibss.c | 2 +-
net/mac80211/ieee80211_i.h | 3 +-
net/mac80211/iface.c | 7 +-
net/mac80211/mesh.c | 2 +-
net/mac80211/mlme.c | 5 +-
net/mac80211/rx.c | 14 +-
net/mac80211/spectmgmt.c | 18 +--
net/sctp/sm_make_chunk.c | 3 +
sound/pci/hda/hda_i915.c | 28 +++-
sound/pci/hda/hda_i915.h | 6 +-
sound/pci/hda/hda_intel.c | 126 ++++++++-------
sound/pci/hda/patch_realtek.c | 2 +
sound/soc/codecs/sgtl5000.c | 3 +-
sound/soc/codecs/sgtl5000.h | 2 +-
sound/soc/codecs/wm_adsp.c | 1 +
sound/soc/sh/fsi.c | 3 +-
sound/soc/sh/rcar/core.c | 3 +-
sound/soc/soc-pcm.c | 72 +++++++--
sound/usb/card.c | 9 +-
sound/usb/mixer_quirks.c | 6 +
sound/usb/quirks.c | 14 ++
131 files changed, 1291 insertions(+), 728 deletions(-)
Aaro Koskinen (1):
MIPS: oprofile: Fix backtrace on 64-bit kernel
Alan Stern (1):
usb-storage: handle a skipped data phase
Alex Deucher (4):
drm/radeon: make sure mode init is complete in bandwidth_update
drm/radeon: use gart for DMA IB tests
drm/radeon: add missing crtc unlock when setting up the MC
drm/radeon: fix endian swapping in vbios fetch for tdp table
Alexander Stein (1):
spi: fsl-dspi: Fix CTAR selection
Alexey Khoroshilov (1):
can: esd_usb2: fix memory leak on disconnect
Andy Lutomirski (3):
x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
x86_64, traps: Stop using IST for #SS
x86_64, traps: Rework bad_iret
Anton Blanchard (1):
powerpc: do_notify_resume can be called with bad thread_info flags argument
Bart Van Assche (1):
srp-target: Retry when QP creation fails with ENOMEM
Benjamin Herrenschmidt (1):
of/base: Fix PowerPC address parsing hack
Bjorn Helgaas (1):
of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text
Borislav Petkov (1):
x86, microcode: Update BSPs microcode on resume
Charles Keepax (1):
ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use
Chris Mason (1):
Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup
Chris Moore (1):
IB/isert: Adjust CQ size to HW limits
Christoph Hellwig (1):
scsi: only re-lock door after EH on devices that were reset
Cristian Stoica (1):
crypto: caam - fix missing dma unmap on error path
Dan Carpenter (1):
[media] ttusb-dec: buffer overflow in ioctl
Daniel Borkmann (1):
net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet
Daniel Vetter (1):
drm/i915: drop WaSetupGtModeTdRowDispatch:snb
Dave Hansen (1):
x86: Require exact match for 'noxsave' command line option
David Henningsson (1):
ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart
David Jeffery (1):
nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
Denis Turischev (1):
xhci: Switch only Intel Lynx Point-LP ports to EHCI on shutdown.
Devin Ryles (1):
ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP
Dmitry Eremin-Solenikov (1):
spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM
Fabio Estevam (1):
ASoC: sgtl5000: Fix SMALL_POP bit definition
Grant Likely (1):
of: Fix overflow bug in string property parsing functions
Greg Kurz (1):
hwrng: pseries - port to new read API and fix stack corruption
Hans de Goede (4):
samsung-laptop: Add broken-acpi-video quirk for NC210/NC110
acer-wmi: Add Aspire 5741 to video_vendor_dmi_table
acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80
usb: Do not allow usb_alloc_streams on unconfigured devices
Heinz Mauelshagen (1):
dm raid: ensure superblock's size matches device's logical block size
Helge Deller (1):
parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls
Herbert Xu (2):
tun: Fix csum_start with VLAN acceleration
macvtap: Fix csum_start when VLAN tags are present
Ilya Dryomov (1):
libceph: do not crash on large auth tickets
Imre Deak (1):
tty/vt: don't set font mappings on vc not supporting this
James Ralston (2):
ahci: Add Device IDs for Intel Sunrise Point PCH
ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH
Jammy Zhou (1):
drm/radeon: set correct CE ram size for CIK
Jan Kara (2):
rbd: Fix error recovery in rbd_obj_read_sync()
nfs: Fix use of uninitialized variable in nfs_getattr()
Jani Nikula (1):
drm/i915: provide interface for audio driver to query cdclk
Jeff Layton (2):
nfsd: don't try to reuse an expired DRC entry off the list
nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry
Joe Thornber (2):
dm thin: grab a virtual cell before looking up the mapping
dm btree: fix a recursion depth bug in btree walking code
Johan Hovold (4):
USB: kobil_sct: fix non-atomic allocation in write path
USB: opticon: fix non-atomic allocation in write path
USB: cdc-acm: add device id for GW Instek AFG-2225
USB: cdc-acm: only raise DTR on transitions from B0
Johannes Berg (2):
mac80211: properly flush delayed scan work on interface removal
mac80211: fix use-after-free in defragmentation
Jurgen Kramer (1):
ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices
Kamal Mostafa (1):
Revert "ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controller"
Kees Cook (1):
x86, mm: Set NX across entire PMD at boot
Krzysztof Kozlowski (2):
regulator: max77693: Fix use of uninitialized regulator config
power: charger-manager: Fix accessing invalidated power supply after charger unbind
Kuninori Morimoto (2):
ASoC: fsi: remove unsupported PAUSE flag
ASoC: rsnd: remove unsupported PAUSE flag
Kyle McMartin (1):
arm64: __clear_user: handle exceptions on strb
Lars-Peter Clausen (3):
staging:iio:ade7758: Fix NULL pointer deref when enabling buffer
staging:iio:ade7758: Fix check if channels are enabled in prenable
staging:iio:ade7758: Remove "raw" from channel name
Luciano Coelho (2):
mac80211: use secondary channel offset IE also beacons during CSA
mac80211: schedule the actual switch of the station before CSA count 0
Max Filippov (1):
xtensa: re-wire umount syscall to sys_oldumount
Maxime COQUELIN (1):
bitops: Fix shift overflow in GENMASK macros
Maxime Ripard (1):
clockevent: sun4i: Fix race condition in the probe code
Mengdong Lin (1):
ALSA: hda - restore BCLK M/N value as per CDCLK for HSW/BDW display HDA controller
Miaoqing Pan (1):
ath9k: Fix RTC_DERIVED_CLK usage
Miklos Szeredi (1):
audit: keep inode pinned
Mikulas Patocka (1):
dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks
Nadav Amit (2):
KVM: x86: Don't report guest userspace emulation error to userspace
KVM: x86: Fix uninitialized op->type for some immediate values
Nathan Lynch (1):
ARM: 8198/1: make kuser helpers depend on MMU
NeilBrown (1):
md: Always set RECOVERY_NEEDED when clearing RECOVERY_FROZEN
Nicholas Bellinger (1):
vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT
Oliver Neukum (1):
xhci: no switching back on non-ULT Haswell
Or Gerlitz (1):
ib_isert: Add max_send_sge=2 minimum for control PDU responses
Pali Rohár (3):
Input: alps - ignore potential bare packets when device is out of sync
Input: alps - allow up to 2 invalid packets without resetting device
Input: alps - ignore bad data on Dell Latitudes E6440 and E7440
Paolo Bonzini (1):
x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only
Paul E. McKenney (1):
rcu: Make callers awaken grace-period kthread
Peng Tao (1):
nfs: fix pnfs direct write memory leak
Peter Hurley (3):
serial: Fix divide-by-zero fault in uart_get_divisor()
tty: Fix high cpu load if tty is unreleaseable
tty: Prevent "read/write wait queue active!" log flooding
Pranith Kumar (1):
rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads
Quentin Casasnovas (1):
[3.13-stable only] regmap: fix kernel hang on regmap_bulk_write with zero val_count.
Rafael J. Wysocki (1):
ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up
Robert Jarzmik (1):
ARM: pxa: fix hang on startup with DEBUG_LL
Roland Dreier (1):
target: Don't call TFO->write_pending if data_length == 0
Ronald Wahl (1):
mac80211: Fix regression that triggers a kernel BUG with CCMP
Sagi Grimberg (1):
iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly
Stanislaw Gruszka (1):
rt2x00: do not align payload on modern H/W
Stefan Richter (1):
firewire: cdev: prevent kernel stack leaking into ioctl arguments
Sujith Manoharan (1):
ath9k: Add version/revision macros for QCA9531
Takashi Iwai (4):
ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect
drm/i915, HD-audio: Don't continue probing when nomodeset is given
ALSA: usb-audio: Fix memory leak in FTU quirk
ASoC: dpcm: Fix race between FE/BE updates and trigger
Tejun Heo (1):
ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks
Thomas Körper (1):
can: dev: avoid calling kfree_skb() from interrupt context
Trond Myklebust (5):
NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired
NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE
NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return
NFSv4: Ensure that we call FREE_STATEID when NFSv4.x stateids are revoked
NFS: Don't try to reclaim delegation open state if recovery failed
Ulrich Eckhardt (1):
[media] ds3000: fix LNB supply voltage on Tevii S480 on initialization
Weijie Yang (1):
zram: avoid kunmap_atomic() of a NULL pointer
Will Deacon (1):
ARM: 8191/1: decompressor: ensure I-side picks up relocated code
Wolfram Sang (1):
i2c: at91: don't account as iowait
Yijing Wang (1):
sysfs: driver core: Fix glue dir race condition by gdp_mutex
^ permalink raw reply [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 001/121] ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 002/121] [3.13-stable only] regmap: fix kernel hang on regmap_bulk_write with zero val_count Kamal Mostafa
` (119 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 0725dda207e95ff25f1aa01432250323e0ec49d6 upstream.
Some USB-audio devices show weird sysfs warnings at disconnecting the
devices, e.g.
usb 1-3: USB disconnect, device number 3
------------[ cut here ]------------
WARNING: CPU: 0 PID: 973 at fs/sysfs/group.c:216 device_del+0x39/0x180()
sysfs group ffffffff8183df40 not found for kobject 'midiC1D0'
Call Trace:
[<ffffffff814a3e38>] ? dump_stack+0x49/0x71
[<ffffffff8103cb72>] ? warn_slowpath_common+0x82/0xb0
[<ffffffff8103cc55>] ? warn_slowpath_fmt+0x45/0x50
[<ffffffff813521e9>] ? device_del+0x39/0x180
[<ffffffff81352339>] ? device_unregister+0x9/0x20
[<ffffffff81352384>] ? device_destroy+0x34/0x40
[<ffffffffa00ba29f>] ? snd_unregister_device+0x7f/0xd0 [snd]
[<ffffffffa025124e>] ? snd_rawmidi_dev_disconnect+0xce/0x100 [snd_rawmidi]
[<ffffffffa00c0192>] ? snd_device_disconnect+0x62/0x90 [snd]
[<ffffffffa00c025c>] ? snd_device_disconnect_all+0x3c/0x60 [snd]
[<ffffffffa00bb574>] ? snd_card_disconnect+0x124/0x1a0 [snd]
[<ffffffffa02e54e8>] ? usb_audio_disconnect+0x88/0x1c0 [snd_usb_audio]
[<ffffffffa015260e>] ? usb_unbind_interface+0x5e/0x1b0 [usbcore]
[<ffffffff813553e9>] ? __device_release_driver+0x79/0xf0
[<ffffffff81355485>] ? device_release_driver+0x25/0x40
[<ffffffff81354e11>] ? bus_remove_device+0xf1/0x130
[<ffffffff813522b9>] ? device_del+0x109/0x180
[<ffffffffa01501d5>] ? usb_disable_device+0x95/0x1f0 [usbcore]
[<ffffffffa014634f>] ? usb_disconnect+0x8f/0x190 [usbcore]
[<ffffffffa0149179>] ? hub_thread+0x539/0x13a0 [usbcore]
[<ffffffff810669f5>] ? sched_clock_local+0x15/0x80
[<ffffffff81066c98>] ? sched_clock_cpu+0xb8/0xd0
[<ffffffff81070730>] ? bit_waitqueue+0xb0/0xb0
[<ffffffffa0148c40>] ? usb_port_resume+0x430/0x430 [usbcore]
[<ffffffffa0148c40>] ? usb_port_resume+0x430/0x430 [usbcore]
[<ffffffff8105973e>] ? kthread+0xce/0xf0
[<ffffffff81059670>] ? kthread_create_on_node+0x1c0/0x1c0
[<ffffffff814a8b7c>] ? ret_from_fork+0x7c/0xb0
[<ffffffff81059670>] ? kthread_create_on_node+0x1c0/0x1c0
---[ end trace 40b1928d1136b91e ]---
This comes from the fact that usb-audio driver may receive the
disconnect callback multiple times, per each usb interface. When a
device has both audio and midi interfaces, it gets called twice, and
currently the driver tries to release resources at the last call.
At this point, the first parent interface has been already deleted,
thus deleting a child of the first parent hits such a warning.
For fixing this problem, we need to call snd_card_disconnect() and
cancel pending operations at the very first disconnect while the
release of the whole objects waits until the last disconnect call.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80931
Reported-and-tested-by: Tomas Gayoso <tgayoso@gmail.com>
Reported-and-tested-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/usb/card.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/usb/card.c b/sound/usb/card.c
index af19560..ab433a0 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -586,18 +586,19 @@ static void snd_usb_audio_disconnect(struct usb_device *dev,
{
struct snd_card *card;
struct list_head *p;
+ bool was_shutdown;
if (chip == (void *)-1L)
return;
card = chip->card;
down_write(&chip->shutdown_rwsem);
+ was_shutdown = chip->shutdown;
chip->shutdown = 1;
up_write(&chip->shutdown_rwsem);
mutex_lock(®ister_mutex);
- chip->num_interfaces--;
- if (chip->num_interfaces <= 0) {
+ if (!was_shutdown) {
struct snd_usb_endpoint *ep;
snd_card_disconnect(card);
@@ -617,6 +618,10 @@ static void snd_usb_audio_disconnect(struct usb_device *dev,
list_for_each(p, &chip->mixer_list) {
snd_usb_mixer_disconnect(p);
}
+ }
+
+ chip->num_interfaces--;
+ if (chip->num_interfaces <= 0) {
usb_chip[chip->index] = NULL;
mutex_unlock(®ister_mutex);
snd_card_free_when_closed(card);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 002/121] [3.13-stable only] regmap: fix kernel hang on regmap_bulk_write with zero val_count.
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 001/121] ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 003/121] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart Kamal Mostafa
` (118 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Quentin Casasnovas, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
If val_count is zero we return -EINVAL with map->lock_arg locked, which
will deadlock the kernel next time we try to acquire this lock.
This was introduced by 6ae8fcd ("regmap: fix possible ZERO_SIZE_PTR pointer
dereferencing error.") which improperly back-ported d6b41cb0.
This issue was found during review of Ubuntu Trusty 3.13.0-40.68 kernel to
prepare Ksplice rebootless updates.
Fixes: [3.13-stable] 6ae8fcd ("regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error.")
Fixes: [Ubuntu Trusty] f5942dd ("regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error.")
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/base/regmap/regmap.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index ebe332c..9e885cf 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1529,8 +1529,10 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
if (val_bytes == 1) {
wval = (void *)val;
} else {
- if (!val_count)
- return -EINVAL;
+ if (!val_count) {
+ ret = -EINVAL;
+ goto out;
+ }
wval = kmemdup(val, val_count * val_bytes, GFP_KERNEL);
if (!wval) {
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 003/121] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 001/121] ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 002/121] [3.13-stable only] regmap: fix kernel hang on regmap_bulk_write with zero val_count Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 004/121] Revert "ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controller" Kamal Mostafa
` (117 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: David Henningsson, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Henningsson <david.henningsson@canonical.com>
commit 423044744aa4c250058e976474856a7a41972182 upstream.
This makes the mute LED work on a HP 15 touchsmart machine (and
a HP 14 touchsmart machine).
BugLink: https://bugs.launchpad.net/bugs/1334950
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 1a24b2c..29e378c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4447,6 +4447,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
/* ALC282 */
+ SND_PCI_QUIRK(0x103c, 0x2191, "HP Touchsmart 14", ALC269_FIXUP_HP_MUTE_LED_MIC1),
+ SND_PCI_QUIRK(0x103c, 0x2192, "HP Touchsmart 15", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x220d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x220e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x220f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 004/121] Revert "ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controller"
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (2 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 003/121] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 005/121] drm/i915, HD-audio: Don't continue probing when nomodeset is given Kamal Mostafa
` (116 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamal Mostafa <kamal@canonical.com>
This reverts commit 72f0c0f47341ac4c86132fe7f7338a3122ac1418.
[ kamal: 3.13-stable: to be replaced by Takashi backport ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/hda_intel.c | 63 ++++++-----------------------------------------
1 file changed, 7 insertions(+), 56 deletions(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e8de8a3..f319b8c 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -663,22 +663,6 @@ static char *driver_short_names[] = {
[AZX_DRIVER_GENERIC] = "HD-Audio Generic",
};
-/* Intel HSW/BDW display HDA controller Extended Mode registers.
- * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display
- * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N
- * The values will be lost when the display power well is disabled.
- */
-#define ICH6_REG_EM4 0x100c
-#define ICH6_REG_EM5 0x1010
-
-struct hda_intel {
- struct azx chip;
-
- /* HSW/BDW display HDA controller to restore BCLK from CDCLK */
- unsigned int bclk_m;
- unsigned int bclk_n;
-};
-
/*
* macros for easy use
*/
@@ -2922,22 +2906,6 @@ static int param_set_xint(const char *val, const struct kernel_param *kp)
#define azx_del_card_list(chip) /* NOP */
#endif /* CONFIG_PM */
-static void haswell_save_bclk(struct azx *chip)
-{
- struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
-
- hda->bclk_m = azx_readw(chip, EM4);
- hda->bclk_n = azx_readw(chip, EM5);
-}
-
-static void haswell_restore_bclk(struct azx *chip)
-{
- struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
-
- azx_writew(chip, EM4, hda->bclk_m);
- azx_writew(chip, EM5, hda->bclk_n);
-}
-
#if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO)
/*
* power management
@@ -2964,13 +2932,6 @@ static int azx_suspend(struct device *dev)
free_irq(chip->irq, chip);
chip->irq = -1;
}
-
- /* Save BCLK M/N values before they become invalid in D3.
- * Will test if display power well can be released now.
- */
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
- haswell_save_bclk(chip);
-
if (chip->msi)
pci_disable_msi(chip->pci);
pci_disable_device(pci);
@@ -2990,10 +2951,8 @@ static int azx_resume(struct device *dev)
if (chip->disabled || chip->init_failed)
return 0;
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
+ if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
hda_display_power(true);
- haswell_restore_bclk(chip);
- }
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
@@ -3037,10 +2996,8 @@ static int azx_runtime_suspend(struct device *dev)
azx_stop_chip(chip);
azx_enter_link_reset(chip);
azx_clear_irq_pending(chip);
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
- haswell_save_bclk(chip);
+ if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
hda_display_power(false);
- }
return 0;
}
@@ -3058,10 +3015,8 @@ static int azx_runtime_resume(struct device *dev)
if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
return 0;
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
+ if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
hda_display_power(true);
- haswell_restore_bclk(chip);
- }
/* Read STATESTS before controller reset */
status = azx_readw(chip, STATESTS);
@@ -3258,8 +3213,6 @@ static int register_vga_switcheroo(struct azx *chip)
static int azx_free(struct azx *chip)
{
struct pci_dev *pci = chip->pci;
- struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
-
int i;
if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME)
@@ -3321,7 +3274,7 @@ static int azx_free(struct azx *chip)
hda_display_power(false);
hda_i915_exit();
}
- kfree(hda);
+ kfree(chip);
return 0;
}
@@ -3568,7 +3521,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
static struct snd_device_ops ops = {
.dev_free = azx_dev_free,
};
- struct hda_intel *hda;
struct azx *chip;
int err;
@@ -3578,14 +3530,13 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
if (err < 0)
return err;
- hda = kzalloc(sizeof(*hda), GFP_KERNEL);
- if (!hda) {
- snd_printk(KERN_ERR SFX "%s: Cannot allocate hda\n", pci_name(pci));
+ chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+ if (!chip) {
+ snd_printk(KERN_ERR SFX "%s: Cannot allocate chip\n", pci_name(pci));
pci_disable_device(pci);
return -ENOMEM;
}
- chip = &hda->chip;
spin_lock_init(&chip->reg_lock);
mutex_init(&chip->open_mutex);
chip->card = card;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 005/121] drm/i915, HD-audio: Don't continue probing when nomodeset is given
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (3 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 004/121] Revert "ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controller" Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 006/121] drm/i915: provide interface for audio driver to query cdclk Kamal Mostafa
` (115 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 74b0c2d75fb4cc89173944e6d8f9eb47aca0c343 upstream.
When a machine is booted with nomodeset option, i915 driver skips the
whole initialization. Meanwhile, HD-audio tries to bind wth i915 just
by request_symbol() without knowing that the initialization was
skipped, and eventually it hits WARN_ON() in i915_request_power_well()
and i915_release_power_well() wrongly but still continues probing,
even though it doesn't work at all.
In this patch, both functions are changed to return an error in case
of uninitialized state instead of WARN_ON(), so that HD-audio driver
can give up HDMI controller initialization at the right time.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_pm.c | 14 ++++++++------
include/drm/i915_powerwell.h | 4 ++--
sound/pci/hda/hda_i915.c | 12 ++++++------
sound/pci/hda/hda_i915.h | 4 ++--
sound/pci/hda/hda_intel.c | 7 ++++++-
5 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 1218c44..839e581 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5849,12 +5849,12 @@ void intel_display_power_put(struct drm_device *dev,
static struct i915_power_domains *hsw_pwr;
/* Display audio driver power well request */
-void i915_request_power_well(void)
+int i915_request_power_well(void)
{
struct drm_i915_private *dev_priv;
- if (WARN_ON(!hsw_pwr))
- return;
+ if (!hsw_pwr)
+ return -ENODEV;
dev_priv = container_of(hsw_pwr, struct drm_i915_private,
power_domains);
@@ -5862,16 +5862,17 @@ void i915_request_power_well(void)
mutex_lock(&hsw_pwr->lock);
__intel_power_well_get(dev_priv->dev, &hsw_pwr->power_wells[0]);
mutex_unlock(&hsw_pwr->lock);
+ return 0;
}
EXPORT_SYMBOL_GPL(i915_request_power_well);
/* Display audio driver power well release */
-void i915_release_power_well(void)
+int i915_release_power_well(void)
{
struct drm_i915_private *dev_priv;
- if (WARN_ON(!hsw_pwr))
- return;
+ if (!hsw_pwr)
+ return -ENODEV;
dev_priv = container_of(hsw_pwr, struct drm_i915_private,
power_domains);
@@ -5879,6 +5880,7 @@ void i915_release_power_well(void)
mutex_lock(&hsw_pwr->lock);
__intel_power_well_put(dev_priv->dev, &hsw_pwr->power_wells[0]);
mutex_unlock(&hsw_pwr->lock);
+ return 0;
}
EXPORT_SYMBOL_GPL(i915_release_power_well);
diff --git a/include/drm/i915_powerwell.h b/include/drm/i915_powerwell.h
index cfdc884..2baba99 100644
--- a/include/drm/i915_powerwell.h
+++ b/include/drm/i915_powerwell.h
@@ -30,7 +30,7 @@
#define _I915_POWERWELL_H_
/* For use by hda_i915 driver */
-extern void i915_request_power_well(void);
-extern void i915_release_power_well(void);
+extern int i915_request_power_well(void);
+extern int i915_release_power_well(void);
#endif /* _I915_POWERWELL_H_ */
diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
index 76c13d5..3ea8b98 100644
--- a/sound/pci/hda/hda_i915.c
+++ b/sound/pci/hda/hda_i915.c
@@ -22,20 +22,20 @@
#include <drm/i915_powerwell.h>
#include "hda_i915.h"
-static void (*get_power)(void);
-static void (*put_power)(void);
+static int (*get_power)(void);
+static int (*put_power)(void);
-void hda_display_power(bool enable)
+int hda_display_power(bool enable)
{
if (!get_power || !put_power)
- return;
+ return -ENODEV;
snd_printdd("HDA display power %s \n",
enable ? "Enable" : "Disable");
if (enable)
- get_power();
+ return get_power();
else
- put_power();
+ return put_power();
}
int hda_i915_init(void)
diff --git a/sound/pci/hda/hda_i915.h b/sound/pci/hda/hda_i915.h
index 5a63da2..bfd835f 100644
--- a/sound/pci/hda/hda_i915.h
+++ b/sound/pci/hda/hda_i915.h
@@ -17,11 +17,11 @@
#define __SOUND_HDA_I915_H
#ifdef CONFIG_SND_HDA_I915
-void hda_display_power(bool enable);
+int hda_display_power(bool enable);
int hda_i915_init(void);
int hda_i915_exit(void);
#else
-static inline void hda_display_power(bool enable) {}
+static inline int hda_display_power(bool enable) { return 0; }
static inline int hda_i915_init(void)
{
return -ENODEV;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index f319b8c..3066ba0 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -3903,8 +3903,13 @@ static int azx_probe_continue(struct azx *chip)
snd_printk(KERN_ERR SFX "Error request power-well from i915\n");
goto out_free;
}
+ err = hda_display_power(true);
+ if (err < 0) {
+ dev_err(chip->card->dev,
+ "Cannot turn on display power on i915\n");
+ goto out_free;
+ }
#endif
- hda_display_power(true);
}
err = azx_first_init(chip);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 006/121] drm/i915: provide interface for audio driver to query cdclk
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (4 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 005/121] drm/i915, HD-audio: Don't continue probing when nomodeset is given Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 007/121] ALSA: hda - restore BCLK M/N value as per CDCLK for HSW/BDW display HDA controller Kamal Mostafa
` (114 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jani Nikula, Mengdong Lin, Takashi Iwai, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <jani.nikula@intel.com>
commit c149dcb5c60bfea8871f16dfcc0690255eeb825f upstream.
For Haswell and Broadwell, if the display power well has been disabled,
the display audio controller divider values EM4 M VALUE and EM5 N VALUE
will have been lost. The CDCLK frequency is required for reprogramming them
to generate 24MHz HD-A link BCLK. So provide a private interface for the
audio driver to query CDCLK.
This is a stopgap solution until a more generic interface between audio
and display drivers has been implemented.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_pm.c | 20 ++++++++++++++++++++
include/drm/i915_powerwell.h | 1 +
2 files changed, 21 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 839e581..ba51112 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5884,6 +5884,26 @@ int i915_release_power_well(void)
}
EXPORT_SYMBOL_GPL(i915_release_power_well);
+/*
+ * Private interface for the audio driver to get CDCLK in kHz.
+ *
+ * Caller must request power well using i915_request_power_well() prior to
+ * making the call.
+ */
+int i915_get_cdclk_freq(void)
+{
+ struct drm_i915_private *dev_priv;
+
+ if (!hsw_pwr)
+ return -ENODEV;
+
+ dev_priv = container_of(hsw_pwr, struct drm_i915_private,
+ power_domains);
+
+ return intel_ddi_get_cdclk_freq(dev_priv);
+}
+EXPORT_SYMBOL_GPL(i915_get_cdclk_freq);
+
int intel_power_domains_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
diff --git a/include/drm/i915_powerwell.h b/include/drm/i915_powerwell.h
index 2baba99..baa6f11 100644
--- a/include/drm/i915_powerwell.h
+++ b/include/drm/i915_powerwell.h
@@ -32,5 +32,6 @@
/* For use by hda_i915 driver */
extern int i915_request_power_well(void);
extern int i915_release_power_well(void);
+extern int i915_get_cdclk_freq(void);
#endif /* _I915_POWERWELL_H_ */
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 007/121] ALSA: hda - restore BCLK M/N value as per CDCLK for HSW/BDW display HDA controller
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (5 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 006/121] drm/i915: provide interface for audio driver to query cdclk Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 008/121] rcu: Make callers awaken grace-period kthread Kamal Mostafa
` (113 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mengdong Lin, Takashi Iwai, Jiri Slaby, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mengdong Lin <mengdong.lin@intel.com>
commit e4d9e513dedb5ac4e166c1053314fa935ddecc8c upstream.
For HSW/BDW display HD-A controller, hda_set_bclk() is defined to set BCLK
by programming the M/N values as per the core display clock (CDCLK) queried from
i915 display driver.
And the audio driver will also set BCLK in azx_first_init() since the display
driver can turn off the shared power in boot phase if only eDP is connected
and M/N values will be lost and must be reprogrammed.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
[ 3.13-stable: takashi's backport for 3.{12,13} ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/hda_i915.c | 16 +++++++++++++
sound/pci/hda/hda_i915.h | 2 ++
sound/pci/hda/hda_intel.c | 60 +++++++++++++++++++++++++++++++++++++++++++++--
3 files changed, 76 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
index 3ea8b98..9e136be 100644
--- a/sound/pci/hda/hda_i915.c
+++ b/sound/pci/hda/hda_i915.c
@@ -24,6 +24,7 @@
static int (*get_power)(void);
static int (*put_power)(void);
+static int (*get_cdclk)(void);
int hda_display_power(bool enable)
{
@@ -38,6 +39,13 @@ int hda_display_power(bool enable)
return put_power();
}
+int haswell_get_cdclk(void)
+{
+ if (!get_cdclk)
+ return -EINVAL;
+ return get_cdclk();
+}
+
int hda_i915_init(void)
{
int err = 0;
@@ -55,6 +63,10 @@ int hda_i915_init(void)
return -ENODEV;
}
+ get_cdclk = symbol_request(i915_get_cdclk_freq);
+ if (!get_cdclk) /* may have abnormal BCLK and audio playback rate */
+ snd_printd("hda-i915: get_cdclk symbol get fail\n");
+
snd_printd("HDA driver get symbol successfully from i915 module\n");
return err;
@@ -70,6 +82,10 @@ int hda_i915_exit(void)
symbol_put(i915_release_power_well);
put_power = NULL;
}
+ if (get_cdclk) {
+ symbol_put(i915_get_cdclk_freq);
+ get_cdclk = NULL;
+ }
return 0;
}
diff --git a/sound/pci/hda/hda_i915.h b/sound/pci/hda/hda_i915.h
index bfd835f..26869fa 100644
--- a/sound/pci/hda/hda_i915.h
+++ b/sound/pci/hda/hda_i915.h
@@ -18,10 +18,12 @@
#ifdef CONFIG_SND_HDA_I915
int hda_display_power(bool enable);
+int haswell_get_cdclk(void);
int hda_i915_init(void);
int hda_i915_exit(void);
#else
static inline int hda_display_power(bool enable) { return 0; }
+static inline int haswell_get_cdclk(void) { return -EINVAL; }
static inline int hda_i915_init(void)
{
return -ENODEV;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 3066ba0..a7431d6 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -748,6 +748,54 @@ static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev,
}
#endif
+#ifdef CONFIG_SND_HDA_I915
+/* Intel HSW/BDW display HDA controller Extended Mode registers.
+ * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display
+ * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N
+ * The values will be lost when the display power well is disabled.
+ */
+#define ICH6_REG_EM4 0x100c
+#define ICH6_REG_EM5 0x1010
+
+static void haswell_set_bclk(struct azx *chip)
+{
+ int cdclk_freq;
+ unsigned int bclk_m, bclk_n;
+
+ cdclk_freq = haswell_get_cdclk();
+ if (cdclk_freq < 0)
+ return;
+
+ switch (cdclk_freq) {
+ case 337500:
+ bclk_m = 16;
+ bclk_n = 225;
+ break;
+
+ case 450000:
+ default: /* default CDCLK 450MHz */
+ bclk_m = 4;
+ bclk_n = 75;
+ break;
+
+ case 540000:
+ bclk_m = 4;
+ bclk_n = 90;
+ break;
+
+ case 675000:
+ bclk_m = 8;
+ bclk_n = 225;
+ break;
+ }
+
+ azx_writew(chip, EM4, bclk_m);
+ azx_writew(chip, EM5, bclk_n);
+}
+#else
+static inline void haswell_set_bclk(struct azx *chip) {}
+#endif
+
static int azx_acquire_irq(struct azx *chip, int do_disconnect);
static int azx_send_cmd(struct hda_bus *bus, unsigned int val);
/*
@@ -2951,8 +2999,10 @@ static int azx_resume(struct device *dev)
if (chip->disabled || chip->init_failed)
return 0;
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
+ if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
hda_display_power(true);
+ haswell_set_bclk(chip);
+ }
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
@@ -3015,8 +3065,10 @@ static int azx_runtime_resume(struct device *dev)
if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
return 0;
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
+ if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
hda_display_power(true);
+ haswell_set_bclk(chip);
+ }
/* Read STATESTS before controller reset */
status = azx_readw(chip, STATESTS);
@@ -3744,6 +3796,10 @@ static int azx_first_init(struct azx *chip)
/* initialize chip */
azx_init_pci(chip);
+
+ if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
+ haswell_set_bclk(chip);
+
azx_init_chip(chip, (probe_only[dev] & 2) == 0);
/* codec detection */
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 008/121] rcu: Make callers awaken grace-period kthread
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (6 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 007/121] ALSA: hda - restore BCLK M/N value as per CDCLK for HSW/BDW display HDA controller Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 009/121] rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads Kamal Mostafa
` (112 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Paul E. McKenney, Peter Zijlstra, Steven Rostedt,
Frederic Weisbecker, Pranith Kumar, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
commit 48a7639ce80cf279834d0d44865e49ecd714f37d upstream.
The rcu_start_gp_advanced() function currently uses irq_work_queue()
to defer wakeups of the RCU grace-period kthread. This deferring
is necessary to avoid RCU-scheduler deadlocks involving the rcu_node
structure's lock, meaning that RCU cannot call any of the scheduler's
wake-up functions while holding one of these locks.
Unfortunately, the second and subsequent calls to irq_work_queue() are
ignored, and the first call will be ignored (aside from queuing the work
item) if the scheduler-clock tick is turned off. This is OK for many
uses, especially those where irq_work_queue() is called from an interrupt
or softirq handler, because in those cases the scheduler-clock-tick state
will be re-evaluated, which will turn the scheduler-clock tick back on.
On the next tick, any deferred work will then be processed.
However, this strategy does not always work for RCU, which can be invoked
at process level from idle CPUs. In this case, the tick might never
be turned back on, indefinitely defering a grace-period start request.
Note that the RCU CPU stall detector cannot see this condition, because
there is no RCU grace period in progress. Therefore, we can (and do!)
see long tens-of-seconds stalls in grace-period handling. In theory,
we could see a full grace-period hang, but rcutorture testing to date
has seen only the tens-of-seconds stalls. Event tracing demonstrates
that irq_work_queue() is being called repeatedly to no effect during
these stalls: The "newreq" event appears repeatedly from a task that is
not one of the grace-period kthreads.
In theory, irq_work_queue() might be fixed to avoid this sort of issue,
but RCU's requirements are unusual and it is quite straightforward to pass
wake-up responsibility up through RCU's call chain, so that the wakeup
happens when the offending locks are released.
This commit therefore makes this change. The rcu_start_gp_advanced(),
rcu_start_future_gp(), rcu_accelerate_cbs(), rcu_advance_cbs(),
__note_gp_changes(), and rcu_start_gp() functions now return a boolean
which indicates when a wake-up is needed. A new rcu_gp_kthread_wake()
does the wakeup when it is necessary and safe to do so: No self-wakes,
no wake-ups if the ->gp_flags field indicates there is no need (as in
someone else did the wake-up before we got around to it), and no wake-ups
before the grace-period kthread has been created.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
[ Pranith: backport to 3.13-stable: just rcu_gp_kthread_wake(),
prereq for 2aa792e "rcu: Use rcu_gp_kthread_wake() to wake up grace
period kthreads" ]
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/rcu/tree.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index dd08198..e559421 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1193,6 +1193,22 @@ static int rcu_future_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
}
/*
+ * Awaken the grace-period kthread for the specified flavor of RCU.
+ * Don't do a self-awaken, and don't bother awakening when there is
+ * nothing for the grace-period kthread to do (as in several CPUs
+ * raced to awaken, and we lost), and finally don't try to awaken
+ * a kthread that has not yet been created.
+ */
+static void rcu_gp_kthread_wake(struct rcu_state *rsp)
+{
+ if (current == rsp->gp_kthread ||
+ !ACCESS_ONCE(rsp->gp_flags) ||
+ !rsp->gp_kthread)
+ return;
+ wake_up(&rsp->gp_wq);
+}
+
+/*
* If there is room, assign a ->completed number to any callbacks on
* this CPU that have not already been assigned. Also accelerate any
* callbacks that were previously assigned a ->completed number that has
@@ -1625,7 +1641,7 @@ static void rsp_wakeup(struct irq_work *work)
struct rcu_state *rsp = container_of(work, struct rcu_state, wakeup_work);
/* Wake up rcu_gp_kthread() to start the grace period. */
- wake_up(&rsp->gp_wq);
+ rcu_gp_kthread_wake(rsp);
}
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 009/121] rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (7 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 008/121] rcu: Make callers awaken grace-period kthread Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 010/121] net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet Kamal Mostafa
` (111 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Pranith Kumar, Mathieu Desnoyers, Paul E. McKenney, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Pranith Kumar <bobby.prani@gmail.com>
commit 2aa792e6faf1a00f5accf1f69e87e11a390ba2cd upstream.
The rcu_gp_kthread_wake() function checks for three conditions before
waking up grace period kthreads:
* Is the thread we are trying to wake up the current thread?
* Are the gp_flags zero? (all threads wait on non-zero gp_flags condition)
* Is there no thread created for this flavour, hence nothing to wake up?
If any one of these condition is true, we do not call wake_up().
It was found that there are quite a few avoidable wake ups both during
idle time and under stress induced by rcutorture.
Idle:
Total:66000, unnecessary:66000, case1:61827, case2:66000, case3:0
Total:68000, unnecessary:68000, case1:63696, case2:68000, case3:0
rcutorture:
Total:254000, unnecessary:254000, case1:199913, case2:254000, case3:0
Total:256000, unnecessary:256000, case1:201784, case2:256000, case3:0
Here case{1-3} are the cases listed above. We can avoid these wake
ups by using rcu_gp_kthread_wake() to conditionally wake up the grace
period kthreads.
There is a comment about an implied barrier supplied by the wake_up()
logic. This barrier is necessary for the awakened thread to see the
updated ->gp_flags. This flag is always being updated with the root node
lock held. Also, the awakened thread tries to acquire the root node lock
before reading ->gp_flags because of which there is proper ordering.
Hence this commit tries to avoid calling wake_up() whenever we can by
using rcu_gp_kthread_wake() function.
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
CC: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/rcu/tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index e559421..9b3beea 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1717,7 +1717,7 @@ static void rcu_report_qs_rsp(struct rcu_state *rsp, unsigned long flags)
{
WARN_ON_ONCE(!rcu_gp_in_progress(rsp));
raw_spin_unlock_irqrestore(&rcu_get_root(rsp)->lock, flags);
- wake_up(&rsp->gp_wq); /* Memory barrier implied by wake_up() path. */
+ rcu_gp_kthread_wake(rsp);
}
/*
@@ -2287,7 +2287,7 @@ static void force_quiescent_state(struct rcu_state *rsp)
}
rsp->gp_flags |= RCU_GP_FLAG_FQS;
raw_spin_unlock_irqrestore(&rnp_old->lock, flags);
- wake_up(&rsp->gp_wq); /* Memory barrier implied by wake_up() path. */
+ rcu_gp_kthread_wake(rsp);
}
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 010/121] net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (8 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 009/121] rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 011/121] KVM: x86: Don't report guest userspace emulation error to userspace Kamal Mostafa
` (110 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Borkmann, Vlad Yasevich, David S. Miller, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <dborkman@redhat.com>
commit e40607cbe270a9e8360907cb1e62ddf0736e4864 upstream.
An SCTP server doing ASCONF will panic on malformed INIT ping-of-death
in the form of:
------------ INIT[PARAM: SET_PRIMARY_IP] ------------>
While the INIT chunk parameter verification dissects through many things
in order to detect malformed input, it misses to actually check parameters
inside of parameters. E.g. RFC5061, section 4.2.4 proposes a 'set primary
IP address' parameter in ASCONF, which has as a subparameter an address
parameter.
So an attacker may send a parameter type other than SCTP_PARAM_IPV4_ADDRESS
or SCTP_PARAM_IPV6_ADDRESS, param_type2af() will subsequently return 0
and thus sctp_get_af_specific() returns NULL, too, which we then happily
dereference unconditionally through af->from_addr_param().
The trace for the log:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000078
IP: [<ffffffffa01e9c62>] sctp_process_init+0x492/0x990 [sctp]
PGD 0
Oops: 0000 [#1] SMP
[...]
Pid: 0, comm: swapper Not tainted 2.6.32-504.el6.x86_64 #1 Bochs Bochs
RIP: 0010:[<ffffffffa01e9c62>] [<ffffffffa01e9c62>] sctp_process_init+0x492/0x990 [sctp]
[...]
Call Trace:
<IRQ>
[<ffffffffa01f2add>] ? sctp_bind_addr_copy+0x5d/0xe0 [sctp]
[<ffffffffa01e1fcb>] sctp_sf_do_5_1B_init+0x21b/0x340 [sctp]
[<ffffffffa01e3751>] sctp_do_sm+0x71/0x1210 [sctp]
[<ffffffffa01e5c09>] ? sctp_endpoint_lookup_assoc+0xc9/0xf0 [sctp]
[<ffffffffa01e61f6>] sctp_endpoint_bh_rcv+0x116/0x230 [sctp]
[<ffffffffa01ee986>] sctp_inq_push+0x56/0x80 [sctp]
[<ffffffffa01fcc42>] sctp_rcv+0x982/0xa10 [sctp]
[<ffffffffa01d5123>] ? ipt_local_in_hook+0x23/0x28 [iptable_filter]
[<ffffffff8148bdc9>] ? nf_iterate+0x69/0xb0
[<ffffffff81496d10>] ? ip_local_deliver_finish+0x0/0x2d0
[<ffffffff8148bf86>] ? nf_hook_slow+0x76/0x120
[<ffffffff81496d10>] ? ip_local_deliver_finish+0x0/0x2d0
[...]
A minimal way to address this is to check for NULL as we do on all
other such occasions where we know sctp_get_af_specific() could
possibly return with NULL.
Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Reference: CVE-2014-7841
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/sctp/sm_make_chunk.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index e45212e..ca22389 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2609,6 +2609,9 @@ do_addr_param:
addr_param = param.v + sizeof(sctp_addip_param_t);
af = sctp_get_af_specific(param_type2af(param.p->type));
+ if (af == NULL)
+ break;
+
af->from_addr_param(&addr, addr_param,
htons(asoc->peer.port), 0);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 011/121] KVM: x86: Don't report guest userspace emulation error to userspace
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (9 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 010/121] net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 012/121] [media] ttusb-dec: buffer overflow in ioctl Kamal Mostafa
` (109 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nadav Amit, Paolo Bonzini, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nadav Amit <namit@cs.technion.ac.il>
commit a2b9e6c1a35afcc0973acb72e591c714e78885ff upstream.
Commit fc3a9157d314 ("KVM: X86: Don't report L2 emulation failures to
user-space") disabled the reporting of L2 (nested guest) emulation failures to
userspace due to race-condition between a vmexit and the instruction emulator.
The same rational applies also to userspace applications that are permitted by
the guest OS to access MMIO area or perform PIO.
This patch extends the current behavior - of injecting a #UD instead of
reporting it to userspace - also for guest userspace code.
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reference: CVE-2014-7842
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kvm/x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 450c5c5..1d6e92c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4894,7 +4894,7 @@ static int handle_emulation_failure(struct kvm_vcpu *vcpu)
++vcpu->stat.insn_emulation_fail;
trace_kvm_emulate_insn_failed(vcpu);
- if (!is_guest_mode(vcpu)) {
+ if (!is_guest_mode(vcpu) && kvm_x86_ops->get_cpl(vcpu) == 0) {
vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
vcpu->run->internal.ndata = 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 012/121] [media] ttusb-dec: buffer overflow in ioctl
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (10 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 011/121] KVM: x86: Don't report guest userspace emulation error to userspace Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 013/121] arm64: __clear_user: handle exceptions on strb Kamal Mostafa
` (108 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, Mauro Carvalho Chehab, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit f2e323ec96077642d397bb1c355def536d489d16 upstream.
We need to add a limit check here so we don't overflow the buffer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Reference: CVE-2014-8884
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/usb/ttusb-dec/ttusbdecfe.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index 5c45c9d..9c29552 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -156,6 +156,9 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc
0x00, 0x00, 0x00, 0x00,
0x00, 0x00 };
+ if (cmd->msg_len > sizeof(b) - 4)
+ return -EINVAL;
+
memcpy(&b[4], cmd->msg, cmd->msg_len);
state->config->send_command(fe, 0x72,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 013/121] arm64: __clear_user: handle exceptions on strb
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (11 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 012/121] [media] ttusb-dec: buffer overflow in ioctl Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 014/121] ARM: pxa: fix hang on startup with DEBUG_LL Kamal Mostafa
` (107 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kyle McMartin, Catalin Marinas, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle McMartin <kyle@redhat.com>
commit 97fc15436b36ee3956efad83e22a557991f7d19d upstream.
ARM64 currently doesn't fix up faults on the single-byte (strb) case of
__clear_user... which means that we can cause a nasty kernel panic as an
ordinary user with any multiple PAGE_SIZE+1 read from /dev/zero.
i.e.: dd if=/dev/zero of=foo ibs=1 count=1 (or ibs=65537, etc.)
This is a pretty obscure bug in the general case since we'll only
__do_kernel_fault (since there's no extable entry for pc) if the
mmap_sem is contended. However, with CONFIG_DEBUG_VM enabled, we'll
always fault.
if (!down_read_trylock(&mm->mmap_sem)) {
if (!user_mode(regs) && !search_exception_tables(regs->pc))
goto no_context;
retry:
down_read(&mm->mmap_sem);
} else {
/*
* The above down_read_trylock() might have succeeded in
* which
* case, we'll have missed the might_sleep() from
* down_read().
*/
might_sleep();
if (!user_mode(regs) && !search_exception_tables(regs->pc))
goto no_context;
}
Fix that by adding an extable entry for the strb instruction, since it
touches user memory, similar to the other stores in __clear_user.
Signed-off-by: Kyle McMartin <kyle@redhat.com>
Reported-by: Miloš Prchlík <mprchlik@redhat.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reference: CVE-2014-7843
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/lib/clear_user.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/lib/clear_user.S b/arch/arm64/lib/clear_user.S
index 6e0ed93..c17967f 100644
--- a/arch/arm64/lib/clear_user.S
+++ b/arch/arm64/lib/clear_user.S
@@ -46,7 +46,7 @@ USER(9f, strh wzr, [x0], #2 )
sub x1, x1, #2
4: adds x1, x1, #1
b.mi 5f
- strb wzr, [x0]
+USER(9f, strb wzr, [x0] )
5: mov x0, #0
ret
ENDPROC(__clear_user)
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 014/121] ARM: pxa: fix hang on startup with DEBUG_LL
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (12 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 013/121] arm64: __clear_user: handle exceptions on strb Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 015/121] samsung-laptop: Add broken-acpi-video quirk for NC210/NC110 Kamal Mostafa
` (106 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Robert Jarzmik, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Jarzmik <robert.jarzmik@free.fr>
commit cde7fc879969f933614b1256df2625d6ff637bab upstream.
The commit 2111667b4677 ("ARM: pxa: call debug_ll_io_init for
earlyprintk") triggers in the current kernel the attached backtrace on
PXA/tosa early in the boot time when DEBUG_LL is enabled.
It is due to overlap between uart virtual memory defined in
DEBUG_UART_VIRT and mapped by debug_ll_io_init() and peripheral bus
mapped by pxa_map_io at the same address, 0xf2100000.
As hinted by Arnd, map early virtual memory for low level debug on
address 0xf6200000, even if that means 2 virtual mappings will give
access to the pxa internal UARTs (FFUART, BTUART, STUART, ...).
------------[ cut here ]------------
kernel BUG at /home/lumag/linux/mm/vmalloc.c:1143!
Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-00032-g8e0d202-dirty #23
task: c062a5a8 ti: c0620000 task.ti: c0620000
PC is at vm_area_add_early+0x54/0x84
LR is at add_static_vm_early+0xc/0x60
pc : [<c03e1100>] lr : [<c03d9ef4>] psr: 800001d3
sp : c0621f04 ip : c03efa74 fp : c03edf84
r10: c0637e98 r9 : 40000001 r8 : c03da57c
r7 : c3ffcfb0 r6 : 00000000 r5 : c3ffcfb0 r4 : 02000000
r3 : c3ffcfd8 r2 : f2100000 r1 : f4000000 r0 : c3ffcfb0
Flags: Nzcv IRQs off FIQs off Mode SVC_32 ISA ARM Segment kernel
Control: 00007977 Table: a0004000 DAC: 00000017
Process swapper (pid: 0, stack limit = 0xc06201c8)
Stack: (0xc0621f04 to 0xc0622000)
1f00: c3ffcfd8 40000001 c3ffcfd8 c03ee08c c03da570 c03db90c c0637d24
1f20: 00000000 c03ec7cc c066e654 a0700000 000a0700 c03db914 c03db90c c03daf84
1f40: 00000000 000a0000 c0000000 c03ec7cc 000a0700 c0700000 ffff1000 000a3fff
1f60: 00001000 00000007 00000000 c03ec7cc c0008000 c03ed748 c0621fd4 c03d5d18
1f80: 69052d00 a03ec48c 00000000 c03d8ad0 0000006c 00007977 c036c6e8 00000001
1fa0: c0621fd4 c03ed744 c0628000 a0004000 69052d00 a03ec48c 00000000 c03d68d4
1fc0: 00000000 00000000 00000000 00000000 00000000 c03ed748 c0649894 c062801c
1fe0: c03ed744 c062b2f0 a0004000 69052d00 a03ec48c a0008040 00000000 00000000
[<c03e1100>] (vm_area_add_early) from [<c03d9ef4>] (add_static_vm_early+0xc/0x60)
[<c03d9ef4>] (add_static_vm_early) from [<c03da570>] (iotable_init.part.6+0xa8/0xb4)
[<c03da570>] (iotable_init.part.6) from [<c03db914>] (pxa25x_map_io+0x8/0x24)
[<c03db914>] (pxa25x_map_io) from [<c03daf84>] (paging_init+0x744/0x8d8)
[<c03daf84>] (paging_init) from [<c03d8ad0>] (setup_arch+0x354/0x608)
[<c03d8ad0>] (setup_arch) from [<c03d68d4>] (start_kernel+0xa8/0x3dc)
[<c03d68d4>] (start_kernel) from [<a0008040>] (0xa0008040)
Code: e5904008 e0811004 e1520001 2a000005 (e7f001f2)
---[ end trace f24b6c88ae00fa9a ]---
Kernel panic - not syncing: Attempted to kill the idle task!
---[ end Kernel panic - not syncing: Attempted to kill the idle task!
Reported-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/Kconfig.debug | 2 +-
arch/arm/mach-pxa/include/mach/addr-map.h | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5765abf..ae15787 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -1033,7 +1033,7 @@ config DEBUG_UART_VIRT
default 0xf1600000 if ARCH_INTEGRATOR
default 0xf1c28000 if DEBUG_SUNXI_UART0
default 0xf1c28400 if DEBUG_SUNXI_UART1
- default 0xf2100000 if DEBUG_PXA_UART1
+ default 0xf6200000 if DEBUG_PXA_UART1
default 0xf4090000 if ARCH_LPC32XX
default 0xf4200000 if ARCH_GEMINI
default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9
diff --git a/arch/arm/mach-pxa/include/mach/addr-map.h b/arch/arm/mach-pxa/include/mach/addr-map.h
index bbf9df3..d28fe29 100644
--- a/arch/arm/mach-pxa/include/mach/addr-map.h
+++ b/arch/arm/mach-pxa/include/mach/addr-map.h
@@ -39,6 +39,11 @@
#define DMEMC_SIZE 0x00100000
/*
+ * Reserved space for low level debug virtual addresses within
+ * 0xf6200000..0xf6201000
+ */
+
+/*
* Internal Memory Controller (PXA27x and later)
*/
#define IMEMC_PHYS 0x58000000
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 015/121] samsung-laptop: Add broken-acpi-video quirk for NC210/NC110
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (13 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 014/121] ARM: pxa: fix hang on startup with DEBUG_LL Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 016/121] acer-wmi: Add Aspire 5741 to video_vendor_dmi_table Kamal Mostafa
` (105 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Darren Hart, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <hdegoede@redhat.com>
commit 5a1426c99f9b7aa11d60c4e6b7a3211bb5321696 upstream.
The acpi-video backlight interface on the NC210 does not work, blacklist it
and use the samsung-laptop interface instead.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=861573
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/platform/x86/samsung-laptop.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index d1f03005..98f61f6 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -1534,6 +1534,16 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = {
},
.driver_data = &samsung_broken_acpi_video,
},
+ {
+ .callback = samsung_dmi_matched,
+ .ident = "NC210",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "NC210/NC110"),
+ DMI_MATCH(DMI_BOARD_NAME, "NC210/NC110"),
+ },
+ .driver_data = &samsung_broken_acpi_video,
+ },
{ },
};
MODULE_DEVICE_TABLE(dmi, samsung_dmi_table);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 016/121] acer-wmi: Add Aspire 5741 to video_vendor_dmi_table
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (14 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 015/121] samsung-laptop: Add broken-acpi-video quirk for NC210/NC110 Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 017/121] acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80 Kamal Mostafa
` (104 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Rafael J. Wysocki, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <hdegoede@redhat.com>
commit 9404cd95507de0a61f2a000fbd76748a9cae33b4 upstream.
The Aspire 5741 has broken acpi-video backlight control, so add it to the
quirk table.
References: https://bugzilla.redhat.com/show_bug.cgi?id=1012674
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/platform/x86/acer-wmi.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index c9076bd..3990c79 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -572,6 +572,14 @@ static const struct dmi_system_id video_vendor_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5750"),
},
},
+ {
+ .callback = video_set_backlight_video_vendor,
+ .ident = "Acer Aspire 5741",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5741"),
+ },
+ },
{}
};
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 017/121] acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (15 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 016/121] acer-wmi: Add Aspire 5741 to video_vendor_dmi_table Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 018/121] rbd: Fix error recovery in rbd_obj_read_sync() Kamal Mostafa
` (103 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Darren Hart, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <hdegoede@redhat.com>
commit 183fd8fcd7f8afb7ac5ec68f83194872f9fecc84 upstream.
The acpi-video backlight interface on the Acer KAV80 is broken, and worse
it causes the entire machine to slow down significantly after a suspend/resume.
Blacklist it, and use the acer-wmi backlight interface instead. Note that
the KAV80 is somewhat unique in that it is the only Acer model where we
fall back to acer-wmi after blacklisting, rather then using the native
(e.g. intel) backlight driver. This is done because there is no native
backlight interface on this model.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1128309
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/platform/x86/acer-wmi.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 3990c79..b942a1b 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -580,6 +580,17 @@ static const struct dmi_system_id video_vendor_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5741"),
},
},
+ {
+ /*
+ * Note no video_set_backlight_video_vendor, we must use the
+ * acer interface, as there is no native backlight interface.
+ */
+ .ident = "Acer KAV80",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "KAV80"),
+ },
+ },
{}
};
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 018/121] rbd: Fix error recovery in rbd_obj_read_sync()
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (16 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 017/121] acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80 Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 019/121] [media] ds3000: fix LNB supply voltage on Tevii S480 on initialization Kamal Mostafa
` (102 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Yehuda Sadeh, Sage Weil, ceph-devel, Jan Kara, Ilya Dryomov,
Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit a8d4205623ae965e36c68629db306ca0695a2771 upstream.
When we fail to allocate page vector in rbd_obj_read_sync() we just
basically ignore the problem and continue which will result in an oops
later. Fix the problem by returning proper error.
CC: Yehuda Sadeh <yehuda@inktank.com>
CC: Sage Weil <sage@inktank.com>
CC: ceph-devel@vger.kernel.org
Coverity-id: 1226882
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/block/rbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index a1455cc..5224f46 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3220,7 +3220,7 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
page_count = (u32) calc_pages_for(offset, length);
pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
if (IS_ERR(pages))
- ret = PTR_ERR(pages);
+ return PTR_ERR(pages);
ret = -ENOMEM;
obj_request = rbd_obj_request_create(object_name, offset, length,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 019/121] [media] ds3000: fix LNB supply voltage on Tevii S480 on initialization
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (17 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 018/121] rbd: Fix error recovery in rbd_obj_read_sync() Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 020/121] powerpc: do_notify_resume can be called with bad thread_info flags argument Kamal Mostafa
` (101 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ulrich Eckhardt, Mauro Carvalho Chehab, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ulrich Eckhardt <uli-lirc@uli-eckhardt.de>
commit 8c5bcded11cb607b1bb5920de3b9c882136d27db upstream.
The Tevii S480 outputs 18V on startup for the LNB supply voltage and does not
automatically power down. This blocks other receivers connected
to a satellite channel router (EN50494), since the receivers can not send the
required DiSEqC sequences when the Tevii card is connected to a the same SCR.
This patch switches off the LNB supply voltage on initialization of the frontend.
[mchehab@osg.samsung.com: add a comment about why we're explicitly
turning off voltage at device init]
Signed-off-by: Ulrich Eckhardt <uli@uli-eckhardt.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/dvb-frontends/ds3000.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c
index 1e344b0..22e8c20 100644
--- a/drivers/media/dvb-frontends/ds3000.c
+++ b/drivers/media/dvb-frontends/ds3000.c
@@ -864,6 +864,13 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config,
memcpy(&state->frontend.ops, &ds3000_ops,
sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state;
+
+ /*
+ * Some devices like T480 starts with voltage on. Be sure
+ * to turn voltage off during init, as this can otherwise
+ * interfere with Unicable SCR systems.
+ */
+ ds3000_set_voltage(&state->frontend, SEC_VOLTAGE_OFF);
return &state->frontend;
error3:
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 020/121] powerpc: do_notify_resume can be called with bad thread_info flags argument
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (18 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 019/121] [media] ds3000: fix LNB supply voltage on Tevii S480 on initialization Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 021/121] USB: kobil_sct: fix non-atomic allocation in write path Kamal Mostafa
` (100 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Anton Blanchard, Michael Ellerman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <anton@samba.org>
commit 808be31426af57af22268ef0fcb42617beb3d15b upstream.
Back in 7230c5644188 ("powerpc: Rework lazy-interrupt handling") we
added a call out to restore_interrupts() (written in c) before calling
do_notify_resume:
bl restore_interrupts
addi r3,r1,STACK_FRAME_OVERHEAD
bl do_notify_resume
Unfortunately do_notify_resume takes two arguments, the second one
being the thread_info flags:
void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
We do populate r4 (the second argument) earlier, but
restore_interrupts() is free to muck it up all it wants. My guess is
the gcc compiler gods shone down on us and its register allocator
never used r4. Sometimes, rarely, luck is on our side.
LLVM on the other hand did trample r4.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/kernel/entry_64.S | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index fb5ba6d..088dca5 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -660,7 +660,13 @@ _GLOBAL(ret_from_except_lite)
b .ret_from_except_lite
2: bl .save_nvgprs
+ /*
+ * Use a non volatile GPR to save and restore our thread_info flags
+ * across the call to restore_interrupts.
+ */
+ mr r30,r4
bl .restore_interrupts
+ mr r4,r30
addi r3,r1,STACK_FRAME_OVERHEAD
bl .do_notify_resume
b .ret_from_except
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 021/121] USB: kobil_sct: fix non-atomic allocation in write path
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (19 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 020/121] powerpc: do_notify_resume can be called with bad thread_info flags argument Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 022/121] USB: opticon: " Kamal Mostafa
` (99 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 191252837626fca0de694c18bb2aa64c118eda89 upstream.
Write may be called from interrupt context so make sure to use
GFP_ATOMIC for all allocations in write.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/kobil_sct.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 78b48c3..efa75b4 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -336,7 +336,8 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
port->interrupt_out_urb->transfer_buffer_length = length;
priv->cur_pos = priv->cur_pos + length;
- result = usb_submit_urb(port->interrupt_out_urb, GFP_NOIO);
+ result = usb_submit_urb(port->interrupt_out_urb,
+ GFP_ATOMIC);
dev_dbg(&port->dev, "%s - Send write URB returns: %i\n", __func__, result);
todo = priv->filled - priv->cur_pos;
@@ -351,7 +352,7 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
result = usb_submit_urb(port->interrupt_in_urb,
- GFP_NOIO);
+ GFP_ATOMIC);
dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result);
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 022/121] USB: opticon: fix non-atomic allocation in write path
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (20 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 021/121] USB: kobil_sct: fix non-atomic allocation in write path Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 023/121] regulator: max77693: Fix use of uninitialized regulator config Kamal Mostafa
` (98 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit e681286de221af78fc85db9222b6a203148c005a upstream.
Write may be called from interrupt context so make sure to use
GFP_ATOMIC for all allocations in write.
Fixes: 0d930e51cfe6 ("USB: opticon: Add Opticon OPN2001 write support")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/opticon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index cbe779f..df495ea 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -219,7 +219,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
/* The conncected devices do not have a bulk write endpoint,
* to transmit data to de barcode device the control endpoint is used */
- dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
+ dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
if (!dr) {
dev_err(&port->dev, "out of memory\n");
count = -ENOMEM;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 023/121] regulator: max77693: Fix use of uninitialized regulator config
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (21 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 022/121] USB: opticon: " Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 024/121] USB: cdc-acm: add device id for GW Instek AFG-2225 Kamal Mostafa
` (97 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Krzysztof Kozlowski, Mark Brown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
commit ca0c37a0b489bb14bf3e1549e7a8d0c9a17f4919 upstream.
Driver allocated on stack struct regulator_config but didn't initialize
it fully. Few fields (driver_data, ena_gpio) were left untouched. This
lead to using random ena_gpio values as GPIOs for max77693 regulators.
On occasion these values could match real GPIO numbers leading to
interfering with other drivers and to unsuccessful enable/disable of
regulator.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 80b022e29bfd ("regulator: max77693: Add max77693 regualtor driver.")
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/regulator/max77693.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/max77693.c b/drivers/regulator/max77693.c
index feb20bf..c2725e4 100644
--- a/drivers/regulator/max77693.c
+++ b/drivers/regulator/max77693.c
@@ -231,7 +231,7 @@ static int max77693_pmic_probe(struct platform_device *pdev)
struct max77693_pmic_dev *max77693_pmic;
struct max77693_regulator_data *rdata = NULL;
int num_rdata, i;
- struct regulator_config config;
+ struct regulator_config config = { };
num_rdata = max77693_pmic_init_rdata(&pdev->dev, &rdata);
if (!rdata || num_rdata <= 0) {
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 024/121] USB: cdc-acm: add device id for GW Instek AFG-2225
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (22 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 023/121] regulator: max77693: Fix use of uninitialized regulator config Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 025/121] usb: Do not allow usb_alloc_streams on unconfigured devices Kamal Mostafa
` (96 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hovold, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit cf84a691a61606a2e7269907d3727e2d9fa148ee upstream.
Add device-id entry for GW Instek AFG-2225, which has a byte swapped
bInterfaceSubClass (0x20).
Reported-by: Karl Palsson <karlp@tweak.net.au>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/class/cdc-acm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 0b5e381..7a2fe19 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1556,6 +1556,7 @@ static const struct usb_device_id acm_ids[] = {
{ USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
+ { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */
{ USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
},
/* Motorola H24 HSPA module: */
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 025/121] usb: Do not allow usb_alloc_streams on unconfigured devices
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (23 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 024/121] USB: cdc-acm: add device id for GW Instek AFG-2225 Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 026/121] usb-storage: handle a skipped data phase Kamal Mostafa
` (95 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <hdegoede@redhat.com>
commit 90a646c770c50cc206ceba0d7b50453c46c13c36 upstream.
This commit fixes the following oops:
[10238.622067] scsi host3: uas_eh_bus_reset_handler start
[10240.766164] usb 3-4: reset SuperSpeed USB device number 3 using xhci_hcd
[10245.779365] usb 3-4: device descriptor read/8, error -110
[10245.883331] usb 3-4: reset SuperSpeed USB device number 3 using xhci_hcd
[10250.897603] usb 3-4: device descriptor read/8, error -110
[10251.058200] BUG: unable to handle kernel NULL pointer dereference at 0000000000000040
[10251.058244] IP: [<ffffffff815ac6e1>] xhci_check_streams_endpoint+0x91/0x140
<snip>
[10251.059473] Call Trace:
[10251.059487] [<ffffffff815aca6c>] xhci_calculate_streams_and_bitmask+0xbc/0x130
[10251.059520] [<ffffffff815aeb5f>] xhci_alloc_streams+0x10f/0x5a0
[10251.059548] [<ffffffff810a4685>] ? check_preempt_curr+0x75/0xa0
[10251.059575] [<ffffffff810a46dc>] ? ttwu_do_wakeup+0x2c/0x100
[10251.059601] [<ffffffff810a49e6>] ? ttwu_do_activate.constprop.111+0x66/0x70
[10251.059635] [<ffffffff815779ab>] usb_alloc_streams+0xab/0xf0
[10251.059662] [<ffffffffc0616b48>] uas_configure_endpoints+0x128/0x150 [uas]
[10251.059694] [<ffffffffc0616bac>] uas_post_reset+0x3c/0xb0 [uas]
[10251.059722] [<ffffffff815727d9>] usb_reset_device+0x1b9/0x2a0
[10251.059749] [<ffffffffc0616f42>] uas_eh_bus_reset_handler+0xb2/0x190 [uas]
[10251.059781] [<ffffffff81514293>] scsi_try_bus_reset+0x53/0x110
[10251.059808] [<ffffffff815163b7>] scsi_eh_bus_reset+0xf7/0x270
<snip>
The problem is the following call sequence (simplified):
1) usb_reset_device
2) usb_reset_and_verify_device
2) hub_port_init
3) hub_port_finish_reset
3) xhci_discover_or_reset_device
This frees xhci->devs[slot_id]->eps[ep_index].ring for all eps but 0
4) usb_get_device_descriptor
This fails
5) hub_port_init fails
6) usb_reset_and_verify_device fails, does not restore device config
7) uas_post_reset
8) xhci_alloc_streams
NULL deref on the free-ed ring
This commit fixes this by not allowing usb_alloc_streams to continue if
the device is not configured.
Note that we do allow usb_free_streams to continue after a (logical)
disconnect, as it is necessary to explicitly free the streams at the xhci
controller level.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/core/hcd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index d39106c..4a4dae5 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2056,6 +2056,8 @@ int usb_alloc_streams(struct usb_interface *interface,
return -EINVAL;
if (dev->speed != USB_SPEED_SUPER)
return -EINVAL;
+ if (dev->state < USB_STATE_CONFIGURED)
+ return -ENODEV;
/* Streams only apply to bulk endpoints. */
for (i = 0; i < num_eps; i++)
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 026/121] usb-storage: handle a skipped data phase
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (24 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 025/121] usb: Do not allow usb_alloc_streams on unconfigured devices Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 027/121] xhci: Switch only Intel Lynx Point-LP ports to EHCI on shutdown Kamal Mostafa
` (94 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Alan Stern, Matthew Dharm, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <stern@rowland.harvard.edu>
commit 93c9bf4d1838d5851a18ca398b0ad66397f05056 upstream.
Sometimes mass-storage devices using the Bulk-only transport will
mistakenly skip the data phase of a command. Rather than sending the
data expected by the host or sending a zero-length packet, they go
directly to the status phase and send the CSW.
This causes problems for usb-storage, for obvious reasons. The driver
will interpret the CSW as a short data transfer and will wait to
receive a CSW. The device won't have anything left to send, so the
command eventually times out.
The SCSI layer doesn't retry commands after they time out (this is a
relatively recent change). Therefore we should do our best to detect
a skipped data phase and handle it promptly.
This patch adds code to do that. If usb-storage receives a short
13-byte data transfer from the device, and if the first four bytes of
the data match the CSW signature, the driver will set the residue to
the full transfer length and interpret the data as a CSW.
This fixes Bugzilla #86611.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Tested-by: Paul Osmialowski <newchief@king.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/storage/transport.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 22c7d43..b1d815e 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -1118,6 +1118,31 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
*/
if (result == USB_STOR_XFER_LONG)
fake_sense = 1;
+
+ /*
+ * Sometimes a device will mistakenly skip the data phase
+ * and go directly to the status phase without sending a
+ * zero-length packet. If we get a 13-byte response here,
+ * check whether it really is a CSW.
+ */
+ if (result == USB_STOR_XFER_SHORT &&
+ srb->sc_data_direction == DMA_FROM_DEVICE &&
+ transfer_length - scsi_get_resid(srb) ==
+ US_BULK_CS_WRAP_LEN) {
+ struct scatterlist *sg = NULL;
+ unsigned int offset = 0;
+
+ if (usb_stor_access_xfer_buf((unsigned char *) bcs,
+ US_BULK_CS_WRAP_LEN, srb, &sg,
+ &offset, FROM_XFER_BUF) ==
+ US_BULK_CS_WRAP_LEN &&
+ bcs->Signature ==
+ cpu_to_le32(US_BULK_CS_SIGN)) {
+ usb_stor_dbg(us, "Device skipped data phase\n");
+ scsi_set_resid(srb, transfer_length);
+ goto skipped_data_phase;
+ }
+ }
}
/* See flow chart on pg 15 of the Bulk Only Transport spec for
@@ -1153,6 +1178,7 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
if (result != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR;
+ skipped_data_phase:
/* check bulk status */
residue = le32_to_cpu(bcs->Residue);
usb_stor_dbg(us, "Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n",
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 027/121] xhci: Switch only Intel Lynx Point-LP ports to EHCI on shutdown.
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (25 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 026/121] usb-storage: handle a skipped data phase Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 028/121] xhci: no switching back on non-ULT Haswell Kamal Mostafa
` (93 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Denis Turischev, Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis Turischev <denis.turischev@compulab.co.il>
commit 0a939993bff117d3657108ca13b011fc0378aedb upstream.
Patch "xhci: Switch Intel Lynx Point ports to EHCI on shutdown."
commit c09ec25d3684cad74d851c0f028a495999591279 is not fully correct
It switches both Lynx Point and Lynx Point-LP ports to EHCI on shutdown.
On some Lynx Point machines it causes spurious interrupt,
which wake the system: bugzilla.kernel.org/show_bug.cgi?id=76291
On Lynx Point-LP on the contrary switching ports to EHCI seems to be
necessary to fix these spurious interrupts.
Signed-off-by: Denis Turischev <denis@compulab.co.il>
Reported-by: Wulf Richartz <wulf.richartz@gmail.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/host/xhci-pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 3fc8d9e..21223f8 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -138,7 +138,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
*/
if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP)
xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
-
+ }
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
+ pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
xhci->quirks |= XHCI_SPURIOUS_REBOOT;
}
if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 028/121] xhci: no switching back on non-ULT Haswell
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (26 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 027/121] xhci: Switch only Intel Lynx Point-LP ports to EHCI on shutdown Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 029/121] of: Fix overflow bug in string property parsing functions Kamal Mostafa
` (92 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Oliver Neukum, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <oneukum@suse.de>
commit b45abacde3d551c6696c6738bef4a1805d0bf27a upstream.
The switch back is limited to ULT even on HP. The contrary
finding arose by bad luck in BIOS versions for testing.
This fixes spontaneous resume from S3 on some HP laptops.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/host/xhci-pci.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 21223f8..4588815 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -126,20 +126,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
xhci->quirks |= XHCI_AVOID_BEI;
}
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
- (pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI ||
- pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI)) {
- /* Workaround for occasional spurious wakeups from S5 (or
- * any other sleep) on Haswell machines with LPT and LPT-LP
- * with the new Intel BIOS
- */
- /* Limit the quirk to only known vendors, as this triggers
- * yet another BIOS bug on some other machines
- * https://bugzilla.kernel.org/show_bug.cgi?id=66171
- */
- if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP)
- xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
- }
- if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
xhci->quirks |= XHCI_SPURIOUS_REBOOT;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 029/121] of: Fix overflow bug in string property parsing functions
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (27 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 028/121] xhci: no switching back on non-ULT Haswell Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 030/121] spi: fsl-dspi: Fix CTAR selection Kamal Mostafa
` (91 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Grant Likely, Rafael J. Wysocki, Mika Westerberg, Rob Herring,
Arnd Bergmann, Darren Hart, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Grant Likely <grant.likely@linaro.org>
commit a87fa1d81a9fb5e9adca9820e16008c40ad09f33 upstream.
The string property read helpers will run off the end of the buffer if
it is handed a malformed string property. Rework the parsers to make
sure that doesn't happen. At the same time add new test cases to make
sure the functions behave themselves.
The original implementations of of_property_read_string_index() and
of_property_count_strings() both open-coded the same block of parsing
code, each with it's own subtly different bugs. The fix here merges
functions into a single helper and makes the original functions static
inline wrappers around the helper.
One non-bugfix aspect of this patch is the addition of a new wrapper,
of_property_read_string_array(). The new wrapper is needed by the
device_properties feature that Rafael is working on and planning to
merge for v3.19. The implementation is identical both with and without
the new static inline wrapper, so it just got left in to reduce the
churn on the header file.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Darren Hart <darren.hart@intel.com>
[ kamal: backport to 3.13-stable: context; dropped tests-phandle.dtsi ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/of/base.c | 88 +++++++++++++--------------------------------------
drivers/of/selftest.c | 66 ++++++++++++++++++++++++++++++++++----
include/linux/of.h | 84 ++++++++++++++++++++++++++++++++++++++++--------
3 files changed, 152 insertions(+), 86 deletions(-)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index f807d0e..6c0dcf5 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1075,52 +1075,6 @@ int of_property_read_string(struct device_node *np, const char *propname,
EXPORT_SYMBOL_GPL(of_property_read_string);
/**
- * of_property_read_string_index - Find and read a string from a multiple
- * strings property.
- * @np: device node from which the property value is to be read.
- * @propname: name of the property to be searched.
- * @index: index of the string in the list of strings
- * @out_string: pointer to null terminated return string, modified only if
- * return value is 0.
- *
- * Search for a property in a device tree node and retrieve a null
- * terminated string value (pointer to data, not a copy) in the list of strings
- * contained in that property.
- * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
- * property does not have a value, and -EILSEQ if the string is not
- * null-terminated within the length of the property data.
- *
- * The out_string pointer is modified only if a valid string can be decoded.
- */
-int of_property_read_string_index(struct device_node *np, const char *propname,
- int index, const char **output)
-{
- struct property *prop = of_find_property(np, propname, NULL);
- int i = 0;
- size_t l = 0, total = 0;
- const char *p;
-
- if (!prop)
- return -EINVAL;
- if (!prop->value)
- return -ENODATA;
- if (strnlen(prop->value, prop->length) >= prop->length)
- return -EILSEQ;
-
- p = prop->value;
-
- for (i = 0; total < prop->length; total += l, p += l) {
- l = strlen(p) + 1;
- if (i++ == index) {
- *output = p;
- return 0;
- }
- }
- return -ENODATA;
-}
-EXPORT_SYMBOL_GPL(of_property_read_string_index);
-
-/**
* of_property_match_string() - Find string in a list and return index
* @np: pointer to node containing string list property
* @propname: string list property name
@@ -1146,7 +1100,7 @@ int of_property_match_string(struct device_node *np, const char *propname,
end = p + prop->length;
for (i = 0; p < end; i++, p += l) {
- l = strlen(p) + 1;
+ l = strnlen(p, end - p) + 1;
if (p + l > end)
return -EILSEQ;
pr_debug("comparing %s with %s\n", string, p);
@@ -1158,39 +1112,41 @@ int of_property_match_string(struct device_node *np, const char *propname,
EXPORT_SYMBOL_GPL(of_property_match_string);
/**
- * of_property_count_strings - Find and return the number of strings from a
- * multiple strings property.
+ * of_property_read_string_util() - Utility helper for parsing string properties
* @np: device node from which the property value is to be read.
* @propname: name of the property to be searched.
+ * @out_strs: output array of string pointers.
+ * @sz: number of array elements to read.
+ * @skip: Number of strings to skip over at beginning of list.
*
- * Search for a property in a device tree node and retrieve the number of null
- * terminated string contain in it. Returns the number of strings on
- * success, -EINVAL if the property does not exist, -ENODATA if property
- * does not have a value, and -EILSEQ if the string is not null-terminated
- * within the length of the property data.
+ * Don't call this function directly. It is a utility helper for the
+ * of_property_read_string*() family of functions.
*/
-int of_property_count_strings(struct device_node *np, const char *propname)
+int of_property_read_string_helper(struct device_node *np, const char *propname,
+ const char **out_strs, size_t sz, int skip)
{
struct property *prop = of_find_property(np, propname, NULL);
- int i = 0;
- size_t l = 0, total = 0;
- const char *p;
+ int l = 0, i = 0;
+ const char *p, *end;
if (!prop)
return -EINVAL;
if (!prop->value)
return -ENODATA;
- if (strnlen(prop->value, prop->length) >= prop->length)
- return -EILSEQ;
-
p = prop->value;
+ end = p + prop->length;
- for (i = 0; total < prop->length; total += l, p += l, i++)
- l = strlen(p) + 1;
-
- return i;
+ for (i = 0; p < end && (!out_strs || i < skip + sz); i++, p += l) {
+ l = strnlen(p, end - p) + 1;
+ if (p + l > end)
+ return -EILSEQ;
+ if (out_strs && i >= skip)
+ *out_strs++ = p;
+ }
+ i -= skip;
+ return i <= 0 ? -ENODATA : i;
}
-EXPORT_SYMBOL_GPL(of_property_count_strings);
+EXPORT_SYMBOL_GPL(of_property_read_string_helper);
void of_print_phandle_args(const char *msg, const struct of_phandle_args *args)
{
diff --git a/drivers/of/selftest.c b/drivers/of/selftest.c
index e21012b..aaa46ea 100644
--- a/drivers/of/selftest.c
+++ b/drivers/of/selftest.c
@@ -132,8 +132,9 @@ static void __init of_selftest_parse_phandle_with_args(void)
selftest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
}
-static void __init of_selftest_property_match_string(void)
+static void __init of_selftest_property_string(void)
{
+ const char *strings[4];
struct device_node *np;
int rc;
@@ -150,13 +151,66 @@ static void __init of_selftest_property_match_string(void)
rc = of_property_match_string(np, "phandle-list-names", "third");
selftest(rc == 2, "third expected:0 got:%i\n", rc);
rc = of_property_match_string(np, "phandle-list-names", "fourth");
- selftest(rc == -ENODATA, "unmatched string; rc=%i", rc);
+ selftest(rc == -ENODATA, "unmatched string; rc=%i\n", rc);
rc = of_property_match_string(np, "missing-property", "blah");
- selftest(rc == -EINVAL, "missing property; rc=%i", rc);
+ selftest(rc == -EINVAL, "missing property; rc=%i\n", rc);
rc = of_property_match_string(np, "empty-property", "blah");
- selftest(rc == -ENODATA, "empty property; rc=%i", rc);
+ selftest(rc == -ENODATA, "empty property; rc=%i\n", rc);
rc = of_property_match_string(np, "unterminated-string", "blah");
- selftest(rc == -EILSEQ, "unterminated string; rc=%i", rc);
+ selftest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
+
+ /* of_property_count_strings() tests */
+ rc = of_property_count_strings(np, "string-property");
+ selftest(rc == 1, "Incorrect string count; rc=%i\n", rc);
+ rc = of_property_count_strings(np, "phandle-list-names");
+ selftest(rc == 3, "Incorrect string count; rc=%i\n", rc);
+ rc = of_property_count_strings(np, "unterminated-string");
+ selftest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
+ rc = of_property_count_strings(np, "unterminated-string-list");
+ selftest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc);
+
+ /* of_property_read_string_index() tests */
+ rc = of_property_read_string_index(np, "string-property", 0, strings);
+ selftest(rc == 0 && !strcmp(strings[0], "foobar"), "of_property_read_string_index() failure; rc=%i\n", rc);
+ strings[0] = NULL;
+ rc = of_property_read_string_index(np, "string-property", 1, strings);
+ selftest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
+ rc = of_property_read_string_index(np, "phandle-list-names", 0, strings);
+ selftest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
+ rc = of_property_read_string_index(np, "phandle-list-names", 1, strings);
+ selftest(rc == 0 && !strcmp(strings[0], "second"), "of_property_read_string_index() failure; rc=%i\n", rc);
+ rc = of_property_read_string_index(np, "phandle-list-names", 2, strings);
+ selftest(rc == 0 && !strcmp(strings[0], "third"), "of_property_read_string_index() failure; rc=%i\n", rc);
+ strings[0] = NULL;
+ rc = of_property_read_string_index(np, "phandle-list-names", 3, strings);
+ selftest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
+ strings[0] = NULL;
+ rc = of_property_read_string_index(np, "unterminated-string", 0, strings);
+ selftest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
+ rc = of_property_read_string_index(np, "unterminated-string-list", 0, strings);
+ selftest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
+ strings[0] = NULL;
+ rc = of_property_read_string_index(np, "unterminated-string-list", 2, strings); /* should fail */
+ selftest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
+ strings[1] = NULL;
+
+ /* of_property_read_string_array() tests */
+ rc = of_property_read_string_array(np, "string-property", strings, 4);
+ selftest(rc == 1, "Incorrect string count; rc=%i\n", rc);
+ rc = of_property_read_string_array(np, "phandle-list-names", strings, 4);
+ selftest(rc == 3, "Incorrect string count; rc=%i\n", rc);
+ rc = of_property_read_string_array(np, "unterminated-string", strings, 4);
+ selftest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
+ /* -- An incorrectly formed string should cause a failure */
+ rc = of_property_read_string_array(np, "unterminated-string-list", strings, 4);
+ selftest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc);
+ /* -- parsing the correctly formed strings should still work: */
+ strings[2] = NULL;
+ rc = of_property_read_string_array(np, "unterminated-string-list", strings, 2);
+ selftest(rc == 2 && strings[2] == NULL, "of_property_read_string_array() failure; rc=%i\n", rc);
+ strings[1] = NULL;
+ rc = of_property_read_string_array(np, "phandle-list-names", strings, 1);
+ selftest(rc == 1 && strings[1] == NULL, "Overwrote end of string array; rc=%i, str='%s'\n", rc, strings[1]);
}
static void __init of_selftest_parse_interrupts(void)
@@ -313,7 +367,7 @@ static int __init of_selftest(void)
pr_info("start of selftest - you will see error messages\n");
of_selftest_parse_phandle_with_args();
- of_selftest_property_match_string();
+ of_selftest_property_string();
of_selftest_parse_interrupts();
of_selftest_parse_interrupts_extended();
pr_info("end of selftest - %i passed, %i failed\n",
diff --git a/include/linux/of.h b/include/linux/of.h
index 276c546..6e47b7f 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -267,14 +267,12 @@ extern int of_property_read_u64(const struct device_node *np,
extern int of_property_read_string(struct device_node *np,
const char *propname,
const char **out_string);
-extern int of_property_read_string_index(struct device_node *np,
- const char *propname,
- int index, const char **output);
extern int of_property_match_string(struct device_node *np,
const char *propname,
const char *string);
-extern int of_property_count_strings(struct device_node *np,
- const char *propname);
+extern int of_property_read_string_helper(struct device_node *np,
+ const char *propname,
+ const char **out_strs, size_t sz, int index);
extern int of_device_is_compatible(const struct device_node *device,
const char *);
extern int of_device_is_available(const struct device_node *device);
@@ -458,15 +456,9 @@ static inline int of_property_read_string(struct device_node *np,
return -ENOSYS;
}
-static inline int of_property_read_string_index(struct device_node *np,
- const char *propname, int index,
- const char **out_string)
-{
- return -ENOSYS;
-}
-
-static inline int of_property_count_strings(struct device_node *np,
- const char *propname)
+static inline int of_property_read_string_helper(struct device_node *np,
+ const char *propname,
+ const char **out_strs, size_t sz, int index)
{
return -ENOSYS;
}
@@ -565,6 +557,70 @@ static inline int of_node_to_nid(struct device_node *device) { return 0; }
#endif
/**
+ * of_property_read_string_array() - Read an array of strings from a multiple
+ * strings property.
+ * @np: device node from which the property value is to be read.
+ * @propname: name of the property to be searched.
+ * @out_strs: output array of string pointers.
+ * @sz: number of array elements to read.
+ *
+ * Search for a property in a device tree node and retrieve a list of
+ * terminated string values (pointer to data, not a copy) in that property.
+ *
+ * If @out_strs is NULL, the number of strings in the property is returned.
+ */
+static inline int of_property_read_string_array(struct device_node *np,
+ const char *propname, const char **out_strs,
+ size_t sz)
+{
+ return of_property_read_string_helper(np, propname, out_strs, sz, 0);
+}
+
+/**
+ * of_property_count_strings() - Find and return the number of strings from a
+ * multiple strings property.
+ * @np: device node from which the property value is to be read.
+ * @propname: name of the property to be searched.
+ *
+ * Search for a property in a device tree node and retrieve the number of null
+ * terminated string contain in it. Returns the number of strings on
+ * success, -EINVAL if the property does not exist, -ENODATA if property
+ * does not have a value, and -EILSEQ if the string is not null-terminated
+ * within the length of the property data.
+ */
+static inline int of_property_count_strings(struct device_node *np,
+ const char *propname)
+{
+ return of_property_read_string_helper(np, propname, NULL, 0, 0);
+}
+
+/**
+ * of_property_read_string_index() - Find and read a string from a multiple
+ * strings property.
+ * @np: device node from which the property value is to be read.
+ * @propname: name of the property to be searched.
+ * @index: index of the string in the list of strings
+ * @out_string: pointer to null terminated return string, modified only if
+ * return value is 0.
+ *
+ * Search for a property in a device tree node and retrieve a null
+ * terminated string value (pointer to data, not a copy) in the list of strings
+ * contained in that property.
+ * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
+ * property does not have a value, and -EILSEQ if the string is not
+ * null-terminated within the length of the property data.
+ *
+ * The out_string pointer is modified only if a valid string can be decoded.
+ */
+static inline int of_property_read_string_index(struct device_node *np,
+ const char *propname,
+ int index, const char **output)
+{
+ int rc = of_property_read_string_helper(np, propname, output, 1, index);
+ return rc < 0 ? rc : 0;
+}
+
+/**
* of_property_read_bool - Findfrom a property
* @np: device node from which the property value is to be read.
* @propname: name of the property to be searched.
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 030/121] spi: fsl-dspi: Fix CTAR selection
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (28 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 029/121] of: Fix overflow bug in string property parsing functions Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 031/121] Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup Kamal Mostafa
` (90 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Alexander Stein, Mark Brown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <alexander.stein@systec-electronic.com>
commit 5cc7b04740effa5cc0af53f434134b5859d58b73 upstream.
There are only 4 CTAR registers (CTAR0 - CTAR3) so we can only use the
lower 2 bits of the chip select to select a CTAR register.
SPI_PUSHR_CTAS used the lower 3 bits which would result in wrong bit values
if the chip selects 4/5 are used. For those chip selects SPI_CTAR even
calculated offsets of non-existing registers.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/spi/spi-fsl-dspi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 49a7346..b8d897c 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -45,7 +45,7 @@
#define SPI_TCR 0x08
-#define SPI_CTAR(x) (0x0c + (x * 4))
+#define SPI_CTAR(x) (0x0c + (((x) & 0x3) * 4))
#define SPI_CTAR_FMSZ(x) (((x) & 0x0000000f) << 27)
#define SPI_CTAR_CPOL(x) ((x) << 26)
#define SPI_CTAR_CPHA(x) ((x) << 25)
@@ -69,7 +69,7 @@
#define SPI_PUSHR 0x34
#define SPI_PUSHR_CONT (1 << 31)
-#define SPI_PUSHR_CTAS(x) (((x) & 0x00000007) << 28)
+#define SPI_PUSHR_CTAS(x) (((x) & 0x00000003) << 28)
#define SPI_PUSHR_EOQ (1 << 27)
#define SPI_PUSHR_CTCNT (1 << 26)
#define SPI_PUSHR_PCS(x) (((1 << x) & 0x0000003f) << 16)
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 031/121] Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (29 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 030/121] spi: fsl-dspi: Fix CTAR selection Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 032/121] staging:iio:ade7758: Fix NULL pointer deref when enabling buffer Kamal Mostafa
` (89 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Chris Mason, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <clm@fb.com>
commit 6e5aafb27419f32575b27ef9d6a31e5d54661aca upstream.
If we hit any errors in btrfs_lookup_csums_range, we'll loop through all
the csums we allocate and free them. But the code was using list_entry
incorrectly, and ended up trying to free the on-stack list_head instead.
This bug came from commit 0678b6185
btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range()
Signed-off-by: Chris Mason <clm@fb.com>
Reported-by: Erik Berg <btrfs@slipsprogrammoer.no>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/btrfs/file-item.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index bb91764..40b09dc 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -423,7 +423,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
ret = 0;
fail:
while (ret < 0 && !list_empty(&tmplist)) {
- sums = list_entry(&tmplist, struct btrfs_ordered_sum, list);
+ sums = list_entry(tmplist.next, struct btrfs_ordered_sum, list);
list_del(&sums->list);
kfree(sums);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 032/121] staging:iio:ade7758: Fix NULL pointer deref when enabling buffer
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (30 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 031/121] Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 033/121] staging:iio:ade7758: Fix check if channels are enabled in prenable Kamal Mostafa
` (88 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lars-Peter Clausen, Jonathan Cameron, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <lars@metafoo.de>
commit e10554738cab4224e097c2f9d975ea781a4fcde4 upstream.
In older versions of the IIO framework it was possible to pass a completely
different set of channels to iio_buffer_register() as the one that is
assigned to the IIO device. Commit 959d2952d124 ("staging:iio: make
iio_sw_buffer_preenable much more general.") introduced a restriction that
requires that the set of channels that is passed to iio_buffer_register() is
a subset of the channels assigned to the IIO device as the IIO core will use
the list of channels that is assigned to the device to lookup a channel by
scan index in iio_compute_scan_bytes(). If it can not find the channel the
function will crash. This patch fixes the issue by making sure that the same
set of channels is assigned to the IIO device and passed to
iio_buffer_register().
Note that we need to remove the IIO_CHAN_INFO_RAW and IIO_CHAN_INFO_SCALE
info attributes from the channels since we don't actually want those to be
registered.
Fixes the following crash:
Unable to handle kernel NULL pointer dereference at virtual address 00000016
pgd = d2094000
[00000016] *pgd=16e39831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 1 PID: 1695 Comm: bash Not tainted 3.17.0-06329-g29461ee #9686
task: d7768040 ti: d5bd4000 task.ti: d5bd4000
PC is at iio_compute_scan_bytes+0x38/0xc0
LR is at iio_compute_scan_bytes+0x34/0xc0
pc : [<c0316de8>] lr : [<c0316de4>] psr: 60070013
sp : d5bd5ec0 ip : 00000000 fp : 00000000
r10: d769f934 r9 : 00000000 r8 : 00000001
r7 : 00000000 r6 : c8fc6240 r5 : d769f800 r4 : 00000000
r3 : d769f800 r2 : 00000000 r1 : ffffffff r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 18c5387d Table: 1209404a DAC: 00000015
Process bash (pid: 1695, stack limit = 0xd5bd4240)
Stack: (0xd5bd5ec0 to 0xd5bd6000)
5ec0: d769f800 d7435640 c8fc6240 d769f984 00000000 c03175a4 d7435690 d7435640
5ee0: d769f990 00000002 00000000 d769f800 d5bd4000 00000000 000b43a8 c03177f4
5f00: d769f810 0162b8c8 00000002 c8fc7e00 d77f1d08 d77f1da8 c8fc7e00 c01faf1c
5f20: 00000002 c010694c c010690c d5bd5f88 00000002 c8fc6840 c8fc684c c0105e08
5f40: 00000000 00000000 d20d1580 00000002 000af408 d5bd5f88 c000de84 c00b76d4
5f60: d20d1580 000af408 00000002 d20d1580 d20d1580 00000002 000af408 c000de84
5f80: 00000000 c00b7a44 00000000 00000000 00000002 b6ebea78 00000002 000af408
5fa0: 00000004 c000dd00 b6ebea78 00000002 00000001 000af408 00000002 00000000
5fc0: b6ebea78 00000002 000af408 00000004 bee96a4c 000a6094 00000000 000b43a8
5fe0: 00000000 bee969cc b6e2eb77 b6e6525c 40070010 00000001 00000000 00000000
[<c0316de8>] (iio_compute_scan_bytes) from [<c03175a4>] (__iio_update_buffers+0x248/0x438)
[<c03175a4>] (__iio_update_buffers) from [<c03177f4>] (iio_buffer_store_enable+0x60/0x7c)
[<c03177f4>] (iio_buffer_store_enable) from [<c01faf1c>] (dev_attr_store+0x18/0x24)
[<c01faf1c>] (dev_attr_store) from [<c010694c>] (sysfs_kf_write+0x40/0x4c)
[<c010694c>] (sysfs_kf_write) from [<c0105e08>] (kernfs_fop_write+0x110/0x154)
[<c0105e08>] (kernfs_fop_write) from [<c00b76d4>] (vfs_write+0xbc/0x170)
[<c00b76d4>] (vfs_write) from [<c00b7a44>] (SyS_write+0x40/0x78)
[<c00b7a44>] (SyS_write) from [<c000dd00>] (ret_fast_syscall+0x0/0x30)
Fixes: 959d2952d124 ("staging:iio: make iio_sw_buffer_preenable much more general.")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/staging/iio/meter/ade7758.h | 1 -
drivers/staging/iio/meter/ade7758_core.c | 33 ++------------------------------
drivers/staging/iio/meter/ade7758_ring.c | 3 +--
3 files changed, 3 insertions(+), 34 deletions(-)
diff --git a/drivers/staging/iio/meter/ade7758.h b/drivers/staging/iio/meter/ade7758.h
index 0731820..e8c98cf 100644
--- a/drivers/staging/iio/meter/ade7758.h
+++ b/drivers/staging/iio/meter/ade7758.h
@@ -119,7 +119,6 @@ struct ade7758_state {
u8 *tx;
u8 *rx;
struct mutex buf_lock;
- const struct iio_chan_spec *ade7758_ring_channels;
struct spi_transfer ring_xfer[4];
struct spi_message ring_msg;
/*
diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c
index cba183e..214b03e 100644
--- a/drivers/staging/iio/meter/ade7758_core.c
+++ b/drivers/staging/iio/meter/ade7758_core.c
@@ -631,8 +631,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 0,
.extend_name = "raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_A, AD7758_VOLTAGE),
.scan_index = 0,
.scan_type = {
@@ -645,8 +643,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 0,
.extend_name = "raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_A, AD7758_CURRENT),
.scan_index = 1,
.scan_type = {
@@ -659,8 +655,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 0,
.extend_name = "apparent_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_A, AD7758_APP_PWR),
.scan_index = 2,
.scan_type = {
@@ -673,8 +667,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 0,
.extend_name = "active_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_A, AD7758_ACT_PWR),
.scan_index = 3,
.scan_type = {
@@ -687,8 +679,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 0,
.extend_name = "reactive_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_A, AD7758_REACT_PWR),
.scan_index = 4,
.scan_type = {
@@ -701,8 +691,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 1,
.extend_name = "raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_B, AD7758_VOLTAGE),
.scan_index = 5,
.scan_type = {
@@ -715,8 +703,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 1,
.extend_name = "raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_B, AD7758_CURRENT),
.scan_index = 6,
.scan_type = {
@@ -729,8 +715,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 1,
.extend_name = "apparent_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_B, AD7758_APP_PWR),
.scan_index = 7,
.scan_type = {
@@ -743,8 +727,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 1,
.extend_name = "active_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_B, AD7758_ACT_PWR),
.scan_index = 8,
.scan_type = {
@@ -757,8 +739,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 1,
.extend_name = "reactive_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_B, AD7758_REACT_PWR),
.scan_index = 9,
.scan_type = {
@@ -771,8 +751,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 2,
.extend_name = "raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_C, AD7758_VOLTAGE),
.scan_index = 10,
.scan_type = {
@@ -785,8 +763,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 2,
.extend_name = "raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_C, AD7758_CURRENT),
.scan_index = 11,
.scan_type = {
@@ -799,8 +775,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 2,
.extend_name = "apparent_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_C, AD7758_APP_PWR),
.scan_index = 12,
.scan_type = {
@@ -813,8 +787,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 2,
.extend_name = "active_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_C, AD7758_ACT_PWR),
.scan_index = 13,
.scan_type = {
@@ -827,8 +799,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.indexed = 1,
.channel = 2,
.extend_name = "reactive_raw",
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = AD7758_WT(AD7758_PHASE_C, AD7758_REACT_PWR),
.scan_index = 14,
.scan_type = {
@@ -869,13 +839,14 @@ static int ade7758_probe(struct spi_device *spi)
goto error_free_rx;
}
st->us = spi;
- st->ade7758_ring_channels = &ade7758_channels[0];
mutex_init(&st->buf_lock);
indio_dev->name = spi->dev.driver->name;
indio_dev->dev.parent = &spi->dev;
indio_dev->info = &ade7758_info;
indio_dev->modes = INDIO_DIRECT_MODE;
+ indio_dev->channels = ade7758_channels;
+ indio_dev->num_channels = ARRAY_SIZE(ade7758_channels);
ret = ade7758_configure_ring(indio_dev);
if (ret)
diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c
index c0accf8..628e902 100644
--- a/drivers/staging/iio/meter/ade7758_ring.c
+++ b/drivers/staging/iio/meter/ade7758_ring.c
@@ -85,7 +85,6 @@ static irqreturn_t ade7758_trigger_handler(int irq, void *p)
**/
static int ade7758_ring_preenable(struct iio_dev *indio_dev)
{
- struct ade7758_state *st = iio_priv(indio_dev);
unsigned channel;
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
@@ -95,7 +94,7 @@ static int ade7758_ring_preenable(struct iio_dev *indio_dev)
indio_dev->masklength);
ade7758_write_waveform_type(&indio_dev->dev,
- st->ade7758_ring_channels[channel].address);
+ indio_dev->channels[channel].address);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 033/121] staging:iio:ade7758: Fix check if channels are enabled in prenable
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (31 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 032/121] staging:iio:ade7758: Fix NULL pointer deref when enabling buffer Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 034/121] staging:iio:ade7758: Remove "raw" from channel name Kamal Mostafa
` (87 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lars-Peter Clausen, Jonathan Cameron, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <lars@metafoo.de>
commit 79fa64eb2ee8ccb4bcad7f54caa2699730b10b22 upstream.
We should check if a channel is enabled, not if no channels are enabled.
Fixes: 550268ca1111 ("staging:iio: scrap scan_count and ensure all drivers use active_scan_mask")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/staging/iio/meter/ade7758_ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c
index 628e902..6e90064 100644
--- a/drivers/staging/iio/meter/ade7758_ring.c
+++ b/drivers/staging/iio/meter/ade7758_ring.c
@@ -87,7 +87,7 @@ static int ade7758_ring_preenable(struct iio_dev *indio_dev)
{
unsigned channel;
- if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
+ if (bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
return -EINVAL;
channel = find_first_bit(indio_dev->active_scan_mask,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 034/121] staging:iio:ade7758: Remove "raw" from channel name
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (32 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 033/121] staging:iio:ade7758: Fix check if channels are enabled in prenable Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 035/121] USB: cdc-acm: only raise DTR on transitions from B0 Kamal Mostafa
` (86 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lars-Peter Clausen, Jonathan Cameron, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <lars@metafoo.de>
commit b598aacc29331e7e638cd509108600e916c6331b upstream.
"raw" is a property of a channel, but should not be part of the name of
channel.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/staging/iio/meter/ade7758_core.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c
index 214b03e..94d9914 100644
--- a/drivers/staging/iio/meter/ade7758_core.c
+++ b/drivers/staging/iio/meter/ade7758_core.c
@@ -630,7 +630,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
- .extend_name = "raw",
.address = AD7758_WT(AD7758_PHASE_A, AD7758_VOLTAGE),
.scan_index = 0,
.scan_type = {
@@ -642,7 +641,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_CURRENT,
.indexed = 1,
.channel = 0,
- .extend_name = "raw",
.address = AD7758_WT(AD7758_PHASE_A, AD7758_CURRENT),
.scan_index = 1,
.scan_type = {
@@ -654,7 +652,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 0,
- .extend_name = "apparent_raw",
+ .extend_name = "apparent",
.address = AD7758_WT(AD7758_PHASE_A, AD7758_APP_PWR),
.scan_index = 2,
.scan_type = {
@@ -666,7 +664,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 0,
- .extend_name = "active_raw",
+ .extend_name = "active",
.address = AD7758_WT(AD7758_PHASE_A, AD7758_ACT_PWR),
.scan_index = 3,
.scan_type = {
@@ -678,7 +676,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 0,
- .extend_name = "reactive_raw",
+ .extend_name = "reactive",
.address = AD7758_WT(AD7758_PHASE_A, AD7758_REACT_PWR),
.scan_index = 4,
.scan_type = {
@@ -690,7 +688,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
- .extend_name = "raw",
.address = AD7758_WT(AD7758_PHASE_B, AD7758_VOLTAGE),
.scan_index = 5,
.scan_type = {
@@ -702,7 +699,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_CURRENT,
.indexed = 1,
.channel = 1,
- .extend_name = "raw",
.address = AD7758_WT(AD7758_PHASE_B, AD7758_CURRENT),
.scan_index = 6,
.scan_type = {
@@ -714,7 +710,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 1,
- .extend_name = "apparent_raw",
+ .extend_name = "apparent",
.address = AD7758_WT(AD7758_PHASE_B, AD7758_APP_PWR),
.scan_index = 7,
.scan_type = {
@@ -726,7 +722,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 1,
- .extend_name = "active_raw",
+ .extend_name = "active",
.address = AD7758_WT(AD7758_PHASE_B, AD7758_ACT_PWR),
.scan_index = 8,
.scan_type = {
@@ -738,7 +734,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 1,
- .extend_name = "reactive_raw",
+ .extend_name = "reactive",
.address = AD7758_WT(AD7758_PHASE_B, AD7758_REACT_PWR),
.scan_index = 9,
.scan_type = {
@@ -750,7 +746,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 2,
- .extend_name = "raw",
.address = AD7758_WT(AD7758_PHASE_C, AD7758_VOLTAGE),
.scan_index = 10,
.scan_type = {
@@ -762,7 +757,6 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_CURRENT,
.indexed = 1,
.channel = 2,
- .extend_name = "raw",
.address = AD7758_WT(AD7758_PHASE_C, AD7758_CURRENT),
.scan_index = 11,
.scan_type = {
@@ -774,7 +768,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 2,
- .extend_name = "apparent_raw",
+ .extend_name = "apparent",
.address = AD7758_WT(AD7758_PHASE_C, AD7758_APP_PWR),
.scan_index = 12,
.scan_type = {
@@ -786,7 +780,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 2,
- .extend_name = "active_raw",
+ .extend_name = "active",
.address = AD7758_WT(AD7758_PHASE_C, AD7758_ACT_PWR),
.scan_index = 13,
.scan_type = {
@@ -798,7 +792,7 @@ static const struct iio_chan_spec ade7758_channels[] = {
.type = IIO_POWER,
.indexed = 1,
.channel = 2,
- .extend_name = "reactive_raw",
+ .extend_name = "reactive",
.address = AD7758_WT(AD7758_PHASE_C, AD7758_REACT_PWR),
.scan_index = 14,
.scan_type = {
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 035/121] USB: cdc-acm: only raise DTR on transitions from B0
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (33 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 034/121] staging:iio:ade7758: Remove "raw" from channel name Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 036/121] serial: Fix divide-by-zero fault in uart_get_divisor() Kamal Mostafa
` (85 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hovold, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 4473d054ceb572557954f9536731d39b20937b0c upstream.
Make sure to only raise DTR on transitions from B0 in set_termios.
Also allow set_termios to be called from open with a termios_old of
NULL. Note that DTR will not be raised prematurely in this case.
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/class/cdc-acm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 7a2fe19..4c43b31 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -845,11 +845,12 @@ static void acm_tty_set_termios(struct tty_struct *tty,
/* FIXME: Needs to clear unsupported bits in the termios */
acm->clocal = ((termios->c_cflag & CLOCAL) != 0);
- if (!newline.dwDTERate) {
+ if (C_BAUD(tty) == B0) {
newline.dwDTERate = acm->line.dwDTERate;
newctrl &= ~ACM_CTRL_DTR;
- } else
+ } else if (termios_old && (termios_old->c_cflag & CBAUD) == B0) {
newctrl |= ACM_CTRL_DTR;
+ }
if (newctrl != acm->ctrlout)
acm_set_control(acm, acm->ctrlout = newctrl);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 036/121] serial: Fix divide-by-zero fault in uart_get_divisor()
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (34 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 035/121] USB: cdc-acm: only raise DTR on transitions from B0 Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 037/121] tty: Fix high cpu load if tty is unreleaseable Kamal Mostafa
` (84 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <peter@hurleysoftware.com>
commit 547039ec502076e60034eeb79611df3433a99b7d upstream.
uart_get_baud_rate() will return baud == 0 if the max rate is set
to the "magic" 38400 rate and the SPD_* flags are also specified.
On the first iteration, if the current baud rate is higher than the
max, the baud rate is clamped at the max (which in the degenerate
case is 38400). On the second iteration, the now-"magic" 38400 baud
rate selects the possibly higher alternate baud rate indicated by
the SPD_* flag. Since only two loop iterations are performed, the
loop is exited, a kernel WARNING is generated and a baud rate of
0 is returned.
Reproducible with:
setserial /dev/ttyS0 spd_hi base_baud 38400
Only perform the "magic" 38400 -> SPD_* baud transform on the first
loop iteration, which prevents the degenerate case from recognizing
the clamped baud rate as the "magic" 38400 value.
Reported-by: Robert Święcki <robert@swiecki.net>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/serial/serial_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index b5180c1..6015b6c 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -353,7 +353,7 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
* The spd_hi, spd_vhi, spd_shi, spd_warp kludge...
* Die! Die! Die!
*/
- if (baud == 38400)
+ if (try == 0 && baud == 38400)
baud = altbaud;
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 037/121] tty: Fix high cpu load if tty is unreleaseable
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (35 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 036/121] serial: Fix divide-by-zero fault in uart_get_divisor() Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 038/121] tty: Prevent "read/write wait queue active!" log flooding Kamal Mostafa
` (83 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <peter@hurleysoftware.com>
commit 37b164578826406a173ca7c20d9ba7430134d23e upstream.
Kernel oops can cause the tty to be unreleaseable (for example, if
n_tty_read() crashes while on the read_wait queue). This will cause
tty_release() to endlessly loop without sleeping.
Use a killable sleep timeout which grows by 2n+1 jiffies over the interval
[0, 120 secs.) and then jumps to forever (but still killable).
NB: killable just allows for the task to be rewoken manually, not
to be terminated.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/tty_io.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index d3448a9..25d0741 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1701,6 +1701,7 @@ int tty_release(struct inode *inode, struct file *filp)
int pty_master, tty_closing, o_tty_closing, do_sleep;
int idx;
char buf[64];
+ long timeout = 0;
if (tty_paranoia_check(tty, inode, __func__))
return 0;
@@ -1785,7 +1786,11 @@ int tty_release(struct inode *inode, struct file *filp)
__func__, tty_name(tty, buf));
tty_unlock_pair(tty, o_tty);
mutex_unlock(&tty_mutex);
- schedule();
+ schedule_timeout_killable(timeout);
+ if (timeout < 120 * HZ)
+ timeout = 2 * timeout + 1;
+ else
+ timeout = MAX_SCHEDULE_TIMEOUT;
}
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 038/121] tty: Prevent "read/write wait queue active!" log flooding
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (36 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 037/121] tty: Fix high cpu load if tty is unreleaseable Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 039/121] tty/vt: don't set font mappings on vc not supporting this Kamal Mostafa
` (82 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <peter@hurleysoftware.com>
commit 494c1eac7e73f719af9d474a96ec8494c33efd6a upstream.
Only print one warning when a task is on the read_wait or write_wait
wait queue at final tty release.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/tty_io.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 25d0741..da7d0a2 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1702,6 +1702,7 @@ int tty_release(struct inode *inode, struct file *filp)
int idx;
char buf[64];
long timeout = 0;
+ int once = 1;
if (tty_paranoia_check(tty, inode, __func__))
return 0;
@@ -1782,8 +1783,11 @@ int tty_release(struct inode *inode, struct file *filp)
if (!do_sleep)
break;
- printk(KERN_WARNING "%s: %s: read/write wait queue active!\n",
- __func__, tty_name(tty, buf));
+ if (once) {
+ once = 0;
+ printk(KERN_WARNING "%s: %s: read/write wait queue active!\n",
+ __func__, tty_name(tty, buf));
+ }
tty_unlock_pair(tty, o_tty);
mutex_unlock(&tty_mutex);
schedule_timeout_killable(timeout);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 039/121] tty/vt: don't set font mappings on vc not supporting this
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (37 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 038/121] tty: Prevent "read/write wait queue active!" log flooding Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 040/121] spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM Kamal Mostafa
` (81 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Imre Deak, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Imre Deak <imre.deak@intel.com>
commit 9e326f78713a4421fe11afc2ddeac07698fac131 upstream.
We can call this function for a dummy console that doesn't support
setting the font mapping, which will result in a null ptr BUG. So check
for this case and return error for consoles w/o font mapping support.
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=59321
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/vt/consolemap.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index 2978ca5..d0a3e23 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -540,6 +540,13 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
/* Save original vc_unipagdir_loc in case we allocate a new one */
p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
+
+ if (!p) {
+ err = -EINVAL;
+
+ goto out_unlock;
+ }
+
if (p->readonly) {
console_unlock();
return -EIO;
@@ -633,6 +640,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
set_inverse_transl(vc, p, i); /* Update inverse translations */
set_inverse_trans_unicode(vc, p);
+out_unlock:
console_unlock();
return err;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 040/121] spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (38 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 039/121] tty/vt: don't set font mappings on vc not supporting this Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 041/121] sysfs: driver core: Fix glue dir race condition by gdp_mutex Kamal Mostafa
` (80 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dmitry Eremin-Solenikov, Mark Brown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
commit 2b9375b91bef65b837bed61a05fb387159b38ddf upstream.
If PM_RUNTIME is enabled, it is easy to trigger the following backtrace
on pxa2xx hosts:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at /home/lumag/linux/arch/arm/mach-pxa/clock.c:35 clk_disable+0xa0/0xa8()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-00007-g1b3d2ee-dirty #104
[<c000de68>] (unwind_backtrace) from [<c000c078>] (show_stack+0x10/0x14)
[<c000c078>] (show_stack) from [<c001d75c>] (warn_slowpath_common+0x6c/0x8c)
[<c001d75c>] (warn_slowpath_common) from [<c001d818>] (warn_slowpath_null+0x1c/0x24)
[<c001d818>] (warn_slowpath_null) from [<c0015e80>] (clk_disable+0xa0/0xa8)
[<c0015e80>] (clk_disable) from [<c02507f8>] (pxa2xx_spi_suspend+0x2c/0x34)
[<c02507f8>] (pxa2xx_spi_suspend) from [<c0200360>] (platform_pm_suspend+0x2c/0x54)
[<c0200360>] (platform_pm_suspend) from [<c0207fec>] (dpm_run_callback.isra.14+0x2c/0x74)
[<c0207fec>] (dpm_run_callback.isra.14) from [<c0209254>] (__device_suspend+0x120/0x2f8)
[<c0209254>] (__device_suspend) from [<c0209a94>] (dpm_suspend+0x50/0x208)
[<c0209a94>] (dpm_suspend) from [<c00455ac>] (suspend_devices_and_enter+0x8c/0x3a0)
[<c00455ac>] (suspend_devices_and_enter) from [<c0045ad4>] (pm_suspend+0x214/0x2a8)
[<c0045ad4>] (pm_suspend) from [<c04b5c34>] (test_suspend+0x14c/0x1dc)
[<c04b5c34>] (test_suspend) from [<c000880c>] (do_one_initcall+0x8c/0x1fc)
[<c000880c>] (do_one_initcall) from [<c04aecfc>] (kernel_init_freeable+0xf4/0x1b4)
[<c04aecfc>] (kernel_init_freeable) from [<c0378078>] (kernel_init+0x8/0xec)
[<c0378078>] (kernel_init) from [<c0009590>] (ret_from_fork+0x14/0x24)
---[ end trace 46524156d8faa4f6 ]---
This happens because suspend function tries to disable a clock that is
already disabled by runtime_suspend callback. Add if
(!pm_runtime_suspended()) checks to suspend/resume path.
Fixes: 7d94a505858 (spi/pxa2xx: add support for runtime PM)
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Reported-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/spi/spi-pxa2xx.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 4dc7036..dc907e5 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1280,7 +1280,9 @@ static int pxa2xx_spi_suspend(struct device *dev)
if (status != 0)
return status;
write_SSCR0(0, drv_data->ioaddr);
- clk_disable_unprepare(ssp->clk);
+
+ if (!pm_runtime_suspended(dev))
+ clk_disable_unprepare(ssp->clk);
return 0;
}
@@ -1294,7 +1296,8 @@ static int pxa2xx_spi_resume(struct device *dev)
pxa2xx_spi_dma_resume(drv_data);
/* Enable the SSP clock */
- clk_prepare_enable(ssp->clk);
+ if (!pm_runtime_suspended(dev))
+ clk_prepare_enable(ssp->clk);
/* Restore LPSS private register bits */
lpss_ssp_setup(drv_data);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 041/121] sysfs: driver core: Fix glue dir race condition by gdp_mutex
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (39 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 040/121] spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 042/121] i2c: at91: don't account as iowait Kamal Mostafa
` (79 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Yijing Wang, Weng Meiling, Greg Kroah-Hartman, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Yijing Wang <wangyijing@huawei.com>
commit e4a60d139060975eb956717e4f63ae348d4d8cc5 upstream.
There is a race condition when removing glue directory.
It can be reproduced in following test:
path 1: Add first child device
device_add()
get_device_parent()
/*find parent from glue_dirs.list*/
list_for_each_entry(k, &dev->class->p->glue_dirs.list, entry)
if (k->parent == parent_kobj) {
kobj = kobject_get(k);
break;
}
....
class_dir_create_and_add()
path2: Remove last child device under glue dir
device_del()
cleanup_device_parent()
cleanup_glue_dir()
kobject_put(glue_dir);
If path2 has been called cleanup_glue_dir(), but not
call kobject_put(glue_dir), the glue dir is still
in parent's kset list. Meanwhile, path1 find the glue
dir from the glue_dirs.list. Path2 may release glue dir
before path1 call kobject_get(). So kernel will report
the warning and bug_on.
This is a "classic" problem we have of a kref in a list
that can be found while the last instance could be removed
at the same time.
This patch reuse gdp_mutex to fix this race condition.
The following calltrace is captured in kernel 3.4, but
the latest kernel still has this bug.
-----------------------------------------------------
<4>[ 3965.441471] WARNING: at ...include/linux/kref.h:41 kobject_get+0x33/0x40()
<4>[ 3965.441474] Hardware name: Romley
<4>[ 3965.441475] Modules linked in: isd_iop(O) isd_xda(O)...
...
<4>[ 3965.441605] Call Trace:
<4>[ 3965.441611] [<ffffffff8103717a>] warn_slowpath_common+0x7a/0xb0
<4>[ 3965.441615] [<ffffffff810371c5>] warn_slowpath_null+0x15/0x20
<4>[ 3965.441618] [<ffffffff81215963>] kobject_get+0x33/0x40
<4>[ 3965.441624] [<ffffffff812d1e45>] get_device_parent.isra.11+0x135/0x1f0
<4>[ 3965.441627] [<ffffffff812d22d4>] device_add+0xd4/0x6d0
<4>[ 3965.441631] [<ffffffff812d0dbc>] ? dev_set_name+0x3c/0x40
....
<2>[ 3965.441912] kernel BUG at ..../fs/sysfs/group.c:65!
<4>[ 3965.441915] invalid opcode: 0000 [#1] SMP
...
<4>[ 3965.686743] [<ffffffff811a677e>] sysfs_create_group+0xe/0x10
<4>[ 3965.686748] [<ffffffff810cfb04>] blk_trace_init_sysfs+0x14/0x20
<4>[ 3965.686753] [<ffffffff811fcabb>] blk_register_queue+0x3b/0x120
<4>[ 3965.686756] [<ffffffff812030bc>] add_disk+0x1cc/0x490
....
-------------------------------------------------------
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/base/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 67b180d..9d94c61 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -739,12 +739,12 @@ class_dir_create_and_add(struct class *class, struct kobject *parent_kobj)
return &dir->kobj;
}
+static DEFINE_MUTEX(gdp_mutex);
static struct kobject *get_device_parent(struct device *dev,
struct device *parent)
{
if (dev->class) {
- static DEFINE_MUTEX(gdp_mutex);
struct kobject *kobj = NULL;
struct kobject *parent_kobj;
struct kobject *k;
@@ -808,7 +808,9 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
glue_dir->kset != &dev->class->p->glue_dirs)
return;
+ mutex_lock(&gdp_mutex);
kobject_put(glue_dir);
+ mutex_unlock(&gdp_mutex);
}
static void cleanup_device_parent(struct device *dev)
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 042/121] i2c: at91: don't account as iowait
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (40 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 041/121] sysfs: driver core: Fix glue dir race condition by gdp_mutex Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 043/121] nfsd: don't try to reuse an expired DRC entry off the list Kamal Mostafa
` (78 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Wolfram Sang, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Wolfram Sang <wsa@the-dreams.de>
commit 11cfbfb098b22d3e57f1f2be217cad20e2d48463 upstream.
iowait is for blkio [1]. I2C shouldn't use it.
[1] https://lkml.org/lkml/2014/11/3/317
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/i2c/busses/i2c-at91.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index a10632e..50fea6c 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -434,7 +434,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
}
}
- ret = wait_for_completion_io_timeout(&dev->cmd_complete,
+ ret = wait_for_completion_timeout(&dev->cmd_complete,
dev->adapter.timeout);
if (ret == 0) {
dev_err(dev->dev, "controller timed out\n");
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 043/121] nfsd: don't try to reuse an expired DRC entry off the list
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (41 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 042/121] i2c: at91: don't account as iowait Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 044/121] nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry Kamal Mostafa
` (77 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jeff Layton, J. Bruce Fields, Joseph Salisbury, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit a0ef5e19684f0447da9ff0654a12019c484f57ca upstream.
Currently when we are processing a request, we try to scrape an expired
or over-limit entry off the list in preference to allocating a new one
from the slab.
This is unnecessarily complicated. Just use the slab layer.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Cc: Joseph Salisbury <joseph.salisbury@canonical.com>
Reference: http://bugs.launchpad.net/bugs/1396065
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfsd/nfscache.c | 36 ++++--------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index b6af150..f8f060f 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -132,13 +132,6 @@ nfsd_reply_cache_alloc(void)
}
static void
-nfsd_reply_cache_unhash(struct svc_cacherep *rp)
-{
- hlist_del_init(&rp->c_hash);
- list_del_init(&rp->c_lru);
-}
-
-static void
nfsd_reply_cache_free_locked(struct svc_cacherep *rp)
{
if (rp->c_type == RC_REPLBUFF && rp->c_replvec.iov_base) {
@@ -416,22 +409,8 @@ nfsd_cache_lookup(struct svc_rqst *rqstp)
/*
* Since the common case is a cache miss followed by an insert,
- * preallocate an entry. First, try to reuse the first entry on the LRU
- * if it works, then go ahead and prune the LRU list.
+ * preallocate an entry.
*/
- spin_lock(&cache_lock);
- if (!list_empty(&lru_head)) {
- rp = list_first_entry(&lru_head, struct svc_cacherep, c_lru);
- if (nfsd_cache_entry_expired(rp) ||
- num_drc_entries >= max_drc_entries) {
- nfsd_reply_cache_unhash(rp);
- prune_cache_entries();
- goto search_cache;
- }
- }
-
- /* No expired ones available, allocate a new one. */
- spin_unlock(&cache_lock);
rp = nfsd_reply_cache_alloc();
spin_lock(&cache_lock);
if (likely(rp)) {
@@ -439,7 +418,9 @@ nfsd_cache_lookup(struct svc_rqst *rqstp)
drc_mem_usage += sizeof(*rp);
}
-search_cache:
+ /* go ahead and prune the cache */
+ prune_cache_entries();
+
found = nfsd_cache_search(rqstp, csum);
if (found) {
if (likely(rp))
@@ -453,15 +434,6 @@ search_cache:
goto out;
}
- /*
- * We're keeping the one we just allocated. Are we now over the
- * limit? Prune one off the tip of the LRU in trade for the one we
- * just allocated if so.
- */
- if (num_drc_entries >= max_drc_entries)
- nfsd_reply_cache_free_locked(list_first_entry(&lru_head,
- struct svc_cacherep, c_lru));
-
nfsdstats.rcmisses++;
rqstp->rq_cacherep = rp;
rp->c_state = RC_INPROG;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 044/121] nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (42 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 043/121] nfsd: don't try to reuse an expired DRC entry off the list Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 045/121] dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks Kamal Mostafa
` (76 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jeff Layton, J. Bruce Fields, Joseph Salisbury, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@primarydata.com>
commit 1b19453d1c6abcfa7c312ba6c9f11a277568fc94 upstream.
Currently, the DRC cache pruner will stop scanning the list when it
hits an entry that is RC_INPROG. It's possible however for a call to
take a *very* long time. In that case, we don't want it to block other
entries from being pruned if they are expired or we need to trim the
cache to get back under the limit.
Fix the DRC cache pruner to just ignore RC_INPROG entries.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Cc: Joseph Salisbury <joseph.salisbury@canonical.com>
Reference: http://bugs.launchpad.net/bugs/1396065
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfsd/nfscache.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index f8f060f..6040da8 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -224,13 +224,6 @@ hash_refile(struct svc_cacherep *rp)
hlist_add_head(&rp->c_hash, cache_hash + hash_32(rp->c_xid, maskbits));
}
-static inline bool
-nfsd_cache_entry_expired(struct svc_cacherep *rp)
-{
- return rp->c_state != RC_INPROG &&
- time_after(jiffies, rp->c_timestamp + RC_EXPIRE);
-}
-
/*
* Walk the LRU list and prune off entries that are older than RC_EXPIRE.
* Also prune the oldest ones when the total exceeds the max number of entries.
@@ -242,8 +235,14 @@ prune_cache_entries(void)
long freed = 0;
list_for_each_entry_safe(rp, tmp, &lru_head, c_lru) {
- if (!nfsd_cache_entry_expired(rp) &&
- num_drc_entries <= max_drc_entries)
+ /*
+ * Don't free entries attached to calls that are still
+ * in-progress, but do keep scanning the list.
+ */
+ if (rp->c_state == RC_INPROG)
+ continue;
+ if (num_drc_entries <= max_drc_entries &&
+ time_before(jiffies, rp->c_timestamp + RC_EXPIRE))
break;
nfsd_reply_cache_free_locked(rp);
freed++;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 045/121] dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (43 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 044/121] nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 046/121] xtensa: re-wire umount syscall to sys_oldumount Kamal Mostafa
` (75 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mikulas Patocka, Mike Snitzer, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 9d28eb12447ee08bb5d1e8bb3195cf20e1ecd1c0 upstream.
The shrinker uses gfp flags to indicate what kind of operation can the
driver wait for. If __GFP_IO flag is present, the driver can wait for
block I/O operations, if __GFP_FS flag is present, the driver can wait on
operations involving the filesystem.
dm-bufio tested for __GFP_IO. However, dm-bufio can run on a loop block
device that makes calls into the filesystem. If __GFP_IO is present and
__GFP_FS isn't, dm-bufio could still block on filesystem operations if it
runs on a loop block device.
The change from __GFP_IO to __GFP_FS supposedly fixes one observed (though
unreproducible) deadlock involving dm-bufio and loop device.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-bufio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index a42efc7..140be2d 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1418,9 +1418,9 @@ static void drop_buffers(struct dm_bufio_client *c)
/*
* Test if the buffer is unused and too old, and commit it.
- * At if noio is set, we must not do any I/O because we hold
- * dm_bufio_clients_lock and we would risk deadlock if the I/O gets rerouted to
- * different bufio client.
+ * And if GFP_NOFS is used, we must not do any I/O because we hold
+ * dm_bufio_clients_lock and we would risk deadlock if the I/O gets
+ * rerouted to different bufio client.
*/
static int __cleanup_old_buffer(struct dm_buffer *b, gfp_t gfp,
unsigned long max_jiffies)
@@ -1428,7 +1428,7 @@ static int __cleanup_old_buffer(struct dm_buffer *b, gfp_t gfp,
if (jiffies - b->last_accessed < max_jiffies)
return 0;
- if (!(gfp & __GFP_IO)) {
+ if (!(gfp & __GFP_FS)) {
if (test_bit(B_READING, &b->state) ||
test_bit(B_WRITING, &b->state) ||
test_bit(B_DIRTY, &b->state))
@@ -1470,7 +1470,7 @@ dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
unsigned long freed;
c = container_of(shrink, struct dm_bufio_client, shrinker);
- if (sc->gfp_mask & __GFP_IO)
+ if (sc->gfp_mask & __GFP_FS)
dm_bufio_lock(c);
else if (!dm_bufio_trylock(c))
return SHRINK_STOP;
@@ -1487,7 +1487,7 @@ dm_bufio_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
unsigned long count;
c = container_of(shrink, struct dm_bufio_client, shrinker);
- if (sc->gfp_mask & __GFP_IO)
+ if (sc->gfp_mask & __GFP_FS)
dm_bufio_lock(c);
else if (!dm_bufio_trylock(c))
return 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 046/121] xtensa: re-wire umount syscall to sys_oldumount
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (44 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 045/121] dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 047/121] dm raid: ensure superblock's size matches device's logical block size Kamal Mostafa
` (74 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Max Filippov, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Filippov <jcmvbkbc@gmail.com>
commit 2651cc6974d47fc43bef1cd8cd26966e4f5ba306 upstream.
Userspace actually passes single parameter (path name) to the umount
syscall, so new umount just fails. Fix it by requesting old umount
syscall implementation and re-wiring umount to it.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/xtensa/include/uapi/asm/unistd.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h
index 51940fe..513effd 100644
--- a/arch/xtensa/include/uapi/asm/unistd.h
+++ b/arch/xtensa/include/uapi/asm/unistd.h
@@ -384,7 +384,8 @@ __SYSCALL(174, sys_chroot, 1)
#define __NR_pivot_root 175
__SYSCALL(175, sys_pivot_root, 2)
#define __NR_umount 176
-__SYSCALL(176, sys_umount, 2)
+__SYSCALL(176, sys_oldumount, 1)
+#define __ARCH_WANT_SYS_OLDUMOUNT
#define __NR_swapoff 177
__SYSCALL(177, sys_swapoff, 1)
#define __NR_sync 178
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 047/121] dm raid: ensure superblock's size matches device's logical block size
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (45 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 046/121] xtensa: re-wire umount syscall to sys_oldumount Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 048/121] ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks Kamal Mostafa
` (73 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Heinz Mauelshagen, Dan Carpenter, Mike Snitzer, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Heinz Mauelshagen <heinzm@redhat.com>
commit 40d43c4b4cac4c2647bf07110d7b07d35f399a84 upstream.
The dm-raid superblock (struct dm_raid_superblock) is padded to 512
bytes and that size is being used to read it in from the metadata
device into one preallocated page.
Reading or writing this on a 512-byte sector device works fine but on
a 4096-byte sector device this fails.
Set the dm-raid superblock's size to the logical block size of the
metadata device, because IO at that size is guaranteed too work. Also
add a size check to avoid silent partial metadata loss in case the
superblock should ever grow past the logical block size or PAGE_SIZE.
[includes pointer math fix from Dan Carpenter]
Reported-by: "Liuhua Wang" <lwang@suse.com>
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-raid.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 4880b69..5971538 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -785,8 +785,7 @@ struct dm_raid_superblock {
__le32 layout;
__le32 stripe_sectors;
- __u8 pad[452]; /* Round struct to 512 bytes. */
- /* Always set to 0 when writing. */
+ /* Remainder of a logical block is zero-filled when writing (see super_sync()). */
} __packed;
static int read_disk_sb(struct md_rdev *rdev, int size)
@@ -823,7 +822,7 @@ static void super_sync(struct mddev *mddev, struct md_rdev *rdev)
test_bit(Faulty, &(rs->dev[i].rdev.flags)))
failed_devices |= (1ULL << i);
- memset(sb, 0, sizeof(*sb));
+ memset(sb + 1, 0, rdev->sb_size - sizeof(*sb));
sb->magic = cpu_to_le32(DM_RAID_MAGIC);
sb->features = cpu_to_le32(0); /* No features yet */
@@ -858,7 +857,11 @@ static int super_load(struct md_rdev *rdev, struct md_rdev *refdev)
uint64_t events_sb, events_refsb;
rdev->sb_start = 0;
- rdev->sb_size = sizeof(*sb);
+ rdev->sb_size = bdev_logical_block_size(rdev->meta_bdev);
+ if (rdev->sb_size < sizeof(*sb) || rdev->sb_size > PAGE_SIZE) {
+ DMERR("superblock size of a logical block is no longer valid");
+ return -EINVAL;
+ }
ret = read_disk_sb(rdev, rdev->sb_size);
if (ret)
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 048/121] ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (46 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 047/121] dm raid: ensure superblock's size matches device's logical block size Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 049/121] ahci: Add Device IDs for Intel Sunrise Point PCH Kamal Mostafa
` (72 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Tejun Heo, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 66a7cbc303f4d28f201529b06061944d51ab530c upstream.
Samsung pci-e SSDs on macbooks failed miserably on NCQ commands, so
67809f85d31e ("ahci: disable NCQ on Samsung pci-e SSDs on macbooks")
disabled NCQ on them. It turns out that NCQ is fine as long as MSI is
not used, so let's turn off MSI and leave NCQ on.
Signed-off-by: Tejun Heo <tj@kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=60731
Tested-by: <dorin@i51.org>
Tested-by: Imre Kaloz <kaloz@openwrt.org>
Fixes: 67809f85d31e ("ahci: disable NCQ on Samsung pci-e SSDs on macbooks")
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/ata/ahci.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index e455090..b942b1e 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -61,6 +61,7 @@ enum board_ids {
/* board IDs by feature in alphabetical order */
board_ahci,
board_ahci_ign_iferr,
+ board_ahci_nomsi,
board_ahci_noncq,
board_ahci_nosntf,
board_ahci_yes_fbs,
@@ -120,6 +121,13 @@ static const struct ata_port_info ahci_port_info[] = {
.udma_mask = ATA_UDMA6,
.port_ops = &ahci_ops,
},
+ [board_ahci_nomsi] = {
+ AHCI_HFLAGS (AHCI_HFLAG_NO_MSI),
+ .flags = AHCI_FLAG_COMMON,
+ .pio_mask = ATA_PIO4,
+ .udma_mask = ATA_UDMA6,
+ .port_ops = &ahci_ops,
+ },
[board_ahci_noncq] = {
AHCI_HFLAGS (AHCI_HFLAG_NO_NCQ),
.flags = AHCI_FLAG_COMMON,
@@ -474,10 +482,10 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */
/*
- * Samsung SSDs found on some macbooks. NCQ times out.
- * https://bugzilla.kernel.org/show_bug.cgi?id=60731
+ * Samsung SSDs found on some macbooks. NCQ times out if MSI is
+ * enabled. https://bugzilla.kernel.org/show_bug.cgi?id=60731
*/
- { PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_noncq },
+ { PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_nomsi },
/* Enmotus */
{ PCI_DEVICE(0x1c44, 0x8000), board_ahci },
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 049/121] ahci: Add Device IDs for Intel Sunrise Point PCH
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (47 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 048/121] ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 050/121] power: charger-manager: Fix accessing invalidated power supply after charger unbind Kamal Mostafa
` (71 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: James Ralston, Tejun Heo, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: James Ralston <james.d.ralston@intel.com>
commit 690000b930456a98663567d35dd5c54b688d1e3f upstream.
This patch adds the AHCI-mode SATA Device IDs for the Intel Sunrise Point PCH.
Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/ata/ahci.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index b942b1e..12fc8d7 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -320,6 +320,11 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series RAID */
{ PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */
{ PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series RAID */
+ { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */
+ { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */
+ { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
+ { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */
+ { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 050/121] power: charger-manager: Fix accessing invalidated power supply after charger unbind
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (48 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 049/121] ahci: Add Device IDs for Intel Sunrise Point PCH Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 051/121] mac80211: use secondary channel offset IE also beacons during CSA Kamal Mostafa
` (70 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Krzysztof Kozlowski, Sebastian Reichel, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
commit cdaf3e15385d3232b52287e50692506f8fd01a09 upstream.
The charger manager obtained in probe references to power supplies for
all chargers with power_supply_get_by_name() for later usage. However
if such charger driver was removed then this reference would point to
old power supply (from driver which was removed).
This lead to accessing invalid memory which could be observed with:
$ echo "max77693-charger" > /sys/bus/platform/drivers/max77693-charger/unbind
$ grep . /sys/devices/virtual/power_supply/battery/charger.0/*
$ grep . /sys/devices/virtual/power_supply/battery/*
[ 15.339817] Unable to handle kernel paging request at virtual address 0001c12c
[ 15.346187] pgd = edd08000
[ 15.348814] [0001c12c] *pgd=6dce2831, *pte=00000000, *ppte=00000000
[ 15.355075] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM
[ 15.360967] Modules linked in:
[ 15.364010] CPU: 2 PID: 1388 Comm: grep Not tainted 3.17.0-next-20141007-00027-ga95e761db1b0 #245
[ 15.372859] task: ee03ad00 ti: edcf6000 task.ti: edcf6000
[ 15.378241] PC is at 0x1c12c
[ 15.381113] LR is at is_ext_pwr_online+0x30/0x6c
[ 15.385706] pc : [<0001c12c>] lr : [<c0339fc4>] psr: a0000013
[ 15.385706] sp : edcf7e88 ip : 00000000 fp : 00000000
[ 15.397161] r10: eeb02c08 r9 : c04b1f84 r8 : eeb02c00
[ 15.402369] r7 : edc69a10 r6 : eea6ac10 r5 : eea6ac10 r4 : 00000004
[ 15.408878] r3 : 0001c12c r2 : edcf7e8c r1 : 00000004 r0 : ee914418
[ 15.415390] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 15.422506] Control: 10c5387d Table: 6dd0804a DAC: 00000015
[ 15.428236] Process grep (pid: 1388, stack limit = 0xedcf6240)
[ 15.434050] Stack: (0xedcf7e88 to 0xedcf8000)
[ 15.438395] 7e80: ee03ad00 00000000 edcf7f80 eea6aca8 edcf7ec4 c033b7b0
[ 15.446554] 7ea0: 00000001 ee1cc3f0 00000004 c06e1e44 eebdc000 c06e1e44 eeb02c00 c0337144
[ 15.454713] 7ec0: ee2dac68 c005cffc ee1cc3c0 c06e1e44 00000fff 00001000 eebdc000 c0278ca8
[ 15.462872] 7ee0: c0278c8c ee1cc3c0 eeb7ce00 c014422c edcf7f20 00008000 ee1cc3c0 ee9a48c0
[ 15.471030] 7f00: 00000001 00000001 edcf7f80 c0142d94 c0142d70 c01060f4 00021000 ee1cc3f0
[ 15.479190] 7f20: 00000000 00000000 c06a2150 eebdc000 2e7ec000 ee9a48c0 00008000 00021000
[ 15.487349] 7f40: edcf7f80 00008000 edcf6000 00021000 00021000 c00e39a4 00000000 ee9a48c0
[ 15.495508] 7f60: 00004000 00000000 00000000 ee9a48c0 ee9a48c0 00008000 00021000 c00e3aa0
[ 15.503668] 7f80: 00000000 00000000 0001f2e0 0001f2e0 00021000 00001000 00000003 c000f364
[ 15.511826] 7fa0: 00000000 c000f1a0 0001f2e0 00021000 00000003 00021000 00008000 00000000
[ 15.519986] 7fc0: 0001f2e0 00021000 00001000 00000003 00000001 000205e8 00000000 00021000
[ 15.528145] 7fe0: 00008000 bebbe910 0000a7ad b6edc49c 60000010 00000003 aaaaaaaa aaaaaaaa
[ 15.536320] [<c0339fc4>] (is_ext_pwr_online) from [<c033b7b0>] (charger_get_property+0x170/0x314)
[ 15.545164] [<c033b7b0>] (charger_get_property) from [<c0337144>] (power_supply_show_property+0x48/0x20c)
[ 15.554719] [<c0337144>] (power_supply_show_property) from [<c0278ca8>] (dev_attr_show+0x1c/0x48)
[ 15.563577] [<c0278ca8>] (dev_attr_show) from [<c014422c>] (sysfs_kf_seq_show+0x84/0x104)
[ 15.571725] [<c014422c>] (sysfs_kf_seq_show) from [<c0142d94>] (kernfs_seq_show+0x24/0x28)
[ 15.579973] [<c0142d94>] (kernfs_seq_show) from [<c01060f4>] (seq_read+0x1b0/0x484)
[ 15.587614] [<c01060f4>] (seq_read) from [<c00e39a4>] (vfs_read+0x88/0x144)
[ 15.594552] [<c00e39a4>] (vfs_read) from [<c00e3aa0>] (SyS_read+0x40/0x8c)
[ 15.601417] [<c00e3aa0>] (SyS_read) from [<c000f1a0>] (ret_fast_syscall+0x0/0x48)
[ 15.608877] Code: bad PC value
[ 15.611991] ---[ end trace a88fcc95208db283 ]---
The charger-manager should get reference to charger power supply on
each use of get_property callback.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 3bb3dbbd56ea ("power_supply: Add initial Charger-Manager driver")
Signed-off-by: Sebastian Reichel <sre@kernel.org>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/power/charger-manager.c | 65 +++++++++++++++++++++--------------
include/linux/power/charger-manager.h | 1 -
2 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
index 897aea6..760d03a 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -86,6 +86,7 @@ static struct charger_global_desc *g_desc; /* init with setup_charger_manager */
static bool is_batt_present(struct charger_manager *cm)
{
union power_supply_propval val;
+ struct power_supply *psy;
bool present = false;
int i, ret;
@@ -102,10 +103,17 @@ static bool is_batt_present(struct charger_manager *cm)
present = true;
break;
case CM_CHARGER_STAT:
- for (i = 0; cm->charger_stat[i]; i++) {
- ret = cm->charger_stat[i]->get_property(
- cm->charger_stat[i],
- POWER_SUPPLY_PROP_PRESENT, &val);
+ for (i = 0; cm->desc->psy_charger_stat[i]; i++) {
+ psy = power_supply_get_by_name(
+ cm->desc->psy_charger_stat[i]);
+ if (!psy) {
+ dev_err(cm->dev, "Cannot find power supply \"%s\"\n",
+ cm->desc->psy_charger_stat[i]);
+ continue;
+ }
+
+ ret = psy->get_property(psy, POWER_SUPPLY_PROP_PRESENT,
+ &val);
if (ret == 0 && val.intval) {
present = true;
break;
@@ -128,14 +136,20 @@ static bool is_batt_present(struct charger_manager *cm)
static bool is_ext_pwr_online(struct charger_manager *cm)
{
union power_supply_propval val;
+ struct power_supply *psy;
bool online = false;
int i, ret;
/* If at least one of them has one, it's yes. */
- for (i = 0; cm->charger_stat[i]; i++) {
- ret = cm->charger_stat[i]->get_property(
- cm->charger_stat[i],
- POWER_SUPPLY_PROP_ONLINE, &val);
+ for (i = 0; cm->desc->psy_charger_stat[i]; i++) {
+ psy = power_supply_get_by_name(cm->desc->psy_charger_stat[i]);
+ if (!psy) {
+ dev_err(cm->dev, "Cannot find power supply \"%s\"\n",
+ cm->desc->psy_charger_stat[i]);
+ continue;
+ }
+
+ ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val);
if (ret == 0 && val.intval) {
online = true;
break;
@@ -178,6 +192,7 @@ static bool is_charging(struct charger_manager *cm)
{
int i, ret;
bool charging = false;
+ struct power_supply *psy;
union power_supply_propval val;
/* If there is no battery, it cannot be charged */
@@ -185,17 +200,22 @@ static bool is_charging(struct charger_manager *cm)
return false;
/* If at least one of the charger is charging, return yes */
- for (i = 0; cm->charger_stat[i]; i++) {
+ for (i = 0; cm->desc->psy_charger_stat[i]; i++) {
/* 1. The charger sholuld not be DISABLED */
if (cm->emergency_stop)
continue;
if (!cm->charger_enabled)
continue;
+ psy = power_supply_get_by_name(cm->desc->psy_charger_stat[i]);
+ if (!psy) {
+ dev_err(cm->dev, "Cannot find power supply \"%s\"\n",
+ cm->desc->psy_charger_stat[i]);
+ continue;
+ }
+
/* 2. The charger should be online (ext-power) */
- ret = cm->charger_stat[i]->get_property(
- cm->charger_stat[i],
- POWER_SUPPLY_PROP_ONLINE, &val);
+ ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val);
if (ret) {
dev_warn(cm->dev, "Cannot read ONLINE value from %s\n",
cm->desc->psy_charger_stat[i]);
@@ -208,9 +228,7 @@ static bool is_charging(struct charger_manager *cm)
* 3. The charger should not be FULL, DISCHARGING,
* or NOT_CHARGING.
*/
- ret = cm->charger_stat[i]->get_property(
- cm->charger_stat[i],
- POWER_SUPPLY_PROP_STATUS, &val);
+ ret = psy->get_property(psy, POWER_SUPPLY_PROP_STATUS, &val);
if (ret) {
dev_warn(cm->dev, "Cannot read STATUS value from %s\n",
cm->desc->psy_charger_stat[i]);
@@ -1510,15 +1528,12 @@ static int charger_manager_probe(struct platform_device *pdev)
while (desc->psy_charger_stat[i])
i++;
- cm->charger_stat = devm_kzalloc(&pdev->dev,
- sizeof(struct power_supply *) * i, GFP_KERNEL);
- if (!cm->charger_stat)
- return -ENOMEM;
-
+ /* Check if charger's supplies are present at probe */
for (i = 0; desc->psy_charger_stat[i]; i++) {
- cm->charger_stat[i] = power_supply_get_by_name(
- desc->psy_charger_stat[i]);
- if (!cm->charger_stat[i]) {
+ struct power_supply *psy;
+
+ psy = power_supply_get_by_name(desc->psy_charger_stat[i]);
+ if (!psy) {
dev_err(&pdev->dev, "Cannot find power supply \"%s\"\n",
desc->psy_charger_stat[i]);
return -ENODEV;
@@ -1848,8 +1863,8 @@ static bool find_power_supply(struct charger_manager *cm,
int i;
bool found = false;
- for (i = 0; cm->charger_stat[i]; i++) {
- if (psy == cm->charger_stat[i]) {
+ for (i = 0; cm->desc->psy_charger_stat[i]; i++) {
+ if (!strcmp(psy->name, cm->desc->psy_charger_stat[i])) {
found = true;
break;
}
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index 0e86840..89645b3 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -248,7 +248,6 @@ struct charger_manager {
struct charger_desc *desc;
struct power_supply *fuel_gauge;
- struct power_supply **charger_stat;
bool charger_enabled;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 051/121] mac80211: use secondary channel offset IE also beacons during CSA
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (49 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 050/121] power: charger-manager: Fix accessing invalidated power supply after charger unbind Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 052/121] mac80211: schedule the actual switch of the station before CSA count 0 Kamal Mostafa
` (69 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Luciano Coelho, Johannes Berg, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Luciano Coelho <luciano.coelho@intel.com>
commit 84469a45a1bedec9918e94ab2f78c5dc0739e4a7 upstream.
If we are switching from an HT40+ to an HT40- channel (or vice-versa),
we need the secondary channel offset IE to specify what is the
post-CSA offset to be used. This applies both to beacons and to probe
responses.
In ieee80211_parse_ch_switch_ie() we were ignoring this IE from
beacons and using the *current* HT information IE instead. This was
causing us to use the same offset as before the switch.
Fix that by using the secondary channel offset IE also for beacons and
don't ever use the pre-switch offset. Additionally, remove the
"beacon" argument from ieee80211_parse_ch_switch_ie(), since it's not
needed anymore.
Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/ibss.c | 2 +-
net/mac80211/ieee80211_i.h | 3 +--
net/mac80211/mesh.c | 2 +-
net/mac80211/mlme.c | 2 +-
net/mac80211/spectmgmt.c | 18 ++++++------------
5 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 3727941..57ac06f 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -809,7 +809,7 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
memset(¶ms, 0, sizeof(params));
memset(&csa_ie, 0, sizeof(csa_ie));
- err = ieee80211_parse_ch_switch_ie(sdata, elems, beacon,
+ err = ieee80211_parse_ch_switch_ie(sdata, elems,
ifibss->chandef.chan->band,
sta_flags, ifibss->bssid, &csa_ie);
/* can't switch to destination channel, fail */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 980d863..c0bb6e4 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1527,7 +1527,6 @@ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
* ieee80211_parse_ch_switch_ie - parses channel switch IEs
* @sdata: the sdata of the interface which has received the frame
* @elems: parsed 802.11 elements received with the frame
- * @beacon: indicates if the frame was a beacon or probe response
* @current_band: indicates the current band
* @sta_flags: contains information about own capabilities and restrictions
* to decide which channel switch announcements can be accepted. Only the
@@ -1541,7 +1540,7 @@ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
* Return: 0 on success, <0 on error and >0 if there is nothing to parse.
*/
int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
- struct ieee802_11_elems *elems, bool beacon,
+ struct ieee802_11_elems *elems,
enum ieee80211_band current_band,
u32 sta_flags, u8 *bssid,
struct ieee80211_csa_ie *csa_ie);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index ba10525..5b2c192 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -882,7 +882,7 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
memset(¶ms, 0, sizeof(params));
memset(&csa_ie, 0, sizeof(csa_ie));
- err = ieee80211_parse_ch_switch_ie(sdata, elems, beacon, band,
+ err = ieee80211_parse_ch_switch_ie(sdata, elems, band,
sta_flags, sdata->vif.addr,
&csa_ie);
if (err < 0)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 6c126fc..d8824f9 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -998,7 +998,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
current_band = cbss->channel->band;
memset(&csa_ie, 0, sizeof(csa_ie));
- res = ieee80211_parse_ch_switch_ie(sdata, elems, beacon, current_band,
+ res = ieee80211_parse_ch_switch_ie(sdata, elems, current_band,
ifmgd->flags,
ifmgd->associated->bssid, &csa_ie);
if (res < 0)
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index 6ab0090..efeba56 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -22,7 +22,7 @@
#include "wme.h"
int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
- struct ieee802_11_elems *elems, bool beacon,
+ struct ieee802_11_elems *elems,
enum ieee80211_band current_band,
u32 sta_flags, u8 *bssid,
struct ieee80211_csa_ie *csa_ie)
@@ -91,19 +91,13 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
return -EINVAL;
}
- if (!beacon && sec_chan_offs) {
+ if (sec_chan_offs) {
secondary_channel_offset = sec_chan_offs->sec_chan_offs;
- } else if (beacon && ht_oper) {
- secondary_channel_offset =
- ht_oper->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET;
} else if (!(sta_flags & IEEE80211_STA_DISABLE_HT)) {
- /* If it's not a beacon, HT is enabled and the IE not present,
- * it's 20 MHz, 802.11-2012 8.5.2.6:
- * This element [the Secondary Channel Offset Element] is
- * present when switching to a 40 MHz channel. It may be
- * present when switching to a 20 MHz channel (in which
- * case the secondary channel offset is set to SCN).
- */
+ /* If the secondary channel offset IE is not present,
+ * we can't know what's the post-CSA offset, so the
+ * best we can do is use 20MHz.
+ */
secondary_channel_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 052/121] mac80211: schedule the actual switch of the station before CSA count 0
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (50 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 051/121] mac80211: use secondary channel offset IE also beacons during CSA Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 053/121] mac80211: properly flush delayed scan work on interface removal Kamal Mostafa
` (68 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Luciano Coelho, Johannes Berg, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Luciano Coelho <luciano.coelho@intel.com>
commit ff1e417c7c239b7abfe70aa90460a77eaafc7f83 upstream.
Due to the time it takes to process the beacon that started the CSA
process, we may be late for the switch if we try to reach exactly
beacon 0. To avoid that, use count - 1 when calculating the switch time.
Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/mlme.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d8824f9..0c32180 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1083,7 +1083,8 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
ieee80211_queue_work(&local->hw, &ifmgd->chswitch_work);
else
mod_timer(&ifmgd->chswitch_timer,
- TU_TO_EXP_TIME(csa_ie.count * cbss->beacon_interval));
+ TU_TO_EXP_TIME((csa_ie.count - 1) *
+ cbss->beacon_interval));
}
static u32 ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 053/121] mac80211: properly flush delayed scan work on interface removal
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (51 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 052/121] mac80211: schedule the actual switch of the station before CSA count 0 Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 054/121] mac80211: fix use-after-free in defragmentation Kamal Mostafa
` (67 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johannes Berg, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes@sipsolutions.net>
commit 46238845bd609a5c0fbe076e1b82b4c5b33360b2 upstream.
When an interface is deleted, an ongoing hardware scan is canceled and
the driver must abort the scan, at the very least reporting completion
while the interface is removed.
However, if it scheduled the work that might only run after everything
is said and done, which leads to cfg80211 warning that the scan isn't
reported as finished yet; this is no fault of the driver, it already
did, but mac80211 hasn't processed it.
To fix this situation, flush the delayed work when the interface being
removed is the one that was executing the scan.
Reported-by: Sujith Manoharan <sujith@msujith.org>
Tested-by: Sujith Manoharan <sujith@msujith.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/iface.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 822d508..e6d592d 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -749,10 +749,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
u32 hw_reconf_flags = 0;
int i, flushed;
struct ps_data *ps;
+ bool cancel_scan;
clear_bit(SDATA_STATE_RUNNING, &sdata->state);
- if (rcu_access_pointer(local->scan_sdata) == sdata)
+ cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata;
+ if (cancel_scan)
ieee80211_scan_cancel(local);
/*
@@ -963,6 +965,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
ieee80211_recalc_ps(local, -1);
+ if (cancel_scan)
+ flush_delayed_work(&local->scan_work);
+
if (local->open_count == 0) {
ieee80211_stop_device(local);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 054/121] mac80211: fix use-after-free in defragmentation
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (52 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 053/121] mac80211: properly flush delayed scan work on interface removal Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 055/121] tun: Fix csum_start with VLAN acceleration Kamal Mostafa
` (66 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johannes Berg, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
commit b8fff407a180286aa683d543d878d98d9fc57b13 upstream.
Upon receiving the last fragment, all but the first fragment
are freed, but the multicast check for statistics at the end
of the function refers to the current skb (the last fragment)
causing a use-after-free bug.
Since multicast frames cannot be fragmented and we check for
this early in the function, just modify that check to also
do the accounting to fix the issue.
Reported-by: Yosef Khyal <yosefx.khyal@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/rx.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 2b0debb..7b9e78a 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1647,11 +1647,14 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
sc = le16_to_cpu(hdr->seq_ctrl);
frag = sc & IEEE80211_SCTL_FRAG;
- if (likely((!ieee80211_has_morefrags(fc) && frag == 0) ||
- is_multicast_ether_addr(hdr->addr1))) {
- /* not fragmented */
+ if (likely(!ieee80211_has_morefrags(fc) && frag == 0))
+ goto out;
+
+ if (is_multicast_ether_addr(hdr->addr1)) {
+ rx->local->dot11MulticastReceivedFrameCount++;
goto out;
}
+
I802_DEBUG_INC(rx->local->rx_handlers_fragments);
if (skb_linearize(rx->skb))
@@ -1744,10 +1747,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
out:
if (rx->sta)
rx->sta->rx_packets++;
- if (is_multicast_ether_addr(hdr->addr1))
- rx->local->dot11MulticastReceivedFrameCount++;
- else
- ieee80211_led_rx(rx->local);
+ ieee80211_led_rx(rx->local);
return RX_CONTINUE;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 055/121] tun: Fix csum_start with VLAN acceleration
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (53 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 054/121] mac80211: fix use-after-free in defragmentation Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 056/121] macvtap: Fix csum_start when VLAN tags are present Kamal Mostafa
` (65 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Herbert Xu, David S. Miller, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit a8f9bfdf982e2b1fb9f094e4de9ab08c57f3d2fd upstream.
When VLAN acceleration is in use on the xmit path, we end up
setting csum_start to the wrong place. The result is that the
whoever ends up doing the checksum setting will corrupt the packet
instead of writing the checksum to the expected location, usually
this means writing the checksum with an offset of -4.
This patch fixes this by adjusting csum_start when VLAN acceleration
is detected.
Fixes: 6680ec68eff4 ("tuntap: hardware vlan tx support")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/tun.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 55c9238..d0460a3 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1186,6 +1186,10 @@ static ssize_t tun_put_user(struct tun_struct *tun,
struct tun_pi pi = { 0, skb->protocol };
ssize_t total = 0;
int vlan_offset = 0, copied;
+ int vlan_hlen = 0;
+
+ if (vlan_tx_tag_present(skb))
+ vlan_hlen = VLAN_HLEN;
if (!(tun->flags & TUN_NO_PI)) {
if ((len -= sizeof(pi)) < 0)
@@ -1237,7 +1241,8 @@ static ssize_t tun_put_user(struct tun_struct *tun,
if (skb->ip_summed == CHECKSUM_PARTIAL) {
gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
- gso.csum_start = skb_checksum_start_offset(skb);
+ gso.csum_start = skb_checksum_start_offset(skb) +
+ vlan_hlen;
gso.csum_offset = skb->csum_offset;
} else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
gso.flags = VIRTIO_NET_HDR_F_DATA_VALID;
@@ -1250,10 +1255,9 @@ static ssize_t tun_put_user(struct tun_struct *tun,
}
copied = total;
- total += skb->len;
- if (!vlan_tx_tag_present(skb)) {
- len = min_t(int, skb->len, len);
- } else {
+ len = min_t(int, skb->len + vlan_hlen, len);
+ total += skb->len + vlan_hlen;
+ if (vlan_hlen) {
int copy, ret;
struct {
__be16 h_vlan_proto;
@@ -1264,8 +1268,6 @@ static ssize_t tun_put_user(struct tun_struct *tun,
veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb));
vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto);
- len = min_t(int, skb->len + VLAN_HLEN, len);
- total += VLAN_HLEN;
copy = min_t(int, vlan_offset, len);
ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 056/121] macvtap: Fix csum_start when VLAN tags are present
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (54 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 055/121] tun: Fix csum_start with VLAN acceleration Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 057/121] dm thin: grab a virtual cell before looking up the mapping Kamal Mostafa
` (64 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Herbert Xu, David S. Miller, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 3ce9b20f1971690b8b3b620e735ec99431573b39 upstream.
When VLAN is in use in macvtap_put_user, we end up setting
csum_start to the wrong place. The result is that the whoever
ends up doing the checksum setting will corrupt the packet instead
of writing the checksum to the expected location, usually this
means writing the checksum with an offset of -4.
This patch fixes this by adjusting csum_start when VLAN tags are
detected.
Fixes: f09e2249c4f5 ("macvtap: restore vlan header on user read")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/macvtap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index eed7544..ffe8fa4 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -622,6 +622,8 @@ static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
if (skb->ip_summed == CHECKSUM_PARTIAL) {
vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
vnet_hdr->csum_start = skb_checksum_start_offset(skb);
+ if (vlan_tx_tag_present(skb))
+ vnet_hdr->csum_start += VLAN_HLEN;
vnet_hdr->csum_offset = skb->csum_offset;
} else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
vnet_hdr->flags = VIRTIO_NET_HDR_F_DATA_VALID;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 057/121] dm thin: grab a virtual cell before looking up the mapping
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (55 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 056/121] macvtap: Fix csum_start when VLAN tags are present Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 058/121] KVM: x86: Fix uninitialized op->type for some immediate values Kamal Mostafa
` (63 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Joe Thornber, Mike Snitzer, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <ejt@redhat.com>
commit c822ed967cba38505713d59ed40a114386ef6c01 upstream.
Avoids normal IO racing with discard.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-thin.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index f8c36d3..0396d7f 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -1504,6 +1504,14 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio)
return DM_MAPIO_SUBMITTED;
}
+ /*
+ * We must hold the virtual cell before doing the lookup, otherwise
+ * there's a race with discard.
+ */
+ build_virtual_key(tc->td, block, &key);
+ if (dm_bio_detain(tc->pool->prison, &key, bio, &cell1, &cell_result))
+ return DM_MAPIO_SUBMITTED;
+
r = dm_thin_find_block(td, block, 0, &result);
/*
@@ -1527,13 +1535,10 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio)
* shared flag will be set in their case.
*/
thin_defer_bio(tc, bio);
+ cell_defer_no_holder_no_free(tc, &cell1);
return DM_MAPIO_SUBMITTED;
}
- build_virtual_key(tc->td, block, &key);
- if (dm_bio_detain(tc->pool->prison, &key, bio, &cell1, &cell_result))
- return DM_MAPIO_SUBMITTED;
-
build_data_key(tc->td, result.block, &key);
if (dm_bio_detain(tc->pool->prison, &key, bio, &cell2, &cell_result)) {
cell_defer_no_holder_no_free(tc, &cell1);
@@ -1554,6 +1559,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio)
* of doing so. Just error it.
*/
bio_io_error(bio);
+ cell_defer_no_holder_no_free(tc, &cell1);
return DM_MAPIO_SUBMITTED;
}
/* fall through */
@@ -1564,6 +1570,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio)
* provide the hint to load the metadata into cache.
*/
thin_defer_bio(tc, bio);
+ cell_defer_no_holder_no_free(tc, &cell1);
return DM_MAPIO_SUBMITTED;
default:
@@ -1573,6 +1580,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio)
* pool is switched to fail-io mode.
*/
bio_io_error(bio);
+ cell_defer_no_holder_no_free(tc, &cell1);
return DM_MAPIO_SUBMITTED;
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 058/121] KVM: x86: Fix uninitialized op->type for some immediate values
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (56 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 057/121] dm thin: grab a virtual cell before looking up the mapping Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 059/121] crypto: caam - fix missing dma unmap on error path Kamal Mostafa
` (62 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nadav Amit, Paolo Bonzini, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nadav Amit <namit@cs.technion.ac.il>
commit d29b9d7ed76c0b961603ca692b8a562556a20212 upstream.
The emulator could reuse an op->type from a previous instruction for some
immediate values. If it mistakenly considers the operands as memory
operands, it will performs a memory read and overwrite op->val.
Consider for instance the ROR instruction - src2 (the number of times)
would be read from memory instead of being used as immediate.
Mark every immediate operand as such to avoid this problem.
Fixes: c44b4c6ab80eef3a9c52c7b3f0c632942e6489aa
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kvm/emulate.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 4ae37e7..97e766b 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4208,6 +4208,7 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
fetch_register_operand(op);
break;
case OpCL:
+ op->type = OP_IMM;
op->bytes = 1;
op->val = reg_read(ctxt, VCPU_REGS_RCX) & 0xff;
break;
@@ -4215,6 +4216,7 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
rc = decode_imm(ctxt, op, 1, true);
break;
case OpOne:
+ op->type = OP_IMM;
op->bytes = 1;
op->val = 1;
break;
@@ -4273,21 +4275,27 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
ctxt->memop.bytes = ctxt->op_bytes + 2;
goto mem_common;
case OpES:
+ op->type = OP_IMM;
op->val = VCPU_SREG_ES;
break;
case OpCS:
+ op->type = OP_IMM;
op->val = VCPU_SREG_CS;
break;
case OpSS:
+ op->type = OP_IMM;
op->val = VCPU_SREG_SS;
break;
case OpDS:
+ op->type = OP_IMM;
op->val = VCPU_SREG_DS;
break;
case OpFS:
+ op->type = OP_IMM;
op->val = VCPU_SREG_FS;
break;
case OpGS:
+ op->type = OP_IMM;
op->val = VCPU_SREG_GS;
break;
case OpImplicit:
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 059/121] crypto: caam - fix missing dma unmap on error path
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (57 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 058/121] KVM: x86: Fix uninitialized op->type for some immediate values Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 060/121] hwrng: pseries - port to new read API and fix stack corruption Kamal Mostafa
` (61 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Cristian Stoica, Herbert Xu, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Stoica <cristian.stoica@freescale.com>
commit 738459e3f88538f2ece263424dafe5d91799e46b upstream.
If dma mapping for dma_addr_out fails, the descriptor memory is freed
but the previous dma mapping for dma_addr_in remains.
This patch resolves the missing dma unmap and groups resource
allocations at function start.
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/crypto/caam/key_gen.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/crypto/caam/key_gen.c b/drivers/crypto/caam/key_gen.c
index ea2e406..b872eed 100644
--- a/drivers/crypto/caam/key_gen.c
+++ b/drivers/crypto/caam/key_gen.c
@@ -51,23 +51,29 @@ int gen_split_key(struct device *jrdev, u8 *key_out, int split_key_len,
u32 *desc;
struct split_key_result result;
dma_addr_t dma_addr_in, dma_addr_out;
- int ret = 0;
+ int ret = -ENOMEM;
desc = kmalloc(CAAM_CMD_SZ * 6 + CAAM_PTR_SZ * 2, GFP_KERNEL | GFP_DMA);
if (!desc) {
dev_err(jrdev, "unable to allocate key input memory\n");
- return -ENOMEM;
+ return ret;
}
- init_job_desc(desc, 0);
-
dma_addr_in = dma_map_single(jrdev, (void *)key_in, keylen,
DMA_TO_DEVICE);
if (dma_mapping_error(jrdev, dma_addr_in)) {
dev_err(jrdev, "unable to map key input memory\n");
- kfree(desc);
- return -ENOMEM;
+ goto out_free;
}
+
+ dma_addr_out = dma_map_single(jrdev, key_out, split_key_pad_len,
+ DMA_FROM_DEVICE);
+ if (dma_mapping_error(jrdev, dma_addr_out)) {
+ dev_err(jrdev, "unable to map key output memory\n");
+ goto out_unmap_in;
+ }
+
+ init_job_desc(desc, 0);
append_key(desc, dma_addr_in, keylen, CLASS_2 | KEY_DEST_CLASS_REG);
/* Sets MDHA up into an HMAC-INIT */
@@ -84,13 +90,6 @@ int gen_split_key(struct device *jrdev, u8 *key_out, int split_key_len,
* FIFO_STORE with the explicit split-key content store
* (0x26 output type)
*/
- dma_addr_out = dma_map_single(jrdev, key_out, split_key_pad_len,
- DMA_FROM_DEVICE);
- if (dma_mapping_error(jrdev, dma_addr_out)) {
- dev_err(jrdev, "unable to map key output memory\n");
- kfree(desc);
- return -ENOMEM;
- }
append_fifo_store(desc, dma_addr_out, split_key_len,
LDST_CLASS_2_CCB | FIFOST_TYPE_SPLIT_KEK);
@@ -118,10 +117,10 @@ int gen_split_key(struct device *jrdev, u8 *key_out, int split_key_len,
dma_unmap_single(jrdev, dma_addr_out, split_key_pad_len,
DMA_FROM_DEVICE);
+out_unmap_in:
dma_unmap_single(jrdev, dma_addr_in, keylen, DMA_TO_DEVICE);
-
+out_free:
kfree(desc);
-
return ret;
}
EXPORT_SYMBOL(gen_split_key);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 060/121] hwrng: pseries - port to new read API and fix stack corruption
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (58 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 059/121] crypto: caam - fix missing dma unmap on error path Kamal Mostafa
@ 2014-12-02 19:18 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 061/121] drm/radeon: set correct CE ram size for CIK Kamal Mostafa
` (60 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:18 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Greg Kurz, Herbert Xu, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
commit 24c65bc7037e7d0f362c0df70d17dd72ee64b8b9 upstream.
The add_early_randomness() function in drivers/char/hw_random/core.c passes
a 16-byte buffer to pseries_rng_data_read(). Unfortunately, plpar_hcall()
returns four 64-bit values and trashes 16 bytes on the stack.
This bug has been lying around for a long time. It got unveiled by:
commit d3cc7996473a7bdd33256029988ea690754e4e2a
Author: Amit Shah <amit.shah@redhat.com>
Date: Thu Jul 10 15:42:34 2014 +0530
hwrng: fetch randomness only after device init
It may trig a oops while loading or unloading the pseries-rng module for both
PowerVM and PowerKVM guests.
This patch does two things:
- pass an intermediate well sized buffer to plpar_hcall(). This is acceptalbe
since we're not on a hot path.
- move to the new read API so that we know the return buffer size for sure.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/char/hw_random/pseries-rng.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/char/hw_random/pseries-rng.c b/drivers/char/hw_random/pseries-rng.c
index ab7ffde..f38f2c1 100644
--- a/drivers/char/hw_random/pseries-rng.c
+++ b/drivers/char/hw_random/pseries-rng.c
@@ -25,18 +25,21 @@
#include <asm/vio.h>
-static int pseries_rng_data_read(struct hwrng *rng, u32 *data)
+static int pseries_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
{
+ u64 buffer[PLPAR_HCALL_BUFSIZE];
+ size_t size = max < 8 ? max : 8;
int rc;
- rc = plpar_hcall(H_RANDOM, (unsigned long *)data);
+ rc = plpar_hcall(H_RANDOM, (unsigned long *)buffer);
if (rc != H_SUCCESS) {
pr_err_ratelimited("H_RANDOM call failed %d\n", rc);
return -EIO;
}
+ memcpy(data, buffer, size);
/* The hypervisor interface returns 64 bits */
- return 8;
+ return size;
}
/**
@@ -55,7 +58,7 @@ static unsigned long pseries_rng_get_desired_dma(struct vio_dev *vdev)
static struct hwrng pseries_rng = {
.name = KBUILD_MODNAME,
- .data_read = pseries_rng_data_read,
+ .read = pseries_rng_read,
};
static int __init pseries_rng_probe(struct vio_dev *dev,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 061/121] drm/radeon: set correct CE ram size for CIK
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (59 preceding siblings ...)
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 060/121] hwrng: pseries - port to new read API and fix stack corruption Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 062/121] drm/radeon: make sure mode init is complete in bandwidth_update Kamal Mostafa
` (59 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Jammy Zhou, Alex Deucher, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jammy Zhou <Jammy.Zhou@amd.com>
commit dc4edad6530a9b7b66c3d905e2bc06021a05dcad upstream.
CE ram size is 32k/0k/0k for GFX/CS0/CS1 with CIK
Ported from amdgpu driver.
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/cik.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index e54f8da..927d523 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -3905,8 +3905,8 @@ static int cik_cp_gfx_start(struct radeon_device *rdev)
/* init the CE partitions. CE only used for gfx on CIK */
radeon_ring_write(ring, PACKET3(PACKET3_SET_BASE, 2));
radeon_ring_write(ring, PACKET3_BASE_INDEX(CE_PARTITION_BASE));
- radeon_ring_write(ring, 0xc000);
- radeon_ring_write(ring, 0xc000);
+ radeon_ring_write(ring, 0x8000);
+ radeon_ring_write(ring, 0x8000);
/* setup clear context state */
radeon_ring_write(ring, PACKET3(PACKET3_PREAMBLE_CNTL, 0));
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 062/121] drm/radeon: make sure mode init is complete in bandwidth_update
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (60 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 061/121] drm/radeon: set correct CE ram size for CIK Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 063/121] drm/radeon: use gart for DMA IB tests Kamal Mostafa
` (58 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 8efe82ca908400785253c8f0dfcf301e6bd93488 upstream.
The power management code calls into the display code for
certain things. If certain power management sysfs attributes
are called before the driver has finished initializing all of
the hardware we can run into problems with uninitialized
modesetting state. Add a check to make sure modesetting
init has completed to the bandwidth update callbacks to
fix this. Can be triggered by the tlp and laptop start
up scripts depending on the timing.
bugs:
https://bugzilla.kernel.org/show_bug.cgi?id=83611
https://bugs.freedesktop.org/show_bug.cgi?id=85771
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/cik.c | 3 +++
drivers/gpu/drm/radeon/evergreen.c | 3 +++
drivers/gpu/drm/radeon/r100.c | 3 +++
drivers/gpu/drm/radeon/rs600.c | 3 +++
drivers/gpu/drm/radeon/rs690.c | 3 +++
drivers/gpu/drm/radeon/rv515.c | 3 +++
drivers/gpu/drm/radeon/si.c | 3 +++
7 files changed, 21 insertions(+)
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 927d523..642eed1 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -8690,6 +8690,9 @@ void dce8_bandwidth_update(struct radeon_device *rdev)
u32 num_heads = 0, lb_size;
int i;
+ if (!rdev->mode_info.mode_config_initialized)
+ return;
+
radeon_update_display_priority(rdev);
for (i = 0; i < rdev->num_crtc; i++) {
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 838dcd5..e337e43 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2361,6 +2361,9 @@ void evergreen_bandwidth_update(struct radeon_device *rdev)
u32 num_heads = 0, lb_size;
int i;
+ if (!rdev->mode_info.mode_config_initialized)
+ return;
+
radeon_update_display_priority(rdev);
for (i = 0; i < rdev->num_crtc; i++) {
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 10abc4d..a90ce9c 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3190,6 +3190,9 @@ void r100_bandwidth_update(struct radeon_device *rdev)
uint32_t pixel_bytes1 = 0;
uint32_t pixel_bytes2 = 0;
+ if (!rdev->mode_info.mode_config_initialized)
+ return;
+
radeon_update_display_priority(rdev);
if (rdev->mode_info.crtcs[0]->base.enabled) {
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 76cc8d3..83f6da3 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -888,6 +888,9 @@ void rs600_bandwidth_update(struct radeon_device *rdev)
u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt;
/* FIXME: implement full support */
+ if (!rdev->mode_info.mode_config_initialized)
+ return;
+
radeon_update_display_priority(rdev);
if (rdev->mode_info.crtcs[0]->base.enabled)
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index e7dab06..008d2d0 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -579,6 +579,9 @@ void rs690_bandwidth_update(struct radeon_device *rdev)
u32 d1mode_priority_a_cnt, d1mode_priority_b_cnt;
u32 d2mode_priority_a_cnt, d2mode_priority_b_cnt;
+ if (!rdev->mode_info.mode_config_initialized)
+ return;
+
radeon_update_display_priority(rdev);
if (rdev->mode_info.crtcs[0]->base.enabled)
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 5d1c316..7295405 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -1271,6 +1271,9 @@ void rv515_bandwidth_update(struct radeon_device *rdev)
struct drm_display_mode *mode0 = NULL;
struct drm_display_mode *mode1 = NULL;
+ if (!rdev->mode_info.mode_config_initialized)
+ return;
+
radeon_update_display_priority(rdev);
if (rdev->mode_info.crtcs[0]->base.enabled)
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 18c197f..ae10c7c 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -2225,6 +2225,9 @@ void dce6_bandwidth_update(struct radeon_device *rdev)
u32 num_heads = 0, lb_size;
int i;
+ if (!rdev->mode_info.mode_config_initialized)
+ return;
+
radeon_update_display_priority(rdev);
for (i = 0; i < rdev->num_crtc; i++) {
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 063/121] drm/radeon: use gart for DMA IB tests
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (61 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 062/121] drm/radeon: make sure mode init is complete in bandwidth_update Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 064/121] drm/radeon: add missing crtc unlock when setting up the MC Kamal Mostafa
` (57 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 0b021c5802fbe5addf6f89f5030f684adf04f7b7 upstream.
Use gart rather than vram to avoid having to deal with
the HDP cache.
Port of adfed2b0587289013f8143c54913ddfd44ac1fd3
(drm/radeon: use gart memory for DMA ring tests)
to the IB tests.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/cik_sdma.c | 21 ++++++++++++---------
drivers/gpu/drm/radeon/r600_dma.c | 20 ++++++++++----------
2 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c
index 376502d..a1aeab0 100644
--- a/drivers/gpu/drm/radeon/cik_sdma.c
+++ b/drivers/gpu/drm/radeon/cik_sdma.c
@@ -564,17 +564,20 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
{
struct radeon_ib ib;
unsigned i;
+ unsigned index;
int r;
- void __iomem *ptr = (void *)rdev->vram_scratch.ptr;
u32 tmp = 0;
+ u64 gpu_addr;
- if (!ptr) {
- DRM_ERROR("invalid vram scratch pointer\n");
- return -EINVAL;
- }
+ if (ring->idx == R600_RING_TYPE_DMA_INDEX)
+ index = R600_WB_DMA_RING_TEST_OFFSET;
+ else
+ index = CAYMAN_WB_DMA1_RING_TEST_OFFSET;
+
+ gpu_addr = rdev->wb.gpu_addr + index;
tmp = 0xCAFEDEAD;
- writel(tmp, ptr);
+ rdev->wb.wb[index/4] = cpu_to_le32(tmp);
r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256);
if (r) {
@@ -583,8 +586,8 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
}
ib.ptr[0] = SDMA_PACKET(SDMA_OPCODE_WRITE, SDMA_WRITE_SUB_OPCODE_LINEAR, 0);
- ib.ptr[1] = rdev->vram_scratch.gpu_addr & 0xfffffffc;
- ib.ptr[2] = upper_32_bits(rdev->vram_scratch.gpu_addr) & 0xffffffff;
+ ib.ptr[1] = lower_32_bits(gpu_addr);
+ ib.ptr[2] = upper_32_bits(gpu_addr);
ib.ptr[3] = 1;
ib.ptr[4] = 0xDEADBEEF;
ib.length_dw = 5;
@@ -601,7 +604,7 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
return r;
}
for (i = 0; i < rdev->usec_timeout; i++) {
- tmp = readl(ptr);
+ tmp = le32_to_cpu(rdev->wb.wb[index/4]);
if (tmp == 0xDEADBEEF)
break;
DRM_UDELAY(1);
diff --git a/drivers/gpu/drm/radeon/r600_dma.c b/drivers/gpu/drm/radeon/r600_dma.c
index cf5e181..aa1b18c 100644
--- a/drivers/gpu/drm/radeon/r600_dma.c
+++ b/drivers/gpu/drm/radeon/r600_dma.c
@@ -333,17 +333,17 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
{
struct radeon_ib ib;
unsigned i;
+ unsigned index;
int r;
- void __iomem *ptr = (void *)rdev->vram_scratch.ptr;
u32 tmp = 0;
+ u64 gpu_addr;
- if (!ptr) {
- DRM_ERROR("invalid vram scratch pointer\n");
- return -EINVAL;
- }
+ if (ring->idx == R600_RING_TYPE_DMA_INDEX)
+ index = R600_WB_DMA_RING_TEST_OFFSET;
+ else
+ index = CAYMAN_WB_DMA1_RING_TEST_OFFSET;
- tmp = 0xCAFEDEAD;
- writel(tmp, ptr);
+ gpu_addr = rdev->wb.gpu_addr + index;
r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256);
if (r) {
@@ -352,8 +352,8 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
}
ib.ptr[0] = DMA_PACKET(DMA_PACKET_WRITE, 0, 0, 1);
- ib.ptr[1] = rdev->vram_scratch.gpu_addr & 0xfffffffc;
- ib.ptr[2] = upper_32_bits(rdev->vram_scratch.gpu_addr) & 0xff;
+ ib.ptr[1] = lower_32_bits(gpu_addr);
+ ib.ptr[2] = upper_32_bits(gpu_addr) & 0xff;
ib.ptr[3] = 0xDEADBEEF;
ib.length_dw = 4;
@@ -369,7 +369,7 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
return r;
}
for (i = 0; i < rdev->usec_timeout; i++) {
- tmp = readl(ptr);
+ tmp = le32_to_cpu(rdev->wb.wb[index/4]);
if (tmp == 0xDEADBEEF)
break;
DRM_UDELAY(1);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 064/121] drm/radeon: add missing crtc unlock when setting up the MC
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (62 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 063/121] drm/radeon: use gart for DMA IB tests Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 065/121] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH Kamal Mostafa
` (56 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit f0d7bfb9407fccb6499ec01c33afe43512a439a2 upstream.
Need to unlock the crtc after updating the blanking state.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/evergreen.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index e337e43..0e0160b 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2572,6 +2572,7 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
}
} else {
tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 065/121] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (63 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 064/121] drm/radeon: add missing crtc unlock when setting up the MC Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 066/121] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP Kamal Mostafa
` (55 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: James Ralston, Takashi Iwai, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: James Ralston <james.d.ralston@intel.com>
commit c8b00fd2f4c504a564adcad5b8bd6952ab850b02 upstream.
This patch adds the HD Audio Device IDs for the Intel Sunrise Point PCH.
[the item position rearranged by tiwai]
Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/hda_intel.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index a7431d6..304fbbf 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -170,6 +170,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
"{Intel, LPT},"
"{Intel, LPT_LP},"
"{Intel, WPT_LP},"
+ "{Intel, SPT},"
"{Intel, HPT},"
"{Intel, PBG},"
"{Intel, SCH},"
@@ -4065,6 +4066,9 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
/* Wildcat Point-LP */
{ PCI_DEVICE(0x8086, 0x9ca0),
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
+ /* Sunrise Point */
+ { PCI_DEVICE(0x8086, 0xa170),
+ .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
/* Haswell */
{ PCI_DEVICE(0x8086, 0x0a0c),
.driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 066/121] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (64 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 065/121] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 067/121] Input: alps - ignore potential bare packets when device is out of sync Kamal Mostafa
` (54 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Devin Ryles, Takashi Iwai, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Ryles <devin.ryles@intel.com>
commit b4565913460cbd7d86c6bd52913dfaa07fa384aa upstream.
This patch adds DeviceIDs for Sunrise Point-LP
Signed-off-by: Devin Ryles <devin.ryles@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/hda_intel.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 304fbbf..a045023 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -171,6 +171,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
"{Intel, LPT_LP},"
"{Intel, WPT_LP},"
"{Intel, SPT},"
+ "{Intel, SPT_LP},"
"{Intel, HPT},"
"{Intel, PBG},"
"{Intel, SCH},"
@@ -4069,6 +4070,9 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
/* Sunrise Point */
{ PCI_DEVICE(0x8086, 0xa170),
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
+ /* Sunrise Point-LP */
+ { PCI_DEVICE(0x8086, 0x9d70),
+ .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
/* Haswell */
{ PCI_DEVICE(0x8086, 0x0a0c),
.driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 067/121] Input: alps - ignore potential bare packets when device is out of sync
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (65 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 066/121] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 068/121] Input: alps - allow up to 2 invalid packets without resetting device Kamal Mostafa
` (53 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Pali Rohár, Dmitry Torokhov, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
commit 4ab8f7f320f91f279c3f06a9795cfea5c972888a upstream.
5th and 6th byte of ALPS trackstick V3 protocol match condition for first
byte of PS/2 3 bytes packet. When driver enters out of sync state and ALPS
trackstick is sending data then driver match 5th, 6th and next 1st bytes as
PS/2.
It basically means if user is using trackstick when driver is in out of
sync state driver will never resync. Processing these bytes as 3 bytes PS/2
data cause total mess (random cursor movements, random clicks) and make
trackstick unusable until psmouse driver decide to do full device reset.
Lot of users reported problems with ALPS devices on Dell Latitude E6440,
E6540 and E7440 laptops. ALPS device or Dell EC for unknown reason send
some invalid ALPS PS/2 bytes which cause driver out of sync. It looks like
that i8042 and psmouse/alps driver always receive group of 6 bytes packets
so there are no missing bytes and no bytes were inserted between valid
ones.
This patch does not fix root of problem with ALPS devices found in Dell
Latitude laptops but it does not allow to process some (invalid)
subsequence of 6 bytes ALPS packets as 3 bytes PS/2 when driver is out of
sync.
So with this patch trackstick input device does not report bogus data when
also driver is out of sync, so trackstick should be usable on those
machines.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/input/mouse/alps.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 5cf62e3..80fac48 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -963,7 +963,13 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
{
struct alps_data *priv = psmouse->private;
- if ((psmouse->packet[0] & 0xc8) == 0x08) { /* PS/2 packet */
+ /*
+ * Check if we are dealing with a bare PS/2 packet, presumably from
+ * a device connected to the external PS/2 port. Because bare PS/2
+ * protocol does not have enough constant bits to self-synchronize
+ * properly we only do this if the device is fully synchronized.
+ */
+ if (!psmouse->out_of_sync_cnt && (psmouse->packet[0] & 0xc8) == 0x08) {
if (psmouse->pktcnt == 3) {
alps_report_bare_ps2_packet(psmouse, psmouse->packet,
true);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 068/121] Input: alps - allow up to 2 invalid packets without resetting device
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (66 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 067/121] Input: alps - ignore potential bare packets when device is out of sync Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 069/121] scsi: only re-lock door after EH on devices that were reset Kamal Mostafa
` (52 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Pali Rohár, Dmitry Torokhov, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
commit 9d720b34c0a432639252f63012e18b0507f5b432 upstream.
On some Dell Latitude laptops ALPS device or Dell EC send one invalid byte
in 6 bytes ALPS packet. In this case psmouse driver enter out of sync
state. It looks like that all other bytes in packets are valid and also
device working properly. So there is no need to do full device reset, just
need to wait for byte which match condition for first byte (start of
packet). Because ALPS packets are bigger (6 or 8 bytes) default limit is
small.
This patch increase number of invalid bytes to size of 2 ALPS packets which
psmouse driver can drop before do full reset.
Resetting ALPS devices take some time and when doing reset on some Dell
laptops touchpad, trackstick and also keyboard do not respond. So it is
better to do it only if really necessary.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/input/mouse/alps.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 80fac48..00544a6 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -2022,6 +2022,9 @@ int alps_init(struct psmouse *psmouse)
/* We are having trouble resyncing ALPS touchpads so disable it for now */
psmouse->resync_time = 0;
+ /* Allow 2 invalid packets without resetting device */
+ psmouse->resetafter = psmouse->pktsize * 2;
+
return 0;
init_fail:
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 069/121] scsi: only re-lock door after EH on devices that were reset
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (67 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 068/121] Input: alps - allow up to 2 invalid packets without resetting device Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 070/121] dm btree: fix a recursion depth bug in btree walking code Kamal Mostafa
` (51 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Christoph Hellwig, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <hch@lst.de>
commit 48379270fe6808cf4612ee094adc8da2b7a83baa upstream.
Setups that use the blk-mq I/O path can lock up if a host with a single
device that has its door locked enters EH. Make sure to only send the
command to re-lock the door to devices that actually were reset and thus
might have lost their state. Otherwise the EH code might be get blocked
on blk_get_request as all requests for non-reset devices might be in use.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Meelis Roos <meelis.roos@ut.ee>
Tested-by: Meelis Roos <meelis.roos@ut.ee>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/scsi_error.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 09f930d..c6dcbe6 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1860,8 +1860,10 @@ static void scsi_restart_operations(struct Scsi_Host *shost)
* is no point trying to lock the door of an off-line device.
*/
shost_for_each_device(sdev, shost) {
- if (scsi_device_online(sdev) && sdev->locked)
+ if (scsi_device_online(sdev) && sdev->was_reset && sdev->locked) {
scsi_eh_lock_door(sdev);
+ sdev->was_reset = 0;
+ }
}
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 070/121] dm btree: fix a recursion depth bug in btree walking code
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (68 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 069/121] scsi: only re-lock door after EH on devices that were reset Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 071/121] parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls Kamal Mostafa
` (50 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Joe Thornber, Mike Snitzer, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <ejt@redhat.com>
commit 9b460d3699324d570a4d4161c3741431887f102f upstream.
The walk code was using a 'ro_spine' to hold it's locked btree nodes.
But this data structure is designed for the rolling lock scheme, and
as such automatically unlocks blocks that are two steps up the call
chain. This is not suitable for the simple recursive walk algorithm,
which retraces its steps.
This code is only used by the persistent array code, which in turn is
only used by dm-cache. In order to trigger it you need to have a
mapping tree that is more than 2 levels deep; which equates to 8-16
million cache blocks. For instance a 4T ssd with a very small block
size of 32k only just triggers this bug.
The fix just places the locked blocks on the stack, and stops using
the ro_spine altogether.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/persistent-data/dm-btree-internal.h | 6 ++++++
drivers/md/persistent-data/dm-btree-spine.c | 2 +-
drivers/md/persistent-data/dm-btree.c | 24 ++++++++++--------------
3 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/md/persistent-data/dm-btree-internal.h b/drivers/md/persistent-data/dm-btree-internal.h
index 37d367b..bf2b80d 100644
--- a/drivers/md/persistent-data/dm-btree-internal.h
+++ b/drivers/md/persistent-data/dm-btree-internal.h
@@ -42,6 +42,12 @@ struct btree_node {
} __packed;
+/*
+ * Locks a block using the btree node validator.
+ */
+int bn_read_lock(struct dm_btree_info *info, dm_block_t b,
+ struct dm_block **result);
+
void inc_children(struct dm_transaction_manager *tm, struct btree_node *n,
struct dm_btree_value_type *vt);
diff --git a/drivers/md/persistent-data/dm-btree-spine.c b/drivers/md/persistent-data/dm-btree-spine.c
index cf9fd67..1b5e13e 100644
--- a/drivers/md/persistent-data/dm-btree-spine.c
+++ b/drivers/md/persistent-data/dm-btree-spine.c
@@ -92,7 +92,7 @@ struct dm_block_validator btree_node_validator = {
/*----------------------------------------------------------------*/
-static int bn_read_lock(struct dm_btree_info *info, dm_block_t b,
+int bn_read_lock(struct dm_btree_info *info, dm_block_t b,
struct dm_block **result)
{
return dm_tm_read_lock(info->tm, b, &btree_node_validator, result);
diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c
index 468e371..9701d29 100644
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -828,22 +828,26 @@ EXPORT_SYMBOL_GPL(dm_btree_find_highest_key);
* FIXME: We shouldn't use a recursive algorithm when we have limited stack
* space. Also this only works for single level trees.
*/
-static int walk_node(struct ro_spine *s, dm_block_t block,
+static int walk_node(struct dm_btree_info *info, dm_block_t block,
int (*fn)(void *context, uint64_t *keys, void *leaf),
void *context)
{
int r;
unsigned i, nr;
+ struct dm_block *node;
struct btree_node *n;
uint64_t keys;
- r = ro_step(s, block);
- n = ro_node(s);
+ r = bn_read_lock(info, block, &node);
+ if (r)
+ return r;
+
+ n = dm_block_data(node);
nr = le32_to_cpu(n->header.nr_entries);
for (i = 0; i < nr; i++) {
if (le32_to_cpu(n->header.flags) & INTERNAL_NODE) {
- r = walk_node(s, value64(n, i), fn, context);
+ r = walk_node(info, value64(n, i), fn, context);
if (r)
goto out;
} else {
@@ -855,7 +859,7 @@ static int walk_node(struct ro_spine *s, dm_block_t block,
}
out:
- ro_pop(s);
+ dm_tm_unlock(info->tm, node);
return r;
}
@@ -863,15 +867,7 @@ int dm_btree_walk(struct dm_btree_info *info, dm_block_t root,
int (*fn)(void *context, uint64_t *keys, void *leaf),
void *context)
{
- int r;
- struct ro_spine spine;
-
BUG_ON(info->levels > 1);
-
- init_ro_spine(&spine, info);
- r = walk_node(&spine, root, fn, context);
- exit_ro_spine(&spine);
-
- return r;
+ return walk_node(info, root, fn, context);
}
EXPORT_SYMBOL_GPL(dm_btree_walk);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 071/121] parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (69 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 070/121] dm btree: fix a recursion depth bug in btree walking code Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 072/121] ALSA: usb-audio: Fix memory leak in FTU quirk Kamal Mostafa
` (49 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Helge Deller, John David Anglin, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <deller@gmx.de>
commit 2fe749f50b0bec07650ef135b29b1f55bf543869 upstream.
Switch over the msgctl, shmat, shmctl and semtimedop syscalls to use the compat
layer. The problem was found with the debian procenv package, which called
shmctl(0, SHM_INFO, &info);
in which the shmctl syscall then overwrote parts of the surrounding areas on
the stack on which the info variable was stored and thus lead to a segfault
later on.
Additionally fix the definition of struct shminfo64 to use unsigned longs like
the other architectures. This has no impact on userspace since we only have a
32bit userspace up to now.
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/parisc/include/uapi/asm/shmbuf.h | 25 +++++++++----------------
arch/parisc/kernel/syscall_table.S | 8 ++++----
2 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/arch/parisc/include/uapi/asm/shmbuf.h b/arch/parisc/include/uapi/asm/shmbuf.h
index 0a3eada..f395cde 100644
--- a/arch/parisc/include/uapi/asm/shmbuf.h
+++ b/arch/parisc/include/uapi/asm/shmbuf.h
@@ -36,23 +36,16 @@ struct shmid64_ds {
unsigned int __unused2;
};
-#ifdef CONFIG_64BIT
-/* The 'unsigned int' (formerly 'unsigned long') data types below will
- * ensure that a 32-bit app calling shmctl(*,IPC_INFO,*) will work on
- * a wide kernel, but if some of these values are meant to contain pointers
- * they may need to be 'long long' instead. -PB XXX FIXME
- */
-#endif
struct shminfo64 {
- unsigned int shmmax;
- unsigned int shmmin;
- unsigned int shmmni;
- unsigned int shmseg;
- unsigned int shmall;
- unsigned int __unused1;
- unsigned int __unused2;
- unsigned int __unused3;
- unsigned int __unused4;
+ unsigned long shmmax;
+ unsigned long shmmin;
+ unsigned long shmmni;
+ unsigned long shmseg;
+ unsigned long shmall;
+ unsigned long __unused1;
+ unsigned long __unused2;
+ unsigned long __unused3;
+ unsigned long __unused4;
};
#endif /* _PARISC_SHMBUF_H */
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 486a600..ddc0597 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -286,11 +286,11 @@
ENTRY_COMP(msgsnd)
ENTRY_COMP(msgrcv)
ENTRY_SAME(msgget) /* 190 */
- ENTRY_SAME(msgctl)
- ENTRY_SAME(shmat)
+ ENTRY_COMP(msgctl)
+ ENTRY_COMP(shmat)
ENTRY_SAME(shmdt)
ENTRY_SAME(shmget)
- ENTRY_SAME(shmctl) /* 195 */
+ ENTRY_COMP(shmctl) /* 195 */
ENTRY_SAME(ni_syscall) /* streams1 */
ENTRY_SAME(ni_syscall) /* streams2 */
ENTRY_SAME(lstat64)
@@ -323,7 +323,7 @@
ENTRY_SAME(epoll_ctl) /* 225 */
ENTRY_SAME(epoll_wait)
ENTRY_SAME(remap_file_pages)
- ENTRY_SAME(semtimedop)
+ ENTRY_COMP(semtimedop)
ENTRY_COMP(mq_open)
ENTRY_SAME(mq_unlink) /* 230 */
ENTRY_COMP(mq_timedsend)
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 072/121] ALSA: usb-audio: Fix memory leak in FTU quirk
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (70 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 071/121] parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 073/121] audit: keep inode pinned Kamal Mostafa
` (48 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 1a290581ded60e87276741f8ca97b161d2b226fc upstream.
M-audio FastTrack Ultra quirk doesn't release the kzalloc'ed memory.
This patch adds the private_free callback to release it properly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/usb/mixer_quirks.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index f4b12c2..5a723df 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -885,6 +885,11 @@ static int snd_ftu_eff_switch_put(struct snd_kcontrol *kctl,
return changed;
}
+static void kctl_private_value_free(struct snd_kcontrol *kctl)
+{
+ kfree((void *)kctl->private_value);
+}
+
static int snd_ftu_create_effect_switch(struct usb_mixer_interface *mixer,
int validx, int bUnitID)
{
@@ -919,6 +924,7 @@ static int snd_ftu_create_effect_switch(struct usb_mixer_interface *mixer,
return -ENOMEM;
}
+ kctl->private_free = kctl_private_value_free;
err = snd_ctl_add(mixer->chip->card, kctl);
if (err < 0)
return err;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 073/121] audit: keep inode pinned
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (71 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 072/121] ALSA: usb-audio: Fix memory leak in FTU quirk Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 074/121] nfs: fix pnfs direct write memory leak Kamal Mostafa
` (47 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Miklos Szeredi, Paul Moore, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <mszeredi@suse.cz>
commit 799b601451b21ebe7af0e6e8f6e2ccd4683c5064 upstream.
Audit rules disappear when an inode they watch is evicted from the cache.
This is likely not what we want.
The guilty commit is "fsnotify: allow marks to not pin inodes in core",
which didn't take into account that audit_tree adds watches with a zero
mask.
Adding any mask should fix this.
Fixes: 90b1e7a57880 ("fsnotify: allow marks to not pin inodes in core")
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/audit_tree.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
index 43c307d..00c4459 100644
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -154,6 +154,7 @@ static struct audit_chunk *alloc_chunk(int count)
chunk->owners[i].index = i;
}
fsnotify_init_mark(&chunk->mark, audit_tree_destroy_watch);
+ chunk->mark.mask = FS_IN_IGNORED;
return chunk;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 074/121] nfs: fix pnfs direct write memory leak
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (72 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 073/121] audit: keep inode pinned Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 075/121] nfs: Fix use of uninitialized variable in nfs_getattr() Kamal Mostafa
` (46 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peng Tao, Trond Myklebust, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Tao <tao.peng@primarydata.com>
commit 8c393f9a721c30a030049a680e1bf896669bb279 upstream.
For pNFS direct writes, layout driver may dynamically allocate ds_cinfo.buckets.
So we need to take care to free them when freeing dreq.
Ideally this needs to be done inside layout driver where ds_cinfo.buckets
are allocated. But buckets are attached to dreq and reused across LD IO iterations.
So I feel it's OK to free them in the generic layer.
Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/direct.c | 1 +
include/linux/nfs_xdr.h | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index d71d66c..a74e888 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -178,6 +178,7 @@ static void nfs_direct_req_free(struct kref *kref)
{
struct nfs_direct_req *dreq = container_of(kref, struct nfs_direct_req, kref);
+ nfs_free_pnfs_ds_cinfo(&dreq->ds_cinfo);
if (dreq->l_ctx != NULL)
nfs_put_lock_context(dreq->l_ctx);
if (dreq->ctx != NULL)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5624e4e..53988cb 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1247,11 +1247,22 @@ struct nfs41_free_stateid_res {
unsigned int status;
};
+static inline void
+nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo)
+{
+ kfree(cinfo->buckets);
+}
+
#else
struct pnfs_ds_commit_info {
};
+static inline void
+nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo)
+{
+}
+
#endif /* CONFIG_NFS_V4_1 */
struct nfs_page;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 075/121] nfs: Fix use of uninitialized variable in nfs_getattr()
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (73 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 074/121] nfs: fix pnfs direct write memory leak Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 076/121] NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired Kamal Mostafa
` (45 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jan Kara, Trond Myklebust, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit 16caf5b6101d03335b386e77e9e14136f989be87 upstream.
Variable 'err' needn't be initialized when nfs_getattr() uses it to
check whether it should call generic_fillattr() or not. That can result
in spurious error returns. Initialize 'err' properly.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index be955cf..8af210f 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -592,7 +592,7 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
{
struct inode *inode = dentry->d_inode;
int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME;
- int err;
+ int err = 0;
trace_nfs_getattr_enter(inode);
/* Flush out writes to the server in order to update c/mtime. */
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 076/121] NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (74 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 075/121] nfs: Fix use of uninitialized variable in nfs_getattr() Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 077/121] NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE Kamal Mostafa
` (44 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit 4dfd4f7af0afd201706ad186352ca423b0f17d4b upstream.
NFSv4.0 does not have TEST_STATEID/FREE_STATEID functionality, so
unlike NFSv4.1, the recovery procedure when stateids have expired or
have been revoked requires us to just forget the delegation.
http://lkml.kernel.org/r/CAN-5tyHwG=Cn2Q9KsHWadewjpTTy_K26ee+UnSvHvG4192p-Xw@mail.gmail.com
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/nfs4proc.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b54753e..33f76f9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2036,6 +2036,28 @@ static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *sta
return ret;
}
+static void nfs_finish_clear_delegation_stateid(struct nfs4_state *state)
+{
+ nfs_remove_bad_delegation(state->inode);
+ write_seqlock(&state->seqlock);
+ nfs4_stateid_copy(&state->stateid, &state->open_stateid);
+ write_sequnlock(&state->seqlock);
+ clear_bit(NFS_DELEGATED_STATE, &state->flags);
+}
+
+static void nfs40_clear_delegation_stateid(struct nfs4_state *state)
+{
+ if (rcu_access_pointer(NFS_I(state->inode)->delegation) != NULL)
+ nfs_finish_clear_delegation_stateid(state);
+}
+
+static int nfs40_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state)
+{
+ /* NFSv4.0 doesn't allow for delegation recovery on open expire */
+ nfs40_clear_delegation_stateid(state);
+ return nfs4_open_expired(sp, state);
+}
+
#if defined(CONFIG_NFS_V4_1)
static void nfs41_clear_delegation_stateid(struct nfs4_state *state)
{
@@ -8256,7 +8278,7 @@ static const struct nfs4_state_recovery_ops nfs41_reboot_recovery_ops = {
static const struct nfs4_state_recovery_ops nfs40_nograce_recovery_ops = {
.owner_flag_bit = NFS_OWNER_RECLAIM_NOGRACE,
.state_flag_bit = NFS_STATE_RECLAIM_NOGRACE,
- .recover_open = nfs4_open_expired,
+ .recover_open = nfs40_open_expired,
.recover_lock = nfs4_lock_expired,
.establish_clid = nfs4_init_clientid,
};
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 077/121] NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (75 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 076/121] NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 078/121] NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return Kamal Mostafa
` (43 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit 0c116cadd94b16b30b1dd90d38b2784d9b39b01a upstream.
This patch removes the assumption made previously, that we only need to
check the delegation stateid when it matches the stateid on a cached
open.
If we believe that we hold a delegation for this file, then we must assume
that its stateid may have been revoked or expired too. If we don't test it
then our state recovery process may end up caching open/lock state in a
situation where it should not.
We therefore rename the function nfs41_clear_delegation_stateid as
nfs41_check_delegation_stateid, and change it to always run through the
delegation stateid test and recovery process as outlined in RFC5661.
http://lkml.kernel.org/r/CAN-5tyHwG=Cn2Q9KsHWadewjpTTy_K26ee+UnSvHvG4192p-Xw@mail.gmail.com
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/nfs4proc.c | 42 +++++++++++++++++-------------------------
1 file changed, 17 insertions(+), 25 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 33f76f9..f81f845 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2059,45 +2059,37 @@ static int nfs40_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *st
}
#if defined(CONFIG_NFS_V4_1)
-static void nfs41_clear_delegation_stateid(struct nfs4_state *state)
+static void nfs41_check_delegation_stateid(struct nfs4_state *state)
{
struct nfs_server *server = NFS_SERVER(state->inode);
- nfs4_stateid *stateid = &state->stateid;
+ nfs4_stateid stateid;
struct nfs_delegation *delegation;
- struct rpc_cred *cred = NULL;
- int status = -NFS4ERR_BAD_STATEID;
-
- /* If a state reset has been done, test_stateid is unneeded */
- if (test_bit(NFS_DELEGATED_STATE, &state->flags) == 0)
- return;
+ struct rpc_cred *cred;
+ int status;
/* Get the delegation credential for use by test/free_stateid */
rcu_read_lock();
delegation = rcu_dereference(NFS_I(state->inode)->delegation);
- if (delegation != NULL &&
- nfs4_stateid_match(&delegation->stateid, stateid)) {
- cred = get_rpccred(delegation->cred);
- rcu_read_unlock();
- status = nfs41_test_stateid(server, stateid, cred);
- trace_nfs4_test_delegation_stateid(state, NULL, status);
- } else
+ if (delegation == NULL) {
rcu_read_unlock();
+ return;
+ }
+
+ nfs4_stateid_copy(&stateid, &delegation->stateid);
+ cred = get_rpccred(delegation->cred);
+ rcu_read_unlock();
+ status = nfs41_test_stateid(server, &stateid, cred);
+ trace_nfs4_test_delegation_stateid(state, NULL, status);
if (status != NFS_OK) {
/* Free the stateid unless the server explicitly
* informs us the stateid is unrecognized. */
if (status != -NFS4ERR_BAD_STATEID)
- nfs41_free_stateid(server, stateid, cred);
- nfs_remove_bad_delegation(state->inode);
-
- write_seqlock(&state->seqlock);
- nfs4_stateid_copy(&state->stateid, &state->open_stateid);
- write_sequnlock(&state->seqlock);
- clear_bit(NFS_DELEGATED_STATE, &state->flags);
+ nfs41_free_stateid(server, &stateid, cred);
+ nfs_finish_clear_delegation_stateid(state);
}
- if (cred != NULL)
- put_rpccred(cred);
+ put_rpccred(cred);
}
/**
@@ -2141,7 +2133,7 @@ static int nfs41_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *st
{
int status;
- nfs41_clear_delegation_stateid(state);
+ nfs41_check_delegation_stateid(state);
status = nfs41_check_open_stateid(state);
if (status != NFS_OK)
status = nfs4_open_expired(sp, state);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 078/121] NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (76 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 077/121] NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 079/121] NFSv4: Ensure that we call FREE_STATEID when NFSv4.x stateids are revoked Kamal Mostafa
` (42 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit 869f9dfa4d6d57b79e0afc3af14772c2a023eeb1 upstream.
Any attempt to call nfs_remove_bad_delegation() while a delegation is being
returned is currently a no-op. This means that we can end up looping
forever in nfs_end_delegation_return() if something causes the delegation
to be revoked.
This patch adds a mechanism whereby the state recovery code can communicate
to the delegation return code that the delegation is no longer valid and
that it should not be used when reclaiming state.
It also changes the return value for nfs4_handle_delegation_recall_error()
to ensure that nfs_end_delegation_return() does not reattempt the lock
reclaim before state recovery is done.
http://lkml.kernel.org/r/CAN-5tyHwG=Cn2Q9KsHWadewjpTTy_K26ee+UnSvHvG4192p-Xw@mail.gmail.com
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/delegation.c | 23 +++++++++++++++++++++--
fs/nfs/delegation.h | 1 +
fs/nfs/nfs4proc.c | 2 +-
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 5d8ccec..2897534 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -177,7 +177,11 @@ static int nfs_do_return_delegation(struct inode *inode, struct nfs_delegation *
{
int res = 0;
- res = nfs4_proc_delegreturn(inode, delegation->cred, &delegation->stateid, issync);
+ if (!test_bit(NFS_DELEGATION_REVOKED, &delegation->flags))
+ res = nfs4_proc_delegreturn(inode,
+ delegation->cred,
+ &delegation->stateid,
+ issync);
nfs_free_delegation(delegation);
return res;
}
@@ -364,11 +368,13 @@ static int nfs_end_delegation_return(struct inode *inode, struct nfs_delegation
{
struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
struct nfs_inode *nfsi = NFS_I(inode);
- int err;
+ int err = 0;
if (delegation == NULL)
return 0;
do {
+ if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags))
+ break;
err = nfs_delegation_claim_opens(inode, &delegation->stateid);
if (!issync || err != -EAGAIN)
break;
@@ -589,10 +595,23 @@ static void nfs_client_mark_return_unused_delegation_types(struct nfs_client *cl
rcu_read_unlock();
}
+static void nfs_revoke_delegation(struct inode *inode)
+{
+ struct nfs_delegation *delegation;
+ rcu_read_lock();
+ delegation = rcu_dereference(NFS_I(inode)->delegation);
+ if (delegation != NULL) {
+ set_bit(NFS_DELEGATION_REVOKED, &delegation->flags);
+ nfs_mark_return_delegation(NFS_SERVER(inode), delegation);
+ }
+ rcu_read_unlock();
+}
+
void nfs_remove_bad_delegation(struct inode *inode)
{
struct nfs_delegation *delegation;
+ nfs_revoke_delegation(inode);
delegation = nfs_inode_detach_delegation(inode);
if (delegation) {
nfs_inode_find_state_and_recover(inode, &delegation->stateid);
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
index 9a79c7a..e02b090 100644
--- a/fs/nfs/delegation.h
+++ b/fs/nfs/delegation.h
@@ -31,6 +31,7 @@ enum {
NFS_DELEGATION_RETURN_IF_CLOSED,
NFS_DELEGATION_REFERENCED,
NFS_DELEGATION_RETURNING,
+ NFS_DELEGATION_REVOKED,
};
int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct nfs_openres *res);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f81f845..322c416 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1589,7 +1589,7 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct
nfs_inode_find_state_and_recover(state->inode,
stateid);
nfs4_schedule_stateid_recovery(server, state);
- return 0;
+ return -EAGAIN;
case -NFS4ERR_DELAY:
case -NFS4ERR_GRACE:
set_bit(NFS_DELEGATED_STATE, &state->flags);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 079/121] NFSv4: Ensure that we call FREE_STATEID when NFSv4.x stateids are revoked
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (77 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 078/121] NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 080/121] NFS: Don't try to reclaim delegation open state if recovery failed Kamal Mostafa
` (41 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit c606bb8857921d3ecf4d353942d6cc7e116cc75a upstream.
NFSv4.x (x>0) requires us to call TEST_STATEID+FREE_STATEID if a stateid is
revoked. We will currently fail to do this if the stateid is a delegation.
http://lkml.kernel.org/r/CAN-5tyHwG=Cn2Q9KsHWadewjpTTy_K26ee+UnSvHvG4192p-Xw@mail.gmail.com
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/nfs4filelayout.c | 3 ---
fs/nfs/nfs4proc.c | 8 --------
2 files changed, 11 deletions(-)
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index b86464b..d5e4bd9 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -153,9 +153,6 @@ static int filelayout_async_handle_error(struct rpc_task *task,
case -NFS4ERR_DELEG_REVOKED:
case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_BAD_STATEID:
- if (state == NULL)
- break;
- nfs_remove_bad_delegation(state->inode);
case -NFS4ERR_OPENMODE:
if (state == NULL)
break;
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 322c416..cc27e1f 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -360,11 +360,6 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
case -NFS4ERR_DELEG_REVOKED:
case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_BAD_STATEID:
- if (inode != NULL && nfs4_have_delegation(inode, FMODE_READ)) {
- nfs_remove_bad_delegation(inode);
- exception->retry = 1;
- break;
- }
if (state == NULL)
break;
ret = nfs4_schedule_stateid_recovery(server, state);
@@ -4792,9 +4787,6 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
case -NFS4ERR_DELEG_REVOKED:
case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_BAD_STATEID:
- if (state == NULL)
- break;
- nfs_remove_bad_delegation(state->inode);
case -NFS4ERR_OPENMODE:
if (state == NULL)
break;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 080/121] NFS: Don't try to reclaim delegation open state if recovery failed
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (78 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 079/121] NFSv4: Ensure that we call FREE_STATEID when NFSv4.x stateids are revoked Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 081/121] libceph: do not crash on large auth tickets Kamal Mostafa
` (40 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit f8ebf7a8ca35dde321f0cd385fee6f1950609367 upstream.
If state recovery failed, then we should not attempt to reclaim delegated
state.
http://lkml.kernel.org/r/CAN-5tyHwG=Cn2Q9KsHWadewjpTTy_K26ee+UnSvHvG4192p-Xw@mail.gmail.com
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/delegation.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 2897534..3ed1be9 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -109,6 +109,8 @@ again:
continue;
if (!test_bit(NFS_DELEGATED_STATE, &state->flags))
continue;
+ if (!nfs4_valid_open_stateid(state))
+ continue;
if (!nfs4_stateid_match(&state->stateid, stateid))
continue;
get_nfs_open_context(ctx);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 081/121] libceph: do not crash on large auth tickets
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (79 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 080/121] NFS: Don't try to reclaim delegation open state if recovery failed Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 082/121] ARM: 8191/1: decompressor: ensure I-side picks up relocated code Kamal Mostafa
` (39 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Ilya Dryomov, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <idryomov@redhat.com>
commit aaef31703a0cf6a733e651885bfb49edc3ac6774 upstream.
Large (greater than 32k, the value of PAGE_ALLOC_COSTLY_ORDER) auth
tickets will have their buffers vmalloc'ed, which leads to the
following crash in crypto:
[ 28.685082] BUG: unable to handle kernel paging request at ffffeb04000032c0
[ 28.686032] IP: [<ffffffff81392b42>] scatterwalk_pagedone+0x22/0x80
[ 28.686032] PGD 0
[ 28.688088] Oops: 0000 [#1] PREEMPT SMP
[ 28.688088] Modules linked in:
[ 28.688088] CPU: 0 PID: 878 Comm: kworker/0:2 Not tainted 3.17.0-vm+ #305
[ 28.688088] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 28.688088] Workqueue: ceph-msgr con_work
[ 28.688088] task: ffff88011a7f9030 ti: ffff8800d903c000 task.ti: ffff8800d903c000
[ 28.688088] RIP: 0010:[<ffffffff81392b42>] [<ffffffff81392b42>] scatterwalk_pagedone+0x22/0x80
[ 28.688088] RSP: 0018:ffff8800d903f688 EFLAGS: 00010286
[ 28.688088] RAX: ffffeb04000032c0 RBX: ffff8800d903f718 RCX: ffffeb04000032c0
[ 28.688088] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff8800d903f750
[ 28.688088] RBP: ffff8800d903f688 R08: 00000000000007de R09: ffff8800d903f880
[ 28.688088] R10: 18df467c72d6257b R11: 0000000000000000 R12: 0000000000000010
[ 28.688088] R13: ffff8800d903f750 R14: ffff8800d903f8a0 R15: 0000000000000000
[ 28.688088] FS: 00007f50a41c7700(0000) GS:ffff88011fc00000(0000) knlGS:0000000000000000
[ 28.688088] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 28.688088] CR2: ffffeb04000032c0 CR3: 00000000da3f3000 CR4: 00000000000006b0
[ 28.688088] Stack:
[ 28.688088] ffff8800d903f698 ffffffff81392ca8 ffff8800d903f6e8 ffffffff81395d32
[ 28.688088] ffff8800dac96000 ffff880000000000 ffff8800d903f980 ffff880119b7e020
[ 28.688088] ffff880119b7e010 0000000000000000 0000000000000010 0000000000000010
[ 28.688088] Call Trace:
[ 28.688088] [<ffffffff81392ca8>] scatterwalk_done+0x38/0x40
[ 28.688088] [<ffffffff81392ca8>] scatterwalk_done+0x38/0x40
[ 28.688088] [<ffffffff81395d32>] blkcipher_walk_done+0x182/0x220
[ 28.688088] [<ffffffff813990bf>] crypto_cbc_encrypt+0x15f/0x180
[ 28.688088] [<ffffffff81399780>] ? crypto_aes_set_key+0x30/0x30
[ 28.688088] [<ffffffff8156c40c>] ceph_aes_encrypt2+0x29c/0x2e0
[ 28.688088] [<ffffffff8156d2a3>] ceph_encrypt2+0x93/0xb0
[ 28.688088] [<ffffffff8156d7da>] ceph_x_encrypt+0x4a/0x60
[ 28.688088] [<ffffffff8155b39d>] ? ceph_buffer_new+0x5d/0xf0
[ 28.688088] [<ffffffff8156e837>] ceph_x_build_authorizer.isra.6+0x297/0x360
[ 28.688088] [<ffffffff8112089b>] ? kmem_cache_alloc_trace+0x11b/0x1c0
[ 28.688088] [<ffffffff8156b496>] ? ceph_auth_create_authorizer+0x36/0x80
[ 28.688088] [<ffffffff8156ed83>] ceph_x_create_authorizer+0x63/0xd0
[ 28.688088] [<ffffffff8156b4b4>] ceph_auth_create_authorizer+0x54/0x80
[ 28.688088] [<ffffffff8155f7c0>] get_authorizer+0x80/0xd0
[ 28.688088] [<ffffffff81555a8b>] prepare_write_connect+0x18b/0x2b0
[ 28.688088] [<ffffffff81559289>] try_read+0x1e59/0x1f10
This is because we set up crypto scatterlists as if all buffers were
kmalloc'ed. Fix it.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ceph/crypto.c | 169 ++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 132 insertions(+), 37 deletions(-)
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index 6e7a236..06f19b9 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -89,11 +89,82 @@ static struct crypto_blkcipher *ceph_crypto_alloc_cipher(void)
static const u8 *aes_iv = (u8 *)CEPH_AES_IV;
+/*
+ * Should be used for buffers allocated with ceph_kvmalloc().
+ * Currently these are encrypt out-buffer (ceph_buffer) and decrypt
+ * in-buffer (msg front).
+ *
+ * Dispose of @sgt with teardown_sgtable().
+ *
+ * @prealloc_sg is to avoid memory allocation inside sg_alloc_table()
+ * in cases where a single sg is sufficient. No attempt to reduce the
+ * number of sgs by squeezing physically contiguous pages together is
+ * made though, for simplicity.
+ */
+static int setup_sgtable(struct sg_table *sgt, struct scatterlist *prealloc_sg,
+ const void *buf, unsigned int buf_len)
+{
+ struct scatterlist *sg;
+ const bool is_vmalloc = is_vmalloc_addr(buf);
+ unsigned int off = offset_in_page(buf);
+ unsigned int chunk_cnt = 1;
+ unsigned int chunk_len = PAGE_ALIGN(off + buf_len);
+ int i;
+ int ret;
+
+ if (buf_len == 0) {
+ memset(sgt, 0, sizeof(*sgt));
+ return -EINVAL;
+ }
+
+ if (is_vmalloc) {
+ chunk_cnt = chunk_len >> PAGE_SHIFT;
+ chunk_len = PAGE_SIZE;
+ }
+
+ if (chunk_cnt > 1) {
+ ret = sg_alloc_table(sgt, chunk_cnt, GFP_NOFS);
+ if (ret)
+ return ret;
+ } else {
+ WARN_ON(chunk_cnt != 1);
+ sg_init_table(prealloc_sg, 1);
+ sgt->sgl = prealloc_sg;
+ sgt->nents = sgt->orig_nents = 1;
+ }
+
+ for_each_sg(sgt->sgl, sg, sgt->orig_nents, i) {
+ struct page *page;
+ unsigned int len = min(chunk_len - off, buf_len);
+
+ if (is_vmalloc)
+ page = vmalloc_to_page(buf);
+ else
+ page = virt_to_page(buf);
+
+ sg_set_page(sg, page, len, off);
+
+ off = 0;
+ buf += len;
+ buf_len -= len;
+ }
+ WARN_ON(buf_len != 0);
+
+ return 0;
+}
+
+static void teardown_sgtable(struct sg_table *sgt)
+{
+ if (sgt->orig_nents > 1)
+ sg_free_table(sgt);
+}
+
static int ceph_aes_encrypt(const void *key, int key_len,
void *dst, size_t *dst_len,
const void *src, size_t src_len)
{
- struct scatterlist sg_in[2], sg_out[1];
+ struct scatterlist sg_in[2], prealloc_sg;
+ struct sg_table sg_out;
struct crypto_blkcipher *tfm = ceph_crypto_alloc_cipher();
struct blkcipher_desc desc = { .tfm = tfm, .flags = 0 };
int ret;
@@ -109,16 +180,18 @@ static int ceph_aes_encrypt(const void *key, int key_len,
*dst_len = src_len + zero_padding;
- crypto_blkcipher_setkey((void *)tfm, key, key_len);
sg_init_table(sg_in, 2);
sg_set_buf(&sg_in[0], src, src_len);
sg_set_buf(&sg_in[1], pad, zero_padding);
- sg_init_table(sg_out, 1);
- sg_set_buf(sg_out, dst, *dst_len);
+ ret = setup_sgtable(&sg_out, &prealloc_sg, dst, *dst_len);
+ if (ret)
+ goto out_tfm;
+
+ crypto_blkcipher_setkey((void *)tfm, key, key_len);
iv = crypto_blkcipher_crt(tfm)->iv;
ivsize = crypto_blkcipher_ivsize(tfm);
-
memcpy(iv, aes_iv, ivsize);
+
/*
print_hex_dump(KERN_ERR, "enc key: ", DUMP_PREFIX_NONE, 16, 1,
key, key_len, 1);
@@ -127,16 +200,22 @@ static int ceph_aes_encrypt(const void *key, int key_len,
print_hex_dump(KERN_ERR, "enc pad: ", DUMP_PREFIX_NONE, 16, 1,
pad, zero_padding, 1);
*/
- ret = crypto_blkcipher_encrypt(&desc, sg_out, sg_in,
+ ret = crypto_blkcipher_encrypt(&desc, sg_out.sgl, sg_in,
src_len + zero_padding);
- crypto_free_blkcipher(tfm);
- if (ret < 0)
+ if (ret < 0) {
pr_err("ceph_aes_crypt failed %d\n", ret);
+ goto out_sg;
+ }
/*
print_hex_dump(KERN_ERR, "enc out: ", DUMP_PREFIX_NONE, 16, 1,
dst, *dst_len, 1);
*/
- return 0;
+
+out_sg:
+ teardown_sgtable(&sg_out);
+out_tfm:
+ crypto_free_blkcipher(tfm);
+ return ret;
}
static int ceph_aes_encrypt2(const void *key, int key_len, void *dst,
@@ -144,7 +223,8 @@ static int ceph_aes_encrypt2(const void *key, int key_len, void *dst,
const void *src1, size_t src1_len,
const void *src2, size_t src2_len)
{
- struct scatterlist sg_in[3], sg_out[1];
+ struct scatterlist sg_in[3], prealloc_sg;
+ struct sg_table sg_out;
struct crypto_blkcipher *tfm = ceph_crypto_alloc_cipher();
struct blkcipher_desc desc = { .tfm = tfm, .flags = 0 };
int ret;
@@ -160,17 +240,19 @@ static int ceph_aes_encrypt2(const void *key, int key_len, void *dst,
*dst_len = src1_len + src2_len + zero_padding;
- crypto_blkcipher_setkey((void *)tfm, key, key_len);
sg_init_table(sg_in, 3);
sg_set_buf(&sg_in[0], src1, src1_len);
sg_set_buf(&sg_in[1], src2, src2_len);
sg_set_buf(&sg_in[2], pad, zero_padding);
- sg_init_table(sg_out, 1);
- sg_set_buf(sg_out, dst, *dst_len);
+ ret = setup_sgtable(&sg_out, &prealloc_sg, dst, *dst_len);
+ if (ret)
+ goto out_tfm;
+
+ crypto_blkcipher_setkey((void *)tfm, key, key_len);
iv = crypto_blkcipher_crt(tfm)->iv;
ivsize = crypto_blkcipher_ivsize(tfm);
-
memcpy(iv, aes_iv, ivsize);
+
/*
print_hex_dump(KERN_ERR, "enc key: ", DUMP_PREFIX_NONE, 16, 1,
key, key_len, 1);
@@ -181,23 +263,30 @@ static int ceph_aes_encrypt2(const void *key, int key_len, void *dst,
print_hex_dump(KERN_ERR, "enc pad: ", DUMP_PREFIX_NONE, 16, 1,
pad, zero_padding, 1);
*/
- ret = crypto_blkcipher_encrypt(&desc, sg_out, sg_in,
+ ret = crypto_blkcipher_encrypt(&desc, sg_out.sgl, sg_in,
src1_len + src2_len + zero_padding);
- crypto_free_blkcipher(tfm);
- if (ret < 0)
+ if (ret < 0) {
pr_err("ceph_aes_crypt2 failed %d\n", ret);
+ goto out_sg;
+ }
/*
print_hex_dump(KERN_ERR, "enc out: ", DUMP_PREFIX_NONE, 16, 1,
dst, *dst_len, 1);
*/
- return 0;
+
+out_sg:
+ teardown_sgtable(&sg_out);
+out_tfm:
+ crypto_free_blkcipher(tfm);
+ return ret;
}
static int ceph_aes_decrypt(const void *key, int key_len,
void *dst, size_t *dst_len,
const void *src, size_t src_len)
{
- struct scatterlist sg_in[1], sg_out[2];
+ struct sg_table sg_in;
+ struct scatterlist sg_out[2], prealloc_sg;
struct crypto_blkcipher *tfm = ceph_crypto_alloc_cipher();
struct blkcipher_desc desc = { .tfm = tfm };
char pad[16];
@@ -209,16 +298,16 @@ static int ceph_aes_decrypt(const void *key, int key_len,
if (IS_ERR(tfm))
return PTR_ERR(tfm);
- crypto_blkcipher_setkey((void *)tfm, key, key_len);
- sg_init_table(sg_in, 1);
sg_init_table(sg_out, 2);
- sg_set_buf(sg_in, src, src_len);
sg_set_buf(&sg_out[0], dst, *dst_len);
sg_set_buf(&sg_out[1], pad, sizeof(pad));
+ ret = setup_sgtable(&sg_in, &prealloc_sg, src, src_len);
+ if (ret)
+ goto out_tfm;
+ crypto_blkcipher_setkey((void *)tfm, key, key_len);
iv = crypto_blkcipher_crt(tfm)->iv;
ivsize = crypto_blkcipher_ivsize(tfm);
-
memcpy(iv, aes_iv, ivsize);
/*
@@ -227,12 +316,10 @@ static int ceph_aes_decrypt(const void *key, int key_len,
print_hex_dump(KERN_ERR, "dec in: ", DUMP_PREFIX_NONE, 16, 1,
src, src_len, 1);
*/
-
- ret = crypto_blkcipher_decrypt(&desc, sg_out, sg_in, src_len);
- crypto_free_blkcipher(tfm);
+ ret = crypto_blkcipher_decrypt(&desc, sg_out, sg_in.sgl, src_len);
if (ret < 0) {
pr_err("ceph_aes_decrypt failed %d\n", ret);
- return ret;
+ goto out_sg;
}
if (src_len <= *dst_len)
@@ -250,7 +337,12 @@ static int ceph_aes_decrypt(const void *key, int key_len,
print_hex_dump(KERN_ERR, "dec out: ", DUMP_PREFIX_NONE, 16, 1,
dst, *dst_len, 1);
*/
- return 0;
+
+out_sg:
+ teardown_sgtable(&sg_in);
+out_tfm:
+ crypto_free_blkcipher(tfm);
+ return ret;
}
static int ceph_aes_decrypt2(const void *key, int key_len,
@@ -258,7 +350,8 @@ static int ceph_aes_decrypt2(const void *key, int key_len,
void *dst2, size_t *dst2_len,
const void *src, size_t src_len)
{
- struct scatterlist sg_in[1], sg_out[3];
+ struct sg_table sg_in;
+ struct scatterlist sg_out[3], prealloc_sg;
struct crypto_blkcipher *tfm = ceph_crypto_alloc_cipher();
struct blkcipher_desc desc = { .tfm = tfm };
char pad[16];
@@ -270,17 +363,17 @@ static int ceph_aes_decrypt2(const void *key, int key_len,
if (IS_ERR(tfm))
return PTR_ERR(tfm);
- sg_init_table(sg_in, 1);
- sg_set_buf(sg_in, src, src_len);
sg_init_table(sg_out, 3);
sg_set_buf(&sg_out[0], dst1, *dst1_len);
sg_set_buf(&sg_out[1], dst2, *dst2_len);
sg_set_buf(&sg_out[2], pad, sizeof(pad));
+ ret = setup_sgtable(&sg_in, &prealloc_sg, src, src_len);
+ if (ret)
+ goto out_tfm;
crypto_blkcipher_setkey((void *)tfm, key, key_len);
iv = crypto_blkcipher_crt(tfm)->iv;
ivsize = crypto_blkcipher_ivsize(tfm);
-
memcpy(iv, aes_iv, ivsize);
/*
@@ -289,12 +382,10 @@ static int ceph_aes_decrypt2(const void *key, int key_len,
print_hex_dump(KERN_ERR, "dec in: ", DUMP_PREFIX_NONE, 16, 1,
src, src_len, 1);
*/
-
- ret = crypto_blkcipher_decrypt(&desc, sg_out, sg_in, src_len);
- crypto_free_blkcipher(tfm);
+ ret = crypto_blkcipher_decrypt(&desc, sg_out, sg_in.sgl, src_len);
if (ret < 0) {
pr_err("ceph_aes_decrypt failed %d\n", ret);
- return ret;
+ goto out_sg;
}
if (src_len <= *dst1_len)
@@ -324,7 +415,11 @@ static int ceph_aes_decrypt2(const void *key, int key_len,
dst2, *dst2_len, 1);
*/
- return 0;
+out_sg:
+ teardown_sgtable(&sg_in);
+out_tfm:
+ crypto_free_blkcipher(tfm);
+ return ret;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 082/121] ARM: 8191/1: decompressor: ensure I-side picks up relocated code
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (80 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 081/121] libceph: do not crash on large auth tickets Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 083/121] ARM: 8198/1: make kuser helpers depend on MMU Kamal Mostafa
` (38 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Will Deacon, Russell King, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit 238962ac71910d6c20162ea5230685fead1836a4 upstream.
To speed up decompression, the decompressor sets up a flat, cacheable
mapping of memory. However, when there is insufficient space to hold
the page tables for this mapping, we don't bother to enable the caches
and subsequently skip all the cache maintenance hooks.
Skipping the cache maintenance before jumping to the relocated code
allows the processor to predict the branch and populate the I-cache
with stale data before the relocation loop has completed (since a
bootloader may have SCTLR.I set, which permits normal, cacheable
instruction fetches regardless of SCTLR.M).
This patch moves the cache maintenance check into the maintenance
routines themselves, allowing the v6/v7 versions to invalidate the
I-cache regardless of the MMU state.
Reported-by: Marc Carino <marc.ceeeee@gmail.com>
Tested-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/compressed/head.S | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 066b034..8017cde 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -400,8 +400,7 @@ dtb_check_done:
add sp, sp, r6
#endif
- tst r4, #1
- bleq cache_clean_flush
+ bl cache_clean_flush
adr r0, BSYM(restart)
add r0, r0, r6
@@ -1050,6 +1049,8 @@ cache_clean_flush:
b call_cache_fn
__armv4_mpu_cache_flush:
+ tst r4, #1
+ movne pc, lr
mov r2, #1
mov r3, #0
mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
@@ -1067,6 +1068,8 @@ __armv4_mpu_cache_flush:
mov pc, lr
__fa526_cache_flush:
+ tst r4, #1
+ movne pc, lr
mov r1, #0
mcr p15, 0, r1, c7, c14, 0 @ clean and invalidate D cache
mcr p15, 0, r1, c7, c5, 0 @ flush I cache
@@ -1075,13 +1078,16 @@ __fa526_cache_flush:
__armv6_mmu_cache_flush:
mov r1, #0
- mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D
+ tst r4, #1
+ mcreq p15, 0, r1, c7, c14, 0 @ clean+invalidate D
mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB
- mcr p15, 0, r1, c7, c15, 0 @ clean+invalidate unified
+ mcreq p15, 0, r1, c7, c15, 0 @ clean+invalidate unified
mcr p15, 0, r1, c7, c10, 4 @ drain WB
mov pc, lr
__armv7_mmu_cache_flush:
+ tst r4, #1
+ bne iflush
mrc p15, 0, r10, c0, c1, 5 @ read ID_MMFR1
tst r10, #0xf << 16 @ hierarchical cache (ARMv7)
mov r10, #0
@@ -1142,6 +1148,8 @@ iflush:
mov pc, lr
__armv5tej_mmu_cache_flush:
+ tst r4, #1
+ movne pc, lr
1: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate D cache
bne 1b
mcr p15, 0, r0, c7, c5, 0 @ flush I cache
@@ -1149,6 +1157,8 @@ __armv5tej_mmu_cache_flush:
mov pc, lr
__armv4_mmu_cache_flush:
+ tst r4, #1
+ movne pc, lr
mov r2, #64*1024 @ default: 32K dcache size (*2)
mov r11, #32 @ default: 32 byte line size
mrc p15, 0, r3, c0, c0, 1 @ read cache type
@@ -1182,6 +1192,8 @@ no_cache_id:
__armv3_mmu_cache_flush:
__armv3_mpu_cache_flush:
+ tst r4, #1
+ movne pc, lr
mov r1, #0
mcr p15, 0, r1, c7, c0, 0 @ invalidate whole cache v3
mov pc, lr
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 083/121] ARM: 8198/1: make kuser helpers depend on MMU
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (81 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 082/121] ARM: 8191/1: decompressor: ensure I-side picks up relocated code Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 084/121] zram: avoid kunmap_atomic() of a NULL pointer Kamal Mostafa
` (37 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nathan Lynch, Russell King, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Lynch <nathan_lynch@mentor.com>
commit 08b964ff3c51b10aaf2e6ba639f40054c09f0f7a upstream.
The kuser helpers page is not set up on non-MMU systems, so it does
not make sense to allow CONFIG_KUSER_HELPERS to be enabled when
CONFIG_MMU=n. Allowing it to be set on !MMU results in an oops in
set_tls (used in execve and the arm_syscall trap handler):
Unhandled exception: IPSR = 00000005 LR = fffffff1
CPU: 0 PID: 1 Comm: swapper Not tainted 3.18.0-rc1-00041-ga30465a #216
task: 8b838000 ti: 8b82a000 task.ti: 8b82a000
PC is at flush_thread+0x32/0x40
LR is at flush_thread+0x21/0x40
pc : [<8f00157a>] lr : [<8f001569>] psr: 4100000b
sp : 8b82be20 ip : 00000000 fp : 8b83c000
r10: 00000001 r9 : 88018c84 r8 : 8bb85000
r7 : 8b838000 r6 : 00000000 r5 : 8bb77400 r4 : 8b82a000
r3 : ffff0ff0 r2 : 8b82a000 r1 : 00000000 r0 : 88020354
xPSR: 4100000b
CPU: 0 PID: 1 Comm: swapper Not tainted 3.18.0-rc1-00041-ga30465a #216
[<8f002bc1>] (unwind_backtrace) from [<8f002033>] (show_stack+0xb/0xc)
[<8f002033>] (show_stack) from [<8f00265b>] (__invalid_entry+0x4b/0x4c)
As best I can tell this issue existed for the set_tls ARM syscall
before commit fbfb872f5f41 "ARM: 8148/1: flush TLS and thumbee
register state during exec" consolidated the TLS manipulation code
into the set_tls helper function, but now that we're using it to flush
register state during execve, !MMU users encounter the oops at the
first exec.
Prevent CONFIG_MMU=n configurations from enabling
CONFIG_KUSER_HELPERS.
Fixes: fbfb872f5f41 (ARM: 8148/1: flush TLS and thumbee register state during exec)
Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Reported-by: Stefan Agner <stefan@agner.ch>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/mm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index ca8ecde..e9c290c 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -798,6 +798,7 @@ config NEED_KUSER_HELPERS
config KUSER_HELPERS
bool "Enable kuser helpers in vector page" if !NEED_KUSER_HELPERS
+ depends on MMU
default y
help
Warning: disabling this option may break user programs.
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 084/121] zram: avoid kunmap_atomic() of a NULL pointer
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (82 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 083/121] ARM: 8198/1: make kuser helpers depend on MMU Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 085/121] Input: alps - ignore bad data on Dell Latitudes E6440 and E7440 Kamal Mostafa
` (36 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Weijie Yang, Sergey Senozhatsky, Dan Streetman, Nitin Gupta,
Weijie Yang, Andrew Morton, Linus Torvalds, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Weijie Yang <weijie.yang@samsung.com>
commit c406515239376fc93a30d5d03192182160cbd3fb upstream.
zram could kunmap_atomic() a NULL pointer in a rare situation: a zram
page becomes a full-zeroed page after a partial write io. The current
code doesn't handle this case and performs kunmap_atomic() on a NULL
pointer, which panics the kernel.
This patch fixes this issue.
Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Weijie Yang <weijie.yang.kh@gmail.com>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/staging/zram/zram_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index e2f0add..63c2a5b 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -430,7 +430,8 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
}
if (page_zero_filled(uncmem)) {
- kunmap_atomic(user_mem);
+ if (user_mem)
+ kunmap_atomic(user_mem);
/* Free memory associated with this sector now. */
zram_free_page(zram, index);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 085/121] Input: alps - ignore bad data on Dell Latitudes E6440 and E7440
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (83 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 084/121] zram: avoid kunmap_atomic() of a NULL pointer Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 086/121] firewire: cdev: prevent kernel stack leaking into ioctl arguments Kamal Mostafa
` (35 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Pali Rohár, Dmitry Torokhov, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
commit a7ef82aee91f26da79b981b9f5bca43b8817d3e4 upstream.
Sometimes on Dell Latitude laptops psmouse/alps driver receive invalid ALPS
protocol V3 packets with bit7 set in last byte. More often it can be
reproduced on Dell Latitude E6440 or E7440 with closed lid and pushing
cover above touchpad.
If bit7 in last packet byte is set then it is not valid ALPS packet. I was
told that ALPS devices never send these packets. It is not know yet who
send those packets, it could be Dell EC, bug in BIOS and also bug in
touchpad firmware...
With this patch alps driver does not process those invalid packets, but
instead of reporting PSMOUSE_BAD_DATA, getting into out of sync state,
getting back in sync with the next byte and spam dmesg we return
PSMOUSE_FULL_PACKET. If driver is truly out of sync we'll fail the checks
on the next byte and report PSMOUSE_BAD_DATA then.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/input/mouse/alps.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 00544a6..b1385f0 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -993,12 +993,27 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
}
/* Bytes 2 - pktsize should have 0 in the highest bit */
- if ((priv->proto_version < ALPS_PROTO_V5) &&
+ if (priv->proto_version < ALPS_PROTO_V5 &&
psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize &&
(psmouse->packet[psmouse->pktcnt - 1] & 0x80)) {
psmouse_dbg(psmouse, "refusing packet[%i] = %x\n",
psmouse->pktcnt - 1,
psmouse->packet[psmouse->pktcnt - 1]);
+
+ if (priv->proto_version == ALPS_PROTO_V3 &&
+ psmouse->pktcnt == psmouse->pktsize) {
+ /*
+ * Some Dell boxes, such as Latitude E6440 or E7440
+ * with closed lid, quite often smash last byte of
+ * otherwise valid packet with 0xff. Given that the
+ * next packet is very likely to be valid let's
+ * report PSMOUSE_FULL_PACKET but not process data,
+ * rather than reporting PSMOUSE_BAD_DATA and
+ * filling the logs.
+ */
+ return PSMOUSE_FULL_PACKET;
+ }
+
return PSMOUSE_BAD_DATA;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 086/121] firewire: cdev: prevent kernel stack leaking into ioctl arguments
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (84 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 085/121] Input: alps - ignore bad data on Dell Latitudes E6440 and E7440 Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 087/121] md: Always set RECOVERY_NEEDED when clearing RECOVERY_FROZEN Kamal Mostafa
` (34 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Stefan Richter, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
commit eaca2d8e75e90a70a63a6695c9f61932609db212 upstream.
Found by the UC-KLEE tool: A user could supply less input to
firewire-cdev ioctls than write- or write/read-type ioctl handlers
expect. The handlers used data from uninitialized kernel stack then.
This could partially leak back to the user if the kernel subsequently
generated fw_cdev_event_'s (to be read from the firewire-cdev fd)
which notably would contain the _u64 closure field which many of the
ioctl argument structures contain.
The fact that the handlers would act on random garbage input is a
lesser issue since all handlers must check their input anyway.
The fix simply always null-initializes the entire ioctl argument buffer
regardless of the actual length of expected user input. That is, a
runtime overhead of memset(..., 40) is added to each firewirew-cdev
ioctl() call. [Comment from Clemens Ladisch: This part of the stack is
most likely to be already in the cache.]
Remarks:
- There was never any leak from kernel stack to the ioctl output
buffer itself. IOW, it was not possible to read kernel stack by a
read-type or write/read-type ioctl alone; the leak could at most
happen in combination with read()ing subsequent event data.
- The actual expected minimum user input of each ioctl from
include/uapi/linux/firewire-cdev.h is, in bytes:
[0x00] = 32, [0x05] = 4, [0x0a] = 16, [0x0f] = 20, [0x14] = 16,
[0x01] = 36, [0x06] = 20, [0x0b] = 4, [0x10] = 20, [0x15] = 20,
[0x02] = 20, [0x07] = 4, [0x0c] = 0, [0x11] = 0, [0x16] = 8,
[0x03] = 4, [0x08] = 24, [0x0d] = 20, [0x12] = 36, [0x17] = 12,
[0x04] = 20, [0x09] = 24, [0x0e] = 4, [0x13] = 40, [0x18] = 4.
Reported-by: David Ramos <daramos@stanford.edu>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/firewire/core-cdev.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index d7d5c8a..6d44568 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -1637,8 +1637,7 @@ static int dispatch_ioctl(struct client *client,
_IOC_SIZE(cmd) > sizeof(buffer))
return -ENOTTY;
- if (_IOC_DIR(cmd) == _IOC_READ)
- memset(&buffer, 0, _IOC_SIZE(cmd));
+ memset(&buffer, 0, sizeof(buffer));
if (_IOC_DIR(cmd) & _IOC_WRITE)
if (copy_from_user(&buffer, arg, _IOC_SIZE(cmd)))
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 087/121] md: Always set RECOVERY_NEEDED when clearing RECOVERY_FROZEN
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (85 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 086/121] firewire: cdev: prevent kernel stack leaking into ioctl arguments Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 088/121] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait Kamal Mostafa
` (33 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <neilb@suse.de>
commit 45eaf45dfa4850df16bc2e8e7903d89021137f40 upstream.
md_check_recovery will skip any recovery and also clear
MD_RECOVERY_NEEDED if MD_RECOVERY_FROZEN is set.
So when we clear _FROZEN, we must set _NEEDED and ensure that
md_check_recovery gets run.
Otherwise we could miss out on something that is needed.
In particular, this can make it impossible to remove a
failed device from an array is the 'recovery-needed' processing
didn't happen.
Suitable for stable kernels since 3.13.
Reported-and-tested-by: Joe Lawrence <joe.lawrence@stratus.com>
Fixes: 30b8feb730f9b9b3c5de02580897da03f59b6b16
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/md.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 09377ba..2ee29a7 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5321,6 +5321,7 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
printk("md: %s still in use.\n",mdname(mddev));
if (did_freeze) {
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
+ set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
md_wakeup_thread(mddev->thread);
}
err = -EBUSY;
@@ -5335,6 +5336,8 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
mddev->ro = 1;
set_disk_ro(mddev->gendisk, 1);
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
+ set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+ md_wakeup_thread(mddev->thread);
sysfs_notify_dirent_safe(mddev->sysfs_state);
err = 0;
}
@@ -5378,6 +5381,7 @@ static int do_md_stop(struct mddev * mddev, int mode,
mutex_unlock(&mddev->open_mutex);
if (did_freeze) {
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
+ set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
md_wakeup_thread(mddev->thread);
}
return -EBUSY;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 088/121] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (86 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 087/121] md: Always set RECOVERY_NEEDED when clearing RECOVERY_FROZEN Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 089/121] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Kamal Mostafa
` (32 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Jeffery, Trond Myklebust, Moritz Mühlenhoff,
Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Jeffery <djeffery@redhat.com>
commit 92a56555bd576c61b27a5cab9f38a33a1e9a1df5 upstream.
If a SIGKILL is sent to a task waiting in __nfs_iocounter_wait,
it will busy-wait or soft lockup in its while loop.
nfs_wait_bit_killable won't sleep, and the loop won't exit on
the error return.
Stop the busy-wait by breaking out of the loop when
nfs_wait_bit_killable returns an error.
Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[ kamal: backport to 3.13-stable: context ]
Cc: Moritz Mühlenhoff <muehlenhoff@univention.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/pagelist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 2ffebf2..27d7f27 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -113,7 +113,7 @@ __nfs_iocounter_wait(struct nfs_io_counter *c)
if (atomic_read(&c->io_count) == 0)
break;
ret = nfs_wait_bit_killable(&c->flags);
- } while (atomic_read(&c->io_count) != 0);
+ } while (atomic_read(&c->io_count) != 0 && !ret);
finish_wait(wq, &q.wait);
return ret;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 089/121] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (87 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 088/121] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 090/121] target: Don't call TFO->write_pending if data_length == 0 Kamal Mostafa
` (31 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Paolo Bonzini,
Chris J Arges, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bonzini <pbonzini@redhat.com>
commit c1118b3602c2329671ad5ec8bdf8e374323d6343 upstream.
On x86_64, kernel text mappings are mapped read-only with CONFIG_DEBUG_RODATA.
In that case, KVM will fail to patch VMCALL instructions to VMMCALL
as required on AMD processors.
The failure mode is currently a divide-by-zero exception, which obviously
is a KVM bug that has to be fixed. However, picking the right instruction
between VMCALL and VMMCALL will be faster and will help if you cannot upgrade
the hypervisor.
Reported-by: Chris Webb <chris@arachsys.com>
Tested-by: Chris Webb <chris@arachsys.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/cpufeature.h | 1 +
arch/x86/include/asm/kvm_para.h | 10 ++++++++--
arch/x86/kernel/cpu/amd.c | 7 +++++++
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 1e49a03..cbc03f9 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -203,6 +203,7 @@
#define X86_FEATURE_DECODEASSISTS (8*32+12) /* AMD Decode Assists support */
#define X86_FEATURE_PAUSEFILTER (8*32+13) /* AMD filtered pause intercept */
#define X86_FEATURE_PFTHRESHOLD (8*32+14) /* AMD pause filter threshold */
+#define X86_FEATURE_VMMCALL (8*32+15) /* Prefer vmmcall to vmcall */
/* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index c7678e4..e62cf89 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -2,6 +2,7 @@
#define _ASM_X86_KVM_PARA_H
#include <asm/processor.h>
+#include <asm/alternative.h>
#include <uapi/asm/kvm_para.h>
extern void kvmclock_init(void);
@@ -16,10 +17,15 @@ static inline bool kvm_check_and_clear_guest_paused(void)
}
#endif /* CONFIG_KVM_GUEST */
-/* This instruction is vmcall. On non-VT architectures, it will generate a
- * trap that we will then rewrite to the appropriate instruction.
+#ifdef CONFIG_DEBUG_RODATA
+#define KVM_HYPERCALL \
+ ALTERNATIVE(".byte 0x0f,0x01,0xc1", ".byte 0x0f,0x01,0xd9", X86_FEATURE_VMMCALL)
+#else
+/* On AMD processors, vmcall will generate a trap that we will
+ * then rewrite to the appropriate instruction.
*/
#define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1"
+#endif
/* For KVM hypercalls, a three-byte sequence of either the vmcall or the vmmcall
* instruction. The hypervisor may replace it with something else but only the
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 59bfebc..3bb450b 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -509,6 +509,13 @@ static void early_init_amd(struct cpuinfo_x86 *c)
}
#endif
+ /*
+ * This is only needed to tell the kernel whether to use VMCALL
+ * and VMMCALL. VMMCALL is never executed except under virt, so
+ * we can set it unconditionally.
+ */
+ set_cpu_cap(c, X86_FEATURE_VMMCALL);
+
/* F16h erratum 793, CVE-2013-6885 */
if (c->x86 == 0x16 && c->x86_model <= 0xf) {
u64 val;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 090/121] target: Don't call TFO->write_pending if data_length == 0
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (88 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 089/121] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 091/121] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT Kamal Mostafa
` (30 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Roland Dreier, Nicholas Bellinger, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Roland Dreier <roland@purestorage.com>
commit 885e7b0e181c14e4d0ddd26c688bad2b84c1ada9 upstream.
If an initiator sends a zero-length command (e.g. TEST UNIT READY) but
sets the transfer direction in the transport layer to indicate a
data-out phase, we still shouldn't try to transfer data. At best it's
a NOP, and depending on the transport, we might crash on an
uninitialized sg list.
Reported-by: Craig Watson <craig.watson@vanguard-rugged.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/target/target_core_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 3acb125..40f171b 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2192,7 +2192,7 @@ transport_generic_new_cmd(struct se_cmd *cmd)
* and let it call back once the write buffers are ready.
*/
target_add_to_state_list(cmd);
- if (cmd->data_direction != DMA_TO_DEVICE) {
+ if (cmd->data_direction != DMA_TO_DEVICE || cmd->data_length == 0) {
target_execute_cmd(cmd);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 091/121] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (89 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 090/121] target: Don't call TFO->write_pending if data_length == 0 Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 092/121] srp-target: Retry when QP creation fails with ENOMEM Kamal Mostafa
` (29 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michael S. Tsirkin, Paolo Bonzini, Stefan Hajnoczi,
Nicholas Bellinger, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <nab@linux-iscsi.org>
commit ab8edab132829b26dd13db6caca3c242cce35dc1 upstream.
This patch addresses a bug where individual vhost-scsi configfs endpoint
groups can be removed from below while active exports to QEMU userspace
still exist, resulting in an OOPs.
It adds a configfs_depend_item() in vhost_scsi_set_endpoint() to obtain
an explicit dependency on se_tpg->tpg_group in order to prevent individual
vhost-scsi WWPN endpoints from being released via normal configfs methods
while an QEMU ioctl reference still exists.
Also, add matching configfs_undepend_item() in vhost_scsi_clear_endpoint()
to release the dependency, once QEMU's reference to the individual group
at /sys/kernel/config/target/vhost/$WWPN/$TPGT is released.
(Fix up vhost_scsi_clear_endpoint() error path - DanC)
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/vhost/scsi.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 1d0196e..bb52909 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1194,6 +1194,7 @@ static int
vhost_scsi_set_endpoint(struct vhost_scsi *vs,
struct vhost_scsi_target *t)
{
+ struct se_portal_group *se_tpg;
struct tcm_vhost_tport *tv_tport;
struct tcm_vhost_tpg *tpg;
struct tcm_vhost_tpg **vs_tpg;
@@ -1241,6 +1242,21 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
ret = -EEXIST;
goto out;
}
+ /*
+ * In order to ensure individual vhost-scsi configfs
+ * groups cannot be removed while in use by vhost ioctl,
+ * go ahead and take an explicit se_tpg->tpg_group.cg_item
+ * dependency now.
+ */
+ se_tpg = &tpg->se_tpg;
+ ret = configfs_depend_item(se_tpg->se_tpg_tfo->tf_subsys,
+ &se_tpg->tpg_group.cg_item);
+ if (ret) {
+ pr_warn("configfs_depend_item() failed: %d\n", ret);
+ kfree(vs_tpg);
+ mutex_unlock(&tpg->tv_tpg_mutex);
+ goto out;
+ }
tpg->tv_tpg_vhost_count++;
tpg->vhost_scsi = vs;
vs_tpg[tpg->tport_tpgt] = tpg;
@@ -1283,6 +1299,7 @@ static int
vhost_scsi_clear_endpoint(struct vhost_scsi *vs,
struct vhost_scsi_target *t)
{
+ struct se_portal_group *se_tpg;
struct tcm_vhost_tport *tv_tport;
struct tcm_vhost_tpg *tpg;
struct vhost_virtqueue *vq;
@@ -1331,6 +1348,13 @@ vhost_scsi_clear_endpoint(struct vhost_scsi *vs,
vs->vs_tpg[target] = NULL;
match = true;
mutex_unlock(&tpg->tv_tpg_mutex);
+ /*
+ * Release se_tpg->tpg_group.cg_item configfs dependency now
+ * to allow vhost-scsi WWPN se_tpg->tpg_group shutdown to occur.
+ */
+ se_tpg = &tpg->se_tpg;
+ configfs_undepend_item(se_tpg->se_tpg_tfo->tf_subsys,
+ &se_tpg->tpg_group.cg_item);
}
if (match) {
for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) {
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 092/121] srp-target: Retry when QP creation fails with ENOMEM
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (90 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 091/121] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 093/121] ASoC: fsi: remove unsupported PAUSE flag Kamal Mostafa
` (28 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bart Van Assche, Sagi Grimberg, Nicholas Bellinger, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <bvanassche@acm.org>
commit ab477c1ff5e0a744c072404bf7db51bfe1f05b6e upstream.
It is not guaranteed to that srp_sq_size is supported
by the HCA. So if we failed to create the QP with ENOMEM,
try with a smaller srp_sq_size. Keep it up until we hit
MIN_SRPT_SQ_SIZE, then fail the connection.
Reported-by: Mark Lehrer <lehrer@gmail.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index b4884ae..97309e4 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2091,6 +2091,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
if (!qp_init)
goto out;
+retry:
ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch,
ch->rq_size + srp_sq_size, 0);
if (IS_ERR(ch->cq)) {
@@ -2114,6 +2115,13 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
ch->qp = ib_create_qp(sdev->pd, qp_init);
if (IS_ERR(ch->qp)) {
ret = PTR_ERR(ch->qp);
+ if (ret == -ENOMEM) {
+ srp_sq_size /= 2;
+ if (srp_sq_size >= MIN_SRPT_SQ_SIZE) {
+ ib_destroy_cq(ch->cq);
+ goto retry;
+ }
+ }
printk(KERN_ERR "failed to create_qp ret= %d\n", ret);
goto err_destroy_cq;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 093/121] ASoC: fsi: remove unsupported PAUSE flag
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (91 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 092/121] srp-target: Retry when QP creation fails with ENOMEM Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 094/121] ASoC: rsnd: " Kamal Mostafa
` (27 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kuninori Morimoto, Mark Brown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
commit c1b9b9b1ad2df6144ca3fbe6989f7bd9ea5c5562 upstream.
FSI doesn't support PAUSE.
Remove SNDRV_PCM_INFO_PAUSE flags from snd_pcm_hardware info
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/sh/fsi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index b33ca7c..5dbf494 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1775,8 +1775,7 @@ static const struct snd_soc_dai_ops fsi_dai_ops = {
static struct snd_pcm_hardware fsi_pcm_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_PAUSE,
+ SNDRV_PCM_INFO_MMAP_VALID,
.formats = FSI_FMTS,
.rates = FSI_RATES,
.rate_min = 8000,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 094/121] ASoC: rsnd: remove unsupported PAUSE flag
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (92 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 093/121] ASoC: fsi: remove unsupported PAUSE flag Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 095/121] ib_isert: Add max_send_sge=2 minimum for control PDU responses Kamal Mostafa
` (26 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kuninori Morimoto, Mark Brown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
commit 706c66213e5e623e23f521b1acbd8171af7a3549 upstream.
R-Car sound doesn't support PAUSE.
Remove SNDRV_PCM_INFO_PAUSE flags from snd_pcm_hardware info
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/sh/rcar/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index b3653d3..47dd1b7 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -626,8 +626,7 @@ static void rsnd_dai_remove(struct platform_device *pdev,
static struct snd_pcm_hardware rsnd_pcm_hardware = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_PAUSE,
+ SNDRV_PCM_INFO_MMAP_VALID,
.formats = RSND_FMTS,
.rates = RSND_RATES,
.rate_min = 8000,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 095/121] ib_isert: Add max_send_sge=2 minimum for control PDU responses
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (93 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 094/121] ASoC: rsnd: " Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 096/121] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly Kamal Mostafa
` (25 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Or Gerlitz, Nicholas Bellinger, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Or Gerlitz <ogerlitz@mellanox.com>
commit f57915cfa5b2b14c1cffa2e83c034f55e3f0e70d upstream.
This patch adds a max_send_sge=2 minimum in isert_conn_setup_qp()
to ensure outgoing control PDU responses with tx_desc->num_sge=2
are able to function correctly.
This addresses a bug with RDMA hardware using dev_attr.max_sge=3,
that in the original code with the ConnectX-2 work-around would
result in isert_conn->max_sge=1 being negotiated.
Originally reported by Chris with ocrdma driver.
Reported-by: Chris Moore <Chris.Moore@emulex.com>
Tested-by: Chris Moore <Chris.Moore@emulex.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/ulp/isert/ib_isert.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 9b2a108..708ca27 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -112,9 +112,12 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id)
attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS;
/*
* FIXME: Use devattr.max_sge - 2 for max_send_sge as
- * work-around for RDMA_READ..
+ * work-around for RDMA_READs with ConnectX-2.
+ *
+ * Also, still make sure to have at least two SGEs for
+ * outgoing control PDU responses.
*/
- attr.cap.max_send_sge = device->dev_attr.max_sge - 2;
+ attr.cap.max_send_sge = max(2, device->dev_attr.max_sge - 2);
isert_conn->max_sge = attr.cap.max_send_sge;
attr.cap.max_recv_sge = 1;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 096/121] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (94 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 095/121] ib_isert: Add max_send_sge=2 minimum for control PDU responses Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 097/121] ASoC: dpcm: Fix race between FE/BE updates and trigger Kamal Mostafa
` (24 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sagi Grimberg, Nicholas Bellinger, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sagi Grimberg <sagig@dev.mellanox.co.il>
commit 3b726ae2de02a406cc91903f80132daee37b6f1b upstream.
In this case the cm_id->context is the isert_np, and the cm_id->qp
is NULL, so use that to distinct the cases.
Since we don't expect any other events on this cm_id we can
just return -1 for explicit termination of the cm_id by the
cma layer.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/ulp/isert/ib_isert.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 708ca27..39e5824 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -700,14 +700,25 @@ wake_up:
complete(&isert_conn->conn_wait);
}
-static void
+static int
isert_disconnected_handler(struct rdma_cm_id *cma_id, bool disconnect)
{
- struct isert_conn *isert_conn = (struct isert_conn *)cma_id->context;
+ struct isert_conn *isert_conn;
+
+ if (!cma_id->qp) {
+ struct isert_np *isert_np = cma_id->context;
+
+ isert_np->np_cm_id = NULL;
+ return -1;
+ }
+
+ isert_conn = (struct isert_conn *)cma_id->context;
isert_conn->disconnect = disconnect;
INIT_WORK(&isert_conn->conn_logout_work, isert_disconnect_work);
schedule_work(&isert_conn->conn_logout_work);
+
+ return 0;
}
static int
@@ -722,6 +733,9 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
switch (event->event) {
case RDMA_CM_EVENT_CONNECT_REQUEST:
ret = isert_connect_request(cma_id, event);
+ if (ret)
+ pr_err("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n",
+ event->event, ret);
break;
case RDMA_CM_EVENT_ESTABLISHED:
isert_connected_handler(cma_id);
@@ -731,7 +745,7 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
case RDMA_CM_EVENT_DEVICE_REMOVAL: /* FALLTHRU */
disconnect = true;
case RDMA_CM_EVENT_TIMEWAIT_EXIT: /* FALLTHRU */
- isert_disconnected_handler(cma_id, disconnect);
+ ret = isert_disconnected_handler(cma_id, disconnect);
break;
case RDMA_CM_EVENT_CONNECT_ERROR:
default:
@@ -739,12 +753,6 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
break;
}
- if (ret != 0) {
- pr_err("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n",
- event->event, ret);
- dump_stack();
- }
-
return ret;
}
@@ -2747,7 +2755,8 @@ isert_free_np(struct iscsi_np *np)
{
struct isert_np *isert_np = (struct isert_np *)np->np_context;
- rdma_destroy_id(isert_np->np_cm_id);
+ if (isert_np->np_cm_id)
+ rdma_destroy_id(isert_np->np_cm_id);
np->np_context = NULL;
kfree(isert_np);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 097/121] ASoC: dpcm: Fix race between FE/BE updates and trigger
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (95 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 096/121] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 098/121] mac80211: Fix regression that triggers a kernel BUG with CCMP Kamal Mostafa
` (23 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Mark Brown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit ea9d0d771fcd32cd56070819749477d511ec9117 upstream.
DPCM can update the FE/BE connection states totally asynchronously
from the FE's PCM state. Most of FE/BE state changes are protected by
mutex, so that they won't race, but there are still some actions that
are uncovered. For example, suppose to switch a BE while a FE's
stream is running. This would call soc_dpcm_runtime_update(), which
sets FE's runtime_update flag, then sets up and starts BEs, and clears
FE's runtime_update flag again.
When a device emits XRUN during this operation, the PCM core triggers
snd_pcm_stop(XRUN). Since the trigger action is an atomic ops, this
isn't blocked by the mutex, thus it kicks off DPCM's trigger action.
It eventually updates and clears FE's runtime_update flag while
soc_dpcm_runtime_update() is running concurrently, and it results in
confusion.
Usually, for avoiding such a race, we take a lock. There is a PCM
stream lock for that purpose. However, as already mentioned, the
trigger action is atomic, and we can't take the lock for the whole
soc_dpcm_runtime_update() or other operations that include the lengthy
jobs like hw_params or prepare.
This patch provides an alternative solution. This adds a way to defer
the conflicting trigger callback to be executed at the end of FE/BE
state changes. For doing it, two things are introduced:
- Each runtime_update state change of FEs is protected via PCM stream
lock.
- The FE's trigger callback checks the runtime_update flag. If it's
not set, the trigger action is executed there. If set, mark the
pending trigger action and returns immediately.
- At the exit of runtime_update state change, it checks whether the
pending trigger is present. If yes, it executes the trigger action
at this point.
Reported-and-tested-by: Qiao Zhou <zhouqiao@marvell.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/sound/soc-dpcm.h | 2 ++
sound/soc/soc-pcm.c | 72 +++++++++++++++++++++++++++++++++++++-----------
2 files changed, 58 insertions(+), 16 deletions(-)
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 047d657..3007641 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -101,6 +101,8 @@ struct snd_soc_dpcm_runtime {
/* state and update */
enum snd_soc_dpcm_update runtime_update;
enum snd_soc_dpcm_state state;
+
+ int trigger_pending; /* trigger cmd + 1 if pending, 0 if not */
};
/* can this BE stop and free */
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index e683959..d1c0b5e 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1155,13 +1155,36 @@ static void dpcm_set_fe_runtime(struct snd_pcm_substream *substream)
}
}
+static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd);
+
+/* Set FE's runtime_update state; the state is protected via PCM stream lock
+ * for avoiding the race with trigger callback.
+ * If the state is unset and a trigger is pending while the previous operation,
+ * process the pending trigger action here.
+ */
+static void dpcm_set_fe_update_state(struct snd_soc_pcm_runtime *fe,
+ int stream, enum snd_soc_dpcm_update state)
+{
+ struct snd_pcm_substream *substream =
+ snd_soc_dpcm_get_substream(fe, stream);
+
+ snd_pcm_stream_lock_irq(substream);
+ if (state == SND_SOC_DPCM_UPDATE_NO && fe->dpcm[stream].trigger_pending) {
+ dpcm_fe_dai_do_trigger(substream,
+ fe->dpcm[stream].trigger_pending - 1);
+ fe->dpcm[stream].trigger_pending = 0;
+ }
+ fe->dpcm[stream].runtime_update = state;
+ snd_pcm_stream_unlock_irq(substream);
+}
+
static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream)
{
struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
struct snd_pcm_runtime *runtime = fe_substream->runtime;
int stream = fe_substream->stream, ret = 0;
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
ret = dpcm_be_dai_startup(fe, fe_substream->stream);
if (ret < 0) {
@@ -1183,13 +1206,13 @@ static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream)
dpcm_set_fe_runtime(fe_substream);
snd_pcm_limit_hw_rates(runtime);
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
return 0;
unwind:
dpcm_be_dai_startup_unwind(fe, fe_substream->stream);
be_err:
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
return ret;
}
@@ -1236,7 +1259,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *fe = substream->private_data;
int stream = substream->stream;
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
/* shutdown the BEs */
dpcm_be_dai_shutdown(fe, substream->stream);
@@ -1250,7 +1273,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP);
fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE;
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
return 0;
}
@@ -1298,7 +1321,7 @@ static int dpcm_fe_dai_hw_free(struct snd_pcm_substream *substream)
int err, stream = substream->stream;
mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
dev_dbg(fe->dev, "ASoC: hw_free FE %s\n", fe->dai_link->name);
@@ -1313,7 +1336,7 @@ static int dpcm_fe_dai_hw_free(struct snd_pcm_substream *substream)
err = dpcm_be_dai_hw_free(fe, stream);
fe->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE;
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
mutex_unlock(&fe->card->mutex);
return 0;
@@ -1406,7 +1429,7 @@ static int dpcm_fe_dai_hw_params(struct snd_pcm_substream *substream,
int ret, stream = substream->stream;
mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
memcpy(&fe->dpcm[substream->stream].hw_params, params,
sizeof(struct snd_pcm_hw_params));
@@ -1429,7 +1452,7 @@ static int dpcm_fe_dai_hw_params(struct snd_pcm_substream *substream,
fe->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS;
out:
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
mutex_unlock(&fe->card->mutex);
return ret;
}
@@ -1543,7 +1566,7 @@ static int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
}
EXPORT_SYMBOL_GPL(dpcm_be_dai_trigger);
-static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd)
+static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_soc_pcm_runtime *fe = substream->private_data;
int stream = substream->stream, ret;
@@ -1617,6 +1640,23 @@ out:
return ret;
}
+static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd)
+{
+ struct snd_soc_pcm_runtime *fe = substream->private_data;
+ int stream = substream->stream;
+
+ /* if FE's runtime_update is already set, we're in race;
+ * process this trigger later at exit
+ */
+ if (fe->dpcm[stream].runtime_update != SND_SOC_DPCM_UPDATE_NO) {
+ fe->dpcm[stream].trigger_pending = cmd + 1;
+ return 0; /* delayed, assuming it's successful */
+ }
+
+ /* we're alone, let's trigger */
+ return dpcm_fe_dai_do_trigger(substream, cmd);
+}
+
static int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream)
{
struct snd_soc_dpcm *dpcm;
@@ -1660,7 +1700,7 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
dev_dbg(fe->dev, "ASoC: prepare FE %s\n", fe->dai_link->name);
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
/* there is no point preparing this FE if there are no BEs */
if (list_empty(&fe->dpcm[stream].be_clients)) {
@@ -1687,7 +1727,7 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE;
out:
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
mutex_unlock(&fe->card->mutex);
return ret;
@@ -1834,11 +1874,11 @@ static int dpcm_run_new_update(struct snd_soc_pcm_runtime *fe, int stream)
{
int ret;
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE);
ret = dpcm_run_update_startup(fe, stream);
if (ret < 0)
dev_err(fe->dev, "ASoC: failed to startup some BEs\n");
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
return ret;
}
@@ -1847,11 +1887,11 @@ static int dpcm_run_old_update(struct snd_soc_pcm_runtime *fe, int stream)
{
int ret;
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE);
ret = dpcm_run_update_shutdown(fe, stream);
if (ret < 0)
dev_err(fe->dev, "ASoC: failed to shutdown some BEs\n");
- fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+ dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
return ret;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 098/121] mac80211: Fix regression that triggers a kernel BUG with CCMP
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (96 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 097/121] ASoC: dpcm: Fix race between FE/BE updates and trigger Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 099/121] rt2x00: do not align payload on modern H/W Kamal Mostafa
` (22 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ronald Wahl, Johannes Berg, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ronald Wahl <ronald.wahl@raritan.com>
commit 4f031fa9f188b2b0641ac20087d9e16bcfb4e49d upstream.
Commit 7ec7c4a9a686c608315739ab6a2b0527a240883c (mac80211: port CCMP to
cryptoapi's CCM driver) introduced a regression when decrypting empty
packets (data_len == 0). This will lead to backtraces like:
(scatterwalk_start) from [<c01312f4>] (scatterwalk_map_and_copy+0x2c/0xa8)
(scatterwalk_map_and_copy) from [<c013a5a0>] (crypto_ccm_decrypt+0x7c/0x25c)
(crypto_ccm_decrypt) from [<c032886c>] (ieee80211_aes_ccm_decrypt+0x160/0x170)
(ieee80211_aes_ccm_decrypt) from [<c031c628>] (ieee80211_crypto_ccmp_decrypt+0x1ac/0x238)
(ieee80211_crypto_ccmp_decrypt) from [<c032ef28>] (ieee80211_rx_handlers+0x870/0x1d24)
(ieee80211_rx_handlers) from [<c0330c7c>] (ieee80211_prepare_and_rx_handle+0x8a0/0x91c)
(ieee80211_prepare_and_rx_handle) from [<c0331260>] (ieee80211_rx+0x568/0x730)
(ieee80211_rx) from [<c01d3054>] (__carl9170_rx+0x94c/0xa20)
(__carl9170_rx) from [<c01d3324>] (carl9170_rx_stream+0x1fc/0x320)
(carl9170_rx_stream) from [<c01cbccc>] (carl9170_usb_tasklet+0x80/0xc8)
(carl9170_usb_tasklet) from [<c00199dc>] (tasklet_hi_action+0x88/0xcc)
(tasklet_hi_action) from [<c00193c8>] (__do_softirq+0xcc/0x200)
(__do_softirq) from [<c0019734>] (irq_exit+0x80/0xe0)
(irq_exit) from [<c0009c10>] (handle_IRQ+0x64/0x80)
(handle_IRQ) from [<c000c3a0>] (__irq_svc+0x40/0x4c)
(__irq_svc) from [<c0009d44>] (arch_cpu_idle+0x2c/0x34)
Such packets can appear for example when using the carl9170 wireless driver
because hardware sometimes generates garbage when the internal FIFO overruns.
This patch adds an additional length check.
Fixes: 7ec7c4a9a686 ("mac80211: port CCMP to cryptoapi's CCM driver")
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/aes_ccm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/mac80211/aes_ccm.c b/net/mac80211/aes_ccm.c
index 7c7df47..cb4f8d2 100644
--- a/net/mac80211/aes_ccm.c
+++ b/net/mac80211/aes_ccm.c
@@ -52,6 +52,9 @@ int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
u8 priv[crypto_aead_reqsize(tfm)];
} aead_req;
+ if (data_len == 0)
+ return -EINVAL;
+
memset(&aead_req, 0, sizeof(aead_req));
sg_init_one(&pt, data, data_len);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 099/121] rt2x00: do not align payload on modern H/W
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (97 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 098/121] mac80211: Fix regression that triggers a kernel BUG with CCMP Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 100/121] ath9k: Add version/revision macros for QCA9531 Kamal Mostafa
` (21 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stanislaw Gruszka, John W. Linville, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <sgruszka@redhat.com>
commit cfd9167af14eb4ec21517a32911d460083ee3d59 upstream.
RT2800 and newer hardware require padding between header and payload if
header length is not multiple of 4.
For historical reasons we also align payload to to 4 bytes boundary, but
such alignment is not needed on modern H/W.
Patch fixes skb_under_panic problems reported from time to time:
https://bugzilla.kernel.org/show_bug.cgi?id=84911
https://bugzilla.kernel.org/show_bug.cgi?id=72471
http://marc.info/?l=linux-wireless&m=139108549530402&w=2
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1087591
Panic happened because we eat 4 bytes of skb headroom on each
(re)transmission when sending frame without the payload and the header
length not being multiple of 4 (i.e. QoS header has 26 bytes). On such
case because paylad_aling=2 is bigger than header_align=0 we increase
header_align by 4 bytes. To prevent that we could change the check to:
if (payload_length && payload_align > header_align)
header_align += 4;
but not aligning payload at all is more effective and alignment is not
really needed by H/W (that has been tested on OpenWrt project for few
years now).
Reported-and-tested-by: Antti S. Lankila <alankila@bel.fi>
Debugged-by: Antti S. Lankila <alankila@bel.fi>
Reported-by: Henrik Asp <solenskiner@gmail.com>
Originally-From: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rt2x00/rt2x00queue.c | 50 ++++++++-----------------------
1 file changed, 12 insertions(+), 38 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index a5d38e8..8481d27 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -160,55 +160,29 @@ void rt2x00queue_align_frame(struct sk_buff *skb)
skb_trim(skb, frame_length);
}
-void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)
+/*
+ * H/W needs L2 padding between the header and the paylod if header size
+ * is not 4 bytes aligned.
+ */
+void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int hdr_len)
{
- unsigned int payload_length = skb->len - header_length;
- unsigned int header_align = ALIGN_SIZE(skb, 0);
- unsigned int payload_align = ALIGN_SIZE(skb, header_length);
- unsigned int l2pad = payload_length ? L2PAD_SIZE(header_length) : 0;
+ unsigned int l2pad = (skb->len > hdr_len) ? L2PAD_SIZE(hdr_len) : 0;
- /*
- * Adjust the header alignment if the payload needs to be moved more
- * than the header.
- */
- if (payload_align > header_align)
- header_align += 4;
-
- /* There is nothing to do if no alignment is needed */
- if (!header_align)
+ if (!l2pad)
return;
- /* Reserve the amount of space needed in front of the frame */
- skb_push(skb, header_align);
-
- /*
- * Move the header.
- */
- memmove(skb->data, skb->data + header_align, header_length);
-
- /* Move the payload, if present and if required */
- if (payload_length && payload_align)
- memmove(skb->data + header_length + l2pad,
- skb->data + header_length + l2pad + payload_align,
- payload_length);
-
- /* Trim the skb to the correct size */
- skb_trim(skb, header_length + l2pad + payload_length);
+ skb_push(skb, l2pad);
+ memmove(skb->data, skb->data + l2pad, hdr_len);
}
-void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length)
+void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int hdr_len)
{
- /*
- * L2 padding is only present if the skb contains more than just the
- * IEEE 802.11 header.
- */
- unsigned int l2pad = (skb->len > header_length) ?
- L2PAD_SIZE(header_length) : 0;
+ unsigned int l2pad = (skb->len > hdr_len) ? L2PAD_SIZE(hdr_len) : 0;
if (!l2pad)
return;
- memmove(skb->data + l2pad, skb->data, header_length);
+ memmove(skb->data + l2pad, skb->data, hdr_len);
skb_pull(skb, l2pad);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 100/121] ath9k: Add version/revision macros for QCA9531
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (98 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 099/121] rt2x00: do not align payload on modern H/W Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 101/121] ath9k: Fix RTC_DERIVED_CLK usage Kamal Mostafa
` (20 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sujith Manoharan, John W. Linville, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
commit f5ee2b18e44d8752ea6e6fba978a873ed5f562bd upstream.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ath/ath9k/reg.h | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index a13b2d1..c148f33 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -810,6 +810,9 @@
#define AR_SREV_VERSION_9565 0x2C0
#define AR_SREV_REVISION_9565_10 0
#define AR_SREV_VERSION_9550 0x400
+#define AR_SREV_VERSION_9531 0x500
+#define AR_SREV_REVISION_9531_10 0
+#define AR_SREV_REVISION_9531_11 1
#define AR_SREV_5416(_ah) \
(((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \
@@ -938,11 +941,19 @@
#define AR_SREV_9580(_ah) \
(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9580) && \
((_ah)->hw_version.macRev >= AR_SREV_REVISION_9580_10))
-
#define AR_SREV_9580_10(_ah) \
(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9580) && \
((_ah)->hw_version.macRev == AR_SREV_REVISION_9580_10))
+#define AR_SREV_9531(_ah) \
+ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531))
+#define AR_SREV_9531_10(_ah) \
+ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531) && \
+ ((_ah)->hw_version.macRev == AR_SREV_REVISION_9531_10))
+#define AR_SREV_9531_11(_ah) \
+ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531) && \
+ ((_ah)->hw_version.macRev == AR_SREV_REVISION_9531_11))
+
/* NOTE: When adding chips newer than Peacock, add chip check here */
#define AR_SREV_9580_10_OR_LATER(_ah) \
(AR_SREV_9580(_ah))
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 101/121] ath9k: Fix RTC_DERIVED_CLK usage
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (99 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 100/121] ath9k: Add version/revision macros for QCA9531 Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 102/121] ASoC: sgtl5000: Fix SMALL_POP bit definition Kamal Mostafa
` (19 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Miaoqing Pan, Sujith Manoharan, John W. Linville, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqing Pan <miaoqing@qca.qualcomm.com>
commit 4e6ce4dc7ce71d0886908d55129d5d6482a27ff9 upstream.
Based on the reference clock, which could be 25MHz or 40MHz,
AR_RTC_DERIVED_CLK is programmed differently for AR9340 and AR9550.
But, when a chip reset is done, processing the initvals
sets the register back to the default value.
Fix this by moving the code in ath9k_hw_init_pll() to
ar9003_hw_override_ini(). Also, do this override for AR9531.
Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 13 +++++++++++++
drivers/net/wireless/ath/ath9k/hw.c | 13 -------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index d39b79f..ea3054c 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -646,6 +646,19 @@ static void ar9003_hw_override_ini(struct ath_hw *ah)
else
ah->enabled_cals &= ~TX_CL_CAL;
}
+
+ if (AR_SREV_9340(ah) || AR_SREV_9531(ah) || AR_SREV_9550(ah)) {
+ if (ah->is_clk_25mhz) {
+ REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1);
+ REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7);
+ REG_WRITE(ah, AR_SLP32_INC, 0x0001e7ae);
+ } else {
+ REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x261 << 1);
+ REG_WRITE(ah, AR_SLP32_MODE, 0x0010f400);
+ REG_WRITE(ah, AR_SLP32_INC, 0x0001e800);
+ }
+ udelay(100);
+ }
}
static void ar9003_hw_prog_ini(struct ath_hw *ah,
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index e79a2cf..5e2063f 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -923,19 +923,6 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
udelay(RTC_PLL_SETTLE_DELAY);
REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_FORCE_DERIVED_CLK);
-
- if (AR_SREV_9340(ah) || AR_SREV_9550(ah)) {
- if (ah->is_clk_25mhz) {
- REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1);
- REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7);
- REG_WRITE(ah, AR_SLP32_INC, 0x0001e7ae);
- } else {
- REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x261 << 1);
- REG_WRITE(ah, AR_SLP32_MODE, 0x0010f400);
- REG_WRITE(ah, AR_SLP32_INC, 0x0001e800);
- }
- udelay(100);
- }
}
static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah,
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 102/121] ASoC: sgtl5000: Fix SMALL_POP bit definition
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (100 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 101/121] ath9k: Fix RTC_DERIVED_CLK usage Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 103/121] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices Kamal Mostafa
` (18 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Fabio Estevam, Mark Brown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <fabio.estevam@freescale.com>
commit c251ea7bd7a04f1f2575467e0de76e803cf59149 upstream.
On a mx28evk with a sgtl5000 codec we notice a loud 'click' sound to happen
5 seconds after the end of a playback.
The SMALL_POP bit should fix this, but its definition is incorrect:
according to the sgtl5000 manual it is bit 0 of CHIP_REF_CTRL register, not
bit 1.
Fix the definition accordingly and enable the bit as intended per the code
comment.
After applying this change, no loud 'click' sound is heard after playback
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/sgtl5000.c | 3 +--
sound/soc/codecs/sgtl5000.h | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 1f4093f..b76c6b6 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1398,8 +1398,7 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
/* enable small pop, introduce 400ms delay in turning off */
snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL,
- SGTL5000_SMALL_POP,
- SGTL5000_SMALL_POP);
+ SGTL5000_SMALL_POP, 1);
/* disable short cut detector */
snd_soc_write(codec, SGTL5000_CHIP_SHORT_CTRL, 0);
diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h
index 2f8c889..bd7a344 100644
--- a/sound/soc/codecs/sgtl5000.h
+++ b/sound/soc/codecs/sgtl5000.h
@@ -275,7 +275,7 @@
#define SGTL5000_BIAS_CTRL_MASK 0x000e
#define SGTL5000_BIAS_CTRL_SHIFT 1
#define SGTL5000_BIAS_CTRL_WIDTH 3
-#define SGTL5000_SMALL_POP 0x0001
+#define SGTL5000_SMALL_POP 0
/*
* SGTL5000_CHIP_MIC_CTRL
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 103/121] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (101 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 102/121] ASoC: sgtl5000: Fix SMALL_POP bit definition Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 104/121] bitops: Fix shift overflow in GENMASK macros Kamal Mostafa
` (17 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jurgen Kramer, Takashi Iwai, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jurgen Kramer <gtmkramer@xs4all.nl>
commit 6e84a8d7ac3ba246ef44e313e92bc16a1da1b04a upstream.
This patch adds a USB control message delay quirk for a few specific Marantz/Denon
devices. Without the delay the DACs will not work properly and produces the
following type of messages:
Nov 15 10:09:21 orwell kernel: [ 91.342880] usb 3-13: clock source 41 is not valid, cannot use
Nov 15 10:09:21 orwell kernel: [ 91.343775] usb 3-13: clock source 41 is not valid, cannot use
There are likely other Marantz/Denon devices using the same USB module which exhibit the
same problems. But as this cannot be verified I limited the patch to the devices
I could test.
The following two devices are covered by this path:
- Marantz SA-14S1
- Marantz HD-DAC1
Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/usb/quirks.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 0df9ede..3fbb455 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1127,6 +1127,20 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
if ((le16_to_cpu(dev->descriptor.idVendor) == 0x23ba) &&
(requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
mdelay(20);
+
+ /* Marantz/Denon devices with USB DAC functionality need a delay
+ * after each class compliant request
+ */
+ if ((le16_to_cpu(dev->descriptor.idVendor) == 0x154e) &&
+ (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) {
+
+ switch (le16_to_cpu(dev->descriptor.idProduct)) {
+ case 0x3005: /* Marantz HD-DAC1 */
+ case 0x3006: /* Marantz SA-14S1 */
+ mdelay(20);
+ break;
+ }
+ }
}
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 104/121] bitops: Fix shift overflow in GENMASK macros
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (102 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 103/121] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 105/121] x86: Require exact match for 'noxsave' command line option Kamal Mostafa
` (16 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Maxime Coquelin, Peter Zijlstra (Intel), linux, gong.chen,
John Sullivan, Linus Torvalds, Paul E. McKenney,
Theodore Ts'o, Ingo Molnar, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime COQUELIN <maxime.coquelin@st.com>
commit 00b4d9a14125f1e51874def2b9de6092e007412d upstream.
On some 32 bits architectures, including x86, GENMASK(31, 0) returns 0
instead of the expected ~0UL.
This is the same on some 64 bits architectures with GENMASK_ULL(63, 0).
This is due to an overflow in the shift operand, 1 << 32 for GENMASK,
1 << 64 for GENMASK_ULL.
Reported-by: Eric Paire <eric.paire@st.com>
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: linux@rasmusvillemoes.dk
Cc: gong.chen@linux.intel.com
Cc: John Sullivan <jsrhbz@kanargh.force9.co.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Fixes: 10ef6b0dffe4 ("bitops: Introduce a more generic BITMASK macro")
Link: http://lkml.kernel.org/r/1415267659-10563-1-git-send-email-maxime.coquelin@st.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/bitops.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index be5fd38..5d858e0 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -18,8 +18,11 @@
* position @h. For example
* GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
*/
-#define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l))
-#define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l))
+#define GENMASK(h, l) \
+ (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
+
+#define GENMASK_ULL(h, l) \
+ (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
extern unsigned int __sw_hweight8(unsigned int w);
extern unsigned int __sw_hweight16(unsigned int w);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 105/121] x86: Require exact match for 'noxsave' command line option
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (103 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 104/121] bitops: Fix shift overflow in GENMASK macros Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 106/121] drm/i915: drop WaSetupGtModeTdRowDispatch:snb Kamal Mostafa
` (15 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Hansen, Dave Hansen, Fenghua Yu, Thomas Gleixner,
Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit 2cd3949f702692cf4c5d05b463f19cd706a92dd3 upstream.
We have some very similarly named command-line options:
arch/x86/kernel/cpu/common.c:__setup("noxsave", x86_xsave_setup);
arch/x86/kernel/cpu/common.c:__setup("noxsaveopt", x86_xsaveopt_setup);
arch/x86/kernel/cpu/common.c:__setup("noxsaves", x86_xsaves_setup);
__setup() is designed to match options that take arguments, like
"foo=bar" where you would have:
__setup("foo", x86_foo_func...);
The problem is that "noxsave" actually _matches_ "noxsaves" in
the same way that "foo" matches "foo=bar". If you boot an old
kernel that does not know about "noxsaves" with "noxsaves" on the
command line, it will interpret the argument as "noxsave", which
is not what you want at all.
This makes the "noxsave" handler only return success when it finds
an *exact* match.
[ tglx: We really need to make __setup() more robust. ]
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Link: http://lkml.kernel.org/r/20141111220133.FE053984@viggo.jf.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/cpu/common.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 78ecb5e..37c4f31 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -144,6 +144,8 @@ EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
static int __init x86_xsave_setup(char *s)
{
+ if (strlen(s))
+ return 0;
setup_clear_cpu_cap(X86_FEATURE_XSAVE);
setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
setup_clear_cpu_cap(X86_FEATURE_AVX);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 106/121] drm/i915: drop WaSetupGtModeTdRowDispatch:snb
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (104 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 105/121] x86: Require exact match for 'noxsave' command line option Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 107/121] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use Kamal Mostafa
` (14 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Vetter, Jani Nikula, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <daniel.vetter@ffwll.ch>
commit 2208d655a91f9879bd9a39ff9df05dd668b3512c upstream.
This reverts the regressing
commit 6547fbdbfff62c99e4f7b4f985ff8b3454f33b0f
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Fri Dec 14 23:38:29 2012 +0100
drm/i915: Implement WaSetupGtModeTdRowDispatch
that causes GPU hangs immediately on boot.
Reported-by: Leo Wolf <jclw@ymail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79996
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
[Jani: amended the commit message slightly.]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_pm.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index ba51112..95543ec 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5195,11 +5195,6 @@ static void gen6_init_clock_gating(struct drm_device *dev)
I915_WRITE(_3D_CHICKEN,
_MASKED_BIT_ENABLE(_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB));
- /* WaSetupGtModeTdRowDispatch:snb */
- if (IS_SNB_GT1(dev))
- I915_WRITE(GEN6_GT_MODE,
- _MASKED_BIT_ENABLE(GEN6_TD_FOUR_ROW_DISPATCH_DISABLE));
-
I915_WRITE(WM3_LP_ILK, 0);
I915_WRITE(WM2_LP_ILK, 0);
I915_WRITE(WM1_LP_ILK, 0);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 107/121] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (105 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 106/121] drm/i915: drop WaSetupGtModeTdRowDispatch:snb Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 108/121] can: dev: avoid calling kfree_skb() from interrupt context Kamal Mostafa
` (13 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Charles Keepax, Mark Brown, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
commit 9da7a5a9fdeeb76b2243f6b473363a7e6147ab6f upstream.
We should not free any buffers associated with writing out coefficients
to the DSP until all the async writes have completed. This patch updates
the out of memory path when allocating a new buffer to include a call to
regmap_async_complete.
Reported-by: JS Park <aitdark.park@samsung.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/wm_adsp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 07c99e8..c9524db 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1340,6 +1340,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
file, blocks, pos - firmware->size);
out_fw:
+ regmap_async_complete(regmap);
release_firmware(firmware);
wm_adsp_buf_free(&buf_list);
out:
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 108/121] can: dev: avoid calling kfree_skb() from interrupt context
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (106 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 107/121] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 109/121] can: esd_usb2: fix memory leak on disconnect Kamal Mostafa
` (12 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Thomas Körper, Marc Kleine-Budde, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Thomas=20K=C3=B6rper?= <thomas.koerper@esd.eu>
commit 5247a589c24022ab34e780039cc8000c48f2035e upstream.
ikfree_skb() is Called in can_free_echo_skb(), which might be called from (TX
Error) interrupt, which triggers the folloing warning:
[ 1153.360705] ------------[ cut here ]------------
[ 1153.360715] WARNING: CPU: 0 PID: 31 at net/core/skbuff.c:563 skb_release_head_state+0xb9/0xd0()
[ 1153.360772] Call Trace:
[ 1153.360778] [<c167906f>] dump_stack+0x41/0x52
[ 1153.360782] [<c105bb7e>] warn_slowpath_common+0x7e/0xa0
[ 1153.360784] [<c158b909>] ? skb_release_head_state+0xb9/0xd0
[ 1153.360786] [<c158b909>] ? skb_release_head_state+0xb9/0xd0
[ 1153.360788] [<c105bc42>] warn_slowpath_null+0x22/0x30
[ 1153.360791] [<c158b909>] skb_release_head_state+0xb9/0xd0
[ 1153.360793] [<c158be90>] skb_release_all+0x10/0x30
[ 1153.360795] [<c158bf06>] kfree_skb+0x36/0x80
[ 1153.360799] [<f8486938>] ? can_free_echo_skb+0x28/0x40 [can_dev]
[ 1153.360802] [<f8486938>] can_free_echo_skb+0x28/0x40 [can_dev]
[ 1153.360805] [<f849a12c>] esd_pci402_interrupt+0x34c/0x57a [esd402]
[ 1153.360809] [<c10a75b5>] handle_irq_event_percpu+0x35/0x180
[ 1153.360811] [<c10a7623>] ? handle_irq_event_percpu+0xa3/0x180
[ 1153.360813] [<c10a7731>] handle_irq_event+0x31/0x50
[ 1153.360816] [<c10a9c7f>] handle_fasteoi_irq+0x6f/0x120
[ 1153.360818] [<c10a9c10>] ? handle_edge_irq+0x110/0x110
[ 1153.360822] [<c1011b61>] handle_irq+0x71/0x90
[ 1153.360823] <IRQ> [<c168152c>] do_IRQ+0x3c/0xd0
[ 1153.360829] [<c1680b6c>] common_interrupt+0x2c/0x34
[ 1153.360834] [<c107d277>] ? finish_task_switch+0x47/0xf0
[ 1153.360836] [<c167c27b>] __schedule+0x35b/0x7e0
[ 1153.360839] [<c10a5334>] ? console_unlock+0x2c4/0x4d0
[ 1153.360842] [<c13df500>] ? n_tty_receive_buf_common+0x890/0x890
[ 1153.360845] [<c10707b6>] ? process_one_work+0x196/0x370
[ 1153.360847] [<c167c723>] schedule+0x23/0x60
[ 1153.360849] [<c1070de1>] worker_thread+0x161/0x460
[ 1153.360852] [<c1090fcf>] ? __wake_up_locked+0x1f/0x30
[ 1153.360854] [<c1070c80>] ? rescuer_thread+0x2f0/0x2f0
[ 1153.360856] [<c1074f01>] kthread+0xa1/0xc0
[ 1153.360859] [<c1680401>] ret_from_kernel_thread+0x21/0x30
[ 1153.360861] [<c1074e60>] ? kthread_create_on_node+0x110/0x110
[ 1153.360863] ---[ end trace 5ff83639cbb74b35 ]---
This patch replaces the kfree_skb() by dev_kfree_skb_any().
Signed-off-by: Thomas Körper <thomas.koerper@esd.eu>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/can/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index bafd28e..98a3b2b 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -385,7 +385,7 @@ void can_free_echo_skb(struct net_device *dev, unsigned int idx)
BUG_ON(idx >= priv->echo_skb_max);
if (priv->echo_skb[idx]) {
- kfree_skb(priv->echo_skb[idx]);
+ dev_kfree_skb_any(priv->echo_skb[idx]);
priv->echo_skb[idx] = NULL;
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 109/121] can: esd_usb2: fix memory leak on disconnect
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (107 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 108/121] can: dev: avoid calling kfree_skb() from interrupt context Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 110/121] x86, microcode: Update BSPs microcode on resume Kamal Mostafa
` (11 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Alexey Khoroshilov, Marc Kleine-Budde, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
commit efbd50d2f62fc1f69a3dcd153e63ba28cc8eb27f upstream.
It seems struct esd_usb2 dev is not deallocated on disconnect. The patch adds
the missing deallocation.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/can/usb/esd_usb2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index ac6177d..91654d0 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -1142,6 +1142,7 @@ static void esd_usb2_disconnect(struct usb_interface *intf)
}
}
unlink_all_urbs(dev);
+ kfree(dev);
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 110/121] x86, microcode: Update BSPs microcode on resume
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (108 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 109/121] can: esd_usb2: fix memory leak on disconnect Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 111/121] x86, mm: Set NX across entire PMD at boot Kamal Mostafa
` (10 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Henrique de Moraes Holschuh, Fenghua Yu, Borislav Petkov,
Thomas Gleixner, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov <bp@suse.de>
commit fb86b97300d930b57471068720c52bfa8622eab7 upstream.
In the situation when we apply early microcode but do *not* apply late
microcode, we fail to update the BSP's microcode on resume because we
haven't initialized the uci->mc microcode pointer. So, in order to
alleviate that, we go and dig out the stashed microcode patch during
early boot. It is basically the same thing that is done on the APs early
during boot so do that too here.
Tested-by: alex.schnaidt@gmail.com
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=88001
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/20141118094657.GA6635@pd.tnic
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/microcode_core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 15c9876..1354282 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -462,6 +462,14 @@ static void mc_bp_resume(void)
if (uci->valid && uci->mc)
microcode_ops->apply_microcode(cpu);
+ else if (!uci->mc)
+ /*
+ * We might resume and not have applied late microcode but still
+ * have a newer patch stashed from the early loader. We don't
+ * have it in uci->mc so we have to load it the same way we're
+ * applying patches early on the APs.
+ */
+ load_ucode_ap();
}
static struct syscore_ops mc_syscore_ops = {
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 111/121] x86, mm: Set NX across entire PMD at boot
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (109 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 110/121] x86, microcode: Update BSPs microcode on resume Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 112/121] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text Kamal Mostafa
` (9 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kees Cook, Andy Lutomirski, Toshi Kani, Yasuaki Ishimatsu,
David Vrabel, Wang Nan, Yinghai Lu, Thomas Gleixner,
Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <keescook@chromium.org>
commit 45e2a9d4701d8c624d4a4bcdd1084eae31e92f58 upstream.
When setting up permissions on kernel memory at boot, the end of the
PMD that was split from bss remained executable. It should be NX like
the rest. This performs a PMD alignment instead of a PAGE alignment to
get the correct span of memory.
Before:
---[ High Kernel Mapping ]---
...
0xffffffff8202d000-0xffffffff82200000 1868K RW GLB NX pte
0xffffffff82200000-0xffffffff82c00000 10M RW PSE GLB NX pmd
0xffffffff82c00000-0xffffffff82df5000 2004K RW GLB NX pte
0xffffffff82df5000-0xffffffff82e00000 44K RW GLB x pte
0xffffffff82e00000-0xffffffffc0000000 978M pmd
After:
---[ High Kernel Mapping ]---
...
0xffffffff8202d000-0xffffffff82200000 1868K RW GLB NX pte
0xffffffff82200000-0xffffffff82e00000 12M RW PSE GLB NX pmd
0xffffffff82e00000-0xffffffffc0000000 978M pmd
[ tglx: Changed it to roundup(_brk_end, PMD_SIZE) and added a comment.
We really should unmap the reminder along with the holes
caused by init,initdata etc. but thats a different issue ]
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/20141114194737.GA3091@www.outflux.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/mm/init_64.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 104d56a..b599241 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1110,7 +1110,7 @@ void mark_rodata_ro(void)
unsigned long end = (unsigned long) &__end_rodata_hpage_align;
unsigned long text_end = PFN_ALIGN(&__stop___ex_table);
unsigned long rodata_end = PFN_ALIGN(&__end_rodata);
- unsigned long all_end = PFN_ALIGN(&_end);
+ unsigned long all_end;
printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
(end - start) >> 10);
@@ -1121,7 +1121,16 @@ void mark_rodata_ro(void)
/*
* The rodata/data/bss/brk section (but not the kernel text!)
* should also be not-executable.
+ *
+ * We align all_end to PMD_SIZE because the existing mapping
+ * is a full PMD. If we would align _brk_end to PAGE_SIZE we
+ * split the PMD and the reminder between _brk_end and the end
+ * of the PMD will remain mapped executable.
+ *
+ * Any PMD which was setup after the one which covers _brk_end
+ * has been zapped already via cleanup_highmem().
*/
+ all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
rodata_test();
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 112/121] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (110 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 111/121] x86, mm: Set NX across entire PMD at boot Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 113/121] of/base: Fix PowerPC address parsing hack Kamal Mostafa
` (8 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bjorn Helgaas, Rob Herring, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Helgaas <bhelgaas@google.com>
commit 66865de4314caca30598244b86817e774c188afa upstream.
a9ecdc0fdc54 ("of/irq: Fix lookup to use 'interrupts-extended' property
first") updated the description to say that:
- Both 'interrupts' and 'interrupts-extended' may be present
- Software should prefer 'interrupts-extended'
- Software that doesn't comprehend 'interrupts-extended' may use
'interrupts'
But there is still a paragraph at the end that prohibits having both and
says 'interrupts' should be preferred.
Remove the contradictory text.
Fixes: a9ecdc0fdc54 ("of/irq: Fix lookup to use 'interrupts-extended' property first")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
index ce6a1a0..8a3c408 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
@@ -30,10 +30,6 @@ should only be used when a device has multiple interrupt parents.
Example:
interrupts-extended = <&intc1 5 1>, <&intc2 1 0>;
-A device node may contain either "interrupts" or "interrupts-extended", but not
-both. If both properties are present, then the operating system should log an
-error and use only the data in "interrupts".
-
2) Interrupt controller nodes
-----------------------------
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 113/121] of/base: Fix PowerPC address parsing hack
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (111 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 112/121] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 114/121] clockevent: sun4i: Fix race condition in the probe code Kamal Mostafa
` (7 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Benjamin Herrenschmidt, Rob Herring, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
commit 746c9e9f92dde2789908e51a354ba90a1962a2eb upstream.
We have a historical hack that treats missing ranges properties as the
equivalent of an empty one. This is needed for ancient PowerMac "bad"
device-trees, and shouldn't be enabled for any other PowerPC platform,
otherwise we get some nasty layout of devices in sysfs or even
duplication when a set of otherwise identically named devices is
created multiple times under a different parent node with no ranges
property.
This fix is needed for the PowerNV i2c busses to be exposed properly
and will fix a number of other embedded cases.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/of/address.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 1a54f1f..005c657 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -401,6 +401,21 @@ static struct of_bus *of_match_bus(struct device_node *np)
return NULL;
}
+static int of_empty_ranges_quirk(void)
+{
+ if (IS_ENABLED(CONFIG_PPC)) {
+ /* To save cycles, we cache the result */
+ static int quirk_state = -1;
+
+ if (quirk_state < 0)
+ quirk_state =
+ of_machine_is_compatible("Power Macintosh") ||
+ of_machine_is_compatible("MacRISC");
+ return quirk_state;
+ }
+ return false;
+}
+
static int of_translate_one(struct device_node *parent, struct of_bus *bus,
struct of_bus *pbus, __be32 *addr,
int na, int ns, int pna, const char *rprop)
@@ -426,12 +441,10 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
* This code is only enabled on powerpc. --gcl
*/
ranges = of_get_property(parent, rprop, &rlen);
-#if !defined(CONFIG_PPC)
- if (ranges == NULL) {
+ if (ranges == NULL && !of_empty_ranges_quirk()) {
pr_err("OF: no ranges; cannot translate\n");
return 1;
}
-#endif /* !defined(CONFIG_PPC) */
if (ranges == NULL || rlen == 0) {
offset = of_read_number(addr, na);
memset(addr, 0, pna * 4);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 114/121] clockevent: sun4i: Fix race condition in the probe code
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (112 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 113/121] of/base: Fix PowerPC address parsing hack Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 115/121] MIPS: oprofile: Fix backtrace on 64-bit kernel Kamal Mostafa
` (6 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Maxime Ripard, Daniel Lezcano, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <maxime.ripard@free-electrons.com>
commit 6bab4a8a1888729f17f4923cc5867e4674f66333 upstream.
The interrupts were activated and the handler registered before the clockevent
was registered in the probe function.
The interrupt handler, however, was making the assumption that the clockevent
device was registered.
That could cause a null pointer dereference if the timer interrupt was firing
during this narrow window.
Fix that by moving the clockevent registration before the interrupt is enabled.
Reported-by: Roman Byshko <rbyshko@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
[ kamal: backport to 3.13-stable ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/clocksource/sun4i_timer.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/clocksource/sun4i_timer.c b/drivers/clocksource/sun4i_timer.c
index a4f6119..aff7a7c 100644
--- a/drivers/clocksource/sun4i_timer.c
+++ b/drivers/clocksource/sun4i_timer.c
@@ -182,6 +182,11 @@ static void __init sun4i_timer_init(struct device_node *node)
/* Make sure timer is stopped before playing with interrupts */
sun4i_clkevt_time_stop(0);
+ sun4i_clockevent.cpumask = cpumask_of(0);
+
+ clockevents_config_and_register(&sun4i_clockevent, rate,
+ TIMER_SYNC_TICKS, 0xffffffff);
+
ret = setup_irq(irq, &sun4i_timer_irq);
if (ret)
pr_warn("failed to setup irq %d\n", irq);
@@ -189,11 +194,6 @@ static void __init sun4i_timer_init(struct device_node *node)
/* Enable timer0 interrupt */
val = readl(timer_base + TIMER_IRQ_EN_REG);
writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
-
- sun4i_clockevent.cpumask = cpumask_of(0);
-
- clockevents_config_and_register(&sun4i_clockevent, rate,
- TIMER_SYNC_TICKS, 0xffffffff);
}
CLOCKSOURCE_OF_DECLARE(sun4i, "allwinner,sun4i-timer",
sun4i_timer_init);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 115/121] MIPS: oprofile: Fix backtrace on 64-bit kernel
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (113 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 114/121] clockevent: sun4i: Fix race condition in the probe code Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 116/121] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up Kamal Mostafa
` (5 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Aaro Koskinen, linux-mips, Ralf Baechle, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaro Koskinen <aaro.koskinen@nsn.com>
commit bbaf113a481b6ce32444c125807ad3618643ce57 upstream.
Fix incorrect cast that always results in wrong address for the new
frame on 64-bit kernels.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8110/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/mips/oprofile/backtrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/oprofile/backtrace.c b/arch/mips/oprofile/backtrace.c
index 6854ed5..83a1dfd 100644
--- a/arch/mips/oprofile/backtrace.c
+++ b/arch/mips/oprofile/backtrace.c
@@ -92,7 +92,7 @@ static inline int unwind_user_frame(struct stackframe *old_frame,
/* This marks the end of the previous function,
which means we overran. */
break;
- stack_size = (unsigned) stack_adjustment;
+ stack_size = (unsigned long) stack_adjustment;
} else if (is_ra_save_ins(&ip)) {
int ra_slot = ip.i_format.simmediate;
if (ra_slot < 0)
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 116/121] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (114 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 115/121] MIPS: oprofile: Fix backtrace on 64-bit kernel Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 117/121] IB/isert: Adjust CQ size to HW limits Kamal Mostafa
` (4 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Rafael J. Wysocki, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
commit 78579b7c7eb45f0e7ec5e9437087ed21749f9a9c upstream.
As reported by Dmitry, on some Chromebooks there are devices with
corresponding ACPI objects and with unusual system wakeup
configuration. Namely, they technically are wakeup-capable, but the
wakeup is handled via a platform-specific out-of-band mechanism and
the ACPI PM layer has no information on the wakeup capability. As
a result, device_may_wakeup(dev) called from acpi_dev_suspend_late()
returns 'true' for those devices, but the wakeup.flags.valid flag is
unset for the corresponding ACPI device objects, so acpi_device_wakeup()
reproducibly fails for them causing acpi_dev_suspend_late() to return
an error code. The entire system suspend is then aborted and the
machines in question cannot suspend at all.
Address the problem by ignoring the device_may_wakeup(dev) return
value in acpi_dev_suspend_late() if the ACPI companion of the device
being handled has wakeup.flags.valid unset (in which case it is clear
that the wakeup is supposed to be handled by other means).
This fixes a regression introduced by commit a76e9bd89ae7 (i2c:
attach/detach I2C client device to the ACPI power domain) as the
affected systems could suspend and resume successfully before that
commit.
Fixes: a76e9bd89ae7 (i2c: attach/detach I2C client device to the ACPI power domain)
Reported-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/acpi/device_pm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index b3480cf..5b39ae5 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -857,7 +857,7 @@ int acpi_dev_suspend_late(struct device *dev)
return 0;
target_state = acpi_target_system_state();
- wakeup = device_may_wakeup(dev);
+ wakeup = device_may_wakeup(dev) && acpi_device_can_wakeup(adev);
error = __acpi_device_sleep_wake(adev, target_state, wakeup);
if (wakeup && error)
return error;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 117/121] IB/isert: Adjust CQ size to HW limits
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (115 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 116/121] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 118/121] drm/radeon: fix endian swapping in vbios fetch for tdp table Kamal Mostafa
` (3 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Moore, Nicholas Bellinger, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Moore <Chris.Moore@Emulex.Com>
commit b1a5ad006b34ded9dc7ec64988deba1b3ecad367 upstream.
isert has an issue of trying to create a CQ with more CQEs than are
supported by the hardware, that currently results in failures during
isert_device creation during first session login.
This is the isert version of the patch that Minh Tran submitted for
iser, and is simple a workaround required to function with existing
ocrdma hardware.
Signed-off-by: Chris Moore <chris.moore@emulex.com>
Reviewied-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/ulp/isert/ib_isert.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 39e5824..5502c7f 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -223,12 +223,16 @@ isert_create_device_ib_res(struct isert_device *device)
struct isert_cq_desc *cq_desc;
struct ib_device_attr *dev_attr;
int ret = 0, i, j;
+ int max_rx_cqe, max_tx_cqe;
dev_attr = &device->dev_attr;
ret = isert_query_device(ib_dev, dev_attr);
if (ret)
return ret;
+ max_rx_cqe = min(ISER_MAX_RX_CQ_LEN, dev_attr->max_cqe);
+ max_tx_cqe = min(ISER_MAX_TX_CQ_LEN, dev_attr->max_cqe);
+
/* asign function handlers */
if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) {
device->use_frwr = 1;
@@ -270,7 +274,7 @@ isert_create_device_ib_res(struct isert_device *device)
isert_cq_rx_callback,
isert_cq_event_callback,
(void *)&cq_desc[i],
- ISER_MAX_RX_CQ_LEN, i);
+ max_rx_cqe, i);
if (IS_ERR(device->dev_rx_cq[i])) {
ret = PTR_ERR(device->dev_rx_cq[i]);
device->dev_rx_cq[i] = NULL;
@@ -282,7 +286,7 @@ isert_create_device_ib_res(struct isert_device *device)
isert_cq_tx_callback,
isert_cq_event_callback,
(void *)&cq_desc[i],
- ISER_MAX_TX_CQ_LEN, i);
+ max_tx_cqe, i);
if (IS_ERR(device->dev_tx_cq[i])) {
ret = PTR_ERR(device->dev_tx_cq[i]);
device->dev_tx_cq[i] = NULL;
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 118/121] drm/radeon: fix endian swapping in vbios fetch for tdp table
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (116 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 117/121] IB/isert: Adjust CQ size to HW limits Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 119/121] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C Kamal Mostafa
` (2 subsequent siblings)
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 28731d5818ae25b92d1fb82fe0ac196e97102c1b upstream.
Value needs to be swapped on BE.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/r600_dpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c
index 2df683a..cc4258a 100644
--- a/drivers/gpu/drm/radeon/r600_dpm.c
+++ b/drivers/gpu/drm/radeon/r600_dpm.c
@@ -1193,7 +1193,7 @@ int r600_parse_extended_power_table(struct radeon_device *rdev)
(mode_info->atom_context->bios + data_offset +
le16_to_cpu(ext_hdr->usPowerTuneTableOffset));
rdev->pm.dpm.dyn_state.cac_tdp_table->maximum_power_delivery_limit =
- ppt->usMaximumPowerDeliveryLimit;
+ le16_to_cpu(ppt->usMaximumPowerDeliveryLimit);
pt = &ppt->power_tune_table;
} else {
ATOM_PPLIB_POWERTUNE_Table *ppt = (ATOM_PPLIB_POWERTUNE_Table *)
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 119/121] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (117 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 118/121] drm/radeon: fix endian swapping in vbios fetch for tdp table Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:34 ` Andy Lutomirski
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 120/121] x86_64, traps: Stop using IST for #SS Kamal Mostafa
2014-12-02 19:20 ` [PATCH 3.13.y-ckt 121/121] x86_64, traps: Rework bad_iret Kamal Mostafa
120 siblings, 1 reply; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Lutomirski, Linus Torvalds, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <luto@amacapital.net>
commit af726f21ed8af2cdaa4e93098dc211521218ae65 upstream.
There's nothing special enough about the espfix64 double fault fixup to
justify writing it in assembly. Move it to C.
This also fixes a bug: if the double fault came from an IST stack, the
old asm code would return to a partially uninitialized stack frame.
Fixes: 3891a04aafd668686239349ea58f3314ea2af86b
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/entry_64.S | 34 ++--------------------------------
arch/x86/kernel/traps.c | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+), 32 deletions(-)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 03cd2a8..2bb5032 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1053,6 +1053,7 @@ ENTRY(native_iret)
jnz native_irq_return_ldt
#endif
+.global native_irq_return_iret
native_irq_return_iret:
iretq
_ASM_EXTABLE(native_irq_return_iret, bad_iret)
@@ -1147,37 +1148,6 @@ ENTRY(retint_kernel)
CFI_ENDPROC
END(common_interrupt)
- /*
- * If IRET takes a fault on the espfix stack, then we
- * end up promoting it to a doublefault. In that case,
- * modify the stack to make it look like we just entered
- * the #GP handler from user space, similar to bad_iret.
- */
-#ifdef CONFIG_X86_ESPFIX64
- ALIGN
-__do_double_fault:
- XCPT_FRAME 1 RDI+8
- movq RSP(%rdi),%rax /* Trap on the espfix stack? */
- sarq $PGDIR_SHIFT,%rax
- cmpl $ESPFIX_PGD_ENTRY,%eax
- jne do_double_fault /* No, just deliver the fault */
- cmpl $__KERNEL_CS,CS(%rdi)
- jne do_double_fault
- movq RIP(%rdi),%rax
- cmpq $native_irq_return_iret,%rax
- jne do_double_fault /* This shouldn't happen... */
- movq PER_CPU_VAR(kernel_stack),%rax
- subq $(6*8-KERNEL_STACK_OFFSET),%rax /* Reset to original stack */
- movq %rax,RSP(%rdi)
- movq $0,(%rax) /* Missing (lost) #GP error code */
- movq $general_protection,RIP(%rdi)
- retq
- CFI_ENDPROC
-END(__do_double_fault)
-#else
-# define __do_double_fault do_double_fault
-#endif
-
/*
* End of kprobes section
*/
@@ -1379,7 +1349,7 @@ zeroentry overflow do_overflow
zeroentry bounds do_bounds
zeroentry invalid_op do_invalid_op
zeroentry device_not_available do_device_not_available
-paranoiderrorentry double_fault __do_double_fault
+paranoiderrorentry double_fault do_double_fault
zeroentry coprocessor_segment_overrun do_coprocessor_segment_overrun
errorentry invalid_TSS do_invalid_TSS
errorentry segment_not_present do_segment_not_present
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b857ed8..e5b2976 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -248,6 +248,30 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
static const char str[] = "double fault";
struct task_struct *tsk = current;
+#ifdef CONFIG_X86_ESPFIX64
+ extern unsigned char native_irq_return_iret[];
+
+ /*
+ * If IRET takes a non-IST fault on the espfix64 stack, then we
+ * end up promoting it to a doublefault. In that case, modify
+ * the stack to make it look like we just entered the #GP
+ * handler from user space, similar to bad_iret.
+ */
+ if (((long)regs->sp >> PGDIR_SHIFT) == ESPFIX_PGD_ENTRY &&
+ regs->cs == __KERNEL_CS &&
+ regs->ip == (unsigned long)native_irq_return_iret)
+ {
+ struct pt_regs *normal_regs = task_pt_regs(current);
+
+ /* Fake a #GP(0) from userspace. */
+ memmove(&normal_regs->ip, (void *)regs->sp, 5*8);
+ normal_regs->orig_ax = 0; /* Missing (lost) #GP error code */
+ regs->ip = (unsigned long)general_protection;
+ regs->sp = (unsigned long)&normal_regs->orig_ax;
+ return;
+ }
+#endif
+
exception_enter();
/* Return not checked because double check cannot be ignored */
notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 120/121] x86_64, traps: Stop using IST for #SS
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (118 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 119/121] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C Kamal Mostafa
@ 2014-12-02 19:19 ` Kamal Mostafa
2014-12-02 19:20 ` [PATCH 3.13.y-ckt 121/121] x86_64, traps: Rework bad_iret Kamal Mostafa
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:19 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Lutomirski, Linus Torvalds, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <luto@amacapital.net>
commit 6f442be2fb22be02cafa606f1769fa1e6f894441 upstream.
On a 32-bit kernel, this has no effect, since there are no IST stacks.
On a 64-bit kernel, #SS can only happen in user code, on a failed iret
to user space, a canonical violation on access via RSP or RBP, or a
genuine stack segment violation in 32-bit kernel code. The first two
cases don't need IST, and the latter two cases are unlikely fatal bugs,
and promoting them to double faults would be fine.
This fixes a bug in which the espfix64 code mishandles a stack segment
violation.
This saves 4k of memory per CPU and a tiny bit of code.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: backport to 3.13-stable: errorentry context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/page_32_types.h | 1 -
arch/x86/include/asm/page_64_types.h | 11 +++++------
arch/x86/include/asm/traps.h | 1 +
arch/x86/kernel/dumpstack_64.c | 1 -
arch/x86/kernel/entry_64.S | 2 +-
arch/x86/kernel/traps.c | 18 +-----------------
6 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/arch/x86/include/asm/page_32_types.h b/arch/x86/include/asm/page_32_types.h
index f48b17d..3a52ee0 100644
--- a/arch/x86/include/asm/page_32_types.h
+++ b/arch/x86/include/asm/page_32_types.h
@@ -20,7 +20,6 @@
#define THREAD_SIZE_ORDER 1
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
-#define STACKFAULT_STACK 0
#define DOUBLEFAULT_STACK 1
#define NMI_STACK 0
#define DEBUG_STACK 0
diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
index 43dcd80..d1d2972 100644
--- a/arch/x86/include/asm/page_64_types.h
+++ b/arch/x86/include/asm/page_64_types.h
@@ -14,12 +14,11 @@
#define IRQ_STACK_ORDER 2
#define IRQ_STACK_SIZE (PAGE_SIZE << IRQ_STACK_ORDER)
-#define STACKFAULT_STACK 1
-#define DOUBLEFAULT_STACK 2
-#define NMI_STACK 3
-#define DEBUG_STACK 4
-#define MCE_STACK 5
-#define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
+#define DOUBLEFAULT_STACK 1
+#define NMI_STACK 2
+#define DEBUG_STACK 3
+#define MCE_STACK 4
+#define N_EXCEPTION_STACKS 4 /* hw limit: 7 */
#define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT)
#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1))
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index 58d66fe..b409b17 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -39,6 +39,7 @@ asmlinkage void simd_coprocessor_error(void);
#ifdef CONFIG_TRACING
asmlinkage void trace_page_fault(void);
+#define trace_stack_segment stack_segment
#define trace_divide_error divide_error
#define trace_bounds bounds
#define trace_invalid_op invalid_op
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index addb207..66e274a 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -24,7 +24,6 @@ static char x86_stack_ids[][8] = {
[ DEBUG_STACK-1 ] = "#DB",
[ NMI_STACK-1 ] = "NMI",
[ DOUBLEFAULT_STACK-1 ] = "#DF",
- [ STACKFAULT_STACK-1 ] = "#SS",
[ MCE_STACK-1 ] = "#MC",
#if DEBUG_STKSZ > EXCEPTION_STKSZ
[ N_EXCEPTION_STACKS ...
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 2bb5032..29e2ff3 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1519,7 +1519,7 @@ apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
paranoidzeroentry_ist debug do_debug DEBUG_STACK
paranoidzeroentry_ist int3 do_int3 DEBUG_STACK
-paranoiderrorentry stack_segment do_stack_segment
+errorentry stack_segment do_stack_segment
#ifdef CONFIG_XEN
zeroentry xen_debug do_debug
zeroentry xen_int3 do_int3
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index e5b2976..d2451ad 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -221,28 +221,12 @@ DO_ERROR(X86_TRAP_OLD_MF, SIGFPE, "coprocessor segment overrun",
coprocessor_segment_overrun)
DO_ERROR(X86_TRAP_TS, SIGSEGV, "invalid TSS", invalid_TSS)
DO_ERROR(X86_TRAP_NP, SIGBUS, "segment not present", segment_not_present)
-#ifdef CONFIG_X86_32
DO_ERROR(X86_TRAP_SS, SIGBUS, "stack segment", stack_segment)
-#endif
DO_ERROR_INFO(X86_TRAP_AC, SIGBUS, "alignment check", alignment_check,
BUS_ADRALN, 0)
#ifdef CONFIG_X86_64
/* Runs on IST stack */
-dotraplinkage void do_stack_segment(struct pt_regs *regs, long error_code)
-{
- enum ctx_state prev_state;
-
- prev_state = exception_enter();
- if (notify_die(DIE_TRAP, "stack segment", regs, error_code,
- X86_TRAP_SS, SIGBUS) != NOTIFY_STOP) {
- preempt_conditional_sti(regs);
- do_trap(X86_TRAP_SS, SIGBUS, "stack segment", regs, error_code, NULL);
- preempt_conditional_cli(regs);
- }
- exception_exit(prev_state);
-}
-
dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
{
static const char str[] = "double fault";
@@ -776,7 +760,7 @@ void __init trap_init(void)
set_intr_gate(X86_TRAP_OLD_MF, coprocessor_segment_overrun);
set_intr_gate(X86_TRAP_TS, invalid_TSS);
set_intr_gate(X86_TRAP_NP, segment_not_present);
- set_intr_gate_ist(X86_TRAP_SS, &stack_segment, STACKFAULT_STACK);
+ set_intr_gate(X86_TRAP_SS, stack_segment);
set_intr_gate(X86_TRAP_GP, general_protection);
set_intr_gate(X86_TRAP_SPURIOUS, spurious_interrupt_bug);
set_intr_gate(X86_TRAP_MF, coprocessor_error);
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* [PATCH 3.13.y-ckt 121/121] x86_64, traps: Rework bad_iret
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
` (119 preceding siblings ...)
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 120/121] x86_64, traps: Stop using IST for #SS Kamal Mostafa
@ 2014-12-02 19:20 ` Kamal Mostafa
120 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 19:20 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Lutomirski, Linus Torvalds, Kamal Mostafa
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <luto@amacapital.net>
commit b645af2d5905c4e32399005b867987919cbfc3ae upstream.
It's possible for iretq to userspace to fail. This can happen because
of a bad CS, SS, or RIP.
Historically, we've handled it by fixing up an exception from iretq to
land at bad_iret, which pretends that the failed iret frame was really
the hardware part of #GP(0) from userspace. To make this work, there's
an extra fixup to fudge the gs base into a usable state.
This is suboptimal because it loses the original exception. It's also
buggy because there's no guarantee that we were on the kernel stack to
begin with. For example, if the failing iret happened on return from an
NMI, then we'll end up executing general_protection on the NMI stack.
This is bad for several reasons, the most immediate of which is that
general_protection, as a non-paranoid idtentry, will try to deliver
signals and/or schedule from the wrong stack.
This patch throws out bad_iret entirely. As a replacement, it augments
the existing swapgs fudge into a full-blown iret fixup, mostly written
in C. It's should be clearer and more correct.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/entry_64.S | 45 +++++++++++++++++++--------------------------
arch/x86/kernel/traps.c | 29 +++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 26 deletions(-)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 29e2ff3..02553d6 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1055,8 +1055,13 @@ ENTRY(native_iret)
.global native_irq_return_iret
native_irq_return_iret:
+ /*
+ * This may fault. Non-paranoid faults on return to userspace are
+ * handled by fixup_bad_iret. These include #SS, #GP, and #NP.
+ * Double-faults due to espfix64 are handled in do_double_fault.
+ * Other faults here are fatal.
+ */
iretq
- _ASM_EXTABLE(native_irq_return_iret, bad_iret)
#ifdef CONFIG_X86_ESPFIX64
native_irq_return_ldt:
@@ -1084,25 +1089,6 @@ native_irq_return_ldt:
jmp native_irq_return_iret
#endif
- .section .fixup,"ax"
-bad_iret:
- /*
- * The iret traps when the %cs or %ss being restored is bogus.
- * We've lost the original trap vector and error code.
- * #GPF is the most likely one to get for an invalid selector.
- * So pretend we completed the iret and took the #GPF in user mode.
- *
- * We are now running with the kernel GS after exception recovery.
- * But error_entry expects us to have user GS to match the user %cs,
- * so swap back.
- */
- pushq $0
-
- SWAPGS
- jmp general_protection
-
- .previous
-
/* edi: workmask, edx: work */
retint_careful:
CFI_RESTORE_STATE
@@ -1629,16 +1615,15 @@ error_sti:
/*
* There are two places in the kernel that can potentially fault with
- * usergs. Handle them here. The exception handlers after iret run with
- * kernel gs again, so don't set the user space flag. B stepping K8s
- * sometimes report an truncated RIP for IRET exceptions returning to
- * compat mode. Check for these here too.
+ * usergs. Handle them here. B stepping K8s sometimes report a
+ * truncated RIP for IRET exceptions returning to compat mode. Check
+ * for these here too.
*/
error_kernelspace:
incl %ebx
leaq native_irq_return_iret(%rip),%rcx
cmpq %rcx,RIP+8(%rsp)
- je error_swapgs
+ je error_bad_iret
movl %ecx,%eax /* zero extend */
cmpq %rax,RIP+8(%rsp)
je bstep_iret
@@ -1649,7 +1634,15 @@ error_kernelspace:
bstep_iret:
/* Fix truncated RIP */
movq %rcx,RIP+8(%rsp)
- jmp error_swapgs
+ /* fall through */
+
+error_bad_iret:
+ SWAPGS
+ mov %rsp,%rdi
+ call fixup_bad_iret
+ mov %rax,%rsp
+ decl %ebx /* Return to usergs */
+ jmp error_sti
CFI_ENDPROC
END(error_entry)
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index d2451ad..574b356 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -388,6 +388,35 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
*regs = *eregs;
return regs;
}
+
+struct bad_iret_stack {
+ void *error_entry_ret;
+ struct pt_regs regs;
+};
+
+asmlinkage __visible
+struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
+{
+ /*
+ * This is called from entry_64.S early in handling a fault
+ * caused by a bad iret to user mode. To handle the fault
+ * correctly, we want move our stack frame to task_pt_regs
+ * and we want to pretend that the exception came from the
+ * iret target.
+ */
+ struct bad_iret_stack *new_stack =
+ container_of(task_pt_regs(current),
+ struct bad_iret_stack, regs);
+
+ /* Copy the IRET target to the new stack. */
+ memmove(&new_stack->regs.ip, (void *)s->regs.sp, 5*8);
+
+ /* Copy the remainder of the stack from the current stack. */
+ memmove(new_stack, s, offsetof(struct bad_iret_stack, regs.ip));
+
+ BUG_ON(!user_mode_vm(&new_stack->regs));
+ return new_stack;
+}
#endif
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 124+ messages in thread
* Re: [PATCH 3.13.y-ckt 119/121] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 119/121] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C Kamal Mostafa
@ 2014-12-02 19:34 ` Andy Lutomirski
2014-12-02 21:20 ` Kamal Mostafa
0 siblings, 1 reply; 124+ messages in thread
From: Andy Lutomirski @ 2014-12-02 19:34 UTC (permalink / raw)
To: Kamal Mostafa
Cc: linux-kernel@vger.kernel.org, stable, kernel-team, Linus Torvalds
As before, this and "Reword bad_iret" may want to wait a week or two.
They're not very urgent.
--Andy
On Tue, Dec 2, 2014 at 11:19 AM, Kamal Mostafa <kamal@canonical.com> wrote:
> 3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Andy Lutomirski <luto@amacapital.net>
>
> commit af726f21ed8af2cdaa4e93098dc211521218ae65 upstream.
>
> There's nothing special enough about the espfix64 double fault fixup to
> justify writing it in assembly. Move it to C.
>
> This also fixes a bug: if the double fault came from an IST stack, the
> old asm code would return to a partially uninitialized stack frame.
>
> Fixes: 3891a04aafd668686239349ea58f3314ea2af86b
> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> [ kamal: backport to 3.13-stable: context ]
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
> arch/x86/kernel/entry_64.S | 34 ++--------------------------------
> arch/x86/kernel/traps.c | 24 ++++++++++++++++++++++++
> 2 files changed, 26 insertions(+), 32 deletions(-)
>
> diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> index 03cd2a8..2bb5032 100644
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -1053,6 +1053,7 @@ ENTRY(native_iret)
> jnz native_irq_return_ldt
> #endif
>
> +.global native_irq_return_iret
> native_irq_return_iret:
> iretq
> _ASM_EXTABLE(native_irq_return_iret, bad_iret)
> @@ -1147,37 +1148,6 @@ ENTRY(retint_kernel)
> CFI_ENDPROC
> END(common_interrupt)
>
> - /*
> - * If IRET takes a fault on the espfix stack, then we
> - * end up promoting it to a doublefault. In that case,
> - * modify the stack to make it look like we just entered
> - * the #GP handler from user space, similar to bad_iret.
> - */
> -#ifdef CONFIG_X86_ESPFIX64
> - ALIGN
> -__do_double_fault:
> - XCPT_FRAME 1 RDI+8
> - movq RSP(%rdi),%rax /* Trap on the espfix stack? */
> - sarq $PGDIR_SHIFT,%rax
> - cmpl $ESPFIX_PGD_ENTRY,%eax
> - jne do_double_fault /* No, just deliver the fault */
> - cmpl $__KERNEL_CS,CS(%rdi)
> - jne do_double_fault
> - movq RIP(%rdi),%rax
> - cmpq $native_irq_return_iret,%rax
> - jne do_double_fault /* This shouldn't happen... */
> - movq PER_CPU_VAR(kernel_stack),%rax
> - subq $(6*8-KERNEL_STACK_OFFSET),%rax /* Reset to original stack */
> - movq %rax,RSP(%rdi)
> - movq $0,(%rax) /* Missing (lost) #GP error code */
> - movq $general_protection,RIP(%rdi)
> - retq
> - CFI_ENDPROC
> -END(__do_double_fault)
> -#else
> -# define __do_double_fault do_double_fault
> -#endif
> -
> /*
> * End of kprobes section
> */
> @@ -1379,7 +1349,7 @@ zeroentry overflow do_overflow
> zeroentry bounds do_bounds
> zeroentry invalid_op do_invalid_op
> zeroentry device_not_available do_device_not_available
> -paranoiderrorentry double_fault __do_double_fault
> +paranoiderrorentry double_fault do_double_fault
> zeroentry coprocessor_segment_overrun do_coprocessor_segment_overrun
> errorentry invalid_TSS do_invalid_TSS
> errorentry segment_not_present do_segment_not_present
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index b857ed8..e5b2976 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -248,6 +248,30 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
> static const char str[] = "double fault";
> struct task_struct *tsk = current;
>
> +#ifdef CONFIG_X86_ESPFIX64
> + extern unsigned char native_irq_return_iret[];
> +
> + /*
> + * If IRET takes a non-IST fault on the espfix64 stack, then we
> + * end up promoting it to a doublefault. In that case, modify
> + * the stack to make it look like we just entered the #GP
> + * handler from user space, similar to bad_iret.
> + */
> + if (((long)regs->sp >> PGDIR_SHIFT) == ESPFIX_PGD_ENTRY &&
> + regs->cs == __KERNEL_CS &&
> + regs->ip == (unsigned long)native_irq_return_iret)
> + {
> + struct pt_regs *normal_regs = task_pt_regs(current);
> +
> + /* Fake a #GP(0) from userspace. */
> + memmove(&normal_regs->ip, (void *)regs->sp, 5*8);
> + normal_regs->orig_ax = 0; /* Missing (lost) #GP error code */
> + regs->ip = (unsigned long)general_protection;
> + regs->sp = (unsigned long)&normal_regs->orig_ax;
> + return;
> + }
> +#endif
> +
> exception_enter();
> /* Return not checked because double check cannot be ignored */
> notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV);
> --
> 1.9.1
>
--
Andy Lutomirski
AMA Capital Management, LLC
^ permalink raw reply [flat|nested] 124+ messages in thread
* Re: [PATCH 3.13.y-ckt 119/121] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
2014-12-02 19:34 ` Andy Lutomirski
@ 2014-12-02 21:20 ` Kamal Mostafa
0 siblings, 0 replies; 124+ messages in thread
From: Kamal Mostafa @ 2014-12-02 21:20 UTC (permalink / raw)
To: Andy Lutomirski
Cc: linux-kernel@vger.kernel.org, stable, kernel-team, Linus Torvalds
On Tue, 2014-12-02 at 11:34 -0800, Andy Lutomirski wrote:
> As before, this and "Reword bad_iret" may want to wait a week or two.
> They're not very urgent.
Ok, I'll defer those two until the next 3.13-stable cycle.
Thanks Andy,
-Kamal
> --Andy
>
> On Tue, Dec 2, 2014 at 11:19 AM, Kamal Mostafa <kamal@canonical.com> wrote:
> > 3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Andy Lutomirski <luto@amacapital.net>
> >
> > commit af726f21ed8af2cdaa4e93098dc211521218ae65 upstream.
> >
> > There's nothing special enough about the espfix64 double fault fixup to
> > justify writing it in assembly. Move it to C.
> >
> > This also fixes a bug: if the double fault came from an IST stack, the
> > old asm code would return to a partially uninitialized stack frame.
> >
> > Fixes: 3891a04aafd668686239349ea58f3314ea2af86b
> > Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> > Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> > Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> > [ kamal: backport to 3.13-stable: context ]
> > Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> > ---
> > arch/x86/kernel/entry_64.S | 34 ++--------------------------------
> > arch/x86/kernel/traps.c | 24 ++++++++++++++++++++++++
> > 2 files changed, 26 insertions(+), 32 deletions(-)
> >
> > diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> > index 03cd2a8..2bb5032 100644
> > --- a/arch/x86/kernel/entry_64.S
> > +++ b/arch/x86/kernel/entry_64.S
> > @@ -1053,6 +1053,7 @@ ENTRY(native_iret)
> > jnz native_irq_return_ldt
> > #endif
> >
> > +.global native_irq_return_iret
> > native_irq_return_iret:
> > iretq
> > _ASM_EXTABLE(native_irq_return_iret, bad_iret)
> > @@ -1147,37 +1148,6 @@ ENTRY(retint_kernel)
> > CFI_ENDPROC
> > END(common_interrupt)
> >
> > - /*
> > - * If IRET takes a fault on the espfix stack, then we
> > - * end up promoting it to a doublefault. In that case,
> > - * modify the stack to make it look like we just entered
> > - * the #GP handler from user space, similar to bad_iret.
> > - */
> > -#ifdef CONFIG_X86_ESPFIX64
> > - ALIGN
> > -__do_double_fault:
> > - XCPT_FRAME 1 RDI+8
> > - movq RSP(%rdi),%rax /* Trap on the espfix stack? */
> > - sarq $PGDIR_SHIFT,%rax
> > - cmpl $ESPFIX_PGD_ENTRY,%eax
> > - jne do_double_fault /* No, just deliver the fault */
> > - cmpl $__KERNEL_CS,CS(%rdi)
> > - jne do_double_fault
> > - movq RIP(%rdi),%rax
> > - cmpq $native_irq_return_iret,%rax
> > - jne do_double_fault /* This shouldn't happen... */
> > - movq PER_CPU_VAR(kernel_stack),%rax
> > - subq $(6*8-KERNEL_STACK_OFFSET),%rax /* Reset to original stack */
> > - movq %rax,RSP(%rdi)
> > - movq $0,(%rax) /* Missing (lost) #GP error code */
> > - movq $general_protection,RIP(%rdi)
> > - retq
> > - CFI_ENDPROC
> > -END(__do_double_fault)
> > -#else
> > -# define __do_double_fault do_double_fault
> > -#endif
> > -
> > /*
> > * End of kprobes section
> > */
> > @@ -1379,7 +1349,7 @@ zeroentry overflow do_overflow
> > zeroentry bounds do_bounds
> > zeroentry invalid_op do_invalid_op
> > zeroentry device_not_available do_device_not_available
> > -paranoiderrorentry double_fault __do_double_fault
> > +paranoiderrorentry double_fault do_double_fault
> > zeroentry coprocessor_segment_overrun do_coprocessor_segment_overrun
> > errorentry invalid_TSS do_invalid_TSS
> > errorentry segment_not_present do_segment_not_present
> > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> > index b857ed8..e5b2976 100644
> > --- a/arch/x86/kernel/traps.c
> > +++ b/arch/x86/kernel/traps.c
> > @@ -248,6 +248,30 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
> > static const char str[] = "double fault";
> > struct task_struct *tsk = current;
> >
> > +#ifdef CONFIG_X86_ESPFIX64
> > + extern unsigned char native_irq_return_iret[];
> > +
> > + /*
> > + * If IRET takes a non-IST fault on the espfix64 stack, then we
> > + * end up promoting it to a doublefault. In that case, modify
> > + * the stack to make it look like we just entered the #GP
> > + * handler from user space, similar to bad_iret.
> > + */
> > + if (((long)regs->sp >> PGDIR_SHIFT) == ESPFIX_PGD_ENTRY &&
> > + regs->cs == __KERNEL_CS &&
> > + regs->ip == (unsigned long)native_irq_return_iret)
> > + {
> > + struct pt_regs *normal_regs = task_pt_regs(current);
> > +
> > + /* Fake a #GP(0) from userspace. */
> > + memmove(&normal_regs->ip, (void *)regs->sp, 5*8);
> > + normal_regs->orig_ax = 0; /* Missing (lost) #GP error code */
> > + regs->ip = (unsigned long)general_protection;
> > + regs->sp = (unsigned long)&normal_regs->orig_ax;
> > + return;
> > + }
> > +#endif
> > +
> > exception_enter();
> > /* Return not checked because double check cannot be ignored */
> > notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV);
> > --
> > 1.9.1
> >
>
>
>
^ permalink raw reply [flat|nested] 124+ messages in thread
end of thread, other threads:[~2014-12-02 21:20 UTC | newest]
Thread overview: 124+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 001/121] ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 002/121] [3.13-stable only] regmap: fix kernel hang on regmap_bulk_write with zero val_count Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 003/121] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 004/121] Revert "ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controller" Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 005/121] drm/i915, HD-audio: Don't continue probing when nomodeset is given Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 006/121] drm/i915: provide interface for audio driver to query cdclk Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 007/121] ALSA: hda - restore BCLK M/N value as per CDCLK for HSW/BDW display HDA controller Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 008/121] rcu: Make callers awaken grace-period kthread Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 009/121] rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 010/121] net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 011/121] KVM: x86: Don't report guest userspace emulation error to userspace Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 012/121] [media] ttusb-dec: buffer overflow in ioctl Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 013/121] arm64: __clear_user: handle exceptions on strb Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 014/121] ARM: pxa: fix hang on startup with DEBUG_LL Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 015/121] samsung-laptop: Add broken-acpi-video quirk for NC210/NC110 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 016/121] acer-wmi: Add Aspire 5741 to video_vendor_dmi_table Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 017/121] acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 018/121] rbd: Fix error recovery in rbd_obj_read_sync() Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 019/121] [media] ds3000: fix LNB supply voltage on Tevii S480 on initialization Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 020/121] powerpc: do_notify_resume can be called with bad thread_info flags argument Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 021/121] USB: kobil_sct: fix non-atomic allocation in write path Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 022/121] USB: opticon: " Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 023/121] regulator: max77693: Fix use of uninitialized regulator config Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 024/121] USB: cdc-acm: add device id for GW Instek AFG-2225 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 025/121] usb: Do not allow usb_alloc_streams on unconfigured devices Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 026/121] usb-storage: handle a skipped data phase Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 027/121] xhci: Switch only Intel Lynx Point-LP ports to EHCI on shutdown Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 028/121] xhci: no switching back on non-ULT Haswell Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 029/121] of: Fix overflow bug in string property parsing functions Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 030/121] spi: fsl-dspi: Fix CTAR selection Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 031/121] Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 032/121] staging:iio:ade7758: Fix NULL pointer deref when enabling buffer Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 033/121] staging:iio:ade7758: Fix check if channels are enabled in prenable Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 034/121] staging:iio:ade7758: Remove "raw" from channel name Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 035/121] USB: cdc-acm: only raise DTR on transitions from B0 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 036/121] serial: Fix divide-by-zero fault in uart_get_divisor() Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 037/121] tty: Fix high cpu load if tty is unreleaseable Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 038/121] tty: Prevent "read/write wait queue active!" log flooding Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 039/121] tty/vt: don't set font mappings on vc not supporting this Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 040/121] spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 041/121] sysfs: driver core: Fix glue dir race condition by gdp_mutex Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 042/121] i2c: at91: don't account as iowait Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 043/121] nfsd: don't try to reuse an expired DRC entry off the list Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 044/121] nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 045/121] dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 046/121] xtensa: re-wire umount syscall to sys_oldumount Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 047/121] dm raid: ensure superblock's size matches device's logical block size Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 048/121] ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 049/121] ahci: Add Device IDs for Intel Sunrise Point PCH Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 050/121] power: charger-manager: Fix accessing invalidated power supply after charger unbind Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 051/121] mac80211: use secondary channel offset IE also beacons during CSA Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 052/121] mac80211: schedule the actual switch of the station before CSA count 0 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 053/121] mac80211: properly flush delayed scan work on interface removal Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 054/121] mac80211: fix use-after-free in defragmentation Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 055/121] tun: Fix csum_start with VLAN acceleration Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 056/121] macvtap: Fix csum_start when VLAN tags are present Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 057/121] dm thin: grab a virtual cell before looking up the mapping Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 058/121] KVM: x86: Fix uninitialized op->type for some immediate values Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 059/121] crypto: caam - fix missing dma unmap on error path Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 060/121] hwrng: pseries - port to new read API and fix stack corruption Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 061/121] drm/radeon: set correct CE ram size for CIK Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 062/121] drm/radeon: make sure mode init is complete in bandwidth_update Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 063/121] drm/radeon: use gart for DMA IB tests Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 064/121] drm/radeon: add missing crtc unlock when setting up the MC Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 065/121] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 066/121] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 067/121] Input: alps - ignore potential bare packets when device is out of sync Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 068/121] Input: alps - allow up to 2 invalid packets without resetting device Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 069/121] scsi: only re-lock door after EH on devices that were reset Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 070/121] dm btree: fix a recursion depth bug in btree walking code Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 071/121] parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 072/121] ALSA: usb-audio: Fix memory leak in FTU quirk Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 073/121] audit: keep inode pinned Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 074/121] nfs: fix pnfs direct write memory leak Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 075/121] nfs: Fix use of uninitialized variable in nfs_getattr() Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 076/121] NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 077/121] NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 078/121] NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 079/121] NFSv4: Ensure that we call FREE_STATEID when NFSv4.x stateids are revoked Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 080/121] NFS: Don't try to reclaim delegation open state if recovery failed Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 081/121] libceph: do not crash on large auth tickets Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 082/121] ARM: 8191/1: decompressor: ensure I-side picks up relocated code Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 083/121] ARM: 8198/1: make kuser helpers depend on MMU Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 084/121] zram: avoid kunmap_atomic() of a NULL pointer Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 085/121] Input: alps - ignore bad data on Dell Latitudes E6440 and E7440 Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 086/121] firewire: cdev: prevent kernel stack leaking into ioctl arguments Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 087/121] md: Always set RECOVERY_NEEDED when clearing RECOVERY_FROZEN Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 088/121] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 089/121] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 090/121] target: Don't call TFO->write_pending if data_length == 0 Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 091/121] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 092/121] srp-target: Retry when QP creation fails with ENOMEM Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 093/121] ASoC: fsi: remove unsupported PAUSE flag Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 094/121] ASoC: rsnd: " Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 095/121] ib_isert: Add max_send_sge=2 minimum for control PDU responses Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 096/121] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 097/121] ASoC: dpcm: Fix race between FE/BE updates and trigger Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 098/121] mac80211: Fix regression that triggers a kernel BUG with CCMP Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 099/121] rt2x00: do not align payload on modern H/W Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 100/121] ath9k: Add version/revision macros for QCA9531 Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 101/121] ath9k: Fix RTC_DERIVED_CLK usage Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 102/121] ASoC: sgtl5000: Fix SMALL_POP bit definition Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 103/121] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 104/121] bitops: Fix shift overflow in GENMASK macros Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 105/121] x86: Require exact match for 'noxsave' command line option Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 106/121] drm/i915: drop WaSetupGtModeTdRowDispatch:snb Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 107/121] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 108/121] can: dev: avoid calling kfree_skb() from interrupt context Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 109/121] can: esd_usb2: fix memory leak on disconnect Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 110/121] x86, microcode: Update BSPs microcode on resume Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 111/121] x86, mm: Set NX across entire PMD at boot Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 112/121] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 113/121] of/base: Fix PowerPC address parsing hack Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 114/121] clockevent: sun4i: Fix race condition in the probe code Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 115/121] MIPS: oprofile: Fix backtrace on 64-bit kernel Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 116/121] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 117/121] IB/isert: Adjust CQ size to HW limits Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 118/121] drm/radeon: fix endian swapping in vbios fetch for tdp table Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 119/121] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C Kamal Mostafa
2014-12-02 19:34 ` Andy Lutomirski
2014-12-02 21:20 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 120/121] x86_64, traps: Stop using IST for #SS Kamal Mostafa
2014-12-02 19:20 ` [PATCH 3.13.y-ckt 121/121] x86_64, traps: Rework bad_iret Kamal Mostafa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).